blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 132 | path stringlengths 3 236 | src_encoding stringclasses 29
values | length_bytes int64 8 7.94M | score float64 2.52 5.72 | int_score int64 3 5 | detected_licenses listlengths 0 142 | license_type stringclasses 2
values | text stringlengths 8 7.94M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
147bac02133c45018db1a6a5e84b8722f17b91b1 | JavaScript | mymrtt/FormWRedux | /src/screens/user/User.js | UTF-8 | 1,184 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react'
import UserForm from './UserForm';
class User extends Component {
render() {
//Lista apenas para mostrar na tela. ~O projeto está enviando dados para API.
let list = [
{
name: 'Yasmin',
email: 'yasminm@gmail.com'
},
{
name: '... | true |
955144bd41596c0a5c31a00c14d46109da234074 | JavaScript | Nicolas-Rohrbach/Lebonrecoin | /views/javascript/formConnexion.js | UTF-8 | 2,869 | 2.75 | 3 | [] | no_license | /*
Form pour pouvoir se connecter, lors du submit le fichier connexion.php est appellé pour pouvoir voir si le login et le mot de passe sont correctes,
si c'est déjà le cas, la connexion est acceptée et l'utilisateur est dirigé sur la page d'accueil.
*/
function formConnexion() {
clear(); // vide le body... | true |
c9ed6d31277914285e1b1d01a4b8188855b07f1d | JavaScript | khalby786/TheRadBot | /commands/clear.js | UTF-8 | 877 | 2.6875 | 3 | [
"MIT"
] | permissive | const Discord = require("discord.js");
module.exports = {
name: "clear",
description: "Clears specified number of messages in the current channel.",
args: true,
cooldown: 0,
usage: '<number of messages>',
async execute(message, args, prefix, client) {
if (message.member.hasPermission("MANAGE_MESSAGES")... | true |
d3454504589a0dfe916fe676a5660a669b21c601 | JavaScript | mlharris516/Initial-Pre-Work | /5-Introduction-to-JavaScript/50-Global_vs._Local_Scope_in_Functions.js | UTF-8 | 235 | 3.546875 | 4 | [] | no_license | /* What I learned: Variables can have the same name if one of them is of global scope and the other of local scope. The local variable will take precedence over the global variable.*/
/* Coding Exercise: */
var outerWear = "sweater";
| true |
b888f067bc053fbedbc6f803acc8f8e029dd4b3e | JavaScript | smashwilson/pushbot | /scripts/prompts.js | UTF-8 | 638 | 2.921875 | 3 | [] | no_license | // Description:
// Generate random writing prompts.
//
// Commands:
// hubot prompt me <n> - Generate n writing prompts.
const fetch = require("node-fetch");
module.exports = function (robot) {
robot.respond(/prompt\s+me(?:\s+(\d+))?/i, async function (msg) {
const count = msg.match[1] || 1;
let url = ... | true |
95adcd343027d316b44eddb5687fc5bc1a8c1d96 | JavaScript | gustavw10/flow2week2proj2 | /src/index.js | UTF-8 | 3,054 | 2.828125 | 3 | [] | no_license | import 'bootstrap/dist/css/bootstrap.css'
const url = "http://restcountries.eu/rest/v1/alpha?codes=";
document.getElementById("svg2").addEventListener("click", function(event){
const eventTarget = event.target.id;
fetch(url + eventTarget)
.then(res=>fetchWithErrorCheck(res))
.then((out) => {
... | true |
f6ef0fc3a6a911787e5d13813644fb674a353f9d | JavaScript | ftroitsky/node-quest | /test/components.spec.js | UTF-8 | 1,252 | 2.75 | 3 | [] | no_license | /* global describe it */
import {expect} from 'chai'
import {ComponentPosition, ComponentDescription} from '../src/components'
describe('Component Position', () => {
const position = new ComponentPosition(5, 8)
it('Should have constructor name of `position`', () => {
expect(position.constructor.name).to.equal... | true |
ff9aaf794ce773ecf21de3075ce3aa53c465cc65 | JavaScript | donpuz/blueplane | /script.js | UTF-8 | 3,648 | 2.734375 | 3 | [] | no_license | setTimeout(function() {
location.reload();
}, 600000);
var x = document.getElementById("x");
$(function(){
$("button").click();
});
$("button").click(function() {
if(navigator.geolocation) {
navigator.geolocation.watchPosition(showPosition);
} else {
x.innerHTML = "yeah geolocation isn't workin... | true |
201140145205a659dc98e0de58d23f5114b95210 | JavaScript | Pleopleq/PEVN-todo | /index.js | UTF-8 | 1,878 | 2.75 | 3 | [] | no_license | const express = require('express')
const cors = require('cors')
const pool = require('./db')
const app = express()
app.use(cors())
app.use(express.json())
app.get('/todos', async (req, res) => {
try {
const allTodos = await pool.query("SELECT * FROM todo")
res.json(allTodos.rows)
} catch (erro... | true |
e59589b6c0bb680a45fceaba379da8ca79cd3c11 | JavaScript | Mehul57/PROJECT-25 | /paper.js | UTF-8 | 1,185 | 2.734375 | 3 | [] | no_license | class paper
{
constructor(x,y,width,height)
{
var options = {
'isStatic' :false,
'restitution' : 0.3,
'friction' : 0.5,
'density' : 1.5
}
this.x=x;
this.y=y;
this.body = Bodies.rectangle(x, y, width, height, options);
this.paperWidth=width
this.paperHeight=height
... | true |
a026f7c2ad96fbe1d9cf9d25e906315290ac24c7 | JavaScript | jccartwright/sandbox | /widget-test/app/main.js | UTF-8 | 2,067 | 2.515625 | 3 | [] | no_license | require([
"esri/map",
"dojo/request",
"dojo/dom",
"dojo/_base/array",
'dojo/on',
"app/dijits/AuthorWidget",
"ncei/tasks/WMSIdentifyParameters",
"ncei/tasks/WMSIdentifyTask",
"dojo/domReady!"],
function(Map, request, dom, arrayUtil, on, AuthorWidget, WMSIdentifyParameters, WMSId... | true |
cb9c9a44e9ed52e829bc3604acbd6944af95a57c | JavaScript | B10610204/B10610204.github.io | /Object/City.js | UTF-8 | 2,019 | 3.296875 | 3 | [] | no_license | let cityArray = [
{
name: 'taipei',
ch_name: '台北',
districts: [
{ id: 'taipei01', district: '中正區' },
{ id: 'taipei02', district: '萬華區' },
{ id: 'taipei03', district: '信義區' }]
},
{
name: 'taoyuan',
ch_name: '桃園',
districts: ... | true |
311bc04c90d087927061ff588d57f8d78893ef16 | JavaScript | Sharkou/PixelCreator | /editor/blueprint/compiler.js | UTF-8 | 8,994 | 2.953125 | 3 | [] | no_license | export class Compiler {
static types;
static operators;
static brackets;
static keywords;
static structures;
static functions;
/**
* Init Compiler
* @constructor
*/
static init() {
// Déclaration des types
this.types = [
/i32/,
/st... | true |
1c8208b8faf780171d839891a921b9671501ee15 | JavaScript | JPWUnesc/exercicios-26 | /index.js | UTF-8 | 157 | 3.359375 | 3 | [] | no_license | var suma = 0
process.argv.forEach((val, index) => {
if ((index > 2) && (val % 2 == 0)){
suma += parseInt(val)
}
})
console.log("Resultado: " + suma);
| true |
3dd707539b9918e8bffc4e874696560b13cde92b | JavaScript | foolmadao/my-leetcode | /231.2-的幂.js | UTF-8 | 256 | 3.234375 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=231 lang=javascript
*
* [231] 2的幂
*/
/**
* @param {number} n
* @return {boolean}
*/
var isPowerOfTwo = function(n) {
if(n === 0) return false;
const i = Math.log10(n)/Math.log10(2)
return i === parseInt(i);
};
| true |
5f51f2c659e129434a0010f889155f0eec04e966 | JavaScript | demzey/training | /flattening.js | UTF-8 | 122 | 3.296875 | 3 | [] | no_license | let arrays = [[1, 2, 3], [4, 5], [6]];
let newArrays = arrays.reduce((a, b) =>
a.concat(b)
);
console.log(newArrays); | true |
f16c7ac91625d1bfb43eadb7d1783aedf8e48ab4 | JavaScript | jeffgran/ajax-convo | /ajax_convo_2.js | UTF-8 | 587 | 2.5625 | 3 | [] | no_license | $(document).ready(function() {
String.prototype.trim = function() {
return this.replace(/^\s*/, "").replace(/\s*$/, "");
}
String.prototype.stripHTML = function() {
return this.replace(/<\S[^><]*>/g, "");
}
String.prototype.nl2br = function() {
return this.replace(/\n/g, '<br />... | true |
553ca6c830b9c17c4eb806b4e87698fd35ad37d6 | JavaScript | GoodLiuyue/todos | /reduxTodos/src/redux/util.js | UTF-8 | 1,194 | 3.21875 | 3 | [] | no_license |
//循环数组;
// ID: 传入的id;
// values:传入的值
// toggle :是否切换
// all :是否全选
let mapArr = (id, value, toggle, all) => {
let values = value.replace(/^(\s)|(\s)$/g, "");//去掉首尾空格
let { data } = this.state;
if (toggle && typeof toggle !== "boolean") return;
if (all && typeof all !== "boolean") return;
... | true |
ecf29cdb38d6447b78812ec988f8b6b78253ec89 | JavaScript | captn3m0/india-pincode-regex | /src/index.js | UTF-8 | 613 | 2.71875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | const readline = require("readline");
const fs = require("fs");
let contents = fs.readFileSync(__dirname + "/../regex.txt", "utf8").trim()
const regex = new RegExp(contents, "gm");
const exactRegex = new RegExp("^" + contents + "$");
module.exports = {
// Validates an exact 6 digit string as a valid pincode
valid... | true |
72852635bdfd2e409b652821a80dd26bec65490f | JavaScript | jmthompson2015/glory-to-rome-game | /artifact/Phase.js | UTF-8 | 462 | 2.515625 | 3 | [
"MIT"
] | permissive | const Phase = {
DECLARE_ROLE: "declareRole",
PERFORM_ROLE: "performRole",
properties: {
declareRole: {
name: "Declare Role",
key: "declareRole",
},
performRole: {
name: "Perform Role",
key: "performRole",
},
},
};
Phase.keys = () => Object.keys(Phase.properties);
Phase... | true |
2781f67fa106662ed9b0d34935b8a86f26cac4c2 | JavaScript | satrong/ipa-rename | /index.js | UTF-8 | 1,570 | 2.578125 | 3 | [] | no_license | // 获取证书名称
const unzip = require('./lib/unzip');
const GetPlistInfo = require('./lib/getPlistInfo');
const getName = require('./lib/getName');
const fileRename = require('./lib/fileRename');
const path = require('path');
const getIpas = require('./lib/getIpas');
// 获取文件名并重命名
const rename = async filepath => {
try {... | true |
d287ee38614162f828f8cf0f9ccd985a8a26d473 | JavaScript | Keamo-getswe/Frontend-Practice | /faq-accordion-card-main/faq-card.js | UTF-8 | 819 | 2.890625 | 3 | [] | no_license | var questions = document.getElementsByClassName('question');
var openedCollapsible = [];
var i;
for (i = 0; i < questions.length; i++) {
questions[i].addEventListener('click', function() {
var arrow = this.nextElementSibling;
var answer = this.nextElementSibling.nextElementSibling;
arrow.classList.toggle("arrow... | true |
7f8ecc7d2630e02d59cccb088fac3774b46c36e2 | JavaScript | patrickshaughnessy/React-Bookmark-Manager | /public/AddBookmarkForm.js | UTF-8 | 1,295 | 2.71875 | 3 | [] | no_license | import React from 'react';
export default class extends React.Component {
constructor(props){
super(props);
this.state = {
title: null,
url: null
}
}
changeTitle(e){
this.setState({title: e.target.value})
}
changeUrl(e){
this.setState({url: e.target.value})
}
handleSubm... | true |
e3f7a99871ce2e4292d2628862e9827c52293c86 | JavaScript | LaoChen1994/Essays | /interview/algorithm/core/list-node/86-partition.js | UTF-8 | 745 | 3.28125 | 3 | [] | no_license | const { ListNode } = require("./index");
/**
* @param {ListNode} head
* @param {number} x
* @return {ListNode}
*/
var partition = function (head, x) {
let min = new ListNode();
let max = new ListNode();
let curr = head,
minHead = min,
maxHead = max;
if (head === null) {
return null;
}
whi... | true |
97612fe7022af264312b82d4ce1ace5c84c58b2e | JavaScript | madhudevaraj/Auth-App | /app.js | UTF-8 | 1,699 | 2.890625 | 3 | [] | no_license | //dependencies or imports
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const cors = require('cors');
const passport = require('passport');
const mongoose = require('mongoose');
//calling connect function for mongoose to connect to database
const config = ... | true |
ffd3bfd2acbd699e65fa2fccc9745526d4e05f3c | JavaScript | wtLemoney/Algorithm | /杨辉三角.js | UTF-8 | 417 | 3.765625 | 4 | [] | no_license | function pascal(n){//n表示你想输出的行数
for(var i=0;i<n;i++){
var inside =[];
for(var j=0;j<=i;j++){
inside.push(combination(i,j));
}
console.log(inside.join(' '));
}
}
function combination(a,b){
if(b==0)
return 1;
else if(a===b)
return 1;
else
... | true |
8df32f98402a5cd8c201e7cd32b5f3893836d66a | JavaScript | halweg/modern-js | /04functionadv/newFunction语法.js | UTF-8 | 509 | 3.640625 | 4 | [] | no_license | let sayHello = new Function("a", "b", "console.log(a); console.log(b)")
sayHello("hello", "word")
let sum = new Function("a", "b", "return a +b")
console.log(sum(1, 7))
//new function 无法获取上下文,需要显示的参数传递
function newFunction() {
let value = "hello world"
let excel = new Function("value" ,"console.log('ths... | true |
5d5c486d0e350d26d25b43dee3c700f8ced7ba36 | JavaScript | xinleiye/LeetCode | /周赛 2023/第 346 场周赛/6439. 删除子串后的字符串最小长度/javascript/ac_v1.js | UTF-8 | 381 | 3.703125 | 4 | [
"Apache-2.0"
] | permissive | /**
* @param {string} s
* @return {number}
*/
var minLength = function(s) {
const res = [];
for (const ch of s) {
if (ch === "B" && (res.length && res[res.length - 1] === "A") ||
ch === "D" && (res.length && res[res.length - 1] === "C")) {
res.pop();
} else {
... | true |
f0acb15541efc9f9cce1105435e2de9ca6a08191 | JavaScript | kaycbas/datastructures-algorithms | /javascript/sorted-squared-array.js | UTF-8 | 213 | 3.8125 | 4 | [] | no_license | // O(n) time | O(n) space
function sortedSquaredArray(array) {
const squares = [];
for (const num of array) {
squares.push(num * num);
}
squares.sort((a, b) => a - b);
return squares;
} | true |
98210bdd2c1a3d81650ff3bc9f874abf00815472 | JavaScript | Stanabol/JS_HW2 | /script08.js | UTF-8 | 803 | 4.125 | 4 | [] | no_license | // Запросить у пользователя длину окружности и периметр квадрата. Определить, может ли такая окружность поместиться в указанный квадрат.
let circle = +prompt("Введите длину окружности ");
let perim = +prompt("Введите периметр квадрата");
const CONSTANT = 3.14;
let radius = circle / (2 * CONSTANT);
let area = CONSTANT *... | true |
2bcad6a63a319289c8b190242116fd58306fd282 | JavaScript | Eparrado/javascriptAllonge | /jasmine/spec/appSpec.js | UTF-8 | 1,318 | 3.453125 | 3 | [
"MIT"
] | permissive | describe("Javascript Allonge", function(){
describe("References types", function(){
it("Compares arrays", function(){
expect([2-1, 2, 2+1] === [1,2,3]).toEqual(false); //Es false porque trato de comparar referencias diferentes
expect([1,2,3] === [1, 2, 3]).toEqual(false);
... | true |
3f8c2de93e8e12ac054b99471950317851e7d59a | JavaScript | oooowl/FramesCanvas | /js/FramesCanvas.js | UTF-8 | 2,980 | 3.109375 | 3 | [] | no_license | //Author by liushitao
'use strict'
function FramesCanvas(canvas, opts, callback) {
this.canvas = canvas;
this.width = opts.width; //宽度
this.height = opts.height; //高度
this.frame = opts.frame //序列帧图片总张数
this.fps = opts.fps || 24; //fps(帧数)
this.loop = opts.loop;//是否循环 true false
... | true |
f7116715304b69c24f0ce41c1153d305015b4aaa | JavaScript | KirstenDunst/PerHomePage | /js/personShow.js | UTF-8 | 1,546 | 2.953125 | 3 | [] | no_license | window.onresize = function (id){changePositionForCenter};
//改变控件的位置,大小不变,使居中
function changePositionForCenter (id) {
//浏览器的宽度
var a = document.documentElement.clientWidth;
//浏览器的高度
var b = document.documentElement.clientHeight;
var element = docum... | true |
7a13a9e9c16fb5027d53d307ae4f53c4b87ebf9b | JavaScript | zxy-Jennifer/Algorithm-offer-JavaScript | /树/617. 合并二叉树.js | UTF-8 | 1,541 | 3.78125 | 4 | [] | no_license | /**
* 深度优先遍历
* @param {*} t1
* @param {*} t2
*/
function mergeTrees(t1, t2) {
//
if (!t1 || !t2) {
return t1 || t2
}
let res = new TreeNode(t1.val + t2.val)
res.left = mergeTrees(t1.left, t2.left)
res.right = mergeTrees(t1.right, t2.right)
return res
}
/**
* 广度... | true |
21557756e8119b58f4470143a0a2063c7762838a | JavaScript | amitbet/dockerlog | /app.js | UTF-8 | 2,619 | 2.609375 | 3 | [] | no_license | var express = require('express');
var expressWs = require('express-ws');
const Docker = require('dockerode');
const timespan = require('timespan');
const { LogDataLayer } = require("./log-data-layer");
const { ContainerManager } = require("./container-manager");
function containerFilter(containerInfo) {
//check it... | true |
7b22ffece84d7fd1f9d96fa5532c413ecee6c06c | JavaScript | agelastes/origami-front | /src/components/Header/DropDownItem/DropDownItem.js | UTF-8 | 2,187 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import "./DropDownItem.css"
import { Link } from "react-router-dom";
class DropDownItem extends Component {
state = {
typesVisible: false
};
dropItems = (item) => {
if (item.name === "Виды оригами") this.setState({typesVisible: !this.state.typesVisi... | true |
89f4f0f01eb0dedf6545314ecc44df09b5949bf9 | JavaScript | rationalspace/algos_ds | /rotateImage.js | UTF-8 | 465 | 3.515625 | 4 | [] | no_license | /*00 01 02
10 11 12
20 21 22
20 10 00
21 11 01
22 12 02*/
/**
* @param {number[][]} matrix
* @return {void} Do not return anything, modify matrix in-place instead.
*/
var rotate = function(matrix) {
let colnum = matrix[0].length;
let newmatrix = [];
for(let i=0; i<colnum ;i++){
let col = matrix... | true |
7f762d31cd7b2162b26eeea66556e9b29bb6adb1 | JavaScript | eyong-joel7/react-tutorial | /src/dotstate.js | UTF-8 | 941 | 2.921875 | 3 | [] | no_license | import React, { Component } from 'react';
class Message extends Component{
constructor(){
super();
this.state = {
Message: 'Welcome Visitors',
Button: 'Click Me!'
}
this.changeState = this.changeState.bind(this)
}
changeState(){
... | true |
3352775bdebff2ce7c491c0d87d79edda026052a | JavaScript | fgoll/learn | /webgl/ray tracing/js/material.js | UTF-8 | 1,406 | 2.859375 | 3 | [] | no_license | let ray = require('./ray')
let { vec3, dot, unit_vector } = require('./vec3')
function random_in_unit_sphere() {
let p
do {
p = new vec3(Math.random(), Math.random(), Math.random())
} while (p.squared_length() >= 1.0)
return p;
}
function reflect(v, n) {
return v.copy().minus(n.copy().multiply(dot(v, ... | true |
3a3b1735d4f9057821b207eede059428167e7723 | JavaScript | ambergupta954/Pandemic | /lambda/pandemic-connector/.aws-sam/build/PhConnectorFunction/app.js | UTF-8 | 3,708 | 2.75 | 3 | [] | no_license | // const axios = require('axios')
// const url = 'http://checkip.amazonaws.com/';
let response;
const log = require('lambda-log');
const AWS = require('aws-sdk');
/**
*
* Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-... | true |
13a08b48a9928e65734927c395b3c8451f8c31a2 | JavaScript | cody0203/cody0203.github.io | /obo-stadium/script/index.js | UTF-8 | 5,084 | 2.515625 | 3 | [] | no_license | $(function () {
changeUiHomePage();
carousel();
render();
})
function changeUiHomePage() {
$(".nav-link").removeClass('active-nav');
if (window.matchMedia && window.matchMedia('(max-width: 768px)').matches) {
$('#promo-banner-1').attr("src", "./image/banner/promo-banner-1-md.png");
... | true |
66427cb548f695d030a63744d575ec1416d4ee10 | JavaScript | bertrandchenal/polyphon | /static/observable.js | UTF-8 | 6,304 | 3.34375 | 3 | [] | no_license | "use strict"
// The observable constructor. If the first param is a function, it
// will be considered as computed observable (I.E readonly), if not,
// the first param is user as the initial value of a simple
// observable.
var Observable = function(value) {
if (!this)
throw Error('Observable constructor... | true |
bfe2272e5e3c1cf2580b3fb0ebb7d197151c5ce5 | JavaScript | shamim666/React-Router-MealDB | /src/components/Menu/Menu.js | UTF-8 | 1,352 | 2.65625 | 3 | [] | no_license |
import React, { useEffect, useState } from 'react';
import { FormControl, InputGroup, Button, Row } from 'react-bootstrap';
import Meal from '../Meal/Meal';
const Menu = () => {
const [searchText, setSearchText] = useState('');
const [menu, setMenu] = useState([]);
useEffect(() => {
fetch(`https... | true |
e66344a6c8b6c2b1c7ba5c180cafc56e837a3245 | JavaScript | yanctrindade/5g-iot-dashboard-web | /src/Components/Map/RouteSection.js | UTF-8 | 1,638 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Polyline } from 'google-maps-react';
import axios from 'axios';
class RouteSection extends Component {
constructor(props){
super(props)
this.state = {
coords : []
}
}
componentDidMount(){
this.getRoute(this.pro... | true |
99fe2f2d849f2e66ce7a3e296b4ce17ba83788ad | JavaScript | diegosfc100/Curso-Web-Moderno-Completo | /05.Funcoes/02.Parametros e Return.js | UTF-8 | 416 | 4.25 | 4 | [] | no_license | //Parametros e Returns são opcioais.
function area(largura, altura) {
const area = largura * altura
if (area >20){
console.log(`Valor acima do permitido: ${area}m2.`)
} else {
return area
}
}
console.log(area(2,2))// 4
console.log(area(2))// NaN
console.log(area())// NaN
console.log... | true |
b68ea351ded1d2c7659f08d2d5ab95faff6bc702 | JavaScript | cibimanoj/restcountries | /script.js | UTF-8 | 673 | 3.0625 | 3 | [] | no_license | //use the rest countries to print the country name and lat and long informations.
var request=new XMLHttpRequest();
request.open("GET","https://restcountries.eu/rest/v2/all",true);
request.send();
request.onload=function(){
var data=JSON.parse(this.response);
console.log(data);
let casia = data.filter((e)... | true |
3df66c629e5714e74b117f1941fbbd7ce64980ef | JavaScript | IluhaByrm81/Ferma-Project- | /farm.js | UTF-8 | 2,640 | 3.546875 | 4 | [
"MIT"
] | permissive | const Cow = require('./animals/cow.js');
const Pig = require('./animals/pig.js');
const Rabbit = require('./animals/rabbit.js');
const Sheep = require('./animals/sheep.js');
class Farm {
constructor() {
this.barn = {
grass: 2000,
acorn: 1000,
cabbage: 300,
};
this.dayLimit = {
... | true |
9038eb346f6f45dfc6b04ef73a70903d012f083b | JavaScript | CharlesJ3/100-Days-4-Endless-Rotation | /scripts/main.js | UTF-8 | 7,984 | 2.859375 | 3 | [] | no_license |
//Current Theme
let theme = 0;
let dirLight, dirLight2;
const renderer = new THREE.WebGLRenderer({
canvas: document.getElementById("battleArea"),
antialias: true
});
renderer.setSize(window.innerWidth, window.innerHeight * .80);
renderer.setClearColor('rgb(2,15,20)',.15);
renderer.setPixelRatio( window.devicePix... | true |
d90dcf6668f203d5546a86124df8e20702c58a5f | JavaScript | interglobalvision/timbre | /app/client/templates/users/signup.js | UTF-8 | 2,164 | 2.625 | 3 | [] | no_license | Template.signup.events = {
'click input[type=submit]': function(event){
event.preventDefault();
var user = {
username: $('#username').val(),
email: $('#email').val(),
password: $('#password').val(),
repeatPassword: $('#repeat-password').val()
},
usernameLength = user.usernam... | true |
8073819655da5466871d2c1612423d2934067020 | JavaScript | summerprogram2019/SILGRO | /SILGROShare_Master/index/static/listings-page-draft/scripts/nav-bar.js | UTF-8 | 702 | 2.53125 | 3 | [] | no_license | $(function(){
$( "#start-time" ).datepicker();
$( "#end-time" ).datepicker();
})
function initMapService() {
//Map autocomplete code taken from https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete
var input = document.getElementById('nav-location');
var autocompl... | true |
c6003a46abb1358ca917f718e867624f139aaf35 | JavaScript | fansOnly/JUSTCODING | /how-to-write-bugs/6-手撕系列/0数据结构/Set.js | UTF-8 | 1,261 | 4.15625 | 4 | [] | no_license | /**
* 集合 Set
*/
class Set {
constructor() {
this.items = {}
}
has(value) {
return this.items.hasOwnProperty(value)
}
add(value) {
if (!this.has(value)) {
this.items[value] = value
}
return this
}
size() {
return Object.keys(thi... | true |
0d78628c7a1f24f405c6c2c8d8cc558da21ffb51 | JavaScript | RobertGloverJr/learnyounode | /program2.js | UTF-8 | 642 | 3.25 | 3 | [] | no_license | //
// R.Glover: Dec 28 2014. Problem is to add the number pass as arguments.
//
// see: https://github.com/rvagg/learnyounode/issues/8
//console.log(process.argv);
var iTotWayOne = 0;
process.argv.forEach(function(val, index, array) {
if (index > 1) {
iTotWayOne = Number(iTotWayOne) + Number(val);
}
});
//c... | true |
8bad8d0c027dd95f25d2c3f0911b448897bfc30d | JavaScript | vimalptl/myjs | /nj_pizzaui/lib/log.js | UTF-8 | 4,431 | 2.984375 | 3 | [] | no_license | /*
* Log Library
*/
// Dependencies
var fs = require('fs');
var path = require('path');
var zlib = require('zlib');
// Container for the module
var lib = {};
// Base directory for data folder
lib.baseDir = path.join(__dirname, '/../.log/');
// Append a string to a file, Create the file if it doesn't exis... | true |
1feee660afcc917c823d44f6b7b60a46d9c7b3ef | JavaScript | steefnee/bloc-jams-angular | /app/scripts/services/SongPlayer.js | UTF-8 | 4,810 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | (function() {
function SongPlayer($rootScope, Fixtures) {
var SongPlayer = {};
/**
*@function currentAlbum
*@desc gets/stores album info retrieved from Fixtures' getAlbum function
*/
var currentAlbum = Fixtures.getAlbum();
/**
* @function updatePlayerBarSong
* @loads currently playing song informati... | true |
d58b68f1a0a988ef8a0ac5b9ce4123f81edbfce2 | JavaScript | goldfish724/sif-gacha-simulator | /dist/js/rng.js | UTF-8 | 3,581 | 2.859375 | 3 | [] | no_license | $(document).ready(function(){
/**
Chances of getting an Ultra-Rare: 1%
Chances of getting an Super-Super-Rare: 1%
Chances of getting an Super-Rare: 1%
Chances of getting an Rare: 1%
**/
var currentgems = 0;
var totalcards = 0;
var UR = 0;
var SSR = 0;
var SR ... | true |
e06e77584c58244e470c4b6536c5fa90588aca20 | JavaScript | zachanator070/dungeon | /command.js | UTF-8 | 7,001 | 3.234375 | 3 | [] | no_license |
function doCommand(tokens){
if(tokens.length>0){
var token = tokens[0];
if(token.type == 'GO'){
doGo(tokens);
}
else if(token.type == 'HELP'){
showHelp(tokens);
}
else if(token.type == 'USE'){
doUse(tokens);
}
else if(token.type == 'TAKE'){
doTake(tokens);... | true |
6a196e87b5a96cffc2369bda61707d47693a8921 | JavaScript | SujalSamai/CSCult-main | /src/components/Pages/DSA-Weekly/DSAWeekly.js | UTF-8 | 2,308 | 2.609375 | 3 | [] | no_license | import './DSAWeekly.css';
import module1 from '../../../image/dsa-weekly/modules/module1.svg';
import module2 from '../../../image/dsa-weekly/modules/module2.gif';
import module3 from '../../../image/dsa-weekly/modules/module3.svg';
import module4 from '../../../image/dsa-weekly/modules/module4.svg';
import module5 fr... | true |
60e0973de82330a9d1b0f5e088b306fd8f2ce1fe | JavaScript | jgvilela/AS36D-202101-Atv08 | /topico3/integracao/promisify.js | UTF-8 | 322 | 2.53125 | 3 | [] | no_license | const util = require('util');
const fs = require('fs');
// fs.stat('.', (err, stats) => {
// if (err) throw err;
// console.log(stats);
// });
const statP = util.promisify(fs.stat);
async function main() {
const stats = await statP('./package.json');
console.log(stats);
}
main().catch(console.error... | true |
5f296314b9ae55f344eb6a4f597780e8a6a2b947 | JavaScript | prestonlimlianjie/straits-times-forum-letter-generator | /generate-article.js | UTF-8 | 1,631 | 3.546875 | 4 | [] | no_license | generateArticle()
function randomSelect(next_word_obj){
// Obtain total sum of all counts in the object
let sumOfCounts = 0
for (next_word in next_word_obj) {
let count = next_word_obj[next_word]
sumOfCounts += parseInt(count)
}
// Generate random integer
let randInt = Math.floor(Math.random() * s... | true |
aa465986c0470fe09ad2c181876f8fa3699f4ad0 | JavaScript | NematollahQasemi/poco | /fifth-week/face.js | UTF-8 | 1,394 | 3.453125 | 3 | [] | no_license | let database = [
{
username: "Susanne",
password: "supersecret"
},
{
username: "Mark",
password: "secretive"
}
];
let newsfeed = [
{
author: "Mark",
title: "This is Mark's title",
summary: "This is the summary of Mark's news entry."
},
... | true |
a15bbfac19fd9650a35ed49b6757b593b289b38b | JavaScript | learn-co-students/web-060517 | /30-react/booklyapp-frontend/src/services/Auth.js | UTF-8 | 830 | 2.609375 | 3 | [] | no_license |
class Auth {
/*
// in my App.js
login()
*/
static login(loginParams) {
return fetch('https://web-060517.herokuapp.com/api/v1/login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(log... | true |
4ef9dfb228965744ebf73e2e8844a279ae195908 | JavaScript | nickjiunchetti/node-sql-movieAPI | /src/modules/WishList/controller/index.js | UTF-8 | 2,982 | 2.671875 | 3 | [] | no_license | const WishDB = require('../components/WishDB')
const WishListDB = require('../components/WishListDB')
const WishListOperations = require('../components/WishListOperations')
//SOLID - Singles Responsability Principle - Esta classe possuí apenas uma única responsabilidade de receber e executar as requisições relacionada... | true |
a8d922b705601ff2a2938caec5341f89cca5d0c8 | JavaScript | sunjing1015/nodeJs | /9.6/fs2/fs2.js | UTF-8 | 1,767 | 2.734375 | 3 | [] | no_license | var http=require("http");
var fs=require("fs");
http.createServer((req,res)=>{
//如果是图标就立刻返回
if(req.url=="/favicon.ico"){
return
}
res.writeHead(200,{"Content-type":"text/html;charset=UTF-8"});
//创建目录
//fs.mkdir("./mkdir",(err,data)=>{
// console.log("创建成功");
// res.end();
... | true |
d5d577c491437aadcffe62c61b94c566e87c2f6d | JavaScript | s-viour/personal-website | /authentication.js | UTF-8 | 661 | 2.625 | 3 | [] | no_license | const bcrypt = require("bcrypt");
const database = require("./database.js");
function get(callback) {
database.get((dbConnection) => {
dbConnection.query("SELECT hash FROM auth", (error, result) => {
if (error) throw error;
console.log("hash: " + result[0].hash);
callba... | true |
e43f95a0b1c8e260d33ce11f6a6e32c724360925 | JavaScript | annimont/code-academy-jns-2020-devenv | /client/src/common/reducers/loaderReducer.js | UTF-8 | 890 | 2.671875 | 3 | [] | no_license | const initialState = {
isLoading: null,
};
export default function (store = initialState, action) {
switch (action.type) {
default:
if (typeof action.type === 'string') {
if (action.type.endsWith('_PENDING')) {
const key = action.type.replace('_PENDING', '');
return {
... | true |
ec6a541ace3b4cbd34adad6095df142cc20c6137 | JavaScript | VasylievHennadii/Lesson-javascript | /hw2/task3-1.js | UTF-8 | 1,047 | 3.765625 | 4 | [] | no_license | // Задание 3-1. Функция принимает количество секунд (проверить что это число). Функция возвращает количество дней, часов, минут, секунд в переданых секундах.
console.log('Задание 3-1. Функция принимает количество секунд (проверить что это число). Функция возвращает количество дней, часов, минут, секунд в переданых сек... | true |
6cf63d1105a8e2290bd6c7fa4d31d13f1c28e701 | JavaScript | arupex/deep-value | /index.js | UTF-8 | 2,007 | 3.046875 | 3 | [
"Unlicense"
] | permissive | /**
* Created by daniel.irwin on 6/14/16.
*/
function arupex_deep_value(entity, accessor) {
if (!entity || !accessor) {
return undefined;
}
var arrayAccessor = /@((\w+)==(\w+))+/g;
var arr = (accessor && accessor.constructor === Array) ? accessor : accessor.split('.');
function handleA... | true |
c4d102607b63ff3ec429f35fa4d38b0bb6bd604c | JavaScript | snehakasar68/MERN_Data | /NodeData/FunctionDemos/empConsCalculatePf.js | UTF-8 | 414 | 3.140625 | 3 | [] | no_license | function employee(eid,ename,salary,pf,da,hra){
this.eid=eid;
this.ename=ename;
this.salary=salary;
this.calPfDaHr=function(){
var pfAmt=(salary*(pf/100))
var hraAmt=(salary*(hra/100));
var daAmt=(salary*(da/100));
console.log("Pf amount:"+pfAmt+" Hra:"+hraAmt+" DA:"+daAm... | true |
9042efb7abd90f4b1b0d16b265ed942e94f07665 | JavaScript | saucesome-gs/saucesome | /client/store/order.js | UTF-8 | 892 | 2.765625 | 3 | [
"MIT"
] | permissive | import axios from 'axios';
// INITIAL STATE
const order = 0;
// ACTION TYPES
const SET_ORDER = 'SET_ORDER';
// ACTION CREATORS
export const setOrderAction = (orderNumber) => {
return {
type: SET_ORDER,
orderNumber
}
}
// THUNKS
export const setOrder = userId => dispatch => {
axios.post('/api/cart', { ... | true |
285d73544dc1907da6f14899ae2ed57c5c157db6 | JavaScript | devshorts/grunt-init-haskell-test | /template.js | UTF-8 | 1,335 | 2.546875 | 3 | [] | no_license | 'use strict';
var exec = require("child_process").exec;
// Basic template description.
exports.description = 'Create a haskell unit testable library';
// Template-specific notes to be displayed before question prompts.
exports.notes = '';
// Template-specific notes to be displayed after question prompts.
exports.af... | true |
c595e0c5d657f08cca5c8cc4bbed422af6f1e6f1 | JavaScript | swamplilly/athenahacks2017 | /main.js | UTF-8 | 4,069 | 3.625 | 4 | [] | no_license | /*
* Global variables.
*/
var karma = 0;
var allItems = 0;
var finishedItems = 0;
/*
* Add an element to the to-do list.
*/
function addElement() {
var listElement = document.getElementById("list");
var valToAdd = document.getElementById("val").value;
/* Update global variables */
allItems += 1;
... | true |
952f1246aeaa61aa048eabd6bae6a134b75884d0 | JavaScript | royal-woods/jazz | /js/utils.js | UTF-8 | 2,841 | 2.859375 | 3 | [
"MIT"
] | permissive | function validateEmail(email, idInput) {
const emailRegex = /(.+.*@.+.*\..+.*)/;
if (email.match(emailRegex)) {
$(idInput).removeClass("input-text--error");
return true;
} else {
$(idInput)
.siblings(".error")
.show();
$(idInput)
.siblings(".error")
.text("Ingresa un correo... | true |
3fdcf23faea529bcca83787688924618d81fde53 | JavaScript | ThomB93/codewarsSolutions | /javascript/listFiltering.js | UTF-8 | 181 | 3.640625 | 4 | [] | no_license | function filter_list(l) {
// Return a new array with the strings filtered out
var numbers = l.filter((ele) => {
return typeof ele == "number";
})
return numbers;
} | true |
b23ba3617ae611d66f32ec37ba35b874abc0381d | JavaScript | matisse510/test | /js/tools/preload-static-res.js | UTF-8 | 1,526 | 2.6875 | 3 | [
"MIT"
] | permissive | // 战斗场景预加载资源
var gameStagePreloadRes = {
count:0
};
var gameStagePreloader = function(str,callback) {
gameStagePreloadRes.count++;
imgToCanvas(picture[str], callback);
}
;(function(){
// 玩家皮肤
gameStagePreloader('playerImage', function(c) {
gameStagePreloadRes.PLAYER = c;
});
// 玩家子... | true |
8a9e27f1fbb445f8e282bc8b0955e0dcf99138e5 | JavaScript | alexandrepiveteau/heig-RES-orchestra | /docker/image-musician/src/index.js | UTF-8 | 1,081 | 2.671875 | 3 | [] | no_license | const MULTICAST_ADDR="239.1.1.100"
const PORT=9009
const INTERVAL=1000
const { v4: uuidv4 } = require('uuid');
const uuid = uuidv4();
const dgram = require('dgram');
const server = dgram.createSocket('udp4');
const map = new Map();
map.set("piano", "ti-ta-ti");
map.set("trumpet", "pouet");
map.set("flute", "trulu");
... | true |
c56251eedd3a9b0017f8388045fa9150a4b4bbd6 | JavaScript | MaxPleaner/snake | /snake-ui.js | UTF-8 | 1,365 | 2.859375 | 3 | [] | no_license | (function () {
if (typeof SnakeGame === "undefined") {
window.SnakeGame = {};
}
var View = SnakeGame.View = function ($el) {
this.$el = $el;
};
View.prototype.bindEvents = function () {
$(document).on("keydown", handleKeyEvent.bind(this));
};
View.prototype.render = function () {
... | true |
ced8c4f9dce08864cbe12337aa0d3352506c969d | JavaScript | pashaigood/aviasearch | /src/components/Filters/components/StopQuantity/index.js | UTF-8 | 1,890 | 2.515625 | 3 | [] | no_license | import React from 'react'
import PropTypes from 'prop-types'
import StopQuantity, { Values } from 'constants/StopQuantity'
import format from 'utils/format'
import Checkbox from '../Checkbox'
import Classes from './index.scss'
export default class extends React.PureComponent {
static propTypes = {
values: PropTy... | true |
7a2937a28109c65b110816b266c664befb8fa302 | JavaScript | caffeinating/alphabit | /src/DateRange.es6 | UTF-8 | 320 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | import * as D from "./dates";
export default class DateRange {
constructor (from=Date.now(), to=from) {
this.from = from;
this.to = to;
}
toString(){
const from = new Date(this.from);
const to = new Date(this.to);
return D.isoDate(from) + "|" + D.isoDate(to);
}
} | true |
d32d3ed21e3c6090f09a556c93a3b74f76b85fda | JavaScript | zzmin13/Algorithm_problems | /baekjoon/15단계-동적계획법1/11054연습.js | UTF-8 | 884 | 3.21875 | 3 | [] | no_license | let fs = require("fs");
let numbers = fs.readFileSync("예제.txt").toString().split("\n");
const N = Number(numbers[0]);
numbers = numbers[1]
.trim()
.split(" ")
.map((element) => Number(element));
numbers.unshift(0);
const increaseDP = new Array(N + 1).fill(1);
const decreaseDP = new Array(N + 1).fill(1);
const dp... | true |
0617b15e5d4d2cdc959401b92c95cf03c43a3f94 | JavaScript | victoratavila/Inventory-management | /frontend/src/controllers/ClientsController.js | UTF-8 | 2,714 | 2.609375 | 3 | [] | no_license | const axios = require('axios');
module.exports = {
async getClients(req, res){
const fixedCompanyId = 5;
axios.get('http://localhost:8080/clients/'+fixedCompanyId).then((clients) => {
const data = clients.data;
const fixedCompanyId = 5;
if(data == null || data... | true |
ccebbca838de6724a3dfd1c80699a3fd0f35d78e | JavaScript | BenYoobic/angular-yoobic-starter | /build/@shared/stencil/collection/utils/validators/tel/tel.validator.js | UTF-8 | 485 | 2.75 | 3 | [] | no_license | export function getTelValidator(options) {
return (tel) => {
let TEL_REGEXP = /^[0-9+()\-]+$/;
if (tel === null || !tel) {
if (options && options.required) {
return false;
}
else {
return null;
}
}
... | true |
5d1c3a3c765633216c7aeec830cbc69f766f893b | JavaScript | chocoai/cores | /cores_arp/WebRoot/script/javascript/alterpassword.js | UTF-8 | 2,147 | 2.515625 | 3 | [] | no_license | /**显示修改密码Dialog*/
function ap_showQianmingDialog(clickName,msg){
/*签名Dialog*/
document.getElementById("alterpassword2").style.display="block";
//提示消息
$('#alterPassword_message').html(msg);
//用户名赋值
$('#ap_userName').val($('#userName').val());
//打开对话框
$('#alterpassword').dialog('open');
document.getElementById(... | true |
ade32f4ca43218b49ecc9be594ed4a2611d4d2fe | JavaScript | fathy17/tokopedia-test | /src/components/CatchStatusModal.jsx | UTF-8 | 2,686 | 2.8125 | 3 | [] | no_license | import React, { useContext, useState } from 'react';
import { AppContext } from '../context/AppContext';
export default function CatchStatusModal() {
const value = JSON.parse(localStorage.getItem('myPokemonList'));
const [nickName, setNickName] = useState('');
const [error, setError] = useState('');
const [o... | true |
cfd15b691ca50b84348fcd2f69faa6e4515d05d4 | JavaScript | nestjsx/nest-access-control | /lib/decorators/user-roles.decorators.js | UTF-8 | 1,832 | 2.59375 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserRoles = void 0;
const common_1 = require("@nestjs/common");
function userFactory(ctx) {
const contextType = ctx.getType();
if (contextType === 'http') {
// do something that is only important in the context of regul... | true |
0d26492598772be5952b7d46ceb22d80249d0443 | JavaScript | Cytofight/Cytofight | /client/components/GameFunctions/createFunctions/barriers.js | UTF-8 | 362 | 3.125 | 3 | [
"MIT"
] | permissive | export function createBarrier(location, ...vertices) {
// all locations are x-y ARRAYS
const barrier = game.add.graphics(0, 0);
barrier.beginFill(0xa9a904);
barrier.lineStyle(4, 0xfd02eb, 1);
barrier.moveTo(...location)
vertices.forEach(vertex => {
barrier.lineTo(...vertex)
})
this.add.graphics(barr... | true |
33af44c11b260940efac5348a078bd4c635bb49c | JavaScript | mcrowder65/task-manager | /server/dao/userDAO.js | UTF-8 | 2,273 | 2.59375 | 3 | [] | no_license | var user = require('../models/user.js');
var userValidator = require('../validators/userValidator');
const getById = async (_id) => {
return new Promise( async (resolve, reject) => {
user.findOne({
_id
},
(err, tempUser) => {
if(err) {
reject(err);
} else {
resolve(tempUser);
}
}
... | true |
de4e451ffc6a54b89c278f2d67c259b39d0ad5c7 | JavaScript | berkansivri/LeetCode | /LeetCode/492. Construct the Rectangle/ConstructRectangle.js | UTF-8 | 343 | 3.8125 | 4 | [] | no_license | /**
* @param {number} area
* @return {number[]}
*/
var constructRectangle = function(area) {
let w = parseInt(Math.sqrt(area))
while(!Number.isInteger(area/w)) w--
return [area/w, w]
};
console.log(constructRectangle(37)); // [37,1]
console.log(constructRectangle(4)); // [2,2]
console.log(constructRectangle... | true |
b3d62fac7376e088dca19a44dc8a3bea41640cac | JavaScript | beyerleinf/rki-covid-api | /server/api/general.js | UTF-8 | 1,869 | 2.640625 | 3 | [
"CC-BY-4.0"
] | permissive | 'use strict';
module.exports.general = async (req, res) => {
try {
const db = req.app.locals.database;
let dCollection = db.collection("general");
let result;
// test if an entry for today exists
const latestEntries = await dCollection.find().sort({ _id: -1 }).limit(2).toArray();
if (latest... | true |
24d9180e5c59d2ff9b65d41997ac990dc44c6e9d | JavaScript | zhentian-wan/ramda-demo | /object/toPairs.js | UTF-8 | 450 | 2.8125 | 3 | [] | no_license | const R = require('ramda');
const {map, join, concat, compose, toPairs} = R;
const obj = {
page: 2,
limit: 6,
type: 'movies'
};
const createQs = compose(
concat('?'), // ?page=2&limit=6&type=movies
join('&'), // page=2&limit=6&type=movies
map(join('=')), // [ 'page=2', 'limit=6', 'type=movies... | true |
8ba00d4af8a236cd36a14f7ce5b0c9239cd6dbb7 | JavaScript | markdyousef/oak-web-app | /src/js/store/types/record.js | UTF-8 | 904 | 2.59375 | 3 | [] | no_license | /* @flow */
import * as I from 'immutable';
/**
* Define an immutable record intended for holding reducer state
* @param spec - the keys and their default values
* @return a state record factory function
*/
export function defineRecord<T: Object>(
name: string,
spec: T
): (init: $Shape<T>) => Record<T> {
... | true |
80d9967d213bd4023c0cb1d5bc5c095aae8a2749 | JavaScript | andrewrametta/shopping-list-challenge | /index.js | UTF-8 | 1,338 | 2.921875 | 3 | [] | no_license | $(function() {
// listen for when a form is submited
$('#js-shopping-list-form').submit(event => {
// prevent form from submitting
event.preventDefault();
// store what is entered
const shoppingListEntry = $(this).find('#shopping-list-entry').val();
$('#shopping-list-en... | true |
a86fdefa284217181160b1ccca55084078ce86d3 | JavaScript | A19140312/tinyHeart | /js/collision.js | UTF-8 | 629 | 2.75 | 3 | [] | no_license | //判断大鱼和果实的distance
function monFruit () {
if(!data.gameOver)
for (var i = 0 ; i < fruit.num ; i ++ ){
if(fruit.alive[i]){
var l = calLength2(fruit.x[i], fruit.y[i], mom.x, mom.y);
if(l < 900){
fruit.eaten(i);
data.fruitNum += 1;
mom.bigBodyNum ++;
if(mom.bigBodyNum > 7)mom.bigBodyNum = 7;
... | true |
0afc14b5938624fc322ea2578b1685f53f6dfda3 | JavaScript | ms0223900/mini-games | /src/dashGame/gameFn.js | UTF-8 | 8,408 | 2.546875 | 3 | [] | no_license | import { simpleCheckObjCollide } from '../game/gameFunc'
export const checkPlayerCollideWithPlatform = (player, obj) => {
const { x, y, w, h } = player.spec
const { vx, vy } = player.movement
const { x: x2, y: y2, w: w2 } = obj.spec
const { vx: vx2, vy: vy2 } = obj.movement
const objV = {
vx: obj.movemen... | true |
2e8d39cce7126e9a05a1f1fdd12972be25494833 | JavaScript | 1ogica1/fullQuiver | /Javascript/products.js | UTF-8 | 9,848 | 2.765625 | 3 | [
"MIT"
] | permissive | /*
-------------------
Title: products.js
Version: 4.0
Date: 11/21/2014
-------------------
*/
var ListOfChecked = [[], []];
var Filter_Type = 0, Filter_Value = 1;
var queryString = "";
var counter = 0;
$(document).ready(function () {
retrieveQueryString();
$("#productDialog").dialog({ //Enables the dialog box th... | true |
9c16021ad2a7fa490f287a50e88b59c76c5d769b | JavaScript | Bobm42/workstuff | /bobjava.js | UTF-8 | 2,608 | 2.84375 | 3 | [
"MIT"
] | permissive | var car = {
colour : ["red", "blue", "green", "yellow"],
speed : 200,
engine : { gears: 5,
horsepower: 500,
pistons: 4,
fuel: "electric"
},
drive: function() {
return "divvie";
}
};
var list = [
"balloons",
"jokes",
"pinics",
"water",
"sugar"
]
function textred() {
... | true |
1cd55c3413696122b361931929dba1ba299daa4c | JavaScript | grillorafael/chess-ter | /js/pieces/tower.js | UTF-8 | 2,883 | 3.359375 | 3 | [] | no_license | 'use strict';
function Tower(player) {
Piece.call(this, player);
}
Tower.prototype = new Piece();
Tower.prototype.constructor = Tower;
Tower.prototype.getPieceValue = function () {
return 500;
};
Tower.prototype.getCountPossibleMoves = function() {
return this._countPossibleMoves;
};
Tower.prototype.possible... | true |
7363ec905aa598d6d0c51f6bacbabe665b9263dc | JavaScript | Sumera222/Task_7_stacks | /Task_7_stacks/app1.js | UTF-8 | 1,321 | 4.6875 | 5 | [
"MIT"
] | permissive | /*Implement following methods. Don’t forget to increase and decrease the size when you add or remove an element from the stack.
push: a method through that you can add a value to the stack
peek: a method through which you can get the value on the top of stack
pop: a method through which you can remove the first elem... | true |
81cdddf84066869e35d59d7cad254a63c58c508a | JavaScript | muranodesign/AgroApp | /helpers/string.helper.js | UTF-8 | 524 | 2.71875 | 3 | [] | no_license | exports.sanitize = (string) =>
string
.trim()
.replace(/^\s+/, "")
.replace(/[áàâãåäæª\u00e1\u00e0\u00e2\u00e3\u00e5\u00e4\u00e6\u00aa]/g, "a")
.replace(/[éèêëЄ€\u00e9\u00e8\u00ea\u00eb\u0404\u20ac]/g, "e")
.replace(/[íìîï\u00ed\u00ec\u00ee\u00ef]/g, "i")
.replace(/[\u00f3\u00f2\u00f4\u00f5\u... | true |
31f66fc855cba307bb4334cfacd18eeb64279d8a | JavaScript | jdomanski79/1k47 | /src/main/resources/static/index.js | UTF-8 | 672 | 2.78125 | 3 | [] | no_license | (function () {
// navigation
const navToggle = document.getElementById('nav-toggle');
const navMobile = document.querySelector('.main-nav ul');
navToggle.addEventListener('click', () => {
if (navMobile.style.display == 'block') {
navMobile.style.display = ''
navToggle.innerHTML = '&... | true |
b0f667e6493afe89622909f6c17b2d815c808482 | JavaScript | rimivan/dynamically-search | /react/src/components/dyna-search/dyna-search.jsx | UTF-8 | 1,330 | 3.09375 | 3 | [] | no_license | import {useState} from "react";
function DynaSearch() {
const [list, setList] = useState(['test-1', 'test-2', 'test-3']);
const [filteredList, setFilteredList] = useState([]);
const [searchKey, setSearchKey] = useState('');
const initList = () => {
setList(Array.from({length: 20}, () =... | true |