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
0dbaae921378ce31bc9214c2ae80945ca166017f
JavaScript
linzhangcs/Breakout-1
/Objects/Enemy.js
UTF-8
1,431
2.796875
3
[]
no_license
function Enemy(x, y, c) { Sprite.apply(this, [x, y].concat([0, 0])); this.immovable = true; sounds['ship' + Math.ceil(Math.random() * 3)].play(); this.scale = 0.5; this.rotate = function() { var nextRot = map(noise(frameCount / 100), 0, 1, -1, 1); if(this.rotation + nextRot >= 30 || this.rotation + n...
true
8cde4f3acfa96d0dd49df06e30a3c9a0545cc98c
JavaScript
praycis-lee/javascript_design
/่ฎพ่ฎกๆจกๅผdemo/extendๅ‡ฝๆ•ฐ.js
UTF-8
533
3.25
3
[]
no_license
// extend funtion function extends(subClass,superClass){ var F = function(){}; F.prototype = superClass.prototype; subClass.prototype = new F(); subClass.prototype.constructor = subClass; } //็ฑปๅผ็ปงๆ‰ฟ.js็ปงๆ‰ฟ็š„ๆ”น้€  // class person function Person(name){ this.name = name; } Person.prototype.getName = function(){ retur...
true
10e803707a2d1730800b9dea9fd8b4142324d916
JavaScript
marcioj/yac
/test/class_test.js
UTF-8
6,828
3.03125
3
[]
no_license
"use strict"; var Class = require("../lib/class"); var expect = require("chai").expect; describe("Class", function() { it("exists", function() { expect(Class).to.exist; }); it(".extend generate a new class", function() { var Sub = Class.extend({ foo: "bar", hello: function() { retur...
true
3d1ed310e77ae4c6361315bf6a2bad725c27a97a
JavaScript
speedyankur/Dalmation
/www/js/app.js
UTF-8
5,752
2.546875
3
[]
no_license
var height, width; var shapes = []; var stage, layer; var bg; var selectedShape; var isDragging = false; var isTextMode = false; var currentTextGroup; $(document).ready(function() { var maxWidth = $('.col-md-12').width() - 20; var maxHeight = window.screen.availHeight - 200; $('#rotate').click(function(){ //sw...
true
42102a93042cc9ce576572efe394a19d71180fcf
JavaScript
miyesdi190119/Electiva-Profesional-I
/Taller 2/1. Triangulo/Script.js
UTF-8
247
3.140625
3
[]
no_license
window.onload = function() { var a, b, h; b=prompt('Ingrese el valor de la base de triangulo',''); h=prompt('Ingrese el valor de la altura de triangulo',''); a = (b * h)/2; alert("El area del triangulo es:" + a); }
true
6127359a9f8abb12c7307c93d49bd554983bf50b
JavaScript
mumei-u/Canvas-p1-ex1
/assets/js/script.js
UTF-8
1,352
3.453125
3
[]
no_license
var c = document.getElementById('canvas'); //Crรฉation d'un objet CanvasRenderingContext2D var ctx = c.getContext('2d'); //Mur de la maison function mur(){ ctx.fillStyle = "#add8e6"; ctx.beginPath(); //Dรฉbut du chemin ctx.moveTo(150, 100); // Se dรฉplacer ร  la position(x, y) ctx.lineTo(150, 200); ctx.lineTo(250...
true
01fb70a40cddb94011e7ff56a08ad4be507d62f0
JavaScript
dhavico/appHiddenCave
/js/moneda.js
UTF-8
223
2.546875
3
[]
no_license
function Moneda(x,y,imagen){ Kinetic.Circle.call(this); this.setWidth(30); this.setHeight(30); this.setX(x); this.setY(y); this.setFill('yellow'); }; Moneda.prototype = Object.create(Kinetic.Circle.prototype);
true
796dd89506c7f3ee5787aca13a75f16a0791a0fe
JavaScript
Park-SooYeon/web_semi
/WebContent/js/w_roomsjs.js
UTF-8
4,988
2.609375
3
[]
no_license
/** * */ //์ฒดํฌ์ธ ์ฒดํฌ์•„์›ƒ ๋ฐ์ดํŠธ ์„ค์ • let btnFunc_w = function(){ if($('#btnHotel') != null) { $('#btnHotel').click(function(){ $('#view2_w').attr('style','display:none'); $('#view3_w').attr('style','display:none'); $('#view1_w').removeAttr('style','display:block'); }); } if($('#btnLodging')...
true
5f294c5c61da75897757d39380286baf2c668f88
JavaScript
Thesilkroaduser/test
/xb-software-test/index.js
UTF-8
1,581
3.109375
3
[]
no_license
const inputArea = document.querySelector('.input'); const addButton = document.querySelector('.add'); const tagContainer = document.querySelector('.items'); const readonlyButton = document.querySelector('.readonly'); let tags = { get ัontent() { return this.content; }, set ัontent(value) { this.content =...
true
31cf7e8f09601fd6c999b3e29eb25b85d408f405
JavaScript
jmcmaster/linkedlist-js
/__tests__/linkedlist.test.js
UTF-8
4,261
3.296875
3
[]
no_license
const LinkedList = require('../linkedlist.js'); describe('LinkedList', function() { describe('constructor', function() { it('should create an empty list', function() { var list = new LinkedList(); expect(list.isEmpty()).toBe(true); expect(list.countNodes()).toBe(0); }); it('has all the...
true
2428eb8a79f944aa7f241407426b07d2f5488619
JavaScript
Xotic750/caboodle-x
/__tests__/sameValueZero.test.js
UTF-8
940
2.5625
3
[ "MIT" ]
permissive
import {sameValueZero} from '../index'; import nonNullPrimitives from './helpers/nonNullPrimitives'; import nils from './helpers/nils'; const coercibleObject = { toString() { return 42; }, valueOf() { return 3; }, }; const valueOfOnlyObject = { toString() { return {}; }, valueOf() { retu...
true
e89c83fd59795401bec9452466b16a33e868d4cb
JavaScript
VictorRodriguesxrp/curso-wm
/Fundamentos/hoisting.js
UTF-8
160
2.59375
3
[]
no_license
console.log('a= ', a) var a = 2 console.log('a= ', a) console.log('b =', b) let b = 2 console.log('b =', b) //https://www.youtube.com/watch?v=nrnBpgTQmcg
true
ba4a2306e19f380cb9163ad05d9f56c9dd435027
JavaScript
AdityaYadavalli1/Subway-Surfers
/nonedit.js
UTF-8
6,394
3.03125
3
[]
no_license
function initShaderProgram(gl, vsSource, fsSource) { const vertexShader = loadShader(gl, gl.VERTEX_SHADER, vsSource); const fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, fsSource); // Create the shader program const shaderProgram = gl.createProgram(); gl.attachShader(shaderProgram, vertexShader); gl...
true
7442795ab16e110e1b20871b41ec2460aedd52ca
JavaScript
sourabhjain9887/react-portfolio
/src/components/About.js
UTF-8
2,024
2.546875
3
[]
no_license
import React, { useState , useEffect } from 'react'; import sanityClient from '../client.js'; import aboutImage from '../about-background.jpg'; import profilePic from '../profile-pic.jpg' function About() { const [author, setAuthor] = useState(null); useEffect(() => { sanityClient.fetch(`*[_type== "au...
true
3fd46869f63d08b9d46ce4b4523477ebf0b54ea3
JavaScript
Le0Michine/learn-js
/13 HTML5 API/src/main.js
UTF-8
3,240
2.953125
3
[]
no_license
import TicTacToe from "./TicTacToe"; import StandardRenderer from "./StandardRenderer"; import CanvasRenderer from "./CanvasRenderer"; import Logger from "./Logger"; let fieldRenderer; const rendererSelector = document.getElementById("rendererType"); let gameFieldElement = document.getElementById("gameField"); const s...
true
8ff2543ccfd5d9afc4e88822d54a80da5e68866e
JavaScript
torirossini/-IGME23-WebDesImp
/Project2_Final/js/main.js
UTF-8
9,405
3.3125
3
[]
no_license
//https://rickandmortyapi.com/documentation window.onload = (e) => { document.querySelector("#showCharacters").onclick = allCharactersData; document.querySelector("#showLocations").onclick = allLocationData; document.querySelector("#showEpisodes").onclick = allEpisodeData; document.querySelector("#sea...
true
5871afb60101e888699fd93196e709584d5c876e
JavaScript
swdecker/js-looping-and-iteration-looping-code-along-austin-web-091619
/index.js
UTF-8
372
3.375
3
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Code your solutions in this file function writeCards(arrNames, strEvent) { const cards = []; for(let i=0; i < arrNames.length; i++){ cards.push(`Thank you, ${arrNames[i]}, for the wonderful ${strEvent} gift!`); } return cards; } function countDown(startNum){ let i = startNum; while( i...
true
f9623e8559f3f5354657a8e658d9959330708d14
JavaScript
bio4j/el-grafo
/resources/libs/graphlib/lib/alg/tarjan.js
UTF-8
1,979
3.25
3
[ "MIT" ]
permissive
module.exports = tarjan; /** * This function is an implementation of [Tarjan's algorithm][] which finds * all [strongly connected components][] in the directed graph **g**. Each * strongly connected component is composed of nodes that can reach all other * nodes in the component via directed edges. A strongly conn...
true
f37a22ceddc7f1fd89d51a36465310d0592dcff0
JavaScript
DrPeyman86/todo-app-api
/playground/hashingJsonWebToken.js
UTF-8
672
3.4375
3
[]
no_license
const jwt = require('jsonwebtoken') //jwt library provides 2 methods, one to //jwt.sign //takes the data id and returns it as the hash //jwt.verify //takes the hash value and makes sure it was not manipulated. var data = { id: 10 } var token = jwt.sign(data, "123Peymy")//sign will return the hashed tok...
true
7c7c7f257c13336cefd12850761d21c166438e67
JavaScript
DemeryMA/Sprint-Challenge-Single-Page-Apps
/src/components/LocationsList.js
UTF-8
764
2.671875
3
[]
no_license
import React, { useEffect, useState } from "react"; import axios from 'axios'; import LocationCard from './LocationCard'; export default function LocationsList() { const [location, setLocation] = useState() useEffect(() => { axios .get('https://rickandmortyapi.com/api/location/') ...
true
8cf1500efcdb27115a7a6fece8f8bb0af733d870
JavaScript
pvphq/rotomhq
/commands/forcesetregion.js
UTF-8
4,877
2.671875
3
[]
no_license
const Discord = require("discord.js"); const mongoose = require("mongoose"); // const botconfig = require("../botconfig.json"); //Connect to db mongoose.connect(process.env.mongoPass, { useNewUrlParser: true, useUnifiedTopology: true, }); //MODELS const User = require("../models/user.js"); module.exports.run = a...
true
9b9e274817b587eab8c721a61b671e01ba045bea
JavaScript
matseng/helloWorldExamples
/insertionSort/insertionSort.js
UTF-8
1,174
4.5
4
[]
no_license
/*jshint expr:true*/ /** * Insertion sort is another basic sorting algorithm. Insertion sort * iterates over an array, growing a sorted array behind the current location. * It takes each element from the input and finds the spot, up to the current point, * where that element belongs. It does this until it gets to ...
true
fe233232a068309638dee0a071e5d403d448cbb3
JavaScript
SoftwareBound/WeatherApp
/src/common/functions/getDataFromApi.js
UTF-8
280
2.953125
3
[]
no_license
export async function getData(url) { try { const data = await fetch(url); const jsonData = await data.json(); return jsonData; } catch { throw new Error("Server is not responding, please try later"); } /* console.log(`jsonData = ${jsonData}`); */ }
true
5b72f90b0840c993707041e8e300b99892d9f028
JavaScript
nishchay-suteri/ExerciseTracker
/src/controllers/UserController.js
UTF-8
1,790
2.6875
3
[]
no_license
const User = require('../models/User'); const UserValidator = require('../validation/User/UserValidation'); const createNewUser = async (req,res) => { const validate = UserValidator.createUserValidator(req.body); if(validate.error) { return res.status(400).send(validate.error.details[0].message); ...
true
cb3470336fd6f99caad62e37b4ada5d9ccec9b23
JavaScript
ibukun-koyer/murder_mystery
/eventListeners.js
UTF-8
761
2.78125
3
[]
no_license
function $addEventListener(DOM, event, fxn) { DOMlist.push([DOM, event, fxn]); DOM.addEventListener(event, fxn); } function template(DOM, fxn) { for (let i = 0; i < DOMlist.length; i++) { if (DOM === DOMlist[i[0]]) { if (typeof fxn === "function") { fxn(DOMlist[i]); DOMlist.splice(i); ...
true
ce908589f24e448f456ab5a9d6d24f9978ed70b7
JavaScript
hamzaeldemery/Chat-App
/assets/js/socket/init.js
UTF-8
817
2.65625
3
[ "MIT" ]
permissive
const socket = io() const btn = document.getElementById('friendRequestsDropdown'); let myId = document.getElementById("userId").value; socket.on('connect' , () => { socket.emit('joinNotificationRoom',myId) socket.emit('goOnline',myId) }); socket.on('newFreindRequest', (data) => { console.log(data); co...
true
715b3620ab39a90e4add72d682ff3000e7c18b09
JavaScript
nss-day-cohort-45/nutyshell-running-with-scissors-1
/src/scripts/friends/SearchResult.js
UTF-8
925
2.765625
3
[]
no_license
// author: Aaron Resch // purpose: html representation of each user search result, including add friend button const eventHub = document.querySelector('.container'); export const SearchResult = (user) => { return ` <div class="search-result"> <div class="friend-card__info text-center"> <p><strong>Userna...
true
2b8466356ec66460262207109c197f687a17569b
JavaScript
nahuelmedina88/sindicatotest
/validation/signinValidate.js
UTF-8
738
2.8125
3
[]
no_license
export default function signinValidate(values) { let errors = {}; if (!values.nombre) { errors.nombre = "El nombre es obligatorio"; } if (!values.email) { errors.email = "El email es obligatorio"; } if (values.email) { let emailRegex = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>(...
true
df9fd949f4783504da454577b4a96878d6fd93ac
JavaScript
CharlieOrtiz/WebDevelopmentProjects
/LanguageSwitcher/language.js
UTF-8
6,142
3.15625
3
[]
no_license
//Variable to store translations let MLstrings = [ { English: "Sausages", Polish: "Kieล‚baski", German: "Wรผrste", Russian: "ะšะพะปะฑะฐัะฝั‹ะต ะธะทะดะตะปะธั", Traditional: "้ฆ™่…ธ", }, { English: "Carrot", Polish: "Marchewka", German: "Karotte", Russian: ...
true
6d9b09f602fab50da39a04ffe41e2a601a52e95a
JavaScript
Nicolasfiguerasparras/2DAW
/DWEC/1trimestre/entregas/Ignacio Ortiz Cobo/validacion_ejercicio1/app.js
UTF-8
1,716
2.59375
3
[ "MIT" ]
permissive
$(document).ready(Start); function Start(){ $("form").validate( { errorClass:"rojo", success:"verde", rules:{ nombre:{ required: true, minlength: 4, maxlength: 20 }, calle:{ required: true, minlength: 20, maxlength: 40 }, numero:{ digits: true, ...
true
0465a2db996c82e50d8673556d804f07efe21443
JavaScript
KianBadie/github-contributor-helper
/octokit-demo.js
UTF-8
1,422
2.78125
3
[]
no_license
require('dotenv').config() const { Octokit } = require("@octokit/rest"); const octokit = new Octokit(); (async () => { let contributors = await octokit.paginate(octokit.repos.listContributors, { owner: "github", repo: "opensourcefriday" }); let issueComments = await octokit.paginate(o...
true
3ce5ddee6291473eb88c6aaea979127618efb203
JavaScript
bluesophia/commercial
/controllers/shop.js
UTF-8
5,218
2.5625
3
[]
no_license
const Product = require("../models/product"); const Cart = require("../models/cart"); const Order = require("../models/order"); const CartItem = require("../models/cart-item"); // const Sequelize = require("sequelize"); /********* getIndex(shop index ๊ฐ€์ ธ์˜ค๊ธฐ) **********/ exports.getIndex = (req, res, next) => { con...
true
a93e3c2bb8d91469a81bce85e4e760b99227a731
JavaScript
volenpopov/SoftUni
/JS Fundamentals/JS Arrays and Matrices Exercises/Homework JS Arrays and Matrices/09. Diagonal Attack.js
UTF-8
1,963
3.75
4
[]
no_license
function Main(input) { // let matrix = getMatrix(); let matrix = input.map(row => row.split(' ').map(Number)); let leftDiagonalSum = getLeftDiagonalSum(); let rightDiagonalSum = getRightDiagonalSum(); if (leftDiagonalSum === rightDiagonalSum) { transformMatrix(); } printMatr...
true
4d92b1a037c83fa5c8fc3e330a52998cfd384006
JavaScript
Uriel29/simple_app_for_android_webview
/Resources/html/javascripts/validacao.js
UTF-8
462
2.890625
3
[ "Apache-2.0" ]
permissive
var validacao = function() { var nome = $("#nome").val(); var cpf = $("#cpf").val(); if (nome == "") { alert("Por favor digite seu nome") $("#nome").focus(); return false; } if (cpf == "") { alert("Por favor digite seu cpf") $("#cpf").focus(); return false; } return true; ...
true
73091422129741e873989069f00cdcdc0734e757
JavaScript
kitkoshino/bootcamp_IGTI_frontend_developer
/modulo3/trabalho-pratico/react-bootcamp-notas/src/components/Calculations.jsx
UTF-8
2,080
2.953125
3
[]
no_license
import React, { useEffect, useState } from 'react'; import '../styles/calculations.scss'; function Calculations({ grades }) { const [isApprovedByPercentage, setIsApprovedByPercentage] = useState(false); const [isApprovedByModule, setIsApprovedByModule] = useState(false); const [sumGrades, setSumGrades] = useStat...
true
106c5bc2c4833ca354e5980c1253f90652f650a9
JavaScript
danwventura/iCaddy2.0
/app/factories/ScorecardFactory.js
UTF-8
11,602
2.515625
3
[]
no_license
"use strict"; app.factory("ScorecardFactory", function($q, $http, firebaseURL, AuthFactory) { var getScorecardsFromFirebase = function(){ var scorecards = []; let user = AuthFactory.getUser(); // console.log("user", user); return $q(function(resolve, reject){ $http.get(`${firebaseURL}scorecards....
true
486efa950ab9389b2bcc71f3b71aa5b0886890c7
JavaScript
yaseyomz/Automotive-Intelligence
/controllers/dashboardController.js
UTF-8
1,202
2.59375
3
[]
no_license
// import required modules const Part = require('../models/partModel'); const Service = require('../models/serviceModel'); const Tool = require('../models/toolModel'); // get all parts from database const getDashboard = (req, res) => { let partResults; let serviceResults; let toolResults; Part.find().s...
true
3c914c11909e31985f3d37e78690e42ffc8be473
JavaScript
TanguyLe/HoulgateFestBack
/api/user/userController/userHelperController.js
UTF-8
1,194
2.71875
3
[ "MIT" ]
permissive
let mongoose = require("mongoose"), User = mongoose.model("Users"); // checks user exists and hasn't shotgun or isn't the owner of another shotgun exports.checkUserOK = (userEmail, callback) => { console.log("Check user OK..."); User.findOne({ email: userEmail }) .then((foundUser) => { ...
true
42a506e11bd84b40afb531e09fa4b2ca742ceed3
JavaScript
ielgstrom/C4-NODE-EJERCICIO-6-GRUPO-A
/operacionesAnimales.js
UTF-8
1,265
2.90625
3
[]
no_license
const { Op } = require("sequelize"); const Animal = require("./schemas/Animal"); const crearAnimal = async () => { try { const nuevoAnimal = await Animal.create({ id: 2, nombre:"", edad: 10, especie:"", NUM_CHIP: 34, }); console.log(nuevoAnimal.nombre); } catch (err) { ...
true
056a18f12bd7c23ca69aad2f35a770dac2666a28
JavaScript
kushan2018/CodeCamper
/CodeCamper.Web/test/web api/webapi.attendance-cud.tests.js
UTF-8
6,151
2.859375
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
๏ปฟ(function () { QUnit.config.testTimeout = 10000; var okAsync = QUnit.okAsync, stringformat = QUnit.stringformat; var baseUrl = '/api/attendance', getMsgPrefix = function(pid, sid, rqstUrl) { return stringformat( ' of attendance with pid=\'{0}\' sid=\'{1...
true
a78ad971a467b42535f0542d0cd3113dd0fd9ef4
JavaScript
GaryRidgway/Elemental_Wyvern_Generator
/js/string_builders/ability_string_builder.js
UTF-8
420
2.96875
3
[]
no_license
function ability_string_builder(abilities) { let ability_keys = Object.keys(abilities); let ability_string = ''; for (let i = 0; i < ability_keys.length; i++) { const ability = ability_keys[i]; ability_string += '\ <div class="property-block">\ <h4>' + ability + '.</h4>\ <p>' + abil...
true
5fc6c666e9d422b022ece3ca99b45130d761f54d
JavaScript
Maryna-Serhiichuk/bike-shop
/js/registrationForm.js
UTF-8
2,770
3.078125
3
[]
no_license
const nameRegistr = document.querySelector('#name-registr'); const emailRegistr = document.querySelector('#email-registr'); const passwordRegistr = document.querySelector('#password-registr'); const conPasswordRegistr = document.querySelector('#confirm-password-registr'); let nameRegistrVal; let emailRegistrVal; let p...
true
c1e4ef1db646e0f5722011b62447e204cfeb9d26
JavaScript
delphinefoo/data-structures
/sprint-two/src/doublyLinkedList.js
UTF-8
1,719
3.78125
4
[]
no_license
var DoublyLinkedList = function() { var list = {}; var Node = function(value) { node = {}; node.value = value; return node; } list.head = null; list.tail = null; list.addToHead = function(value) { var newNode = Node(value); newNode.previous = null; if (list.head === null) { ...
true
4110d1683ef44ee01690225186da7f93e05002a1
JavaScript
alexander34ro/sliding_puzzle
/app/assets/javascripts/pages.js
UTF-8
8,755
3.265625
3
[]
no_license
'use strict'; // general stuff var puzzleContainer; var steps; var moves; var solved; // puzzle props var puzzleSize; var nrPieces; var originalPieces; // GENERATE function shuffle(pieces) { var move, index, newPieces; var shuffleSteps = parseInt($('#shuffle_steps').val()); for (var i = 0; i < shuffleSteps; i++...
true
0a0df8c549a26f3ca00230a10a7ee0da8436f567
JavaScript
forrana/callstats-test-task
/src/client/modules/lifeCycle/step.initial.js
UTF-8
1,582
3
3
[ "MIT" ]
permissive
import Step from 'step'; /** * Representing the initial step. Initialize DOM, waiting for file uploading. * @class StepInitial * @extends Step */ export default class StepInitial extends Step { constructor() { let button = document.querySelector('.button'); /** * prepareDOM - Add step...
true
f4451ae7871689b73aded9cc329b26c8beba111d
JavaScript
lianj-fex/dollar
/src/utils/debounce.js
UTF-8
876
3.46875
3
[]
no_license
/** * ๅ‡ฝๆ•ฐๅŽปๆŠ–๏ผŒ่พ“ๅ…ฅไธ€ไธชๅ‡ฝๆ•ฐfunc๏ผŒๅนถ่ฟ”ๅ›žๅฆไธ€ไธชๅ‡ฝๆ•ฐ๏ผŒ่ฏฅ่ฟ”ๅ›ž็š„ๅ‡ฝๆ•ฐไป…ไผšๅœจๅœๆญข่ฐƒ็”จๅฎƒๅŽ็›ธ้š”waitๆ—ถ้—ดๆฎตๅŽๆ‰ไผšๆ‰ง่กŒfuncๅ‡ฝๆ•ฐๅนถ่ฟ”ๅ›ž็ป“ๆžœ๏ผŒๅฆๅˆ™่ฟ”ๅ›žไธŠไธ€ๆฌก่ฐƒ็”จfunc็š„็ป“ๆžœ * @param {function} func ้œ€่ฆๅŽปๆŠ–็š„ๅ‡ฝๆ•ฐ * @param {number} wait ็ญ‰ๅพ…็š„ๆ—ถ้—ด * @param {boolean} immediate ็ฌฌไธ€ๆฌก่ฐƒ็”จ็š„ๆƒ…ๅ†ต้ฉฌไธŠๆ‰ง่กŒ * @returns {function} ๅŽปๆŠ–ๅŽ็š„ๅ‡ฝๆ•ฐ */ export default function (func, wait, immediate) { let timeout; let result; ...
true
3f71b4352fc4a8cedd0845507b7a64b29c9d7281
JavaScript
374632897/just-some-tips
/src/cross-origin/t.js
UTF-8
343
2.671875
3
[]
no_license
const fs = require('fs') const readFile = (filePath) => { return new Promise((resolve, reject) => { fs.readFile(filePath, (err, data) => { if (err) return reject(err); resolve(data.toString()) }); }); } async function getServer () { const result = await readFile('./server.js'); console.log(r...
true
8f6d8b6cbd20d4219ec085cdc7f61a62e395c48c
JavaScript
nxbin/wee
/static/js/diy/plugins/necklace/06/ZNecklace.js
UTF-8
10,429
2.53125
3
[ "MIT" ]
permissive
function ZNecklace(materialManage, publicKey) { this.zg = new ZGeometry(); this.material = materialManage.material; this.wordMaterial = materialManage.wordMaterial; // ่ฎพ็ฝฎ้“พๅญ็š„ไฝๅญ this.zChain = new ZChain(this.material, publicKey, false); this.zChain.chainLeftMeshes.rotation.set(0, 0, Math.PI / 8)...
true
94f4da4d6af90dd2a5c19b41439753e80f62df60
JavaScript
SethOfCarso/JS-Algorithms
/DataStructure/stack/testStack.js
UTF-8
353
3.078125
3
[]
no_license
import Stack from "./stack.js" let newStack = new Stack(); console.log(newStack); console.log(newStack.isEmpty()); newStack.push(4); newStack.push(8); newStack.push(12); newStack.push(16); console.log(newStack.toArray()); newStack.pop(); console.log(newStack.toArray()); let stringStack = newStack.toStrin...
true
c6a7b2bbf13a53ddcf769438b2a9c4775bf77c4e
JavaScript
marcoC76/ICEL-juegos
/leccion16/js/js.js
UTF-8
1,262
3.75
4
[]
no_license
var canvas; var ctx;//contexto del canvas var FPS = 50; var personaje = function(x,y){ this.x = x; this.y = y; this.derecha = true; //metodos this.dibuja = function(){ ctx.fillstyle = "#ff000"; ctx.fillRect(this.x,this.y, 50,50); } this.mueve = function(velo...
true
bebc6775c0a133e18f75ec5df36ef09a9045ab38
JavaScript
yukjin/expressyourself
/lib/tools.js
UTF-8
295
2.59375
3
[]
no_license
/** * Created by luzhen on 14-12-16. */ var moment =require('moment'); moment.locale('zh-cn'); exports.formatDate = function (date, friendly) { date = moment(date); if (friendly) { return date.fromNow(); } else { return date.format('YYYY-MM-DD HH:mm'); } };
true
6020391f8ee4bb4bb60f3c75a910ec54e0d7c703
JavaScript
rllzrc/algosbb
/leet/30DaysOfCodePt2/maximumSumCircularSubArray.js
UTF-8
2,336
4.1875
4
[]
no_license
// ** Day 15 of 30 Days of Code Challenge Part ii -- May Edition! // ** --> { Maximum Sum Circular Subarray! } // T A S K !! // Given a circular array C of integers represented by A, find the maximum possible sum of a non-empty subarray of C. // Here, a circular array means the end of the array connects to the begi...
true
445a7e66df9d44a76e47a7574a21d3eaa394aee0
JavaScript
e-erdolu/VUIN_CISP
/docs/sketch.js
UTF-8
5,101
3.046875
3
[]
no_license
var mode = "HOME"; // Starting state of entire system var help = false; var beginButtons = 30; //the starting x value for the top row of buttons var endButtons = 450; // the ending x value for the top row of buttons var buttonY = 20; // the y value for top row var buttonStep = 120; // distance between buttons var but...
true
c151156a48c5cf1b3300898cd959a6e012f2b239
JavaScript
baseonmars/JSEdge
/edge.js
UTF-8
6,249
3.015625
3
[]
no_license
/** * @constructor * @param {Image} image Image object */ var Edge = function (image, canvas) { this.canvas = document.getElementById(canvas); this.canvas.width = image.width; this.canvas.height = image.height; this.width = image.width; this.height = image.height; this.context = this.canvas....
true
6770394627486dbf583c1fcc80d94e4122fe0589
JavaScript
lllllinli/webpack-node-babel-example
/src/server/pages/About/About.js
UTF-8
1,658
2.6875
3
[]
no_license
import React, { PropTypes } from "react"; import fetch from "node-fetch" /** * use node fetch **/ // fetch('https://github.com/') // .then(function(res) { // return res.text(); // }).then(function(body) { // console.log(body); // }); // // function getVideoInfo(callback) { // fetch('ht...
true
0f9f7aaa4ab3a6d990658243ce417861aaa70dda
JavaScript
Pahmaton/lessons
/voice/static/voice/voice.js
UTF-8
2,207
2.75
3
[]
no_license
recognizeUrl = "/voice/recognize/" const record = document.getElementById('start'); const stop = document.getElementById('stop'); const container = document.getElementById('messages'); let audio_context; let recorder; function startUserMedia(stream) { audio_context = new AudioContext; let input = audio_contex...
true
8e93ab924adaf593bc72e1729588df9a0fbac870
JavaScript
afryk91/project-euler
/5.js
UTF-8
1,151
2.671875
3
[]
no_license
const lazy = require("lazy.js"); const _ = require("underscore"); const utils = require("./utils"); let withoutNthElement = (array, n) => { return _.first(array, n).concat(_.last(array, array.length - n - 1)); } let crossOutAndMerge = (toMerge, original) => { let remainder = toMerge.reduce((res, s) => { ...
true
c097c322551af4a04201917dee3af43022ccbf42
JavaScript
rxsh96/advent-of-code
/day4/passport-processing.js
UTF-8
2,903
3.359375
3
[]
no_license
const fs = require("fs"); const readDataFromFile = () => { return fs .readFileSync("./input.txt", { encoding: "utf-8" }) .toString() .split("\n\n"); }; const convertArrayToObject = (array) => { const object = {}; for (let i = 0; i < array.length; i++) { const keyValue = array[i].split(":"); ...
true
eeb7f5122cbd3f9b9c55637ece115bf4de228b45
JavaScript
GarrettGraham/TIY-Assignments
/Assignments-Helluva-Ride/String-Calculator/js/main.js
UTF-8
12,080
4.40625
4
[]
no_license
//### String Calculator Kata // //Provide a function called `plus` that accepts two `String` arguments that should always be English number words (e.g. one, two, three) and returns a `Number` representing the sum. Use your new `it()` and `describe()` robots from `mocha`. For example: //javascript //var assert = requ...
true
8dc78b7de703d21a3135f6f1ea4137a2af14e37b
JavaScript
LeonMrBonnie/altv-os-keybinds
/dist/client.js
UTF-8
4,907
2.890625
3
[]
no_license
import * as alt from "alt-client"; const KEYBINDS = {}; class Keybind { constructor(key, hold, debounce, onRelease, onPress) { this._isHeld = false; this._lastDebounce = +new Date(); this._disabled = false; this._id = ++Keybind.currentID; this._key = key; this._hold =...
true
9affbd0bbed1b85f07342d05902f671505eaffa8
JavaScript
Rusle94/Prototype-
/Spรธrreundersรธkelse/script.js
UTF-8
1,268
2.953125
3
[]
no_license
function show() { const disabledOrNot = moodRating === 0 ? 'disabled' : ''; contentDiv.innerHTML = ` <br> <div class="col-md-3"></div> <div class="col-md-6 well"> <div> <h4>${model.ratingMap.questionNumber[questionNextNumber]}:</h4> <div>${model.ratingMap.questions[questionStart]}</div> <br> <...
true
ef30c54b2c3cb4c2f38107082def20d771850e5c
JavaScript
ConnectivityChris/mailosaur-node
/lib/operations/files.js
UTF-8
3,356
2.640625
3
[ "MIT" ]
permissive
'use strict'; const MailosaurError = require('../models/mailosaurError'); /** Class representing Files operations. */ class Files { /** * Create a Files. * @param {MailosaurClient} client Reference to the Mailosaur client. */ constructor(client) { this.client = client; } /** * @summary Downlo...
true
4c334ee76824cfac9da93d10c5b97c93388988ee
JavaScript
Minh-Tam27/BasicJS
/C4EJS-2/index9.js
UTF-8
748
3.53125
4
[]
no_license
let demT = 0; let demD = 0; for(let num=0; num<=6; num++) { if (num >= 3){ demT++; } else { demD++; } } console.log(`a. Sแป‘ lฦฐแปฃng sแป‘ nแปญa trรชn cแปงa 6 lร  ${demT} vร  sแป‘ lฦฐแปฃng sแป‘ nแปญa dฦฐแป›i cแปงa 6 lร  ${demD}`); demD = 0; demT = 0; let n = prompt('Hรฃy nhแบญp sแป‘ n'); for(let nub=0; nub<=n; nub++) { if (nub >= Math...
true
cef036def4b45600ef80e79f436dd2ec3634ae7b
JavaScript
nazhimkalam/Build-A-Clock-With-Data-And-Time-Using-JS
/index.js
UTF-8
827
3.640625
4
[]
no_license
const hourHand = document.getElementById('hour'); const minuteHand = document.getElementById('minute'); const secondHand = document.getElementById('second'); const date = document.getElementById('date'); setClock(); setInterval(setClock, 1000); function setClock() { let currentDate = new Date(); let secondsRatio = c...
true
d6535e4df5bd5705d8b90f72f4e7c24787910636
JavaScript
rodneicouto/coursera-test
/curso1/semana4/demo/snippets.js
UTF-8
1,547
3.890625
4
[]
no_license
console.log(typeof(window)); console.log(this === window); console.log(window.retangulo === retangulo); //====== #09 ========= var comprimento = 10; var largura = 10; function perimetro() { console.log("Perimetro: " + (2 * this.largura + 2 * this.comprimento)); console.log(this === window); } perimetro();...
true
a0c839d5e494a9fe6353a6ac9c1cd97f02f7003a
JavaScript
zearkiatos/nodejs.tictactoe
/backend/server/matching.js
UTF-8
2,082
2.625
3
[]
no_license
const game = require("./gameState"); module.exports = () => { let players = {}, onWait = [], onMatch = {}; const loop = setInterval(checkQueue, 5000); function checkQueue() { //Print Value of the user pool console.info( `Queues: {Players: ${Object.keys(players).length}, OnWait: ${ ...
true
1210da3307700794a247b1b48dee5b9991ba29dc
JavaScript
KongKvistad/makerspace
/public/login.js
UTF-8
2,748
2.84375
3
[]
no_license
let login = document.querySelector("header > div > ul > li > a") let loginForm = document.querySelector("#loginform") let isLoggedIn = false; window.addEventListener("load", e => { let cookie = JSON.parse(localStorage.getItem("student")) //if login cookie exists if (cookie) { let loginDiv =...
true
4d72f581f33b42aa49e0cae0af359aea45e7c84e
JavaScript
PickAppHockey/server
/src/Domain/Player.js
UTF-8
435
2.75
3
[]
no_license
function Player(id){ this.id = id; this.username = null; this.hash = null; this.position = null; this.skillLevel = null; this.gender = null; this.editProfile =(username, hash, position, skillLevel, gender)=>{ this.username = username; this.hash = hash; this.positio...
true
862ac5d6c099db4768448bf77009b109b719da21
JavaScript
lysuse/react-learn
/react-redux-02/src/reducers/index.js
UTF-8
2,426
3.359375
3
[]
no_license
import { combineReducers } from 'redux' import { SELECT_SUBREDDIT, INVALIDATE_SUBREDDIT, REQUEST_POSTS, RECEIVE_POSTS } from '../actions' const selectedSubreddit = (state = 'reactjs', action) => { switch (action.type) { case SELECT_SUBREDDIT: return action.subreddit default: return state } ...
true
4b6467e165f15bddc11a606f60743306ccf77973
JavaScript
harmonicnw/snippets
/js/jquery/parallax/jquery.hmc-parallax.js
UTF-8
1,359
2.765625
3
[]
no_license
(function ( $ ) { /* Harmonic Background Parallax jQuery Plugin Version: 1.0.1 https://github.com/harmonicnw/snippets/tree/master/js/jquery/parallax Options: { scRate : ( optional | integer | default = 0.3 ) identifies the scroll rate for the parallaxed background image, must be an integer between 0 and 1. ...
true
d58a8af6d59e34938a77afc86277258548ee6b61
JavaScript
zazahrah/finalProjectFixed
/homepage.js
UTF-8
1,209
2.84375
3
[]
no_license
function buttonUnlock() { var insertAnswer = document.getElementById("answerToUnlock").value; if(insertAnswer == "The Moon is the only natural satellite of Earth" || insertAnswer == "Galaxy consist billions of stars") { var body = document.body; var changeText = document.getElementBy...
true
7e352f89d7e1412ee3ea57767aff0fdfaf6192d9
JavaScript
MrMicrowaveOven/DrawCircle
/lib/drawCircle/drawFirstEighth.js
UTF-8
658
3.390625
3
[]
no_license
function drawFirstEighth(center, radius){ var PointStorage = [] // diagonalEighth is the x-coordinate of the point an eighth // of the way around the circle. // We add 1 to the calculation because there tends to be a 'hole' // near the point of reflection. var diagonalEighth = radius/Math.sqrt(2) + 1; f...
true
91b8485699a94d8bf1c07a7b4a5da3f257f05312
JavaScript
DmitryMasny/u4u
/source/server/adapters/backgrounds.es6
UTF-8
1,096
2.5625
3
[]
no_license
/** * ะะดะฐะฟั‚ะตั€ ะดะปั ะฟะฐะบะฐ ั„ะพะฝะพะฒ * @param stickerPacks * @returns {*} */ export const backgroundsPackAdapter = ( stickerPacks ) => { const converted = stickerPacks.map( pack => { if ( pack.status === 'enable' ) { return { id: pack.id, name: pack.name, ...
true
1ef261a315007116d225a09ab33709990935990c
JavaScript
ak-front/netology-ra21-homework
/forms/steps/src/components/Steps/Steps.js
UTF-8
1,207
2.53125
3
[]
no_license
import React, { useState } from 'react'; import nanoid from 'nanoid'; import moment from 'moment'; import 'moment/locale/ru'; import StepsForm from './StepsForm'; import StepsTable from './StepsTable'; import './Steps.css'; moment.locale('ru'); function Steps(props) { const [steps, setSteps] = useState([]); con...
true
d70ca399091e57ad753d0f18de47521b70f29613
JavaScript
callmemc/bughaus
/client/src/reducers/game/selectPiece.js
UTF-8
1,761
2.6875
3
[]
no_license
import Immutable from 'seamless-immutable'; import _ from 'lodash'; import chessjs from '../../chess.js'; export function selectPiece(state, action) { const { boardNum, square, color } = action; const position = _.findLast(state.gameHistory, position => position.boardNum === boardNum ); const chess = new ...
true
f06342f729752d02d70a69bb001649d51ea21775
JavaScript
konoha-academy/konoha-academy
/exercises/fundamentals/solutions/testingFramework.js
UTF-8
199
2.53125
3
[]
no_license
function test(title, callback) { try { callback(); console.log(`โœ“ ${title}`); } catch (error) { console.error(`โœ• ${title}`); console.error(error); } } export default test;
true
cf46dd87f26b19966b0a56c851644598d1ddcf7f
JavaScript
CojocaruLiviu/JavaScript-task
/7.8/main.js
UTF-8
463
2.953125
3
[]
no_license
function InsertList() { let z = document.getElementById("Element").value; if (z.length > 0) { let x = document.createElement("OL"); x.setAttribute("id", "myOl"); document.body.appendChild(x); let y = document.createElement("LI"); let t = document.createTextNode(z); ...
true
7f2ea852132263befa2b9b4b04cf44049f29293d
JavaScript
kirastella/debedstepandekager
/dm.js
UTF-8
1,075
3
3
[]
no_license
/*Angiv et classname pรฅ det element du vil have menuen i (husk punktum foran)*/ let dmClass = ".main-menu"; /*Angiv* menu-titel og url*/ let dmPages = [ ["De Bedste Pandekager", "index.html"], ["Amerikanse Pandekager", "index.html"], ["Crepรฉs", "index.html"], ["Om & Kontakt", "om.html"], ]; let dmParent...
true
1fe510a33d15e7c5785a9aea943848b296a37f48
JavaScript
analyze-properties/web-app
/src/views/calculator.js
UTF-8
4,512
2.671875
3
[]
no_license
import React from 'react' const RANGE_PROPS = { purchase: {min: 0, max: 1000000, step: 1000} } class Slider extends React.Component { state = { textValue: this.props.value, numberValue: this.props.value } static defaultProps = {value: '0'} setValue = value => { const string = `${value}` th...
true
c0fc685c5dee31eee54ca1bba0a3dff2347d73c4
JavaScript
STEP-tw/head-sumandeepak8
/test/parseInputTest.js
UTF-8
5,139
2.84375
3
[]
no_license
const { parseInput, parseCount, isOnlyOption, isOnlyCount, isOptionWithCount, hasNoDash, } = require('../src/parseInput.js'); const { deepEqual, deepStrictEqual } = require('assert'); describe('parseInput', function () { it('should return object which contains two keys options and...
true
50db686fa2b8a1dd767012541aef17c0052e97da
JavaScript
jiyoung-dev/js-algorithm
/boj/template/input-interface.js
UTF-8
594
3.796875
4
[]
no_license
// ์ž…๋ ฅ์ด ํ•œ์ค„์ผ๋•Œ // 1. ์ •์ˆ˜ ํ•˜๋‚˜์ธ๊ฒฝ์šฐ let fs = require('fs'); let input = Number(fs.readFileSync('dev/stdin')); // 2. ๊ณต๋ฐฑ์œผ๋กœ ๊ตฌ๋ถ„๋œ ๊ฒฝ์šฐ let input = fs.readFileSync('dev/stdin').toString().split(' '); /* ------------------------------------------------------------- */ // ์ž…๋ ฅ์ด ์—ฌ๋Ÿฌ์ค„์ผ๋•Œ // 1. ์˜ˆ์ œ ๋ฐ์ดํ„ฐ์˜ ๊ฐœ์ˆ˜๊ฐ€ ์ฃผ์–ด์ง„ ๊ฒฝ์šฐ let fs = require('fs');...
true
ff5b067e25b921ee06d3339401df6ca83667a2eb
JavaScript
bdrenaud/Order-App
/welcomeScripts.js
UTF-8
1,447
3.59375
4
[]
no_license
document.getElementById("appList").style.display = "none"; //order //id --interger-- //email --string-- //phone (optional) --string-- //agreeToTerms --boolean-- //list of items --array-- //Total cost --decimal (also called float in c#)-- var order; function submitOrder(event){ ...
true
d4bd13b303053319b7787af9a62b44762e692c4c
JavaScript
rrmesquita/cookbook-api
/src/app/controllers/RecipesController.js
UTF-8
2,221
2.75
3
[]
no_license
const Recipe = require("../models/recipe"); module.exports = { async index(req, res) { await Recipe.findAll() .then(recipes => res.send(recipes)) .catch(err => res.status(500).send(err)); }, async read(req, res) { const { id } = req.params; await Recipe.findByPk(id).then(recipe => ...
true
3e5470233cbbc986a12282d1503343500944e07b
JavaScript
Wangzhzh0723/vue-core
/src/observer/watcher.js
UTF-8
3,895
2.90625
3
[]
no_license
import { pushTarget, popTarget } from "./dep" import nextTick from "../util/nextTick" import { isBoolean } from "../util/utils" let id = 0 export default class Watcher { /** * @param {*} vm vueๅฎžไพ‹ * @param {*} exprOrFn ๆ›ดๆ–ฐๅ‡ฝๆ•ฐ * @param {*} cb ๅ›ž่ฐƒๅ‡ฝๆ•ฐ * @param {*} options ้€‰้กน */ constructor(vm, exprOrFn, cb,...
true
10d0d754c24833e4502fa7b266b5e691f5ac7cd2
JavaScript
SamScholefield/mbacMonitor
/GET_classes.gs
UTF-8
1,700
2.703125
3
[]
no_license
var baseUrl = "https://YOUR_SUB_DOMAIN_HERE.managebac.com/api/classes?auth_token="; var auth_token = "YOUR_PUBLIC_API_KEY_HERE" var classUrl = baseUrl + auth_token; //retrieve all classes function callManagebacClasses(){ var response = UrlFetchApp.fetch(classUrl); return response; } //return all classes as...
true
1aa253b457128a95213b76d3d99b76139d443796
JavaScript
redpeaks33/canvas_test
/createjs_test/JavaScript.js
UTF-8
1,582
2.734375
3
[ "MIT" ]
permissive
๏ปฟ let canvas; let stage; let clock; let bg; let points = []; let images = []; let centerPos = {x:0,y:0} function init() { var stage = new createjs.Stage("demoCanvas"); stage.autoClear = false; var line = new createjs.Shape(); line.graphics .setStrokeStyle(12, "round") // ็ทšๅน…(็ซฏใ‚’่ง’ไธธใซ) .begi...
true
c39e9db82a6dd857c2e34627f8b76c2760ab9e5d
JavaScript
brianwhon/Algorithms
/data structures/queue.js
UTF-8
668
3.765625
4
[ "MIT" ]
permissive
//Contructor function for a new queue object function Queue() { this.storage = {}; this.index = 0; } //adding an element to a queue Queue.prototype.enqueue = function(value) { let keys = Object.keys(this.storage); let indexOfQ = keys.length; this.storage[indexOfQ] = value; this.index++; }; //r...
true
1e8bda243d4ac0c905fb09cb916c5f4a071d9869
JavaScript
dbolesta/donut-boy-promo
/src/js/footerAnim.js
UTF-8
4,842
3.171875
3
[]
no_license
/// This code is responsible for the footer elements sliding up at variable speeds when // the user scrolls to the bottom of the page // we calculate the footer percentage, then control the 'bottom' style of // all of the images and divs in the footer // bless this question: // https://stackoverflow.com/questions/3385...
true
4af38d2a6f377a62643990303e485148b826c9d7
JavaScript
Zarmakuizz/ResponsivePaint
/js/paint.js
UTF-8
5,059
3
3
[ "WTFPL" ]
permissive
var canvas, ctx, paint, size=100; var shape="square"; function init() { // Appelรฉe une fois que la page a รฉtรฉ chargรฉe (que le DOM est accessible) canvas = document.querySelector("#mycanvas"); ctx = canvas.getContext('2d'); drawForm(10, 10); size=document.querySelector('#size').value; // Pour...
true
6f3ea88fc89ff448bb4f282c5c3f911a1446387e
JavaScript
nataliefrancis/project_2
/test/tests_spec.js
UTF-8
985
2.796875
3
[]
no_license
const expect = require('chai').expect; const request = require('request'); // let tripModel = require('./models/trip'); var baseURL = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyA8MjE8GAbJYYoJl77bJckRqYvANrVt1D8&callback=initMap'; describe("API test", function () { request(baseURL, function (error, response, ...
true
9f432125504077c09dc813d45e49957d3aad3830
JavaScript
Constifox/My-Sports
/routes/events.js
UTF-8
3,290
2.71875
3
[]
no_license
const express = require('express'); const Event = require('../models/Event'); const User = require('../models/User'); const eventRouter = express.Router(); eventRouter.post('', async (req, res) => { try { const { host, title, sport, size, date, time, location, about, court } = req.body const user = await Us...
true
ea09a1b3060cc55fcdcea5cbba9bad554cbf2d47
JavaScript
sarah-hillo/city-explorer-api
/server.js
UTF-8
1,858
2.671875
3
[]
no_license
const { request, response } = require('express'); const express = require('express'); const cors = require('cors'); require('dotenv').config(); const app = express(); app.use(cors()); const PORT = process.env.PORT; const axios = require('axios'); // const weatherData = require('./data/weather.json'); const getWeather...
true
4550879cf7b6fe5fcfdc58c76b36f6cc9dbf0f89
JavaScript
Assuralink/Popnrest-server
/js/user_welcoming.js
UTF-8
736
2.828125
3
[]
no_license
$(document).on("ready", function(){ get_user_details(function(response, err){ if(!err){ $(".user_firstname").html(response.user.firstname); } }); }); function get_user_details(callback){ var userId = window.localStorage.getItem('userId'); $.ajax({ ...
true
8c75783b0e971de7d4476ced14d265450b8ca3de
JavaScript
nnhk23/makegotchi-frontend
/src/components/TicTacToeBoard.js
UTF-8
4,770
3.046875
3
[]
no_license
import React from 'react' import Square from './Square' import Button from 'react-bootstrap/Button' class TicTacToeBoard extends React.Component { state={ squares: Array(9).fill(null), userTurn: true, isWinner: false, winner : null } // handle click on each square to decid...
true
8b261bc6a2494a0741f3240bfcd54a7c64c55390
JavaScript
jogracida/cst252
/lab5/js/lab5.js
UTF-8
449
3.484375
3
[]
no_license
// * Author: Jonathan Gracida <jogracida@csumb.edu> // * Created: 15 September // * License: Public Domain // Define Variables make = "Toyota"; model = "Corolla"; color = "Silver"; year = 2009; // calculate age = 2020 - year; // output document.writeln("Make: " + make + "<br>"); document.writeln("Model: " + mod...
true
ce079bc707eae1dc7519273c9104dd5320253d01
JavaScript
oscarmorrison/umbrella
/src/plugins/trigger/trigger.js
UTF-8
593
2.84375
3
[ "MIT" ]
permissive
// Call an event manually on all the nodes u.prototype.trigger = function(events) { var data = this.slice(arguments).slice(1); this.eacharg(events, function(node, event){ // Allow the event to bubble up and to be cancelable (default) var ev, opts = { bubbles: true, cancelable: true, detail: data }; ...
true
0468f51e4e4e4d56b81e16ace0b23405690d17a2
JavaScript
754544602/-
/templet/templet.js
UTF-8
866
2.65625
3
[]
no_license
/** * * ๅˆ›ๅปบๅฝ“ๅ‰ไธšๅŠกๅฏน่ฑก * ๅฝ“ๅ‰็ป™ๅ‡บ็š„ๆ˜ฏ็คบไพ‹๏ผŒ็ ”ๅ‘ไธญๆ นๆฎ่‡ชๅทฑ็š„ไธšๅŠก่ฟ›่กŒๅˆ›ๅปบ * ๅ‘ฝๅ่ง„่Œƒ:้ฉผๅณฐๅ‘ฝๅ๏ผŒ้ฆ–ๅญ—ๆฏๅฐๅ†™๏ผŒๅŽ้ขๅŠ ไธŠObj็ป“ๆŸ */ var loanApplyObj = { /** * * ๅˆๅง‹ๅŒ–ๆ–นๆณ•(ๆ–นๆณ•ๅไธๅฏๅ˜ๆ›ด) * */ init:function(){ /** * * ๆญคๆ–นๆณ•้‡Œๅฏๅ†™ๅฏนๆ•ฐๆฎ็š„ๅˆๅง‹ๅŒ–่Žทๅ–ๆ˜พ็คบ็ญ‰ๆ“ไฝœ * * ๅฆ‚๏ผš * //ๅˆๅง‹ๅŒ–้กต้ขselectๆŽงไปถ * $("select").niceSelect(); * */ }, /** * * ๆ“ไฝœไบ‹ไปถๆ–นๆณ•(ๆ–นๆณ•ๅไธๅฏๅ˜ๆ›ด) * ...
true
dd9bec60c69f507a854375293604299622dff448
JavaScript
kazirumi/Link_Monitoring_RawNodeJS
/lib/worker.js
UTF-8
5,973
2.875
3
[]
no_license
// dependencies const url = require('url'); const http = require('http'); const https = require('https'); const { sendTwilioSms } = require('../helpers/notifications'); const { parseJSON } = require('../helpers/utilities'); const data = require('./data'); // worker object -module scaffolding const worker = {}; // loo...
true
a8d942af1bb7bf8bdef3cdf0063a251bcf6611de
JavaScript
Snehal2605/Technical-Interview-Preparation
/ProblemSolving/450DSA/JavaScript/src/string/CheckIfAStringIsRotationOfOther.js
UTF-8
505
4.21875
4
[]
no_license
/** * @author Anirudh Sharma * * Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? * (eg given s1 = ABCD and s2 = CDAB, returns true, given s1 = ABCD, and s2 = ACBD , returns false) */ const checkIfRotation = (s1, s2) => { return (s1.length === s2.length && (s1 + s1).in...
true
6e262d9f22b29c233edff559e3f8c90aee9c9278
JavaScript
Sunspark/WarJammer
/WarJammer/js/dice_roller.js
UTF-8
7,636
3.796875
4
[]
no_license
/** * interfaces with the random number generator to simulate rolling of dice. * * Object DiceRoller * Public Properties * None * Public Methods * roll(string, boolean) {return array} takes a string in form 'xdy', rolls them and adds them up. Result is element 0 of array, optional additional el...
true