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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
efe0cf2dfb2fd622f25a3c007ccf9193911ba8d0 | JavaScript | JGTapia/Star-Match | /src/components/App.js | UTF-8 | 937 | 2.640625 | 3 | [] | no_license | import React, { useState } from 'react';
import Game from "./Game"
import Table from './Table';
const StarMatch = (props) => {
const [gameId, setGameId] = useState(1);
return <Game key={gameId} startNewGame={() => setGameId(gameId + 1)} gameId={gameId} setGameScore={props.setGameScore} />;
}
export function Ap... | true |
f5e85a7ae596a6ebd2d9b3bed57511fc91bb5ddf | JavaScript | juandonalez/colorblind | /colorblind/colorblind-nwf/app/js/test/level.js | UTF-8 | 3,018 | 2.84375 | 3 | [] | no_license | Level.prototype = new GameObject();
Level.prototype.constructor = Level;
function Level(d) {
var go = d.layers[4].objects[0];
this.platform = new Platform(go.x, go.y, go.width, go.height);
console.log(this.platform);
/*this.name = "level";
this.id = utilities.getNewID();
this.camera = cameraManager.foreground;
... | true |
aa88b385507995f1a2610709ba51ecbee4464107 | JavaScript | Mekdes1/hyf-homework | /javascript/javascript1/week3/smartPhoneUsageApp.js | UTF-8 | 1,206 | 3.25 | 3 | [] | no_license |
/* CactusIO-interactive (Smart phone usage app) optional */
/* Adding an activity */
let activities = [];
let today = new Date();
const date = today.toLocaleDateString("en-US");
function addActivity(date, activity,duration){
activities.push({date,activity,duration});
return activities
}
addActivity(date, ... | true |
dcfcc2a5f9db9b548d9f70ea138965bffd9da6f8 | JavaScript | bodyasafff/IndeemaTest | /2. Task/script.js | UTF-8 | 1,208 | 3.03125 | 3 | [] | no_license | function generateModalWindow(){
var background = document.createElement("div");
background.id = "background";
background.className = "background";
background.addEventListener("click",closeModalWindow,false);
var window = document.createElement("div");
window.className = "window";
window.in... | true |
e433fb4952ea9260ca3a897ceeb5c5416ebf289f | JavaScript | vlino2015/DCWork | /CN-Node-test.js | UTF-8 | 108 | 3.265625 | 3 | [] | no_license |
// var name = "Alfie"
function greeting(name) {
return "hello " + name
}
console.log(greeting(name))
| true |
f0163bdc04bb7cb9018ec4705272eeab8cf728ff | JavaScript | javiermvaldecantos/chess | /api/test/test-position.js | UTF-8 | 939 | 2.890625 | 3 | [
"MIT"
] | permissive | var Position = require('../position.js');
(function testPosition() {
console.log( "new Position(0,0) -->", (new Position(0,0)).toString() );
console.log( "new Position(-1,0) -->", (new Position(-1,0)).toString() );
console.log( "new Position('-1',0) -->", (new Position('-1',0)).toString() );
console.lo... | true |
1c2148970c189bd53dcca48dc2c01f871b221f6f | JavaScript | KandaYozo/Geeks-Read-FrontEnd | /Backend API with Documentation/reviewsController.js | UTF-8 | 3,483 | 2.609375 | 3 | [] | no_license | ///////////////////Required Modules//////////////////////////
var express = require('express');
var Router = express.Router();
const mongoose = require('mongoose');
const {validate,review} = require('../models/reviews.model');
const user = require('../models/User').User;
const Joi = require('joi');
///////////////////R... | true |
5bd79e4274e43f4a238d19a949216384fcdfa4d0 | JavaScript | atBeatty/d3-stats | /pages/api/hello.js | UTF-8 | 584 | 2.921875 | 3 | [] | no_license | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default (req, res) => {
res.status(200).json({ name: 'John Doe' })
}
// Not to worry though, this is where Next.js shines.In the pages directory, we can create an additional special directory called api.In this API directory, as t... | true |
45937d0c520fbb9d0db9fb08127db917464c5537 | JavaScript | yoanaB/MeetMe | /homework1Kalina/Simple blogging/app/utils/utils.js | UTF-8 | 329 | 2.515625 | 3 | [] | no_license | import {ACTIVE, INACTIVE, ALL} from '../config/constants'
export default (posts, active) => {
switch (active) {
case ACTIVE:
return posts.filter((post) => (post.status));
case INACTIVE:
return posts.filter((post) => !(post.status));
case ALL:
return post... | true |
9475adae0748235bcdf688de4326a4b823a4eca2 | JavaScript | ayushhdwi/Basic-WeatherApp | /app.js | UTF-8 | 329 | 2.5625 | 3 | [] | no_license | const forecast = require('./utils/forecast');
const address = process.argv[2];
if (!address) {
console.log('Please provide an address')
} else {
forecast(address, (res, err) => {
if (err) {
return console.log(err);
}
console.log(res);
// console.log(forecastData);
... | true |
fcc8faa6390de8a6efea56359f8f16fda98058ab | JavaScript | JeongbinPark/Colle_flower | /client/src/components/SignUpPage/FindSchool.js | UTF-8 | 2,294 | 2.875 | 3 | [] | no_license | import React, { Fragment, useState, useEffect } from 'react';
import { useDispatch } from "react-redux";
export default function FindSchool(props){
const schools = [
{
"code" : "pknu",
"name_kr" : "부경대학교",
"name_en" : "pukyong national university"
},
{
"code" : "pnu",
"name_... | true |
6929da039eefd210e5ab892ed5c8398cf3362874 | JavaScript | DanielOrfeu/ProjetoMatrix | /03-Encapsulamento.js | UTF-8 | 567 | 3.359375 | 3 | [] | no_license | //Daniel Yago da Silva Orfeu Joaquim
function checarNumeroDecimal(n){
return (n===Math.trunc(n));
}
function checarNumeroNegativo(n){
if(n>=0) return checarNumeroDecimal(n);
}
function checarNumeroValido(n){
if(typeof n==="number") return checarNumeroNegativo(n);
}
function somarInteiros(n){
... | true |
4a48ce4a7c3139309922486378b569029c881866 | JavaScript | Shubham-010/Finacus_Training | /React/Day3/finpro/src/components/TimeMain/TimeTableRender.js | UTF-8 | 702 | 2.546875 | 3 | [] | no_license |
import TableFilter from '../NewE/TableFilter/TableFilter';
import React,{useState} from 'react';
import TimeList from './TimeList';
import TimeChart from './TimeChart';
const TimeTableR=(props)=>{
const [filteredYear, setFilteredYear] = useState('2021');
const filterchangeHandler = selectedYear=>{
se... | true |
59c9c4ffe563e90ba49cf4412d2409a8fdfb83b9 | JavaScript | piotrglazar/webs | /src/main/resources/static/js/websAjax.js | UTF-8 | 716 | 2.59375 | 3 | [
"MIT"
] | permissive | function websAjaxLoad(fetchId, ajaxDataHandler) {
$(fetchId).click(function(event) {
$.ajax({
url: $(event.target).attr("href"),
type: "GET",
beforeSend: function(xhr) {
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestH... | true |
41b700cf8383c79928c1877c357e04526ad11ff2 | JavaScript | rgaldean/RG_BSSD3520_10.1 | /main.js | UTF-8 | 3,664 | 3.25 | 3 | [] | no_license | // Homework: Complete Remaining Tasks and submit via github by Monday before 10PM.
/*
x Task 1: Put Countries in select
x Task 2: Print flag when country is selected
x Task 3: Change the select to show flags and countries together
x Task 4: Change select to show only flags and print the country when se... | true |
a01c2e1ff8615dab2ed4e1368f75c6170abedd17 | JavaScript | faryar48/practice_bradfield | /10-08/algorithm.js | UTF-8 | 2,341 | 3.03125 | 3 | [] | no_license | // var myList = [ {start: 30, end: 150}, {start: 540, end: 600}, {start: 560, end: 620}, {start: 610, end: 670} ]
var myList = [ {start: 30, end: 150}, {start: 540, end: 600}, {start: 540, end: 600}, {start: 560, end: 620}, {start: 610, end: 670} ]
var mainWidth = 600
var mainHeight = 720
var eventTreeToPositionedEv... | true |
4d00f1713652da87eda4bc1800798313baa536f9 | JavaScript | HedyChen/self-study | /jqueryPractice/2016.9.8/demo.js | UTF-8 | 425 | 2.90625 | 3 | [] | no_license | window.onload=function(){
var lis=document.getElementsByTagName('li');
for(var i=0; i< lis.length; i++){
lis[i].onmouseover=function(event){
//鼠标经过一级菜单,二级菜单动画下拉显示出来
event.style.overflow = 'visible';
}
//鼠标离开菜单,二级菜单动画收缩起来。
lis.onmouseout=function(lis){
event.style.overfl... | true |
b0b9a4c334fad354a9a9c392dd248d4e1ac12cb6 | JavaScript | yeheskhielprasetyo/Papan-info-KeDai | /admin/firebase/firebase-login.js | UTF-8 | 1,977 | 2.625 | 3 | [] | no_license | // Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyBozP-nzVAwq3UNF4yu0AM2V1T9pweXNPo",
authDomain: "fir-papaninformasi.firebaseapp.com",
projectId: "fir-papaninformasi",
storageBucket: "fir-papaninformasi.appspot.com",
messagingSenderId: "920683588565",
appId: "1:9206... | true |
06161f07e12550c140c75156667fafca8249b4bc | JavaScript | ItaloSampaio/16-digit-credit-card-number-validation | /creditCardValidation.js | UTF-8 | 884 | 3.578125 | 4 | [] | no_license | function isValidNumber(number) {
if(typeof number !== 'number')
throw new Error('You should pass a number');
if(number.toString().length !== 16)
return false;
const sum = getNumberAsArray(number)
.reverse()
.map(doubleOddDigit)
.reduce(sumValues, 0);
r... | true |
6a9f0c9f80eea2562af3d42f40d550aa5bab0397 | JavaScript | ms-vague/quiz_app | /app.js | UTF-8 | 4,772 | 2.96875 | 3 | [] | no_license | var questions = [
{
question: 'Where is Orphan Black filmed?',
options: ['Toronto, Canada', 'New Orleans, LA', 'New York, New York', 'Athens, Greece'],
choice: 0,
correctMessage: "Correctomundo! Orphan Black is filmed in Toronto, Canada. (Hi, Drake)"
},
{
question: 'What is the name of the cloning program?... | true |
fa19b40d40b5ecba26da70d0e93986c1d5cf4cbb | JavaScript | FullerJam/todo_list | /js/main.js | UTF-8 | 1,676 | 2.984375 | 3 | [] | no_license | import '../main.scss';
import img1 from '../assets/top-left-elips.png';
import img2 from '../assets/bottom-right-elips.png';
import todos from "./todos";
import Todo from './Components/Todo';
const uuidv1 = require('uuid/v1');
console.log(todos);
const view = ` <img
src="${img1}"
id="background-left"
alt="background... | true |
edcd818cb8d075a8c1240f372286e6ef8039247c | JavaScript | danielvportlandia/data-structures-and-algorithms | /__test__/check-permutation.test.js | UTF-8 | 1,344 | 2.90625 | 3 | [
"MIT"
] | permissive | 'use strict';
import isPermutation from '../strings/check-permutation/check-permutation';
describe('check-permutation.test.js', () => {
describe('#isPermutation', () => {
test('Should return true if one input is a permutation of the other.', () => {
const matchingString1 = 'these strings should match.';
... | true |
96b80e227721051f0d4cf89a60ed2dab5370d308 | JavaScript | Subrata-Shuvo/Javascript-String-and-Array | /array-exists.js | UTF-8 | 818 | 4.4375 | 4 | [] | no_license | // using isArray to find out array element
function megaFriend(friends) {
if (Array.isArray(friends) == false) {
return 'please provide an array';
}
let mega = friends[0];
for (const friend of friends) {
if (friend.length > mega.length) {
mega = friend;
}
}
r... | true |
a9fe5b2922692feaaf7fe4ec398fb1bc426919c6 | JavaScript | prybylouski/basic-js | /src/transform-array.js | UTF-8 | 904 | 2.875 | 3 | [
"MIT"
] | permissive | const CustomError = require("../extensions/custom-error");
module.exports = function transform(arr) {
let newArr = [];
try{
if(!Array.isArray(arr)){
throw new Error('Error');
}
}
catch (err){
return e.message;
}
for(let i=0; i<arr.length;i++){
if(typeof arr[i] == 'string' && arr[i]... | true |
d63e46093d5d52977c33a28ceb502f07f112fa9d | JavaScript | az1dii/PokeDB | /js/script.js | UTF-8 | 1,828 | 3.0625 | 3 | [] | no_license | let pokeDB;
//https://pokeapi.co/api/v2/pokemon/${name}
const $input = $('input[type="text"]');
const $pName = $('#name');
const $pImg = $('#poster');
const $pId =$('#id');
// STATS
const $pStats =$('#stats');
const $pStats1 =$('#stats1');
const $pStats2 =$('#stats2');
const $pStats3 =$('#stats3');
const $pStats4 =$... | true |
314d70a98bb66882c424e1404f12e331970f1ed8 | JavaScript | gjyalpha/coding | /codeeval/084.stringrotation.js | UTF-8 | 654 | 3.3125 | 3 | [] | no_license | var fs = require('fs');
function compare(s1, s2, base) {
for (var i = 0, ii = s1.length; i < ii; i++) {
var c1 = s1.charAt(i);
var c2 = s2.charAt((base + i) % ii);
if (c1 != c2) {
return false;
}
}
return true;
}
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (lin... | true |
08c53df0e84162b74171a79916e0cb229ce26141 | JavaScript | mtfrat/clase6-js | /main.js | UTF-8 | 1,824 | 3.546875 | 4 | [] | no_license | function auto(marca,modelo,color,año,km) {
this.marca = marca
this.modelo = modelo
this.color = color
this.año = año
this.km = km
}
function ingresoDatos(){
marcaIngreasada = prompt("Ingrese marca:")
modeloIngreasado = prompt("Ingrese modelo:")
colorIngresado = prompt("Ingrese color:")
... | true |
09a0b2d5607cd0994c4ac612f028ec96c9b02d82 | JavaScript | emmorts/carousel | /client/src/carousel.js | UTF-8 | 8,254 | 2.6875 | 3 | [] | no_license | import './carousel.css';
import ApiProvider from './providers/api-provider.js';
export default class Carousel {
constructor(elementSelector, options = {}) {
if (!elementSelector) {
throw new Error(`Element selector for carousel initialization was not provided!`);
}
this.containerElement = document... | true |
ff29efeaa345127c867c6c9cdb82d10e5b38c3d2 | JavaScript | Aym-fuhong/empty-flaten | /practices/flaten/double_dimensional_array_to_one_1.js | UTF-8 | 199 | 2.8125 | 3 | [] | no_license | 'use strict';
function double_to_one(collection) {
var arr = [];
for(var i=0;i<collection.length;i++){
arr = arr.concat(collection[i]);
}
return arr;
}
module.exports = double_to_one;
| true |
ef91ebcdab20dba93a43573be5463396096db87c | JavaScript | jrschmidt/colortv | /protopixels-jasmine.js | UTF-8 | 8,588 | 2.5625 | 3 | [] | no_license | // Generated by CoffeeScript 1.9.1
var ColorTvApp, DotDraw, DotHelper, DotIterator, DotSquareHelper, QuadrantSplitter,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
ColorTvApp = (function() {
function ColorTvApp(... | true |
4035aa79a2f57aca69d0df0a877cb164f2541324 | JavaScript | hihozhou/larashop | /resources/assets/js/home/myc.js | UTF-8 | 12,434 | 2.625 | 3 | [
"MIT"
] | permissive | var myc = (function(){
//判断手机号码是否正确
function regularPhoneNumber(str) {
var s = str.replace(/\s|\-/g, '');
if(s.indexOf("+86") == 0) {
s = s.substr(3);
}
var d = /^1\d{10}$/g;
if(d.test(s)) {
return s;
} else {
return null;
}
}
//定时器
function repeat(f, t, c) {
var count = 0;
return setTim... | true |
ebae72f692bb3bf3fc0b69b90d3b78875b4770b2 | JavaScript | webrenee7/course-react | /1.React入门/js/3.component.js | UTF-8 | 964 | 3.640625 | 4 | [] | no_license | /*
* 如何声明组件
* 组件的本质是一个类,类里面有一个render的方法,render的方法返回一个虚拟DOM
* 组件是有要求的
* 1、类名首字母大写
* 2、里边需要一个render方法,此render方法要返回一个react虚拟DOM元素
* */
//声明组件
var Message=React.createClass({
render(){//相当于render:render(){...} es6语法
return <h1>hello</h1>
}
});
/*组件原理:
function Message() {}
Message.prototype={
render()... | true |
886882868c3e0289a593284fc4d609821da7a4a8 | JavaScript | ed1868/roadToFB | /freeCode/CaesarsCipher/caesars.js | UTF-8 | 562 | 2.9375 | 3 | [
"MIT"
] | permissive | rot13 = (str) => {
let simpleAlphaBet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
let letters = str.split('');
let decoded = [];
letters.map(letter => {
if(simpleAlphaBet.includes(letter)){
let codedIndex = simpleAlphaBet.indexOf(letter) + 13;
if(codedIndex >= simpleAlphaBet.length){
let newLetter = ... | true |
4c48fdc4e168fc5eb15e5c52ddaea1073607d4e0 | JavaScript | mh453Uol/Network | /Network/wwwroot/js/site.js | UTF-8 | 5,106 | 3.015625 | 3 | [] | no_license | var userService = function () {
const baseUrl = window.location.origin;
function follow(userId) {
const followUrl = `${baseUrl}/api/follow/${userId}`;
return fetch(followUrl, {
method: "POST",
}).then(response => response.json());
}
function unfollow(userId) {
... | true |
a8448d24314ac451126e47061090977ecb176683 | JavaScript | redgaryesid/listaUsuarios | /src/controlers/edit.js | UTF-8 | 2,444 | 2.796875 | 3 | [] | no_license | var userActive = localStorage.getItem("user_active");
console.log(userActive=="null")
if(userActive == "null"){
$(location).attr('href',"../templates/login.html");
}else{
var usuarios = JSON.parse(localStorage.getItem("users"));
var usuarioEdit = JSON.parse(localStorage.getItem("user_edit"));
$("#Password").... | true |
2af9319da234f46320a1303e815b6ff66cbd246c | JavaScript | MavyEP/rest-chartbool | /main.js | UTF-8 | 4,412 | 2.625 | 3 | [] | no_license | //variabile per il grafico sull'andamento annuale
var mesi = {
January : 0,
February : 0,
March : 0,
April : 0,
May : 0,
June : 0,
July : 0,
August : 0,
September : 0,
October : 0,
November : 0,
December : 0
};
//variabile per il grafico sui venditori
var venditore = {};
//c... | true |
6223d9780451a56ab6124cf737a80d2e304424af | JavaScript | colinvanwinkle/Encore-Radio | /views/controllers/Login.js | UTF-8 | 966 | 2.703125 | 3 | [] | no_license | var axios = require('axios');
//Export the file to be used in other components
module.exports = {
Login: function(that, result){
that.setState({showModal: false});
var saveRef = that;
var data = {username: that.state.username, password: that.state.password};
axios.post('/login',data).then(functi... | true |
ee0f7503b5b56b581e78983a77a2207c0eb3507c | JavaScript | IronOnet/codebases | /codebases/app.hubspot.com/usr/share/hubspot/build/hubspot/static-archive/transmute/static-2.18/isArray.js | UTF-8 | 307 | 2.640625 | 3 | [] | no_license | "use strict";
'use es6';
/**
* Returns `true` if value is an Array.
*
* @param {any} value
* @return {boolean}
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isArray;
function isArray(value) {
return Array.isArray(value);
}
module.exports = exports.default; | true |
84b365b94e3339e2bf74aaf5d6e31d30d9ec60fb | JavaScript | aftongauntlett/readme-generator | /index.js | UTF-8 | 5,127 | 3.296875 | 3 | [
"MIT"
] | permissive | // start with my variables for libraries
const inquirer = require("inquirer")
const fs = require("fs")
const axios = require("axios")
// -- create an array of questions/objects using const, since I don't want these to change -- //
const questions = [{
type: "input",
message: "Enter your Github username",
n... | true |
5df709e76ae178f106c663fca75fc5d09e0a13b7 | JavaScript | h3devin/whopper | /index.js | UTF-8 | 7,953 | 3.015625 | 3 | [
"MIT"
] | permissive | const bodyParser = require('body-parser')
const express = require('express')
const logger = require('morgan')
const app = express()
const {
fallbackHandler,
notFoundHandler,
genericErrorHandler,
poweredByHandler
} = require('./handlers.js')
// Libraries
var PF = require('pathfinding');
const util = require('ut... | true |
124900398dc4651752cdc64d61db5b25faa15d27 | JavaScript | SmilingFrom1994/arvi | /app/controllers/users.controller.js | UTF-8 | 5,046 | 2.65625 | 3 | [] | no_license | const db = require("../models");
const logger = require('../services/logger-write-methods');
const md5 = require('md5');
const Users = db.users;
const Op = db.Sequelize.Op;
// Create and Save a new User
exports.create = (req, res) => {
logger.writeLogInfo(req, "Request recieved at /Users/")
console.log(req.bo... | true |
367641df35262294eaa7a240db1ada0c9b3026dd | JavaScript | OdeclasV/mastering-js | /exercises/068-extend/app.js | UTF-8 | 521 | 3.59375 | 4 | [] | no_license | var obj1 = {
a: 1,
b: 2
};
var obj2 = {
b: 4,
c: 3,
d: 6
};
function extend(obj1, obj2) {
// your code here
for(let item in obj2){
if(item in obj1 === false){
obj1[item]
}
}
return obj1
}
extend(obj1,obj2)
//console.log(obj1);
//console.log(obj2);
// ... | true |
b839ad8c5512dc61cc51ad9409a78f80b62f2208 | JavaScript | fangsmile/page-test-webpack | /src/common/dialog/dialog.js | UTF-8 | 5,733 | 2.859375 | 3 | [] | no_license | /**
* @file
* @author yuanwei (yuanwei@xueleyun.com)
* @since 2020-04-13 16:22:13
*/
import './dialog.css';
/**
* @class DialogBox
* @field type 可选 alert|confirm
* @field title 标题
* @field concent 内容
* @field actions 动作
* @description 统一的弹出框
*/
export default class DialogBox {
construc... | true |
60923ee2a420010bcb4dd5cb07a9cceaf08ff062 | JavaScript | Vitrine2020/Rank-Date | /function.js | UTF-8 | 1,084 | 2.953125 | 3 | [] | no_license | window.function = function (arr, format, jl, sep, rankItem, dateonly, des) {
if (arr == undefined && jl == undefined) return undefined;
if (rankItem == undefined) return undefined;
format = format.value ?? "short";
jl = jl.value ?? "";
sep = sep.value ?? "|";
dateonly = dateonly.value ?? 0;
des = des.val... | true |
c4342d2eb9d27ebb75029a3cc38c5929f2e7debf | JavaScript | nikhomgithub/expressbasic | /index.js | UTF-8 | 1,882 | 2.59375 | 3 | [] | no_license | const express=require('express');
const bodyParser=require('body-parser');
const path=require('path');
const mongojs=require('mongojs');
const app=express();
const db=mongojs('mycustomers',['table1'])
/*
//Middleware sequence
const log1=function(req,res,next){
console.log('Log1');
next();
}
app.use(log1);
const l... | true |
bb931332973ebd83fba1d0fbf2744906208d3c0e | JavaScript | ossset/football-app | /src/components/Pager/Pager.jsx | UTF-8 | 2,089 | 2.78125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
class Pager extends React.Component {
createSelect = () => {
const { itemsOnPage, data } = this.props;
const select = [];
for (let i = 0; i < Math.ceil(data.length / itemsOnPage); i += 1) {
select.push(i + 1);
}
return select;
... | true |
a1cd867d0cedf50fe04112acd8a984070dca4e58 | JavaScript | CoyRonboy92/mywebsite | /js/programming.js | UTF-8 | 1,329 | 3.203125 | 3 | [] | no_license | // JavaScript Document
// access the grid element - returns a single object
var grid = document.getElementById("grid");
// access the classes within grid - returns a set of objects
var spans = grid.getElementsByClassName("span1");
var rows = grid.getElementsByClassName("row");
// add a paragraph of text within each blo... | true |
014a627ac818e21fcbb2580f8b345356ce540a94 | JavaScript | GSG-G9/Israa-useEffect-Exercises | /src/Exercise3/index.js | UTF-8 | 1,074 | 2.828125 | 3 | [] | no_license | import React,{useState,useEffect} from 'react'
function Exercise3(){
const [input,setInput]=useState("")
const [image,setImage]=useState("")
const [data,setData]=useState([])
useEffect(()=>{
let isActive = true;
fetch(`http://api.giphy.com/v1/gifs/search?q=${input}&api_key=fqRDKIkC6bHjBqqhzUXG8c... | true |
cdcf2e103d3cbb2a5e6719c8375f399cff29915d | JavaScript | hugoiuri/movies-api | /lib/users/users-service.js | UTF-8 | 2,303 | 2.53125 | 3 | [
"MIT"
] | permissive | const userMovieRepository = require('../user-movie/user-movie-repository');
const userRepository = require('./users-repository');
const service = (() => {
const validateAuth = (auth, callback) => {
userRepository.findByFbToken(auth, (err, user) => {
if (err || !user) {
return callback(false)
... | true |
cc02cbe50f6c872c0e05c3a8d5e40322e955d74e | JavaScript | TannerVSchool/bounty-hunter | /frontend/app.js | UTF-8 | 889 | 2.59375 | 3 | [] | no_license | var app = angular.module("BountyApp", []);
app.controller("MainController", ["$scope", "HttpService", function($scope, HttpService) {
$scope.newBounty = {};
$scope.getAllBounties = function() {
HttpService.getAllBounties().then(
function(bountyList) {
$scope.bountyList = bo... | true |
360f246579267bbd2ae8ea707bdd9c7db55a0e9d | JavaScript | employee451/tritype | /src/TriangleValueInputs.js | UTF-8 | 1,351 | 2.546875 | 3 | [] | no_license | import React from 'react'
import { connect } from 'react-redux'
import { calculateTriangle } from './actions'
class TriangleValueInputs extends React.Component {
constructor(props) {
super(props);
this.state = {
sideA: '',
sideB: '',
sideC: ''
}
this.handleChange = this.handleChang... | true |
d53db9d8805d7b08515efe7886c867685fc4132f | JavaScript | dradoslavov01/SoftUni | /JS-Fundamentals/Programming Fundamentals Mid Exam Retake - 12 August 2020/the lift.js | UTF-8 | 879 | 3.34375 | 3 | [] | no_license | function solve(input) {
let waitingPeople = Number(input.shift());
let wagon = input.shift().split(' ');
wagon = wagon.map(Number);
for (let i = 0; i <= wagon.length - 1; i++) {
if (waitingPeople >= 4) {
let people = 4 - wagon[i];
wagon[i] += people;
... | true |
ee18061f36fa8599417247caae98755c79a74db7 | JavaScript | drblue/nodebots | /bot.js | UTF-8 | 1,666 | 2.734375 | 3 | [] | no_license | var five = require("johnny-five");
const EventEmitter = require("events");
class Bot extends EventEmitter {
constructor(device) {
super();
let bot = this;
console.log("Bot starting up!");
bot.eyes = null;
bot.sonar = null;
bot.motors = null;
bot.line = {
left: true,
right: true,
};
bot.opt... | true |
b6a25833fe490a6af30d619e3c443c8be4b39542 | JavaScript | modiem/games | /nokia-snake/app.js | UTF-8 | 5,368 | 3.40625 | 3 | [
"MIT"
] | permissive | /*
Copyright (c) 2020 Ania Kubow
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, subli... | true |
e0ef1b2fdc6e3189d32d7ab3178403495df70e19 | JavaScript | fluffynuts/stalker-weather-tweaker | /src/shared/is-file.js | UTF-8 | 324 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | const
promisify = require("util.promisify"),
fs = require("fs"),
exists = promisify(fs.exists),
stat = promisify(fs.stat);
async function isFile(arg) {
const pathExists = await exists(arg);
if (!pathExists) {
return false;
}
const st = await stat(arg);
return st.isFile();
}
module.exports = isFi... | true |
af848704f632d905e5c066d9028972ffe148638e | JavaScript | dariusbaba/FalcorBookshelfIntegration | /app/TaskRepo.js | UTF-8 | 917 | 2.671875 | 3 | [] | no_license | var TasksRepo = {
create: newTask => {
console.log("creating a new tasks...");
return newTask.save().then(
model => {
console.log(model);
console.log(' ---- created task ----');
})
},
read: task => {
console.log(task);
return task.fetch().then(
model => {
... | true |
aef72f54effdd1efcccf53772a6e375f0621bad2 | JavaScript | HunterHeads/Retify | /src/store/authenticationStore.js | UTF-8 | 870 | 2.5625 | 3 | [] | no_license | const initialState = () => ({
isLogged: false,
username: "",
isSpotify: false,
});
export default {
namespaced: true,
state: initialState(),
mutations: {
setIsLogged(state, payload) {
state.isLogged = payload.isLogged;
},
setUsername(state, payload) {
... | true |
997de6c7af0c7aad2d72be3b06797cd723f4b90a | JavaScript | KubaJarmolowicz/nawyki | /js/state/YearManager.js | UTF-8 | 1,122 | 2.734375 | 3 | [] | no_license | import { MonthManager } from "./MonthManager.js";
export class YearManager {
constructor(state) {
this._date = new Date(state.lastSavedDate);
this.currentYear = this._date.getFullYear();
this.months = [
new MonthManager(state, 0, this.currentYear),
new MonthManager(state, 1, this.currentYear),
new Mon... | true |
2f38aaf06e50980a5f57ac88827df3d7b39689cd | JavaScript | fergusKe/crawler_20191122 | /07_flask_api/static/js/index.js | UTF-8 | 803 | 2.890625 | 3 | [] | no_license | fetch('http://127.0.0.1:8081/api/posts')
.then(function(response) {
return response.json()
})
.then(function(data) {
console.log(data)
renderPosts(data)
})
function renderPosts(data) {
let postHtml = ''
for (i = 0; i < data.length; i++) {
postHtml += `
<div class="card">
<a h... | true |
420eb07af10ad232ec9df3de43dd647318dca092 | JavaScript | ayejayhicks/workdayscheduler | /script.js | UTF-8 | 1,470 | 3.046875 | 3 | [] | no_license | // Moment vs Luxon
var currentDate = luxon.DateTime.local();
var topDate = $("#currentDay");
var printDate = currentDate.toLocaleString(luxon.DateTime.DATE_MED_WITH_WEEKDAY)
topDate.text(printDate);
console.log(printDate);
var todo;
function storetodo() {
todo = $(this)
var todoId = todo.attr("id")
var us... | true |
a661651db7a9782123f58fa0391a1130b2154c32 | JavaScript | ravi1122/emi-calc | /src/components/Slider/index.jsx | UTF-8 | 4,085 | 2.546875 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
class Slider extends Component {
state = {
limit: 0,
grab: 0
};
slider = React.createRef();
handle = React.createRef();
componentDidMount() {
this.handleUpdate();
}
onMouseMove = e => {
... | true |
7066b3e304af0e2998927a12626436f1aa3683da | JavaScript | clymerrm/todo-list | /src/App.js | UTF-8 | 2,918 | 2.578125 | 3 | [] | no_license | // Importing Modules
import React, { Component } from 'react';
import axios from 'axios';
// Importing React-Router
import { BrowserRouter as Router, Route } from 'react-router-dom';
// Importing Components
import Todos from './components/Todos';
import Header from './components/layout/Header';
import AddTodo from '.... | true |
c1209714aee2c49cffd7ad3dcdda00cf30aa7188 | JavaScript | NFalinska/ui-internship-lwo2 | /tasks/8_factorize-number/factorize-number.js | UTF-8 | 145 | 2.859375 | 3 | [] | no_license | /* eslint "require-jsdoc": 0 */
export function factorialize(n) {
if (n===0) {
return 1;
} else {
return n*factorialize(n-1);
}
}
| true |
df94a984d81e656357d8ea03762b080303487b7a | JavaScript | wickettc/toDoList | /src/eventListeners.js | UTF-8 | 6,438 | 2.5625 | 3 | [] | no_license | import createToDo from './toDo';
import { renderToDos, renderProjectList, toDoHide } from './renderDOM';
import { createProject, deleteProject, projects } from './projects';
const heading = document.querySelector('#heading');
const toDoAddBtn = document.querySelector('.to-do-add-btn');
const toDoEditBtn = document.que... | true |
0231721e4ea667f62208322a2f4350701246390b | JavaScript | Miangame/miangame.github.io | /practicas/DWEC/ExamenDiciembre2016/js/empleado.js | UTF-8 | 847 | 3.09375 | 3 | [] | no_license | {
Empleado = function (nombre, fecha, dni) {
this.nombre = nombre;
this.fecha = fecha;
this.dni = dni;
}
Empleado.prototype.crearVentana = function () {
let fechaActual = new Date();
let anioActual = fechaActual.getFullYear();
let fechaFinAnio = new Date("12/... | true |
98abd37efe6af98ce8dcb44f69dd9321f80f8de1 | JavaScript | splendourhui/koa-react-redux-f7 | /common/tools.js | UTF-8 | 296 | 2.59375 | 3 | [] | no_license | 'use strict';
const crypto = require('crypto');
exports.md5Encrypt = (string) => {
if (string === null) return null;
if (typeof (string) != 'string') return null;
var md5sum = crypto.createHash('md5');
md5sum.update(string, 'utf8');
string = md5sum.digest('hex');
return string;
};
| true |
c0b8dce4f39d24f590eabd193adbc8bc716572f8 | JavaScript | NicoRLasso/PokeApp | /pokeapp/frontend/src/components/PokeCompo.js | UTF-8 | 1,745 | 2.546875 | 3 | [] | no_license | import React from "react";
import { Card, Row, Col, ListGroup } from "react-bootstrap";
function PokeCompo({ poke }) {
return (
<Card className="my-3 p-3 rounded">
<Card.Img src={poke.imagensprite} fluid />
<Card.Body>
<Card.Title as="div">
<strong>{poke.nombre}</strong>
</C... | true |
93046d2e5cc385489054772ae111a08c4bfb2d20 | JavaScript | Mrzzchao/Study | /算法/头条/最长连续序列/longestConsecutive.js | UTF-8 | 564 | 3.71875 | 4 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
const longestConsecutive = function (nums) {
if (nums.length < 2) return nums.length;
nums = Array.from(new Set(nums));
nums = nums.sort((a, b) => {
return a - b;
});
let count = 1;
let max = 1;
for (let i = 0; i < nums.length; i++) {
if (num... | true |
a081890edd17d51053e3c0bf32010fdef20e39da | JavaScript | NanceCA/mySQL-node-app | /bamazonCustomer.js | UTF-8 | 5,025 | 3.03125 | 3 | [] | no_license | //requiring mysql and inquirer for the CLI
var mysql = require("mysql");
var inquirer = require("inquirer");
var entry = require("./entry.js");
//----------STARTING CONNECTION TO MYSQL --------//
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: entry,... | true |
1fc7073f21b0ad6bbd028068304856a726c4108e | JavaScript | nolo7e/Case-Converter | /src/index.js | UTF-8 | 1,584 | 3.21875 | 3 | [] | no_license | let upper_case = document.getElementById("upper-case");
let lower_case = document.getElementById("lower-case");
let proper_case = document.getElementById("proper-case");
let sentence_case = document.getElementById("sentence-case");
let save_text_file = document.getElementById("save-text-file");
let text = document... | true |
0190db0343caf427ad5c1ecd75f78cb199b2fbc5 | JavaScript | StreemFile/car_dealership_front | /src/components/employee/EmployeeTableComponent.jsx | UTF-8 | 2,954 | 2.53125 | 3 | [] | no_license | import React from 'react';
import {Button} from "react-bootstrap";
const EmployeeTableComponent = (props) => {
const handleShowRead = (id) => {
props.getEmployeeToAction(id);
props.handleShowRead();
}
const handleShowEdit = (id) => {
props.getEmployeeToAction(id);
props.ha... | true |
45aa440f64322eadddf7596f26fdd230d3805b53 | JavaScript | victormelnyk/connection | /src/observer.spec.js | UTF-8 | 3,046 | 2.578125 | 3 | [] | no_license | import Observer from '../src/observer';
describe('Observer -', () => {
let observer;
beforeEach(() => {
observer = new Observer();
});
describe('subscribe -', () => {
it('subscribe to one channel', () => {
const func = () => {};
observer.subscribe('Subscriber', 'CHANEL', func);
ex... | true |
47c44996655fc83310ce7b7f4247ddd5c8558851 | JavaScript | samuelkahn/DS209 | /Javascript Practice/helloworld.js | UTF-8 | 269 | 3.015625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<body>
<h1>Dingle Dong</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Dingle Dong";
}
</script>
</body>
</html> | true |
b3f2263a7aa8ad994fee272cdd4cab7290bed0d2 | JavaScript | SanyaOdare/Dribble-Ball-Game | /main.js | UTF-8 | 367 | 3.5 | 4 | [] | no_license | let ball = document.getElementById('float-circle');
// function named up() that will raise the bottom
function up() {
ball.style.bottom = '250px';
};
//function named down() that will lower the bottom position of the ball
function down() {
ball.style.bottom = '50px';
}
document.body.addEventListener("keydown", up);... | true |
ab76f6ec73efba6b46e6c9d32dc8635371c0ce01 | JavaScript | Breather08/gooey-animation | /index.js | UTF-8 | 1,026 | 3.3125 | 3 | [] | no_license | const circlesLogic = () => {
const circles = [...document.querySelectorAll(".circle")].filter(
(circle) => !circle.classList.contains("main")
);
const circlesAmount = circles.length;
const tension = 12;
const mainCircle = document.querySelector(".main");
const carouselRadius = 120;
const angle = 360 /... | true |
3fb2bfc8cc88f1a796aabc8e97791d3d3f1d324d | JavaScript | EndlessParadox/TetrisOL | /assets/script/tetris_base.js | UTF-8 | 16,268 | 2.640625 | 3 | [] | no_license |
(function(window){
// 动作枚举
var ActionType = {
ACTION_LEFT:1,
ACTION_RIGHT:2,
ACTION_CHANGE:3,
ACTION_DOWN:4
};
function Shape(x, y, idx, color, shapes,shapeArrIdx,atlas) {
this.x = x;
this.y = y;
this.idx = idx;
this.color = color;
... | true |
a4bcfba63f737c40cc3c053f981b832c33b2885d | JavaScript | priteshkeleven/ielts-writing-practice | /src/Components/MainBody/MainBody.js | UTF-8 | 1,448 | 2.859375 | 3 | [] | no_license | import React, {Fragment, useState, useEffect} from 'react';
import "./MainBody.css";
import useLocalState from "../../CustomHooks/useLocalState";
const MainBody = () => {
const [text, setText] = useLocalState("", "text");
const [count, setCount] = useState(0);
const [radio, setRadio] = useLocalState("task1... | true |
769a7b0538b4c0fc16ce6f0cf87add8cef909506 | JavaScript | vishnu-meera/Algorithms-And-DTs | /DT/linkedlist.js | UTF-8 | 2,637 | 3.59375 | 4 | [] | no_license | class Node {
constructor(value) {
this.value = value;
this.next = null;
}
}
class LinkedList {
constructor() {
this.head = null;
this.length = 0;
}
static merge(s1, s2) {
const s3 = new LinkedList();
let nod1 = s1.head;
let nod2 = s2.head;
while (nod1 && nod2) {
if (no... | true |
54435f887575dcf859aa8631639c9da6ec22561f | JavaScript | iammael/CountryClick-1.0 | /js/few_fonctions.js | UTF-8 | 1,714 | 2.59375 | 3 | [
"MIT"
] | permissive | var bool = false;
document.getElementById("exButton").onclick = function(){
if (bool == false)
{
bool = true;
$('#header').animate({
marginTop: "-160px",
}, 800 ).fadeOut(400);
}
else
{
bool = false;
$('#header').fadeIn(400).animate({
marginTop: "0",
}, 800 );
}
}
function closePop_up(name)
{... | true |
1eff9d5a7e493d716ff9e5fb4f56eba75bde9da6 | JavaScript | furuya666/Curso-React | /src/components/Componente.js | UTF-8 | 386 | 2.671875 | 3 | [] | no_license | import React,{Component} from 'react';
// 1 Forma de hacer
// class Componente extends Component{
// render(){
// return <h2>{this.props.a}</h2>
// }
// }
//Segunda forma de hacer un componente
// function Componente(props){
// return <h2>{props.a}</h2>
// }
///3 forma de hacer un componente
const C... | true |
156cbd66f78d90eab76819efec06551d67aadac1 | JavaScript | MMcClure11/practice-constructor.io | /src/components/ObjFromString.js | UTF-8 | 2,028 | 3.578125 | 4 | [] | no_license | import React, { useState } from 'react'
const ObjFromString = () => {
const [string, setString] = useState('')
const [letter, setLetter] = useState('')
const [count, setCount] = useState(0)
const [maxCount, setMaxCount] = useState('')
const countLetters = (str, char) => {
let charMap = {}
for(let l... | true |
25cf7e0e2554bcd86479a05d0c70531b371ac36e | JavaScript | Tushar443/MEAN_Stack | /Bootstrap/Signup.js | UTF-8 | 2,493 | 3.125 | 3 | [] | no_license | function Validation(){
/**
* All Input Elements
*/
let fname=document.querySelector('#fname').value;
let lname=document.querySelector('#lname').value;
let mobile=document.querySelector('#mobile').value;
let email=document.querySelector('#email').value;
let password=document.querySelect... | true |
d6936c96a8e0412d393ce612b377c246b04852cf | JavaScript | proxyfetus/proxyfetus.github.io | /sketch.js | UTF-8 | 571 | 3.078125 | 3 | [] | no_license | // var bubbles = [];
var imgs = [];
var txt = [];
var i;
// var text = document.getElementById("show");
function setup() {
imgs = selectAll('img');
for (i = 0; i < imgs.length; i++) {
imgs[i].mouseOver(lowOpacity);
imgs[i].mouseOut(highOpacity);
}
// function show(){
// var myAlt = this.alt;
// t... | true |
95fdeaf96aff187864b1943a04b6e26d1d1bce2b | JavaScript | d4n1elchen/NCKU-select-course-helper | /app/assets/javascripts/courses/front.js | UTF-8 | 7,877 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
var i;
if (typeof obligatory_courses === 'undefined') {
obligatory_courses = [];
}
for (i = 0 ; i < obligatory_courses.length ; ++i) {
// $('tr[value="5"]');
var course_name = obligatory_courses[i]["course_name"];
var schedule = obligatory_courses[i]["schedule"];... | true |
332c5bddaa62533c79ebb9dcdbc1553473e57e48 | JavaScript | chromium/chromium | /third_party/blink/web_tests/external/wpt/FileAPI/reading-data-section/filereader_error.any.js | UTF-8 | 614 | 2.546875 | 3 | [
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | // META: title=FileAPI Test: filereader_error
async_test(function() {
var blob = new Blob(["TEST THE ERROR ATTRIBUTE AND ERROR EVENT"]);
var reader = new FileReader();
assert_equals(reader.error, null, "The error is null when no error occurred");
reader.onload = this.step_func(function(evt... | true |
b5c292578a75a75a4285b63d94b5c6dfdfa844d5 | JavaScript | tblaze77/blockchain_nodejs | /dev/networkNode.js | UTF-8 | 1,521 | 2.546875 | 3 | [] | no_license | var express = require("express");
var app = express();
const port = process.argv[2];
const bodyParser = require ('body-parser');
const Blockchain = require("./blockchain");
const uuid = require ('uuid');
const dukatoni = new Blockchain();
app.use(express.json());
app.use(express.urlencoded({
extended: true
}));
... | true |
8e7848532285066c71fec81213b0d9af678babab | JavaScript | NujiaLin/relativity | /timer.js | UTF-8 | 844 | 3.484375 | 3 | [] | no_license | const MILISECONDS_IN_HOUR = 60 * 60 * 1000
async function* relativisticTimer() {
let tick = 0
// my productivity is highest at 18:00, and lowest at 6:00
async function ticker() {
return new Promise((resolve, reject) => {
const hourNow = new Date().getHours()
const hourShifted = hourNow - 18
... | true |
7af8862caa41c4cd07e9eec0e9d34ce5e8aea2db | JavaScript | Warez1864/JavaScript-Notes | /index.js | UTF-8 | 8,189 | 4.75 | 5 | [] | no_license |
// Set the variable var1 to a string type
let var1 = "";
// Change the type of the variable var1 from a string to an integer
var1 = 25;
// Set the variable var2 to an integer type
let var2 = 1;
// Set the variable var3 to a float type
let var3 = 2.5;
// Make an empty object called person
let person = {
}
// Make... | true |
bf60acc74990a19eb00b9a3fa5ac29dee16f6f5a | JavaScript | itsStrobe/Final-Exam-1 | /Server coding challenge/middleware/errorHandler.js | UTF-8 | 410 | 2.59375 | 3 | [] | no_license | function errorHandler(error, req, res) {
/*
Your code goes here
*/
// Error in the request
if(error.body){
let movie_ID = error.params;
let {id, firstName, lastName} = error.body;
if(!id){
res.statusMessage = "Id is missing in the body of the request.";
... | true |
142011215f7659977a7fb8b6f9bdd8117857031b | JavaScript | morko/haxroomie | /packages/haxroomie-cli/src/errors.js | UTF-8 | 741 | 2.546875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /**
* Error thrown by CLI class CommandHandler when it can not find the command.
*/
class InvalidCommandError extends Error {
constructor(message) {
message = message || 'Invalid command!';
super(message);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
}
}
/**... | true |
963e5cf0f1337e81e5ff8a6231b17d254ad01e76 | JavaScript | shrutiaggarwal3012/n-middleware | /services/http-service.js | UTF-8 | 1,152 | 2.5625 | 3 | [] | no_license | 'use strict';
var http = require('http');
class HttpService {
doGetRequest(requestParams, response) {
let req = http.get(requestParams, function(res) {
response.set('Content-Type', 'application/json');
res.pipe(response);
});
req.on('error', function(e) {
response.sendStatus(500);
... | true |
8b50350f4971a3f0969539dafd93ee89fbc36786 | JavaScript | maiellarep/gallery | /src/AddCollectionPg.js | UTF-8 | 3,934 | 2.53125 | 3 | [] | no_license | import React from 'react';
import './css/common.css';
import './css/Buttons.css';
import IndexedDbRepository from './IndexedRepository';
import logo from './img/defaultOrganisationLogo.jpg';
class AddCollectionPg extends React.Component {
constructor(props) {
super(props);
this.state = {
... | true |
0abdcc58f3f12ba0713a87a4f85706a72809cc92 | JavaScript | EeliLam/2048-AI | /grid.js | UTF-8 | 4,700 | 3.4375 | 3 | [] | no_license | class Grid {
constructor(rows, cols, tileWidth, scoreHeight) {
this.rows = rows
this.cols = cols
this.tileWidth = tileWidth
this.score = 0
this.values = new Array(rows).fill(0).map(() => new Array(cols).fill(0))
this.moves = [this.moveUp, this.moveRight, this.moveDown, this.moveLeft]
th... | true |
de279f9a6e1842275856e7a616efa65a5bf4dfdc | JavaScript | RavvaBhaskar/Viswa_JS-Interview | /generic-questions/find-difference-of-object.js | UTF-8 | 665 | 3.03125 | 3 | [] | no_license |
const obj1 = {
name: "Tokyo",
age: 25,
professions: ["Con artist", "Waitress"],
contactDetails: {
phone: "12345",
email: "c@d.com"
}
};
const obj2 = {
name: "Denver",
age: 26,
professions: ["Con artist", "Waitress"],
contactDetails: {
phone: "12345",
email: "c@d.com"
}
};
function... | true |
81bdc541ee0ebd2d50b86e6b5d77da1e6748bdad | JavaScript | ethan1406/refriend | /config/passport.js | UTF-8 | 6,870 | 2.59375 | 3 | [] | no_license | // config/passport.js
// load all the things we need
var FacebookStrategy = require('passport-facebook').Strategy;
// load up the user model
var User = require('../models/user');
// load the auth variables
var configAuth = require('./auth');
module.exports = function(passport) {
// used to serialize the ... | true |
90ceac7e2f0a60f52b73a2ded045715f4a017eb1 | JavaScript | zlb632649818/CarParkSystem | /WebContent/js/zlbjs/zlbcpjs/index.js | UTF-8 | 937 | 2.734375 | 3 | [] | no_license | window.onload = function() {
$("#car_name").on("focus", function() {
var car_name = $("#car_name").val();
if (car_name == "输入车牌") {
$("#car_name").val("");
}
});
$(".next_step").on("click", function() {
var car_name = $("#car_name").val().toUpperCase();
if (car_name == "输入车牌" || car_name == "")... | true |
edb84804e05956836c80630b6832dbbd030cfd70 | JavaScript | ddyer/NodeRover | /Rover.js | UTF-8 | 3,247 | 2.59375 | 3 | [] | no_license | var Motor = require('./Motor.js').Motor;
var MotorDirection = require('./Motor.js').MotorDirection;
var heading = require('./heading');
var manuevers = require('./manuevers')();
var Calibrate = require('./Calibrate.js');
function Rover(){
this.leftMotor = new Motor(5,6);
this.rightMotor = new Motor(22,27);
this.c... | true |
a19da0c9888790f2591afc9a75d88b62c730558a | JavaScript | jbram-js/javascript-basics-express | /src/app.js | UTF-8 | 3,671 | 3.28125 | 3 | [] | no_license | const express = require('express');
const stringFunctions = require('./lib/strings');
const numberFunctions = require('./lib/numbers');
const booleanFunctions = require('./lib/booleans');
const arrayFunctions = require('./lib/arrays');
const app = express();
app.use(express.json());
// strings
// hello world
app.get... | true |
5191e9b178fc6a08a24de27a8c70f974bf6fdb01 | JavaScript | shutrisk/duagram | /examples/terminal.js | UTF-8 | 1,446 | 2.578125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | const { duaGram } = require("duagram");
class duaG extends duaGram {
constructor(options) {
super(options);
this.myInit();
this.prefixTerminal = '[anu]';
}
myInit() {
this.oldTerminal = this.terminal;
let terminal = this.terminal;
let newTerminal = ... | true |
791873b75b874e313b4dab7c93f6fe49bcc87f98 | JavaScript | viniciuslucena/javascript-origamid | /Objetos/8 - Objects/script.js | UTF-8 | 798 | 3.078125 | 3 | [] | no_license | // moto = {}
// carro = {}
// Object.defineProperties(moto, {
// rodas: {
// value: 2,
// configurable: false,
// enumerable: true,
// writable: false
// },
// })
// Object.defineProperties(carro, {
// portas: {
// get() {
// return this._portas
// ... | true |