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
257a5df4ed7dbbe44d477c26cf20a72d982077b5
JavaScript
coliath/Brickles
/Game.js
UTF-8
8,197
3.015625
3
[]
no_license
function Game (Ball, Paddle, Board, canvasElement, scoreElement, livesElement, levelElement, bannerElement, startingLives) { this.ball = Ball; this.paddle = Paddle; this.board = Board; this.canvas = canvasElement; this.context = this.canvas.getContext("2d"); this.livesRemaining = startingL...
true
c5f86d3209fd6812e71b6768e609462f2b324999
JavaScript
fjtorres/JQuery---Custom-plugins
/jquery.overrideSpecialCharacters.js
UTF-8
1,708
3.046875
3
[]
no_license
/** * Plugin de JQuery para sustiuir ciertos caracteres por otros especificados, * los caracteres se especifican mediante cadenas de igual longitud. * * @param specialCharacters * Cadena con los caracteres que se quieren sustituir. * @param overrideCharacters * Cadena con los caracteres con...
true
f89d2763ef7e7bbe78b5326d54501b4f6d254f2c
JavaScript
CJStryker/lambda-calculator
/src/components/ButtonComponents/SpecialButtons/Specials.js
UTF-8
540
2.71875
3
[]
no_license
import React, { useState } from "react"; //import any components needed import { SpecialButton } from "./SpecialButton"; //Import your array data to from the provided data file import { specials } from "../../../data"; const Specials = props => { // STEP 2 - add the imported data to state const [specialState, setS...
true
fa776833874045e2a3d45d316e0ff4d8bf91219e
JavaScript
jonreading81/Algorithms
/test/brackets.spec.js
UTF-8
776
3.265625
3
[]
no_license
import solution from '../src/brackets'; describe('Brackets', function () { it('should return 1 for correctly nested string', function () { expect(solution('{[()()]}')).to.equal(1); }); it('should return 0 for incorrectly nested string', function () { expect(solution('([)()]')).to.equal(0); ...
true
b28e3db0cb967fcb1dbbde274638c701b07aedca
JavaScript
hsinlinghu1101/Pomodoro-app
/src/components/Break.js
UTF-8
827
2.515625
3
[]
no_license
import React, { Component } from 'react' import '../App.css'; export class Break extends Component { increaseBreak=()=>{ if(this.props.break === 60){ return; } this.props.increase(); } decreaseBreak=()=>{ if(this.props.break === 1){ return; ...
true
68b3065b9bea32cc84a359693136a1a2a26e0d79
JavaScript
Team-Battenberg/sdc-reviews-api
/database-mysql/index.js
UTF-8
2,557
2.625
3
[]
no_license
const mysql = require('mysql'); const mysqlConfig = require('./config.js'); const connection = mysql.createConnection(mysqlConfig); //change to Get Review const getReviews = function(params, callback) { console.log('in reviews') console.log(params.product_id); //how do i improve error handling here? if(par...
true
fe20d4c9626ba4bce03e451f451c43dd9f1b365f
JavaScript
hijiangtao/LeetCode-with-JavaScript
/src/maximum-subarray/res.js
UTF-8
484
3.140625
3
[ "Apache-2.0" ]
permissive
/** * @param {number[]} nums * @return {number} */ var maxSubArray = function(nums) { if (nums.length < 1) return 0; let ans = nums[0]; let sum = 0; for (let i = 0; i < nums.length; i++) { if (sum > 0) { sum += nums[i]; } else { sum = nums[i]; } ans = Math.max(sum, ans); } ...
true
ef7730f5a5a5591489d8dabead3d455b8d4e94da
JavaScript
tristansmn/website
/src/components/InputName.js
UTF-8
2,120
2.84375
3
[]
no_license
import React from 'react'; import { CSSTransition } from "react-transition-group"; import './inputName.css'; class InputName extends React.Component { state = {name: '', showForm: true, error: ''}; onFormSubmit = event => { event.preventDefault(); if(this.validateName()){ console.log(this.s...
true
2b9ee43972dccc983c9f31244b483c8364917d6c
JavaScript
asmockler/textkit
/packages/core/src/layout/LayoutEngine.js
UTF-8
4,783
2.640625
3
[]
no_license
import ParagraphStyle from '../models/ParagraphStyle'; import Rect from '../geom/Rect'; import Block from '../models/Block'; import GlyphGenerator from './GlyphGenerator'; import Typesetter from './Typesetter'; import injectEngines from './injectEngines'; // 1. split into paragraphs // 2. get bidi runs and paragraph d...
true
f4fdd330b7e832ec226c59f3d2fcbe96d2ee7ea1
JavaScript
Damnaty85/masonry-custom-js
/index.js
UTF-8
20,580
2.71875
3
[]
no_license
document.addEventListener('DOMContentLoaded', () => { renderGrid('.grid'); eventImageHandler("[data-view-image]"); }); window.addEventListener("orientationchange", debounce(() => { renderGrid('.grid'); })); window.addEventListener("resize", debounce(() => { renderGrid('.grid'); })); cons...
true
36566b31086b6057af5a4d291c45089ca7eae81a
JavaScript
vuthe2602/project
/js/number.js
UTF-8
267
3
3
[]
no_license
$('.minus').click(function(){ if($('.number').val() <= 1){ $('.number').val(1); }else{ $('.number').val(parseInt($('.number').val()) - 1); } }) $('.plus').click(function(){ $('.number').val(parseInt($('.number').val()) + 1); })
true
703ef605f08844e48d6d528e3c27c4c2fe77321c
JavaScript
gitvijayy/tweeter
/public/scripts/composer-char-counter.js
UTF-8
397
3.046875
3
[]
no_license
$(document).ready(function () { $(`.new-tweet textarea.char`).keyup(function () { const totalChars = $(this).val().length; const balanceChars = 140 - totalChars; $(this).siblings(`.counter`).text(balanceChars) if (balanceChars < 0) { $(this).siblings(`.counter`).css(`color`, `red`) } else ...
true
12f7d2e688a6914ea0ec60c3e9f63372218139f1
JavaScript
ChasKane/poopgroophome
/js/common.js
UTF-8
6,472
3.046875
3
[]
no_license
// common functions that many pages will use, will be imported by all for the url below var url = "http://104.248.113.22/gavin/"; function swapDisplay(div_name) { var x = document.getElementById(div_name); var display = x.getAttribute("vis"); if (display == "" || display == "none") { x.setAttribute("vis", "...
true
b044fc90ca78a8034ab826f3789f0b273817a14e
JavaScript
pranavchandra27/social-media-react
/src/provider/reducer.js
UTF-8
698
2.59375
3
[]
no_license
import jwt_decode from "jwt-decode"; import { SET_USER, SET_DARK_MODE } from "./actionTypes"; const token = localStorage.getItem("graphQl_jwt_token"); export const intialState = { user: null, isDarkMode: false, }; if (token) { const decodedToken = jwt_decode(token); decodedToken.exp * 1000 < Date.now() ?...
true
278fbe065fb1c2b64b629e158795367f084b2bc6
JavaScript
sexyHuang/HybirdApp
/src/HybirdApp.js
UTF-8
4,642
2.6875
3
[]
no_license
/* * @Author: Sexy * @LastEditors: Sexy * @Description: file content * @Date: 2019-04-03 11:00:58 * @LastEditTime: 2019-04-03 14:22:38 * @Description: HybirdApp类 */ //回调函数栈 const CALLBACK_STORE = {}; //回调主方法名 const CALLBACK_HANDLER_NAME = '_runCallBack'; const INJECT_OBJECT_NAME = '_injectObject'; //错误码 cons...
true
343fcf25d7273b2ca3b5dbc2989109d438a55ee1
JavaScript
joeyyeoj/ipmedt3-groep9
/js/components.js
UTF-8
9,190
2.703125
3
[]
no_license
AFRAME.registerComponent("teleportplace", { init: function() { this.teleportPlayer = function() { console.log("Teleporting Player"); const camera = document.getElementById("js--camera"); // Get position of Object relative to the world (Instead of relative to parents) => new Position var w...
true
40b503f61f9a0a93313677bb018c3eb3f50d4244
JavaScript
Zitle-Nancy/ejercicioPandas
/assets/js/app.js
UTF-8
1,297
3.171875
3
[]
no_license
var cerrar = document.getElementsByClassName('cerrar'); var imagenesPandas = document.getElementsByClassName('imagenesPandas'); var aparecer = document.getElementById('aparecer'); aparecer.addEventListener('click',mostrar); var extincion = document.getElementById('extincion'); extincion.addEventListener('click',borrarE...
true
4362bedc8f5744a300e664d4025bde33dca9f08e
JavaScript
mdazadhossain95/Web_Development
/javascript - start/index.js
UTF-8
302
3.9375
4
[]
no_license
var name = prompt("what is your name:"); var firstChar = name.slice(0, 1); var UpperCaseOfName = firstChar.toUpperCase(); var restOfName = name.slice(1, name.length); restOfName = restOfName.toLowerCase(); var capitalisedName = UpperCaseOfName + restOfName; alert("Hello " + capitalisedName);
true
1c16ce08a94a9e1927d8a2c24ae43cb47299a650
JavaScript
caseswitch/code
/myblog/routers/api.js
UTF-8
4,155
2.59375
3
[]
no_license
/** * Created by zl on 2017/2/19. * 负责处理/api 路由 */ var express = require('express'); var router = express.Router(); //引入数据模型 var User = require('../models/User'); var Content= require('../models/Content') //响应数据 var resData; router.use(function(req, res, next){ //每次初始化resData resData = { code: 0, ...
true
7f637759a439ec2a1fdb727506c8284e56aedc43
JavaScript
aordono/ChakraKitty
/www/maneko.js
UTF-8
4,219
2.71875
3
[]
no_license
// view zog("hi from maneko.js"); var app = function(app) { app.makeHorizontalPages = function(queue, layoutManager) { zog("pages"); p = {}; p.main = new createjs.Container(); p.main.name = "main"; p.main.setBounds(0,0,stageW,stageH); var fade = p.fade = new createjs.Sh...
true
c0bb29cbc38ddd2173dee82d658d38658cd19121
JavaScript
Tomasgb97/css-test1
/menu.js
UTF-8
1,313
2.796875
3
[]
no_license
if(window.screen.availWidth <= 480){ const whenOpen = () => { const menudisplay = document.createElement('div'); menudisplay.classList.add('menudisplay'); menudisplay.setAttribute('id', 'menu') navbar.appendChild(menudisplay) const divDelista = document.createElement('div'); divDelista.classList.add('...
true
fabdacd5b9da6d1a12c59cbb0fbad20d1d0598c3
JavaScript
kallolo/mvc-rest-api
/controllers/UsersController.js
UTF-8
2,535
2.53125
3
[]
no_license
'use strict'; var Users = require('../models').Users, respon = require('../respon'); //ambil data profil dari yang login exports.profil = function(req, res){ // res.json(req.user); var result = req.user; // mengabil request login var message = "Berhasil Mendapatkan Profil "+req.u...
true
380003d9bef63009dd349ea21627dead4a1c2ff3
JavaScript
torresga/launch-school-code
/exercises/js210_small_problems/easy_4/multiplyLists.js
UTF-8
1,179
5.21875
5
[]
no_license
// Multiply Lists // Write a function that takes two array arguments, each containing a list of numbers, and returns a new array that contains the product of each pair of numbers from the arguments that have the same index. You may assume that the arguments contain the same number of elements. // Input: Two array argu...
true
845654179ac1ab8cd64175fdc69d9fb74375f4f9
JavaScript
Charlay-Chen/overwatch
/public/js/index.js
UTF-8
4,885
2.765625
3
[]
no_license
'use strict'; (function(){ //向服务端接口localhost:3000/index发送ajax请求,获得返回的数组对象 ajax({ url:"http://localhost:8080/index", type:"get", dataType:"json"//让ajax自动将json字符串转为对象,可直接使用 })//当ajax请求完成后 .then(function(result){//result就是服务端返回的结果 // console.log(result); var ht...
true
f3923a23cf7de36e0b5c38efe64a76f36850d44c
JavaScript
Hank-wood/bdash
/app/lib/Util/stripHeredoc.js
UTF-8
228
2.515625
3
[ "MIT" ]
permissive
export default function stripHeredoc(str) { str = str.trim(); let margins = (str.match(/^ +/mg) || []).map(s => s.length); let margin = Math.min(...margins); return str.replace(new RegExp(`^ {${margin}}`, 'gm'), ''); }
true
eece900bee6d526bc7686a2ccdbaa4dce477b577
JavaScript
Prashant-Jonny/ObjectCloud
/Server/DefaultFiles/Shell/UserManagers/UserManager.js
UTF-8
1,526
2.53125
3
[]
no_license
// Scripts: /API/jquery.js function setupUserManager(userwrapper) { $(document).ready(function() { var passwordsDontMatch = $('.passwordsdontmatch'); passwordsDontMatch.hide(); var updatePasswordForm = $('form.changepassword'); var newPassword = $('input.newpassword', updatePasswordForm)...
true
41cb5c22312e607381e31191d9c5b1794794d486
JavaScript
oriblau21/ironsource_assignment_server
/src/api/app/app.service.js
UTF-8
1,192
2.65625
3
[]
no_license
const fsextra = require('fs-extra') const path = require('path') module.exports.queryApps = queryApps async function queryApps (freeText, birthYear, preferredCategories, minAppRating) { let filteredApps = await fsextra.readJSON(path.join(__dirname, '../../../data/apps.json')) filteredApps = filteredApps.filter(ap...
true
9db0a095e1189529e72f1d699a855d61ff49de5d
JavaScript
SocketCluster/consumable-stream
/test/test.js
UTF-8
3,268
2.796875
3
[ "MIT" ]
permissive
const ConsumableStream = require('../index'); const assert = require('assert'); let pendingTimeoutSet = new Set(); function wait(duration) { return new Promise((resolve) => { let timeout = setTimeout(() => { pendingTimeoutSet.clear(timeout); resolve(); }, duration); pendingTimeoutSet.add(tim...
true
a1f637cb546e3328dc15c2b9b6e4488058461791
JavaScript
DanLeng/GridFrontierClient
/script/client/level.js
UTF-8
3,488
2.78125
3
[]
no_license
/** * Builds The Game Level */ var level = function(){ // var space; // var middleDensity = 40; // Density of red boxes in the middle of the map var themeColor = "blue"; // Color of the map var obstacleAlpha = 0.35; var decorAlpha = 0.05; var build = function(levelLayer, space){ // Black background ...
true
e38f8a390ef40b8be3fd930be5b72e38c8a4d492
JavaScript
deyanpeychev00/JS-Core-SoftUni-May-2017
/JavaScript-Advanced/Exams/JS-Advanced-Sample-Exam-31-Oct-2016/03-Storm-Watcher.js
UTF-8
1,165
3.5625
4
[]
no_license
/** * Created by Deyan Peychev on 18-Jul-17. */ let returnClass = (function () { let id = 0; class Record{ constructor( temperature, humidity, pressure, windSpeed){ this.id = id++; this.temperature = temperature; this.humidity = humidity; this.pressure =...
true
e823a8a6f31f055227cf5150e0fb04999e234492
JavaScript
mana7/jest_study
/introduction/src/initializeCity.js
UTF-8
759
3.28125
3
[]
no_license
function initializeCityDatabase() { console.log("initializeCityDatabase") const city = [ "Vienna", "Tokyo", "San Juan", "Los", ]; return city; }; function isCity(cityname, city) { console.log('BBB:',city); let result = city.filter(function(item, index) { if (item.indexOf(cityname) >= ...
true
325f4631b645cc288d9e375a908c6ffab0fdf019
JavaScript
diptigandhi24/Search-Engine-SPA
/src/SearchUtilityFunction/Index/createSummariesIndex.js
UTF-8
980
2.796875
3
[]
no_license
import stopWordsList from "./stopWordsList"; function createNewkey(keyword, summaryId, indexHashMap) { if (!stopWordsList.has(keyword)) { indexHashMap.set(keyword, { id: [summaryId] }); } } function doesIdExist(keyword, summaryId, indexHashMap) { let idsArr = indexHashMap.get(keyword)["id"]; let result =...
true
250cd1f1aa52b1fe808b79bd91d0af6ea91fd1a5
JavaScript
Hakawa2/curso-react
/src/containers/calc/index.js
UTF-8
1,660
2.78125
3
[]
no_license
import React, { useState } from "react"; import CalculadoraComponent from "../../components/calculadora"; import { concatenarNumero, calcular } from "../../utils/calculadoraService"; const Calculadora = () => { const [txtNumeros, setTxtNumeros] = useState("0"); const [numero1, setNumero1] = useState("0"); const...
true
d85476f7299ff137e314f1ef293a4ac719f1c0a9
JavaScript
atelierBek/Html2Print-Base
/js/docs.js
UTF-8
1,523
2.640625
3
[]
no_license
window.HTML2print = window.HTML2print || {}; (function(undefined) { 'use strict'; HTML2print.Docs = function() {}; HTML2print.Docs.prototype.initialize = function(src) { this.src = src || {}; var viewport = document.getElementById("viewport"); var toolbar = document.getElementBy...
true
22a0e6f7d776c81de5d9d4d8b56e37f3bfa8efe2
JavaScript
N8sGit/sorting-
/mergesort.js
UTF-8
621
3.4375
3
[]
no_license
function split(wholeArray){ var half = Math.floor(wholeArray.length/2) var firstHalf = wholeArray.slice(0, half) var secondHalf = wholeArray.slice(half) return [firstHalf,secondHalf] } function merge(one, two){ var result = []; for(var i = 0; i < two.length; i++){ if(one[i]){ if(one[i]<two[i]){ ...
true
17aff6484ea6852b017b0aa72646683d7704983e
JavaScript
donburks/tonal
/packages/note-range/index.js
UTF-8
1,176
2.84375
3
[ "MIT" ]
permissive
'use strict' var transpose = require('note-transposer') var semitones = require('semitones') var pitchSet = require('pitch-set') var parse = require('music-notation/pitch/parse') var distanceTo = require('note-interval') var SCALE = '1 2b 2 3b 3 4 4# 5 6b 6 7b 7'.split(' ') module.exports = function (scale, tonic, l...
true
27d0a62d2a022f7e6694e2ece2d586a41ba403df
JavaScript
Zhando7/shedule
/dev/scripts/admin/month/MonthModule.js
UTF-8
6,091
2.625
3
[]
no_license
function MonthModule() { var ServerController = { errors: [], initXHR: function(type, url) { if(type, url) { var xhr = new XMLHttpRequest(); xhr.open(type, url, true); xhr.setRequestHeader("Content-Type", "application/json"); ...
true
853a09cb80382e281cd8ac1827b173c82853328e
JavaScript
varnita619/Cash-Register-Manager
/app.js
UTF-8
2,542
3.46875
3
[]
no_license
const billAmount = document.querySelector('#billAmount'); const nextBtn = document.querySelector('#nextBtn'); const section3 = document.querySelector('.section3'); const cashAmount = document.querySelector('#cashAmount'); const checkBtn = document.querySelector('#checkBtn'); const section4 = document.querySelector('.se...
true
4cebec57310c7a0cacba88a3320ff3c12bffa325
JavaScript
borysyuk/tartan-viewer
/src/services/search/category.js
UTF-8
1,872
2.515625
3
[ "MIT" ]
permissive
'use strict'; var _ = require('lodash'); var async = require('../utils/async'); function worker() { self.onmessage = function(event) { var refsList = []; var refCategories = {}; var refMap = {}; var records = event.data; for (var i = 0; i < records.length; i++) { var record = records[i]; ...
true
4d656e1101e792a3a84d92aaac690f10389815d5
JavaScript
hitcherland/fp_planner
/js/planner.js
UTF-8
3,566
2.828125
3
[ "MIT" ]
permissive
// vi: ft=javascript function encode( s ) { var out = []; for ( var i = 0; i < s.length; i++ ) { out[i] = s.charCodeAt(i); } return new Uint8Array( out ); } var selected = undefined; function add( data ) { var option = $( '<div class="option"></div>' ); var header = $( '<div class="h...
true
b611c26ab0c6c9f1f9671b121a1eb7ab965fcb09
JavaScript
SocialMediaExchange/muhal
/lib/utils.js
UTF-8
420
2.53125
3
[ "MIT" ]
permissive
import { compose, not, isEmpty, values, test, any } from 'ramda' export const notEmpty = compose(not, isEmpty) export function filterCases(searchText) { return caseData => { const testSearch = test(new RegExp(searchText, 'ig')) return any(testSearch, values(caseData)) } } export function substr(str, len)...
true
a30f426c56bd8688c1b8e966b3622987c43457d1
JavaScript
Nibin-k-Mathew/javacripting
/function-arguments.js
UTF-8
133
3.015625
3
[]
no_license
function math(first,second,third){ let result=0; result=first+ (second * third); return result; } console.log(math(53,61,67));
true
498979e1830b925e0c5cbf09b3466e12770508b1
JavaScript
shahen94/react-native-video-processing
/lib/utils/test/utils.test.js
UTF-8
614
2.640625
3
[ "GPL-2.0-or-later", "MIT" ]
permissive
/* global expect */ import { getActualSource } from '../utils'; describe('[Utils]', () => { describe('[getActualSource]', () => { it('should be defined', () => { expect(getActualSource).toBeInstanceOf(Function); }); it('using assets path, should return string', () => { const PATH_TO_SORUCE = 'pathToSource...
true
ae1d88fcd6bc5b8799c223be88f19fef1d37cc8b
JavaScript
Aparin/stickyNotes
/src/view/editSticker/editSticker.js
UTF-8
2,852
2.578125
3
[]
no_license
/* eslint-disable func-names */ import './editSticker.css'; import addMiniSigns from '../../model/addMiniSigns'; import state from '../../model/state'; import xhrYaMap from '../../control/xhrYaMap'; export default function editSticker(id, type) { const sticker = document.getElementById(id); sticker.className = 'ed...
true
fe84bf4e9ac9586856ad53902bad2d24a5eb5237
JavaScript
larryhudson/personal-site-wp-11ty
/src/_utils/lastfm.js
UTF-8
757
2.5625
3
[]
no_license
// required packages const axios = require("axios"); // Config from environment variable const {LASTFM_API_KEY} = require('../../env'); // Config const LASTFM_URL = `http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&limit=6&period=7day&user=harryludson&api_key=${LASTFM_API_KEY}&format=json`; async function ...
true
73c917fad7c01fcdf58a5e1f007d3292a9607a0c
JavaScript
Tanqurey/jsNote
/testjs/错误处理.js
UTF-8
499
3.015625
3
[]
no_license
/* try-catch语句 */ try { //可能会引起错误的代码 } catch (err) { //发生错误后的处理 } finally { // 无论哪种情况下都会执行这里的代码 } /* 抛出异常 throw 抛出错误时,必须throw指定一个值,没有要求,以下代码都是有效的 */ throw '发生了错误' throw 'error!' throw new Error('sth went wrong') /* error事件 没有event对象 有error/url/line 分别是错误信息,错误所在url和行号 */
true
894fe6b9d1be31d77abd3a770e736f3a0e79e2c5
JavaScript
kawa-kw/albums
/src/Components/AlbumList.js
UTF-8
1,634
2.84375
3
[]
no_license
import React, { Component } from 'react'; import { ScrollView } from 'react-native'; import axios from 'axios'; import AlbumDetail from './AlbumDetail' class AlbumList extends Component { constructor(props) { super(props); this.state = { albums: [] }; // this.renderAlbums = this.renderAlbu...
true
d17f1c157265a823c8954e76ca7c257e71e5e8a1
JavaScript
ihollander/js-fundamentals-playlist
/12-callbacks/starter.js
UTF-8
322
4.0625
4
[]
no_license
// fnCaller takes in a CALLBACK FUNCTION (a function definition) function fnCaller(fn) { // it INVOKES the callback function fn() } function sayHi() { console.log("hi") } function sayBye() { console.log("bye") } // sayHi is a CALLBACK FUNCTION (a function passed into another function as an argument) fnCaller(sayH...
true
4316c21d1387a93b905e2cbc7468d54494a1b358
JavaScript
AntonAdamkovich/guessing-game
/src/guessing-game.js
UTF-8
571
3.625
4
[]
no_license
class GuessingGame { constructor() { this._numbersList = []; this._middle = 0; this._min = 0; this._max = 0; } setRange(min, max) { this._min = min; this._max = max; for(var i = this._min; i < this._max; i++){ this._numbersList.push(i); } } guess() { ...
true
a6203d1c2c94ac055477f6467a9d90ad6567de49
JavaScript
palak2104/The-Dice-Game
/index.js
UTF-8
714
3.78125
4
[]
no_license
var randomNumber1=Math.floor((Math.random() * 6) + 1); var randomImage1="images/"+"dice"+ randomNumber1 +".png"; var image1 = document.querySelectorAll("img")[0]; image1.setAttribute("src",randomImage1); var randomNumber2=Math.floor((Math.random() * 6) + 1); var randomImage2="images/"+"dice"+ randomNumber1 +"....
true
8ca881cef4a01a41d3a59d07378c455c21473401
JavaScript
pythongyj/bigshijian
/web_back/view/article_category.js
UTF-8
2,084
2.890625
3
[]
no_license
// 获取文章分类列表数据 function getShow() { articleCategory.show(function (res) { console.log(res); if (res.code === 200) { var htmlTemp = template('template', res); $('#showList').html(htmlTemp); } }) } // 展示数据 getShow() // 点击添加 文章分类列表种类 $('#model_add').click(function ()...
true
dc4ab7c044b0220cd7e28a587111e2cb2efcd0f6
JavaScript
daehoanshin/nodejs-lab
/codejong/closure_01.js
UTF-8
65
2.515625
3
[]
no_license
function outer() { var a = 1; console.log(a); } outer();
true
d7f3fdf63e39c9d14a7026abd5981962082554e3
JavaScript
gufanyi/wdp
/src/resource/lui/platform/script/comps/FloatTextComp.js
UTF-8
8,734
2.53125
3
[]
no_license
/** * @fileoverview float类型的Text输入控件. * * @author lxl * @version lui 1.0 * */ (function($) { /** * 浮点型输入框构造函数 * @class 浮点型输入框 * @constructor floatText构造函数 */ $.widget("lui.floattext" , $.lui.textfield , { options : { dataType : 'N', precision : '2', maxValue : 10000000000000000, minVal...
true
7ab6aef75020eae933248a8fb498cb6125851826
JavaScript
skotraba/platformer
/menu.js
UTF-8
1,019
2.640625
3
[]
no_license
var background; class menu extends Phaser.Scene { constructor() { super("startMenu"); } preload(){ this.load.spritesheet('background', 'assets/idkagain.png',{ frameWidth: 800, frameHeight: 600}) } create(){ //Load background image this.background = this....
true
054955ba5fa8f6495f7a6b460d17b78c574bc824
JavaScript
bzemba/cerosSki
/src/Core/Game.js
UTF-8
6,477
2.96875
3
[ "MIT" ]
permissive
import * as Constants from "../Constants"; import { AssetManager } from "./AssetManager"; import { Canvas } from './Canvas'; import { Skier } from "../Entities/Skier"; import { ObstacleManager } from "../Entities/Obstacles/ObstacleManager"; import { Rect } from './Utils'; import { Rhino } from "../Entities/Rhino"; exp...
true
f5aa24b3b2417c1014320d466954e6939dcecbfa
JavaScript
ivanovalarisa/hillel
/3/hw_3/js/5.js
UTF-8
1,331
4.4375
4
[]
no_license
/*15) Дано некоторое число. Определить, можно ли получить это число путем возведения числа 3 в некоторую степень. (Например, числа 9, 81 можно получить, а 13 - нельзя)*/ let number = ''; do { number = prompt("Enter a number!"); } while (number === ''); const parseNum = parseInt(number, 10); document.write('The en...
true
eb5a8610ae7422e79c78d78fb3bf726749b432ed
JavaScript
khaleb85/office-developer
/cepnator/cepnatorWeb/src/cep-api.js
UTF-8
491
3.0625
3
[]
no_license
var _cepApiBaseUrl = "https://viacep.com.br"; function getCep(cep) { return new Promise(function (resolve, reject) { var url = _cepApiBaseUrl + "/ws/" + cep + "/json/"; if (!isValidCep(cep)) { return reject(new Error('Invalid CEP')); } $.get(url, function (res...
true
d1bb0b1b66265d0f1bebdd16de5d474c82be1847
JavaScript
tesla809/data-structures-algorithms-masterclass
/data-structures/stacks-as-linked-list.js
UTF-8
3,780
4.3125
4
[ "MIT" ]
permissive
// Stacks data structure- linked list implementation class Node { constructor(value) { this.value = value; this.next = null; } } class Stack { constructor() { this.first = null; // first instead of head this.last = null; // last instead of tail this.size = 0; } // just shift code from...
true
9e328b447d932b81083930f2f052e9b1c32042c0
JavaScript
mdcleber/william-hill-mrggt
/MRGGT/ClientApp/src/components/Customer.js
UTF-8
2,075
2.6875
3
[]
no_license
import React, { Component } from 'react'; export class Customer extends Component { constructor(props) { super(props); this.state = { customers: [], loading: true }; } componentDidMount() { this.populateCustomersData(); } static renderCustomersTable(customers) { r...
true
a26a9766d0ca73e019f0d154f8817a5f18f4c2de
JavaScript
ubergrape/react-finite-list
/src/index.js
UTF-8
4,491
2.640625
3
[]
no_license
import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { findDOMNode } from 'react-dom' import { debounce, findIndex, noop } from 'lodash' import VisibilitySensor from 'react-visibility-sensor' /** * Finds an element index in a list by selector "prev" or "next". * If selector goes to ...
true
27cbb550c71f2f0598358ff62cc4a27129464b77
JavaScript
ahrampy/tower-time
/js/tower.js
UTF-8
3,695
2.859375
3
[]
no_license
import Vector from "./vector"; import Attack from "./attack"; export default class Tower { constructor( game, dom, sprites, context, idx, cost, upgrade, type, range, damage, cooldown, speed ) { this.game = game; this.dom = dom; this.sprites = sprites; ...
true
18c6961d483a230a0864889f828d537e49a87924
JavaScript
alesmenzel/number-format
/src/round.spec.js
UTF-8
1,467
2.765625
3
[ "MIT" ]
permissive
import round from './round'; describe('round', () => { test('round a big number to large precision', () => { const input = 1465849859165153; const precision = 10000000; const format = round(precision); expect(format(input)).toBe(1465849860000000); }); test('round a big number to small precision'...
true
65f8b833590ef7d11d27669ab653c409f655c3b9
JavaScript
scmccoy/graphql-apollo-sample
/src/Blog.js
UTF-8
1,099
2.765625
3
[]
no_license
import React from 'react'; // Package containing everything you need to set up Apollo Client import { gql } from 'apollo-boost'; // React hooks based view layer integration import { useQuery } from '@apollo/react-hooks'; import './App.css'; // test query (convention to Uppercase Queries) const POSTS_QUERY = gql` # Pre...
true
33819225bd450e8833222fb0f8658d5a29342988
JavaScript
TripWireZa/GA-traveling-salesman
/scripts/viewmodels/engine.js
UTF-8
4,054
3.046875
3
[]
no_license
function Engine(params) { var self = this; self.generation = []; self.generationCount = ko.observable(0); self.generationSize = null; self.crossoverRate = null; self.mutationRate - null; self.Init = function (numberOfCities, generationSize, crossoverRate, mutationRate) { ...
true
1255d24aed5080e43595ef813ec60d24e410d77b
JavaScript
nofun97/codebrew19
/src/screen/SwipeCards.js
UTF-8
5,087
2.65625
3
[]
no_license
"use strict"; import React from "react"; import { StyleSheet, Text, View, Image, Dimensions } from "react-native"; import { API } from "aws-amplify"; import SwipeCards from "react-native-swipe-cards"; class Card extends React.Component { constructor(props) { super(props); } render() { return ( <V...
true
c88c5c96f1f17292cbb11ad433626f8e054ba61a
JavaScript
isaacjtullis/hogwarts-admission-letters
/src/components/App.js
UTF-8
1,307
2.75
3
[]
no_license
import React from 'react'; import UserForm from './UserForm.js' import LetterList from './LetterList.js' class App extends React.Component { constructor(props) { super(props); this.state = { applicationNotice: "accepted", addresse: 'Addresse' } this.handleApplicationAcceptClick = this.han...
true
cd7e3381eac8ea20933953d4964e7488a3273396
JavaScript
cityofaustin/austinconventioncenter.com
/_assets/javascripts/components/accordion.js
UTF-8
2,081
2.796875
3
[]
no_license
function select(selector, context) { if (typeof selector !== 'string') { return []; } if ((context === undefined) || !isElement(context)) { context = window.document; } var selection = context.querySelectorAll(selector); return Array.prototype.slice.call(selection); }; function...
true
1fe6d84b7f660ee7daefd06f4411b8d0e67ea7e2
JavaScript
kustomzone/copperlicht
/source/src/matrix4.js
UTF-8
23,176
3.015625
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-other-permissive" ]
permissive
//+ Nikolaus Gebhardt // This file is part of the CopperLicht library, copyright by Nikolaus Gebhardt /** * A 4x4 matrix. Mostly used as transformation matrix for 3d calculations. * The matrix is a D3D style matrix, row major with translations in the 4th row. * @constructor * @public * @class A 4x4 matrix, mostl...
true
b589a2447353ed62890de5540409eded2d7e9b02
JavaScript
vandor5676/vandor5676.github.io
/setup.js
UTF-8
2,243
3.15625
3
[]
no_license
// Get A WebGL context /** @type {HTMLCanvasElement} */ var canvas = document.querySelector("#canvas"); var gl = canvas.getContext("webgl"); if (!gl) { //return; alert("Cant get gl") } //shape constants //create Geometry var sphereBufferInfo = primitives.createSphereWithVertexColorsBufferInfo(gl, 10, 12, 6); const...
true
c40a09d5b02e4337d9a7c48be07c09036a431f15
JavaScript
mysqlplus163/aboutPython
/20170713/static/20170713.js
UTF-8
2,991
2.671875
3
[]
no_license
/** * Created by Q1mi on 2017/7/13. */ // swal({ // title: "你确定要删除这条记录吗?", // text: "删除之后就找不回来咯!", // type: "warning", // showCancelButton: true, // confirmButtonColor: "#f22b00", // confirmButtonText: "删吧,我想好了", // closeOnConfirm: false // }, // function(){ // swal("Deleted!", "Your imaginary file h...
true
9365f9480fc4e7a6639aac07bc109efed65e5ab4
JavaScript
BlackHatzz/RealEstateSearch
/src/utils/upperFirstLetter.js
UTF-8
160
3.125
3
[]
no_license
export const upperFirstLetter = (str) => { let strArr = str.split(""); return strArr[0].toLocaleUpperCase() + strArr.slice(1, strArr.length).join(""); }
true
cbcc4a9f5e567c4e55b79eeb8f3539268b52fd3b
JavaScript
anurag-4345/react-basic
/src/App.js
UTF-8
530
2.828125
3
[]
no_license
import React from 'react'; import './App.css'; class App extends React.Component { state = { title: "Loading" } componentDidMount() { fetch('https://jsonplaceholder.typicode.com/todos') .then(res => res.json()) .then(res2 => { console.log(res2) this.setState({ title...
true
9f45e714be0d570f655c64aded5976ace69faffc
JavaScript
suhailgupta03/cmocha
/lib/SocketServer.js
UTF-8
841
2.5625
3
[]
no_license
var WebSocketServer = require('ws').Server, wss = new WebSocketServer({ port: 8085 }), Ingress = require('./Ingress'); function newConnection(webSocket) { webSocket.on('message', function newMessage(message) { try { message = JSON.parse(message); if(webSocket.username)...
true
9e6b6f2b8a045228e75852b5243fd0ec7c497e35
JavaScript
tasesmuemils/100DaysOfCode
/web_development/js/product_page/js/script.js
UTF-8
5,618
2.90625
3
[]
no_license
//I will create a videogame site where user will be able to check games, add new game also. const games = [{ id: 1, src: 'https://static-cdn.jtvnw.net/ttv-boxart/FIFA%2019.jpg', title: 'Fifa 19', consoleType: 'Multiple consoles', price: '60$' }, { ...
true
3b89b1cbc5f5aa7eb6dbbabdacef58421e528e94
JavaScript
endy21osu/Deploy_StudyLexWebApp
/templates/instructions/responses.js
UTF-8
3,549
2.75
3
[]
no_license
module.exports = function(userData, appState) { console.log('responses file'); console.log(userData, appState); var _ = require('lodash'), self = this; self.appState = appState; self.userData = userData; return { handleWelcome: handleWelcome, handleStep: handleStep,...
true
b97d7d4c5633b93bdf1e26d8b6057456bb38d512
JavaScript
lxyhe/eycheck
/js/index.js
UTF-8
5,332
2.671875
3
[]
no_license
$(function() { let btnIsShow2 = false let viewIsShow2 = false let btnIsShow1 = false let viewIsShow1 = false // 动态的显示和隐藏产品方案下拉页 setTimeout(() => { $('#product_btn').hover(function(event) { console.log('production调用') if (event.type == 'mouseenter') { productHeader() $('.cont...
true
14b07c9fd4c3b4cfc1948e46d1a764fb4a07d0c2
JavaScript
DianaGC/test
/src/Components/Container/PizzaPartyContainer.js
UTF-8
1,254
2.515625
3
[]
no_license
import React, {Component} from 'react'; import Mesero from "../../Mesero"; import {Number, NumberPar} from "../../Numbers"; import PizzaParty from '../presentational/PizzaParty' class PizzaPartyContainer extends Component { constructor(props) { super(props); this.state = { sliceForPers...
true
75b2a38a6a866f54eefc8210401adcbe1ad105f9
JavaScript
berbaquero/Reeddit-app
/js/sharing.js
UTF-8
926
2.515625
3
[ "MIT" ]
permissive
var sharing = (function() { var scriptString = 'tell application "Safari" to add reading list item "{{URL}}"', applescript, clipboard; var getAppleScript = function() { if (!applescript) { applescript = require('applescript'); } return applescript; }; ...
true
557b2232a8170ef1cdc84abbf617cdbf2664011e
JavaScript
devmujahidsk/GSAP-Animation
/js/main.js
UTF-8
2,055
2.515625
3
[]
no_license
// var tl = new TimelineLite({}) // tl.to(".logo", {duration: 2, x: 300, rotation: 360, backgroundColor: "#560563", borderRadius: "20%", // border: "5px solid #000", ease: "power2.out"}); gsap.set(".logo", {transformOrigin: "50% 50%"}); gsap.to(".logo", {duration: 20, rotation: 360}); var myObject = {rotation...
true
7fa60755061a8ad188eb7e3d7bbab189060eaad7
JavaScript
vashenko49/JS_homework
/homework16_optional/js/script.js
UTF-8
689
3.703125
4
[]
no_license
function enterNumber(number = "Number") { number = prompt("Enter your number multiples of five", number); number = number.replace(',','.'); if (isNaN(number) || !Number.isInteger(+number) || !number){ number = enterNumber(number); } return +number; } function factoriallFunction...
true
8eb947c4bd506aac3aa3abb4ef0390082bd7f018
JavaScript
adishthapa/train-scheduler
/assets/javascript/app.js
UTF-8
3,682
3.1875
3
[]
no_license
// Firebase configuration var firebaseConfig = { apiKey: "AIzaSyDl_LzzZ5sNq7V0VFm9yEi2aKmmC028emg", authDomain: "train-scheduler-7339f.firebaseapp.com", databaseURL: "https://train-scheduler-7339f.firebaseio.com", projectId: "train-scheduler-7339f", storageBucket: "", messagingSenderId: "3060791...
true
e13fad35b0e06c26a62da2cd07c7266f726c4563
JavaScript
s-zanker/personal-website-bootstrap
/server.js
UTF-8
1,142
2.71875
3
[]
no_license
const http = require("http"); //Modul was Node für uns bereitstellt const fs = require("fs"); const server = http.createServer((request, response) => { const { url } = request; if (url === "/") { response.writeHead(200, { "Content-Type": "text/html" }); const index = fs.readFileSync("./index.html"); re...
true
a32d608131676f5e546e2c5b939d6021be79ab12
JavaScript
dl184/BeerHW
/public/app.js
UTF-8
2,102
3.40625
3
[]
no_license
var app = function(){ const url = 'https://s3-eu-west-1.amazonaws.com/brewdogapi/beers.json' makeRequest(url, requestComplete) } const makeRequest = function(url, callback) { const request = new XMLHttpRequest(); request.open("GET", url); request.addEventListener('load', callback); request.send(); }; cons...
true
a5decbbd10788f6a3db8d15b6f4beab29811fee5
JavaScript
fsundstedt/cat-reducer-04-07-2020
/src/redux/reducers/activity.js
UTF-8
660
2.859375
3
[]
no_license
import { ACTION_SET_ACTIVITY, ACTION_SET_NAME } from '../actionTypes'; const initialState = { name: "Name", activity: "napping" } const activityReducer = (state = initialState, action) => { switch (action.type) { case ACTION_SET_ACTIVITY: { const { activity } = action.payload; ...
true
0a020e835f3f596bf7a95004b81d68bb43209616
JavaScript
Syed-Kashif-Bukhari/server-express
/25-07-2017/app.js
UTF-8
958
2.921875
3
[]
no_license
var http = require("http"); var express = require("express"); var app = express(); app.use((request, response, next) => { console.log("Ya Rasool Allah"); next(); }) app.use((request, response, next) => { var minutes =(new Date()).getMinutes(); if ((minutes % 2) === 0) { next(); } else { ...
true
b99aed6352ad5af1591524cc56a2056bb797392f
JavaScript
ZoeyF75/kata-practice
/kata1.js
UTF-8
673
4.875
5
[]
no_license
// In this exercise, we will be given an array of 2 or more numbers. // We will then have to find the two largest numbers in that array, // and sum them together. function largestSum (array) { if (array.length < 2) { //if theres less than 2 numbers edge case console.log("The given array is not big enough"); ...
true
c70908a364afdf9a02f5c5d48a842b83b75de06a
JavaScript
devjo0810/Himchan_estate_server
/src/main/webapp/resources/js/common.js
UTF-8
1,301
2.609375
3
[]
no_license
// 공통 핸들러 매핑 $(document).ready(function() { $("#main-navi-home").on("click", function() { changePage("/"); }); $("#main-navi-board").on("click", function() { changePage("/board"); }); $("#main-navi-come").on("click", function() { changePage("/come"); }); $("input[name...
true
43658181be63befd261a709a00db1538f3c61a95
JavaScript
euthenicsDev/twitter-crypto-tagger
/src/browser_action/browser_action.js
UTF-8
1,202
2.875
3
[]
no_license
function onButtonClick() { chrome.runtime.sendMessage({ type: "buttonClick" }, function (response) { console.log(response); }); } function addTagTest() { const name = document.querySelector("#newName").value; const tag = document.querySelector("#tagsForName").value; chrome.runtime.sendMessage( { type...
true
9b3ed7a7937ec633d9d03072bc20d1b0d192c1b6
JavaScript
bluewow/ServiceJUJU
/mainProject/WebContent/js/index.js
UTF-8
3,738
2.765625
3
[ "MIT" ]
permissive
var timer; //인덱스창에서 엔터키가 눌렸을 때 실행할 내용 function enterkey() { if (window.event.keyCode == 13) { var searchInput = document.querySelector(".search__input").value; var EncodeData = encodeURI(searchInput); location.href="./main?k="+EncodeData; } } window.addEventListener("mousewheel", functi...
true
e656021f9967b5ee147547c10c024a3f3d20de9f
JavaScript
gmjeong/IoT-Practice
/Chapter3/3-3.js
UTF-8
88
3.078125
3
[]
no_license
var a = 1; console.log(a); // 1 console.log(window.a); // 1 console.log(this.a); // 1
true
97dc9182d635fb3d6f3201b10d16b723a2e10f00
JavaScript
MayankKhajanchi/le
/src/Counter.js
UTF-8
995
2.78125
3
[]
no_license
import React from 'react'; class Counter extends React.Component { constructor(props) { super(props); this.handleAddOne = this.handleAddOne.bind(this); this.handleMinusOne = this.handleMinusOne.bind(this); this.handleReset = this.handleReset.bind(this); this.state = { count: 0 }; } ...
true
a55a20be029027efd00444a7e047a12493aa75cd
JavaScript
pan93412/ciscc-discord
/lib/utils/RemoveMentions.js
UTF-8
582
2.515625
3
[]
no_license
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Removes dangerous pings such as @everyone and @here from the message. * * @param message The message object * @see {Message} */ function RemoveMentions(message) { // We adds a zero width space to the ping. message = message....
true
b7e89d282b988204a073090864f16222fe1fd4b1
JavaScript
JasmeetRangar/json_the_cat
/breedFetcher.js
UTF-8
723
2.90625
3
[]
no_license
const request = require('request'); // if (process.argv.length < 3) { // console.log('not enough parameters!'); // process.exit(); // } const fetchBreedDescription = function(breedName, callback) { const url = "https://api.thecatapi.com/v1/breeds/search?q=" + breedName; const requestCallback = (error, response,...
true
ee23921565875d1bc8655312438a6cf2e6bb0217
JavaScript
travelappdev/FL-Project-EventApp
/src/js/fb_login.js
UTF-8
2,972
2.515625
3
[]
no_license
// initializes facebook client window.fbAsyncInit = function() { FB.init({ appId: '211283292620723', xfbml: true, status: true, cookie: true, version: 'v2.7' }); }; (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {...
true
fa8343f89ce8aaf646b853b5b3b2c7125a59c454
JavaScript
jamaspy/sei-classwork
/15_nodeJS/intro/03-server.js
UTF-8
395
2.671875
3
[]
no_license
const http = require('http'); http.createServer((request, response) => { console.log(`servering request: ${request.method} ${request.url}`); response.writeHeader(200, {'Content-Type': 'text/plain'}); if (request.url === '/groucho'){ response.end("Hello Grouchoe") }else{ response.end("He...
true
299ad45fba08c5f5fff8a31cf206a11e8eb2a24d
JavaScript
CityChrone/citychrone
/.build/bundle/programs/server/mini-files.js
UTF-8
4,374
2.640625
3
[ "MIT" ]
permissive
var _ = require("underscore"); var os = require("os"); var path = require("path"); var assert = require("assert"); // All of these functions are attached to files.js for the tool; // they live here because we need them in boot.js as well to avoid duplicating // a lot of the code. // // Note that this file does NOT con...
true
65cef5a3e8af0cb2806d67b9d90ab4cf4ec27814
JavaScript
redmonty/udSite
/app/assets/scripts/modules/Person.js
UTF-8
676
3.796875
4
[]
no_license
// function Person(name,color) { // this.name = name; // this.color = color; // this.greet = function() { // console.log(this.name +' hello there'); // }; // } class Person { constructor(name,color) { this.name = name; this.color = color; } greet() { console.l...
true
6a32749bdcbc1ce20588b99b23064fdc7ce69521
JavaScript
Northeastern-DS-4200-F19/project-team-11-pedestrians
/scatterplot.js
UTF-8
3,811
3
3
[ "BSD-3-Clause" ]
permissive
function scatterplot(data) { var minSafetyLevel = 0; var maxSafetyLevel = 10; var width = 1000; var height = 600; var margin = { top: 50, bottom: 100, left: 75, right: 30 }; var svg = d3 .select("#vis4") // .append('svg') .attr("width", width) .attr("height", height); /...
true
2cb8bc200f74353b17735644066351bee8153af7
JavaScript
AndrewTownsley/express-router-class-7-19
/server.js
UTF-8
636
2.703125
3
[]
no_license
// Import Express const express = require('express'); // Create an express server const app = express() app.use(express.json()); app.use((res, req, next) => { req.custom = "Test"; next(); }) // Express middleware app.get("/", (req, res, next) => { try { res.sendFile(join(__dirname, "./public/in...
true
a42967295b94746ff375286e419a6650fa78e7ff
JavaScript
pookpal/simple-react-demo
/01-helloworld/helloworld2.js
UTF-8
458
2.65625
3
[]
no_license
/*** * 在dom节点渲染 * 在js中用类似xml的方式写html的语法叫做jsx * ReactDOM类库:react-dom,在浏览器端渲染 * ReactDOMServer类库:react-dom-server,在服务器端渲染,同构应用SEO友好性能好 * */ // 获取dom节点 var targetEle = document.getElementById('app'); ReactDOM.render( <div> <h1>Hello, world!</h1> <p>这是我写的react hello world</p> </div> ,...
true