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
3c4df5060e0847044d147466f31ea956e66a3817
JavaScript
NoalTessman/Assignments
/practice/test.js
UTF-8
170
3.5625
4
[]
no_license
var str = "Hello my name is Albert" var albertremover = function(string){ string = string.split(" "); return string.splice(0,4); } console.log(albertremover(str));
true
def6fc7869faa29ef1ce9183a2dd3b3008e58315
JavaScript
Bobaflex-HSV/KonamiCode
/src/index.js
UTF-8
2,836
3.796875
4
[]
no_license
// used keys in code array var possibleKeys = { 37: "left", 38: "up", 39: "right", 40: "down", 74: "j", 69: "e", 78: "n", 83: "s" }; function screenManipulation() { document.body.style.background = "black"; } function showGhost() { var ghostElement = document.getElementById("ghost"); ghostElemen...
true
b62561e4f9539d3730111e1b07ff2fcce45ebc88
JavaScript
xmbz/react-demo
/src/redux/assistant.js
UTF-8
2,410
2.71875
3
[]
no_license
import {bindActionCreators} from 'redux' import {carActions} from './modules/car' // 购物车 import {dicActions} from './modules/dic' const actionMethods = { carActions, dicActions } /*********单个引入state,action*********/ export function carState(state) { return state.car } export function carAction(dispatch) { ...
true
7b628250673c92dcfb3d7c42e5fc53e5b36d124b
JavaScript
victorvhpg/juntarObj
/juntarObj.js
UTF-8
2,356
3.015625
3
[]
no_license
/** * @victorvhpg 19/02/2014 * https://github.com/victorvhpg/juntarObj * juntarObj: faz merge recursivo de vários objetos, inclusive com referencia circular * */ (function(global) { "use strict"; var juntarObj = (function() { var _copiaRecursiva = function(copiaCadeiaPrototype, origem, destino, c...
true
804001f1927874a1348dd4f9a984af408b8d6c4e
JavaScript
adamkost79/TrainHomework
/app2.js
UTF-8
2,886
3.234375
3
[]
no_license
// Initialize Firebase var config = { apiKey: "AIzaSyBZ0ALcTbskcYb3aFdOyFRjJ44vfal-MsE", authDomain: "train-scheduler-173d4.firebaseapp.com", databaseURL: "https://train-scheduler-173d4.firebaseio.com", projectId: "train-scheduler-173d4", storageBucket: "train-scheduler-173d4.appspot.com", messagingSender...
true
938c1f224082192eb27b8a188e2b4d3dd846c7b8
JavaScript
cgarcia0924/Desarrollo-Web
/4. JavaScript/3. Selectores DOM y HTMl/4. Eventos/3. Otro tipo de eventos/js/eventos.js
UTF-8
1,507
2.765625
3
[ "MIT" ]
permissive
function cambiarRadioButtons() { var estadoRB = document.getElementById('activar_rb').checked; if (estadoRB) { var estado = "true" document.getElementById('animales').disabled = false; document.getElementById('postres').disabled = false; document.getElementById('musica').disabled...
true
ba76ee512b7b2d0bccc7710a0102fb75e9b548f5
JavaScript
Dnguye92/sc-download-script
/src/get-track-urls.js
UTF-8
1,392
2.59375
3
[]
no_license
const { disableAssets } = require('./disable-assets'); const extractUrls = () => { const trackItems = document.querySelectorAll('.trackItem__content .trackItem__trackTitle'); const trackUrls = []; for (let track of trackItems) { trackUrls.push(track.href); } return trackUrls; }; const getTrackUrls = as...
true
740155305044b41fc2965afdd30d82f95c6f7ca7
JavaScript
MFTECH-code/Estudos-Desenvolvimento-web
/ESnext/set.js
UTF-8
735
3.359375
3
[]
no_license
const { time } = require("console") const { Z_NO_COMPRESSION } = require("zlib") // Estrutura não indexada e não aceita repetição const times = new Set() // Podemos adicionar com o método add times.add('Vasco') // Podemos encadear chamadas times.add('São Paulo').add('Palmeiras').add('Flamengo') times.add('Vasco') con...
true
1416fcada3118948ca3c6a6b1d269f6c2bd5d2bc
JavaScript
frosh-li/cleancss
/src/ast.js
UTF-8
3,448
2.515625
3
[]
no_license
import { pseudoElements } from "./config"; import { isRegExp, countLine, debug } from "./utils"; import colors from "colors/safe"; function isExcludes(oSelector) { const { excludes } = require(`${process.cwd()}/cleancss.config.js`); return excludes.some((ex) => { if (typeof ex === "string") { return oSe...
true
d69197b817dc2528b93c89de4b34b57470ed88d7
JavaScript
OggiDanailov/Chris-in-class
/Morning_Challenges/Ruby_Fibonacci.js
UTF-8
394
3.578125
4
[]
no_license
def fibonacci num first_num = 0 second_num = 1 returning_array = [0, 1] (1..num).each do c = first_num + second_num first_num = second_num second_num = c returning_array.push(c) end p returning_array end fibonacci(10) def fibonacci(num) array=[0,1]; (...
true
05fe9e06e29c6697683ab0b868b6297ee6e3a9f4
JavaScript
rafaelcastrocouto/PathFinding.js
/visual/js/view.js
UTF-8
10,302
2.625
3
[ "MIT" ]
permissive
/** * The pathfinding visualization. * It uses raphael.js to show the grids. */ var View = { nodeSize: 16, // width and height of a single node, in pixel nodeStyle: { normal: { fill: 'white', 'stroke-opacity': 0.2, // the border }, blocked: { fill: ...
true
9ba3d9fc59c649a05e12cb580187113a55564bf8
JavaScript
b-natalie/natalie-b-website
/script.js
UTF-8
315
2.84375
3
[]
no_license
const inputSubmit = document.getElementById('submit'); inputSubmit.addEventListener('click', function() { alert('Success! I\'ll reach out within 2 days :)'); }); /* const h2 = document.createElement('h2'); h2.textContent = "This content added by JavaScript"; document.querySelector('body').appendChild(h2); */
true
cbe2522178b7daebbc4226a287ef2543380ab275
JavaScript
zdj666666/sms
/src/main/webapp/js/add.js
GB18030
2,717
3.734375
4
[]
no_license
//Уѧ function isStuNumber(){ var Stunumber = document.getElementById("Stunumber"); var StunumberMsg = document.getElementById("StunumberMsg"); var Stunumberreg =/^1[0-9]{7}$/; if(Stunumber.value==""){ StunumberMsg.innerText="ѧŲΪ!"; StunumberMsg.style.color="red"; } else if(Stunum...
true
aebcfa4eb6a2457bca32279023923d724b4e2b88
JavaScript
StonePSU/techcards
/models/card.js
UTF-8
2,836
2.71875
3
[ "MIT" ]
permissive
const mongoose = require('mongoose'); const Schema = mongoose.Schema; const Deck = require('./deck'); const CardSchema = new Schema({ question: { type: String, required: true }, answer: { type: String, required: true }, ownerId: { type: Schema.Types.ObjectId,...
true
03047a96d6c848666f91e4dbbe829cb395a55d49
JavaScript
NiklasEckert/CROSS_Vocabulary_Trainer
/www/js/stats.js
UTF-8
2,058
3.296875
3
[]
no_license
function drawStats(stats) { const correctlySpan = document.getElementById("correctly") const attemptsSpan = document.getElementById("attempts") let sumCor = 0 let sumAtt = 0 stats.games.forEach(game => { sumCor += game.correct sumAtt += game.attempts }) correctlySpan.innerT...
true
59ad2ca04d8f68a9b2ff9440da242ad57ec34d7e
JavaScript
yurian-v/nodewpg
/JS/script53.js
UTF-8
359
4.15625
4
[]
no_license
const number = 11; if (number == 10) { console.log("number(10) is an even number(10)"); } else { console.log("number 9 is an odd number"); } //Create a new index53.js file //Copy and paste the code from exercise 50 //Refactor the code so it match the new requirements: //If number is not even then show the follo...
true
5adba711ce24c5dba992f3a3202db9030c858d05
JavaScript
lloja/wM-UseCases-Package
/pub/scripts/webMethods.js
UTF-8
6,817
2.53125
3
[]
no_license
var row = "even"; var other = "odd"; var swap = ""; var path1 = ""; var menu1 = ""; var path1_class = ""; var normal = 1; var error = 2; var serverkey = 4; function w(text) { document.write(text); } function pathInit(css_class) { path1 = ""; path1_class = css_class; } function ...
true
7a953fbecefa6605707a0a2184dbf0d3a074019b
JavaScript
PauloLuan/pagarme-node
/utils/utils.js
UTF-8
3,419
2.671875
3
[]
no_license
'use strict'; var ursa = require('ursa'); var request = require('request'); var keys = require('./keys.json'); var utils = { api_url: 'https://api.pagar.me/1/transactions/', /* TODO: armazenar os dados da chave pública, pois aparentemente é o mesmo a cada requisição. */ ...
true
a5a6e81e2a79d1cc4c0bc4f0ad3f3bb61b4b3179
JavaScript
imiw-vn/entity-api
/src/field/field_types/text.js
UTF-8
798
2.578125
3
[ "MIT" ]
permissive
import FieldType from './field-type' /** * Text field type */ class TextFieldType extends FieldType { /** * Construct field * * @param params */ constructor(variables = {}) { if (!variables.hasOwnProperty('fieldTypeId')) { variables['fieldTypeId'] = 'text' } super(variables) } /** ...
true
7899b184141ce622eb16921ff1c48b65c925df3f
JavaScript
dennsva/Fullstack-2019-osa3
/puhelinluettelo-frontend/src/components/Persons.js
UTF-8
942
2.640625
3
[]
no_license
import React from 'react' import personService from '../services/persons' const Persons = ({persons, setPersons, filter, notify}) => { const toShow = persons.filter(person => person.name.toLowerCase().indexOf(filter.toLowerCase()) >= 0) console.log(`Found ${toShow.length} persons matching filter ${filter}`) retu...
true
0a8261cb1439f7f98fae0bb8c70a6de8e495dfdf
JavaScript
saxman6989/materializeModal
/materializeModal.js
UTF-8
4,949
2.703125
3
[]
no_license
(function(window){ function materializeModal(){ var _exports = {}; var _structure = '<div class="modal">' + '<div class="modal-content"></div>' + '<div class="modal-footer"></div>' + '<div>'; function getUniqueID(){ var id = new String; var field = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijk...
true
4f95a24d1dabe1fc03a7b4b902773c31060eff7a
JavaScript
xu405049495/GitlabForChinese
/spec/javascripts/environments/environments_store_spec.js.es6
UTF-8
2,839
2.5625
3
[ "MIT" ]
permissive
//= require vue //= require environments/stores/environments_store //= require ./mock_data /* globals environmentsList */ (() => { beforeEach(() => { gl.environmentsList.EnvironmentsStore.create(); }); describe('Store', () => { it('should start with a blank state', () => { expect(gl.environmentsLis...
true
9ac18dcf79225d10113de12ae7b41e942b12b623
JavaScript
Luchettinni/UTN-FRA-Curso-de-ingreso
/5-InstruccionWhile/jsIteraciones (10).js
UTF-8
1,547
3.21875
3
[ "MIT" ]
permissive
function mostrar() { var numero; var numeroNegativo; var numeroPositivo var contador; var contadorNegativos; var contadorPositivos; var contadorDeCeros; var contadorDeNumerosPar; var respuesta; // -------------------------- numero = 0; numeroPositivo = 0; numeroNegativo = 0; contador = 0; contadorPositiv...
true
6fd467b7c5f20d7631357f269bca78528cb2ed82
JavaScript
OsamaKhan220/reactivex-todo-client-nosql-api
/src/modules/todos/reducer.js
UTF-8
1,823
2.515625
3
[]
no_license
import { TODOS_FETCH_REQUEST, TODOS_FETCH_SUCCESS, TODOS_ADD_REQUEST, TODOS_ADD_SUCCESS, TODOS_REMOVE_REQUEST, TODOS_REMOVE_SUCCESS, TODOS_COMPLETE_REQUEST, TODOS_COMPLETE_SUCCESS, TODOS_EDIT_REQUEST, TODOS_EDIT_SUCCESS, } from './actions'; const initialState = { pending: false, error: null, ...
true
a2a9f28fc70beb8b884f36e1e6b80f451287f72a
JavaScript
wassim-saadallah/p5-projects
/gravity/particle.js
UTF-8
620
3.140625
3
[]
no_license
class Particle { constructor(x, y) { this.pos = createVector(x, y) this.vel = createVector(0, 0); this.acc = createVector(0, 0); this.r = 10; } show() { stroke(255,25,150); strokeWeight(this.r); point(this.pos.x, this.pos.y); } update() { ...
true
39d42bb2cdc69be9016b9a0af86498df26dbfd86
JavaScript
zhaopufeng/koa-session-minimal
/test/store.test.js
UTF-8
3,529
2.828125
3
[ "MIT" ]
permissive
/* eslint max-classes-per-file: ["error", 2] */ const { expect } = require('chai') const MemoryStore = require('../src/memory_store') const Store = require('../src/store') class GeneratorStore { constructor() { this.store = new MemoryStore() } * get(sid) { return yield Promise.resolve(this.store.get(si...
true
9c9f2ef32d6bb162f7d4f1bfd5f776d158e094af
JavaScript
kevinbrail/React_WhatToWear
/src/playground/ES6LetConst.js
UTF-8
210
3.21875
3
[]
no_license
var nameVar = 'Kevin'; nameVar = 'Steve'; console.log('nameVar', nameVar); let nameLet = 'Jen'; nameLet = 'Val'; console.log('namelet', nameLet); const nameConst = 'Frank'; console.log('nameConst', nameConst)
true
50ea2c9a326142cf42af1f53ced6d4ff6bef2ac9
JavaScript
sivareddysp/nagangular
/Mini-bytes/byte4.js
UTF-8
1,029
3.75
4
[]
no_license
/* Async Programming Api ---------------------- 1- Promise Api ( fromES6 ) 2. Reactive eXtensions in Javascript ( RxJs) */ //------------------------------------------------------------- // producer //------------------------------------------------------------- const trainer = { // getTopic() { /...
true
0c6032b37081c93c4b637e8d7eaff5114103acdf
JavaScript
lissagoforth/personal-nutshell
/scripts/event/createNewEvent.js
UTF-8
1,661
2.96875
3
[]
no_license
//author Ray Purpose: this module will create a new event and push it into the database const nutshell = require("../nutShellDB") const idGenerator = require("../idGenerator") let lastid = 0 // Create a new task object with taskName and completion date const createNewEvent = function (eventName, eventDate, eventLoc...
true
f59cbd2bc20b7268118467aeb0d806f4497324b8
JavaScript
hwang106/TamogotchiProject
/script.js
UTF-8
4,667
3.3125
3
[]
no_license
// console.log("this script is running"); let reproduceButton = document.querySelector("#reproduce"); let destroyButton = document.querySelector("#hunger"); let populationDisplay = document.querySelector("#popNumber"); let reebopOne = document.querySelector("#reebopDad"); let reebopTwo = document.querySelector("#reeb...
true
b6d3a37afd6e723a8f562e93e02d5e0d0862ecd0
JavaScript
srogersact/srogersact.github.io
/tutorials/present_participle_gerund/composition_js/composition_problem01.js
UTF-8
3,163
3.40625
3
[ "MIT" ]
permissive
// PRESENT PARTICIPLE AND GERUND // This has been modified by setting var i to 1. var $ = function(id) { return document.getElementById(id); }; var problem = [ { analyzedSentence: 'Blank. Blank.', composedSentence: 'Blank and blank.', }, { analyzedSentence: 'The Bronze Age gave way to the Iron Age. The Bronze A...
true
e1f394a4b18c32a876abbd67d0cdef5fc7eb2f3b
JavaScript
soarescbm/e-cidade
/e-cidade/scripts/classes/educacao/escola/ListaEscola.classe.js
ISO-8859-1
4,734
2.8125
3
[]
no_license
require_once("scripts/arrays.js"); require_once("scripts/classes/educacao/DBViewFormularioEducacao.classe.js"); /** * Monta um select com uma lista de escolas * @dependency Utiliza DBViewFormularioEducacao.classe.js * @autor Andrio Costa <andrio.costa@dbseller.com.br> * @autor Trucolo <trucolo@dbseller.com.br> * ...
true
6001e4957ad75d5f812df173f2c40d713710dc15
JavaScript
kunxin-chor/tgc7-react
/hands-on-sandbox/src/NumberArray.js
UTF-8
1,100
2.890625
3
[]
no_license
import React from "react"; export default class NumberArray extends React.Component { state = { numbers: [1, 3, 7, 9, 11], newNumber: 0 }; render() { return ( <React.Fragment> <ul style={{ display: "flex" }}> {this.state.numbers.map( (n, index) => ( <li ...
true
508073aa34ceadc0d89a08f53d281c876a71e036
JavaScript
vesperfi/lib-js
/src/promise-loop.js
UTF-8
671
3.4375
3
[ "MIT" ]
permissive
'use strict' /** * Repeately calls the iterator function until an error is found. * * The iterator function is called with the iteration number as a single * parameter, starting with 0. To stop the loop, the function must either throw * or return a rejected promise. The result is an array with the results of all ...
true
e5567c7f41fd4172df00b235072b5167d91d172d
JavaScript
sammydeni/mycode
/js_code/10-js-timing/01-the-timed-calculator/script/the-timed-calculator.js
UTF-8
1,072
4.375
4
[]
no_license
/** * @file: the-timed-calculator.js * @author: Samuele * Print the result with a delay of 3 seconds. */ function squareNumber(num) { var squaredNumber = num * num; console.log('The result of squaring the number ' + num + ' is ' + squaredNumber); return squaredNumber; } squareNumber(3); function half...
true
8030ede5e291c08f18343d78b4d70a01ef7de423
JavaScript
agams92/Onpoint-test
/src/js/Footer/FooterContainer.js
UTF-8
6,498
2.828125
3
[]
no_license
import React from 'react'; import Footer from './Footer'; import SlidePoint from './SlidePoint'; class FooterContainer extends React.Component { constructor(props) { super(props); this.goToSlide = this.goToSlide.bind(this); this.state = { currentSlideIndex: 0, transl...
true
02a7afe8fe528a1baeb9e1d1f15f2f5049ecbe8f
JavaScript
DIEG0FERNANDES/CPW2_2019
/Lembrete/src/js/index.js
UTF-8
299
2.75
3
[]
no_license
function exibirAnotacoes() { let lembrete = document.getElementById('lembrete').value; let resposta = document.getElementById('meusLembretes'); let paragrafo = document.createElement('p'); paragrafo.innerText = lembrete; resposta.appendChild(paragrafo); }
true
6b5de0532731535c6e28277a0875e633a58dcf6d
JavaScript
oncomouse/design-brief-server
/index.js
UTF-8
1,342
2.84375
3
[]
no_license
const express = require('express'); const cors = require('cors'); const app = express(); const adjectives = require('./data/adjectives.json'); const audiences = require('./data/audience.json'); const businesses = require('./data/businesses.json'); const cities = require('./data/cities.json'); const makeRandom = (item...
true
a0afc095a1e77c96bc5107ddcee7dea49a272c06
JavaScript
IvanSamudio/interfaces
/practico5/404/js/js.js
UTF-8
5,423
2.78125
3
[]
no_license
let trump = document.getElementById('trump_r'); let edificios = document.getElementById('edificios'); let cielo = document.getElementById('cielo'); let suelo = document.getElementById('suelo'); let moneda = document.getElementById('moneda'); let obst_container = document.getElementById('obstaculo-container...
true
6302c4de0e88bf12301a4a9598cabb5d2e1b80d6
JavaScript
MikeAlexMartinez/subootio-db
/test/scripts/utils/get-tables.spec.js
UTF-8
4,308
2.515625
3
[ "MIT" ]
permissive
// Testing const expect = require('chai').expect; const rewire = require('rewire'); const dedent = require('dedent'); const { DbConnectionMock, defineQueryReturnData } = require('../../__mocks__/pool-mock'); const preMappedMockTables = [ {table_name: 'table_one'}, {table_name: 'table_two'}, {table_name: 'table...
true
085167f67e69306ae3bec7193f8429d29ccab882
JavaScript
Semergal/sf_js_9
/task4/script.js
UTF-8
331
2.8125
3
[]
no_license
let replaceText = document.querySelector('#text'); replaceText.addEventListener('click', function () { document.querySelector('#text').textContent = prompt('Текст изменится на тот, что ты введёшь'); }) replaceText.addEventListener('click', function () { text.preventDefault(); })
true
577165d10a2eab9c8192df0365b9429a0b02cfa6
JavaScript
AntoineS92/cohort-124
/module-3/week-1/day-4/advanced-routing/src/Pages/PokemonDetail.jsx
UTF-8
810
2.84375
3
[]
no_license
import React from "react"; import pokemons from "../pokemon.json"; const PokemonDetail = (props) => { console.log(props.match.params.id); /** * For now we consider that our data comes from a Database * So we just import the pokemons.json file in order * to find the Pokemon that has the same id as the one...
true
612e1c797c09fa196163acef542be84a91186411
JavaScript
manwar16/advanced-javascript
/true-false.js
UTF-8
202
3.921875
4
[]
no_license
//Falsy: //false // 0 //NaN //"" //null //undefined //Truly: //" ", "0",[ ] //true const age = 4; if (age>0) { console.log("Condition is true") } else{ console.log("Condition is False") }
true
95b2a3c9018d564a4263352a878a45bcd74a4d1f
JavaScript
pedrocleto/clipify
/app/components/LinkBox.jsx
UTF-8
5,222
2.5625
3
[]
no_license
'use strict'; var React = require('react/addons'); var fire = require('../db/firebase'); var LinkBox = React.createClass({ getInitialState: function(){ return { text:"", name:'', linkID:'', link:"", pos: this.props.initialPos, dragging: false, rel: null, // position ...
true
0826864b13606cff747a893b9fadf89e73863402
JavaScript
DimitarKum/AntColony
/view/frameRefresher.js
UTF-8
1,408
3.015625
3
[]
no_license
"use strict"; // Global namespace AntColony var AntColony = AntColony || {}; AntColony.FrameRefresher = function(params){ AntColony.validateParams(params, "frameCount", "framesPerSecond"); if(params.frameCount === 1 || params.framesPerSecond === 0){ this.advanceFrame = function(){}; this.getFr...
true
3b4782a68c3478691dd309160062d4e5eef60375
JavaScript
krzysztofdymicki/Full-Stack-Open-2021
/part5/bloglist-frontend/src/components/BlogForm.js
UTF-8
1,173
2.515625
3
[]
no_license
import React, { useState } from 'react' import blogService from '../services/blogs' const BlogForm = ({ blogs, setBlogs, setNotification, blogFormTogglableRef }) => { const [blog, setBlog] = useState({ title: '', author: '', url: '' }) const handleBlogForm = async (event) => { event.preventDefa...
true
5570b5e438974b8780372260f3d9d77d22e95426
JavaScript
kcak11/CodeceptJS
/test/unit/recorder_test.js
UTF-8
2,752
2.59375
3
[ "MIT" ]
permissive
const { expect } = require('chai'); const recorder = require('../../lib/recorder'); describe('Recorder', () => { beforeEach(() => recorder.start()); it('should create a promise', () => { expect(recorder.promise()).to.be.instanceof(Promise); }); it('should execute error handler on error', (done) => { ...
true
4c67a830857b2cad1d060b2d68c1550eabbe0d4f
JavaScript
dzakki/es6.Javascript
/src/Class.js
UTF-8
439
4
4
[]
no_license
// 1 // Class Members { // constructor(name, umur){ // this.name = name // this.umur = umur // } // } // let Member = new Members('ahmad', 40) // console.log(Member()) // 2 class Students { constructor(){ this.name = "ahmad" } getName(age){ return `${this.name} umurnya ${age}` } static getData(){ con...
true
9de0fc840672991bf133e952b06eab051223bafc
JavaScript
wuyong1992/MyWeb02
/web/Demo01JS.js
UTF-8
2,183
2.890625
3
[]
no_license
/** * Created by wuyong on 2016/12/18. */ window.onload = function () { /*获取登陆按钮*/ var loginBtn = document.getElementById("loginBtn"); loginBtn.onclick = function () { /*获取页面的高宽*/ var sH = document.documentElement.scrollHeight; var sW = document.documentElement.scrollWidth; ...
true
c702eea4a208133ce70e8f71a5e5bdfe837066f3
JavaScript
CPUhobbes/codingChallenge-Survey
/app/components/Main/Admin_Child/Results.js
UTF-8
2,020
2.84375
3
[]
no_license
//Import Packages import React, { Component } from 'react'; import { Row, Col, Grid, Jumbotron} from 'react-bootstrap'; import Utils from '../../Utils/utils'; class Results extends Component{ constructor(props) { super(props); this.state = { results:{} }; } componentWillMount(){ Utils.getResults()....
true
5b1ba5572087185fde97760760269acc5c836426
JavaScript
dudeee/dude-teamline
/src/functions/parse-date.js
UTF-8
1,737
2.796875
3
[ "MIT" ]
permissive
import 'sugar'; import moment from 'moment'; import _ from 'lodash'; const SEPARATORS = /\b(?:to|-|until|till|for)\b/i; const KEYWORDS = /\b(?:from|since|at)\b/gi; const SYMBOLS = /\.|,|'|"/gi; export default (bot, string, base = moment(), separators = SEPARATORS) => { // eslint-disable-line moment.updateLocale('en...
true
c00ec322ae35d5f7e0c0d750cca79ff6967ec1ad
JavaScript
AleAlvanez/repoConMongo
/public/JS/budgets.js
UTF-8
3,996
2.765625
3
[]
no_license
function easyTabs() { var groups = document.querySelectorAll('.t-container'); //if t-container if (groups.length > 0) { for(i = 0; i < groups.length; i++){ //tabs var tabs = groups[i].querySelectorAll('.t-tab'); for(t = 0; t < tabs.length; t++){ ...
true
c3cb99958aac8baf459ee9bbfe01b0ef6c3e6777
JavaScript
Barretem/create-react-hybird-app
/src/app/todo/store/TaskStore.js
UTF-8
1,222
2.828125
3
[]
no_license
/** * todoList 事件列表 * @author barret007 * @data 2018/03/24 */ import { action, observable, computed } from 'mobx'; class TaskStore { @observable todoList = [ { taskName: '吃饭', done: false, }, { taskName: '睡觉', done: false, }, ...
true
acd5b790e5417704495b0ac8054cdbe4f074540d
JavaScript
thunderchad/codewithchad
/src/script.js
UTF-8
6,037
3.078125
3
[]
no_license
$(document )// doesn't even work lmao .one('focus.autoExpand', 'textarea.expand-like-chads-cock', function(){ var savedValue = this.value; this.value = ''; this.baseScrollHeight = this.scrollHeight; this.value = savedValue; }) .on('input.autoExpand', 'textarea.expand-like-ch...
true
ec363b9eaceeb77002723f969548b49d3678ab76
JavaScript
diponkorcs/Computer-Shop-Web-Application
/DataBaseLayer/input/desktop_input.js
UTF-8
913
2.796875
3
[]
no_license
function typelist() { var brandlist = document.getElementById('brand').value; if(brandlist == "Intel"){ const brand_types = ["Duel Core", "Pentium Gold", "Core i3", "Core i5", "Core i7", "Core i9" ]; var type = '<option disabled selected>Select Type</option>'; for (var i = 0; i < brand_types.length; i...
true
ce8df93e32197ee7acb6a792dd0d09b35d672a2b
JavaScript
hcuffy/choropleth-map
/public/main.js
UTF-8
3,467
2.84375
3
[ "MIT" ]
permissive
const width = 1000 const height = 900 let path = d3.geoPath() let degree = d3.map() const colorDomain = [ 5,10,20,30,40,50,60,70,80,90 ] const colorRange = [ '#e6ffe6', '#ccffcc', '#b3ffb3', '#80ff80', '#4dff4d', '#33ff33', '#00e600', '#00cc00', '#00b300', '#008000' ] let colorScale = d3.scaleThreshold(...
true
720a32bbc074a03f39a844f50271fe2277cfe6f4
JavaScript
peteco83/programming-basics-federico
/arithmetic/index.js
UTF-8
1,734
3.90625
4
[]
no_license
//1 const x = 17; const z = 30; console.log(`${x/z*100}%`); //2 const workingHours = 8+6+5+9+8+2+1+8.5+7+4; const numberOfDays = 10; const averageHours = (workingHours / numberOfDays); console.log(`Noemy's average hours are: ${averageHours}`); //3 /*let firstPart = 85 * 6; let secondPart = 75+70+85+90+100; consol...
true
f7821b5c2da7802e66cf1f69ffea53a61ea76f0d
JavaScript
chenyu-max/Greedy-Snake-Pro
/src/js/SquareFactory.js
UTF-8
2,006
3.140625
3
[]
no_license
function SquareFactory() { } SquareFactory.create = function (type, x, y, className) { if (typeof SquareFactory.prototype[type] == 'undefined') { throw new Error('no this type'); } if (SquareFactory.prototype[type].prototype.__proto__ !== SquareFactory.prototype) { SquareFactory.prototype[...
true
3ade60518cff86844c9a260a9ea4a43deb51c56e
JavaScript
junhong1923/STYLiSH
/utils/midterm.js
UTF-8
7,181
2.578125
3
[]
no_license
require("dotenv").config(); const { pool } = require("../mysqlcon"); const fetch = require("node-fetch"); function getApiOrderData (api) { return new Promise((resolve, reject) => { fetch(api) .then(function (response) { return response.json(); }) .then(function (data) { resolve(...
true
8bc819ae9f342079c84cf3e6a000e72f001191f0
JavaScript
CodeCloudMe/node-recommend
/lib/recommend.js
UTF-8
5,231
3.0625
3
[ "MIT" ]
permissive
var async = require('async'); var similarity = require('./similarity'); var util = require('./util'); var Recommend = function(dataSet, options) { this.dataSet = dataSet; // TODO: validate dataSet. this.options = { topMatchesCount: 5, recommendationsCount: 5, recommendedItemsCount: 5, getSimilarity: sim...
true
4a33394224b396c172bb89334352b12441462d3c
JavaScript
deme7trius/battleships
/bs.js
UTF-8
6,556
3.640625
4
[]
no_license
/* GLOBAL TOOLS */ //Global variables and arrays let ground = document.getElementsByClassName('ground')[0]; let letterCol = document.getElementsByClassName('letters')[0]; let numberRow = document.getElementsByClassName('numbers')[0]; let input = document.getElementById('addCoords'); const xArr = []; let totalHits ...
true
ad0b83b153099ac589a6023e4b73557a7101fc71
JavaScript
lhw1995/MyWeb
/Restaurant/web/js/upLoadPreView.js
UTF-8
1,521
2.546875
3
[ "MIT" ]
permissive
function checkSubmit() { var registerFlag = [false, false, false]; var reg = /^[a-zA-Z0-9\u4e00-\u9fa5]{4,10}$/g; if (reg.test($("input[name='showName']").val())) { registerFlag[0] = true; } else { registerFlag[0] = false; } var reg2 = /^[0-9]{11}$/g; if (reg2.test($("input[n...
true
fbe9d03ae7305cc843ab462e30d50cdde2c18c79
JavaScript
korysergey55/todo-app-milestep
/src/redax/auth/authOperations.js
UTF-8
819
2.53125
3
[]
no_license
import { registrationUserApi, loginUserApi } from "../../services/authApi"; import { registerUserAction, registerUserActionError, loginUserAction, loginUserActionError, } from "./authActions"; export const registrationUserOperation = (InputFormState, history) => async (dispatch) => { try { const response = a...
true
9b0a6b3ce4872ae613394fe92b7a24fe5e943706
JavaScript
jchen8787/inting
/filterSupersets/filterSupersets.js
UTF-8
1,157
3.453125
3
[]
no_license
const filterSupersets = tuples => { let supersets = [] tuples.forEach(tuple => { if (supersets.length === 0) { supersets.push(tuple) return } for (let i = 0; i < supersets.length; i++) { const trueSuperset = findSuperset(tuple, supersets[i]) ...
true
673194d519f3737d8a302416095fca3f31496ee9
JavaScript
szg2008/mynote
/js/scope.js
UTF-8
1,798
3.96875
4
[]
no_license
/** 作用域 **/ var scope1 = 'a'; function fun1(){ console.log(scope1); var scope1 = 'b'; } fun1();//undefined 变量声明提升 var scope2 = 'c'; function fun2(){ console.log(scope2); } var scope2; fun2();//c 如果同一个变量声明两次,一个赋值,一个没有初始化,那么变量的值为初始化的值 function fun3(){ console.log(scope3); scope3 = 'd'; } var scope3; fun3();//un...
true
f80e2171fed7ab6940d14ea138b7098ffd4791ea
JavaScript
smbape/node-rfs-sync
/lib/pretty-time.js
UTF-8
2,029
2.984375
3
[ "MIT" ]
permissive
/*! * pretty-time <https://github.com/jonschlinkert/pretty-time> * * Copyright (c) 2015-2018, present, Jon Schlinkert. * Released under the MIT License. */ const utils = {}; utils.nano = time => +time[0] * 1e9 + +time[1]; // eslint-disable-line no-magic-numbers utils.scale = { w: 6048e11, d: 864e11, ...
true
4d76f57be0c6a5a7409c43f195a4c665aff7b7d8
JavaScript
LuFei-tc/permissionSys
/src/main/resources/static/js/send.js
UTF-8
18,016
2.53125
3
[ "MIT" ]
permissive
/** * ajax */ //---------------------------common------------------------------ //获取数据 function getData(url,currentPage){ config = { type:"get", url:url, data:{"currentPage":currentPage}, success:function(data){ $("#content").html(data); }, error:function(xhr){ if(xhr.status == 401){ alert("暂无...
true
0a440c4e49e9d65b08a4df3447c54ad0b3d71636
JavaScript
Livefyre/livefyre-package-attribute
/tools/prefix-css-requirejs.js
UTF-8
1,003
2.765625
3
[ "MIT" ]
permissive
var packageJson = require('json!package.json'); var prefix = require('./prefix-css'); module.exports = prefix.bind({}, packageJson, prefixCss); function prefixCss(prefix, cssText) { var match, results = [], cssPattern = new RegExp("([^\\s][\\s\\S]*?)(\\{[\\s\\S]*?\\})", "g"), selectors, prefixedSe...
true
418336a21648917b19f2c0aea31d47d4f8f9edf1
JavaScript
edegiil/deal-19
/client/public/utils/parsePrice.js
UTF-8
159
2.609375
3
[ "MIT" ]
permissive
function parsePrice (price) { if (typeof price !== 'number') { price = Number(price); } return price.toLocaleString(); } export default parsePrice;
true
fae4165cf3956915a047b9d3503b51da768164cc
JavaScript
vladimirbuskin/shapes
/src/figures/parallelogram.test.js
UTF-8
1,181
2.515625
3
[]
no_license
import {expect} from 'chai' import Parallelogram from './parallelogram' import EPoint from './epoint' import Point from '../structs/point' import LayerEvent from '../events/figureEvent' import { getParallelogramArea } from './parallelogram' import { pointsToPolygonStr } from './polygon' describe('Parallelogram.test', ...
true
bf8932184891be5e44073062d3874c0488ece6bc
JavaScript
sznowicki/pwned-passwords-chrome-extension
/sniffer.js
UTF-8
1,411
3.171875
3
[]
no_license
function hexString(buffer) { const byteArray = new Uint8Array(buffer); const hexCodes = [...byteArray].map(value => { const hexCode = value.toString(16); return hexCode.padStart(2, '0'); }); return hexCodes.join(''); } const checkPassword = async (password) => { const subtle = window.crypto.su...
true
005e9caad2b05481353d97ba96abef266f796ee3
JavaScript
pkeane1/unit-4-game
/assets/javascript/game.js
UTF-8
2,019
3.734375
4
[]
no_license
var random = Math.floor(Math.random() * 102) + 19; console.log("random number is:" + random); $(".randomNumber").html(random); var gem1 = Math.floor(Math.random() *11) + 1; var gem2 = Math.floor(Math.random() *11) + 1; var gem3 = Math.floor(Math.random() *11) + 1; var gem4 = Math.floor(Math.ra...
true
02fac27697303309f0f371994f834aa316b1cc07
JavaScript
stopsopa/stopsopa.github.io
/pages/macro/lib/waitForAce.js
UTF-8
454
2.65625
3
[]
no_license
export default () => { return new Promise((resolve) => { (function repeat() { const exist = (function () { try { return typeof window.ace.edit === "function"; } catch (e) {} return false; })(); if (exist) { // console.log("ace defined"); resol...
true
8a46a258df993532d22040b9a960f1a8a8e6f2f4
JavaScript
interestingjoe/YouTube-Search-API
/dest/js/index.js
UTF-8
8,550
2.84375
3
[]
no_license
(() => { let main = { api: 'https://content.googleapis.com/youtube/v3/', paramPart: 'part=snippet', outputElem: document.getElementsByClassName('output')[0], init: () => { main.setEvent(); }, /** * Add Event Listener for SEARCH and CLEAR buttons....
true
79f117f47660f416268ac621819f4c155219455c
JavaScript
johnvincentio/csf
/Archive/2.1.3 Drills/Are-you-here.js
UTF-8
1,395
3.734375
4
[]
no_license
// function areYouHere(arr1, arr2) { let ticks = 0; for (let i = 0; i < arr1.length; i++) { ticks++; const el1 = arr1[i]; for (let j = 0; j < arr2.length; j++) { ticks++; const el2 = arr2[j]; if (el1 === el2) return { result: true, ticks: ticks, }; } } return { result: false, ...
true
8009fa2ea6bd53d0545fcd6f7f7a1a1b8e83a28d
JavaScript
AhmadAmin/Bofff-Me
/Bofffs List/app/controllers/normalContactProfile.js
UTF-8
5,320
2.90625
3
[ "Apache-2.0" ]
permissive
var args=arguments[0] || {}; var contact= args.contact; var close = args.close; //Here is to know whether to open invite or call dialog var inviteOrCall; //Here is to save the number that the user want to call var numberToCall; function close(e) { close(); } //Here is to fill the interface objects in the profileVie...
true
bbbee5c9a5028fa65a9ecf4474a2c071afde1705
JavaScript
Aditya-Pundir/web-development
/project7_fetch_api/app.js
UTF-8
683
2.609375
3
[]
no_license
// const apiKey = "5b118e5197344befb1f371a0b6027e0f"; // let topic = "covid 19"; // let url = `https://newsapi.org/v2/top-headlines?sources=google-news-in&apiKey=5b118e5197344befb1f371a0b6027e0f`; let url = "https://reqres.in/api/users"; // POST Request: // fetch(url, { // method: "POST", // headers: { // "con...
true
866210b5b88f00065450f3964b2c802507225e84
JavaScript
dhwei90/OPSWAT
/index.js
UTF-8
5,189
2.6875
3
[]
no_license
require('dotenv').config(); const http = require('https'); const md5File = require('md5-file'); const prompt = require('prompt-sync')(); const fs = require('fs'); let filename, hash; while (true) { // Prompts user to enter name of file to be scanned filename = prompt('Name of file to be scanned (press "q" to quit...
true
b1d896bb2fe6eb1898ae650e485adbeeee044525
JavaScript
Dinpravi/demo
/src/App.js
UTF-8
837
3.0625
3
[]
no_license
import React from "react"; class App extends React.Component { state = { counter: 0, map : { a: 1, b: 2, c: 3 } }; increaseCounter = () => { if (this.state.counter == 999) { this.state.counter = 0; this.setState({ counter: 0 }); } else this.setState({ counter: this.state.counter + 1 ...
true
ea454c1d0b931fd1221f87ceac0cac9aec8c13e8
JavaScript
JavaScript-Practice-Algorithms/EasyAlgorithms
/Solutions/palindromeSolution.js
UTF-8
456
4.09375
4
[]
no_license
var palindromeChecker = function(string){ //The first step is to establish our base case if(string.length <= 1){ return true; } //Then we check to see if the first and last character in the string are equal if(string[0] !== string[string.length - 1]){ //if they are not equal return false return ...
true
35e438cefe68e773409ca4bf3ecc7682943f9cec
JavaScript
SCToolsfactory/xmlgen
/web/js/dropmap.js
UTF-8
1,796
2.578125
3
[]
no_license
/* File Name: dropmap.js Author: Sebastian Morgan (sebass63@gmail.com) Date Created: July 9, 2014. EULA: This file and its contents are sole property and creation of Sebastian Morgan. By downloading this file you are granted the right to use this file to assist in the creation of Star Citizen ...
true
eb4de670f103e89b515e599c092950cab7db5871
JavaScript
fabioparra/TypeScript
/tests/baselines/reference/tryStatements.js
UTF-8
344
2.75
3
[ "Apache-2.0" ]
permissive
//// [tryStatements.ts] function fn() { try { } catch (x) { var x: any; } try { } finally { } try { }catch(z){ } finally { } } //// [tryStatements.js] function fn() { try { } catch (x) { var x; } try { } finally { } try { } catch (z) {...
true
9f5b18c5a5d1d2c06fee34b5c6f62fb0683511b2
JavaScript
ekbr/nodejs-express-sequelize-example
/public/javascripts/all.js
UTF-8
746
2.96875
3
[ "MIT" ]
permissive
function addFarmer(){ window.location.href = '/farmers/add'; } function cancelAdd(){ window.location.href = '/farmers'; } function addTask(){ window.location.href = '/tasks/add'; } function getDateLocale(old_date){ var date = old_date.getDate(); var month = old_date.getMonth(); var year =...
true
eedde81c6937fa44b227477960421f6c150bb508
JavaScript
Anant147r/Programs
/EggDroping/script.js
UTF-8
364
3.515625
4
[]
no_license
function eggs(){ var arr=new Array(101); arr[0]=0; arr[1]=1; arr[2]=2; var j,i,temp; for (i=3;i<=100;i++){ arr[i]=100000; for(j=1;j<i;j++){ temp=Math.max(j,i-j) if(temp<arr[i]) arr[i]=temp; } temp=0; } console.log(ar...
true
bfaa587c61e8ab01347830dff93653428dde3051
JavaScript
area73/The-NodeJS-Master-Class-HW02
/lib/helpers.js
UTF-8
1,247
3.125
3
[]
no_license
/* * Helpers for various tasks * */ // Dependencies const crypto = require('crypto'); const config = require('../config/enviroments'); // Container for all the helpers const helpers = {}; helpers.createRandomString = (strLength, randomString) => { const possibleChars = '0123456789abcdefghijklmnopqrstuvwxyzABCDE...
true
dd83046d0216186ca995b17d1aa239733c1ee1d2
JavaScript
div-yam/front-end-web-RADY
/Pages9/Pages12/assets/js/script.js
UTF-8
354
3.234375
3
[]
no_license
function myFunction() { // Get the checkbox var checkBox = document.getElementById("checkbox"); // Get the output text var text = document.getElementByClass("available"); // If the checkbox is checked, display the output text if (checkBox.checked == true){ text.style.display = "block"; } else { t...
true
269b532a0d5919f341c160cd16e692f8e30030d6
JavaScript
Sanandh143/Whowantstobeamillionaire
/www/myscript.js
UTF-8
19,447
3.109375
3
[]
no_license
$(document).ready(function() { //var modalDialog = $(this).find(".modal-dialog"); // Applying the top margin on modal dialog to align it vertically center //modalDialog.css("margin-top", Math.max(0, ($(window).height() - modalDialog.height()) / 3)); $("#Description").modal('show'); }); functi...
true
258c3484c9c8ff069ed0692ce0bc200f69271546
JavaScript
biggens/Js_Volchik_Ihar
/lesson-14-animation/tennisDom.js
UTF-8
7,601
2.875
3
[]
no_license
"use strict"; var wrap = document.getElementById('wrapper'), widthOfWrap = "700px", heightOfWrap = "400px", buttonStart = document.createElement("input"), scoreBoard = document.createElement("div"), score1 = 0, score2 = 0, racquet1 = document.createElement("div"), racquet2 = d...
true
0c37937cf1deae770bb4f6337e4c469a317899fc
JavaScript
eliq1986/Website-Scraper
/err.js
UTF-8
613
3.125
3
[]
no_license
"use strict"; const fs = require("fs"); //produces error message & appends to file. const awwAnError = (error) => { const date = new Date; console.log(`There was an issue with the URL entered; ${error}`); const yearMonthDay = date.toString(); // date 2018-08-02T15:47:20.341Z => yearMonthDay Thu Aug 02 2018 08...
true
72b4d40478cbf84ca2f5ff88cefe96ca3d7791c6
JavaScript
Jenny1029/plane
/js/bullet.js
UTF-8
1,166
2.8125
3
[]
no_license
function Bullet(l,t,speed){ this.l = l; this.t = t; this.self=null; this.left=0; this.top=0; this.speed=speed; } Bullet.prototype={ constructor:Bullet, init:function(){ var _this=this; var img=document.createElement("img"); img.src="img/bullet1.png"; Engine.bg.appendChild(img); this.self=img; img.on...
true
80a81129f0472f5467164aa9eaa68a498c8cab63
JavaScript
Bronsalt/DongPong
/nibber.js
UTF-8
3,118
3.25
3
[]
no_license
var canvas = document.getElementById('gameCanvas'); var canvasContext = canvas.getContext('2d'); var ballX = canvas.width/2; var ballY = canvas.height/2; var ballSpeedX = 2 * Math.E; var ballSpeedY = 2 * Math.PI; var framesPerSecond = 120; var paddle1Y = 250; var paddle2Y = 250; var ballSize = 15; var ballColor = '...
true
f076b39359354478f0d9c52b8f56b53df6435fc8
JavaScript
zjfcool/front-end-note
/jsapi/bind.js
UTF-8
318
3.140625
3
[]
no_license
Function.prototype.myBind = function(){ const args = [...arguments]; const context = args.shift() const fn = this; return function (){ return fn.apply(context,args.concat([...arguments])) } } let obj = { name:"hello" } function hello (){ console.log(this.name) } hello.myBind(obj)()
true
00f92a82cd571bc5f78a7053e844f4189291e382
JavaScript
Vivekagent47/data_structure
/JavaScript/stack_using_LinkedList.js
UTF-8
1,030
3.4375
3
[]
no_license
function stackUsingLL() { //Node let Node = function (elm) { this.element = elm; this.next = null; }; let length = 0; let head = null; this.push = function (elm) { //Create a new node let node = new Node(elm), current; current = head; node.next = current; head = node; ...
true
27cfbdc9d844dfb34d0c79e2b38599729eb8cca8
JavaScript
techmatt101/StarFighter
/src/scripts/ui.js
UTF-8
1,342
2.796875
3
[]
no_license
function UI() { GameLoop.add(this); } UI.prototype.update = function(time) { }; UI.prototype.draw = function(ctx) { ctx.fillStyle = "#FFDB00"; if (Game.isPlaying) { ctx.font = "16px visitor"; ctx.fillStyle = "#fff"; ctx.fillText("Score: " + Game.score, 15, 20); ctx.font = ...
true
5ec31bf405f4ce7e9a67481755590fed159db62e
JavaScript
viisionary/es6-algorithm
/test/dynameic/dy.test.js
UTF-8
602
2.734375
3
[]
no_license
import Dy from '../../src/dynameic/dy.js'; import chai from 'chai' let expect = chai.expect; let dy = Reflect.construct(Dy, []); describe('dynameic/dy.js::Dy', () => { // 斐波那契数列:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … it('递归/动态规划/贪心算法:', () => { expect(dy.reFib(10)).to.be.equal(55); // 动态规划斐波那契 expect...
true
d448c474bb16df00049ed3f424db5e42f2cae369
JavaScript
paiathao/tailor-made
/src/components/ServiceTotal/ServiceTotal.jsx
UTF-8
1,341
2.625
3
[]
no_license
import React, { Component } from 'react'; import { connect } from 'react-redux'; const mapStateToProps = state => ({ services: state.newCustomer.orderDetails }); class ServiceTotal extends Component { totalCost = 0; sum = 0; tax = 0; saveState() { this.props.dispatch({ type: ...
true
ab9ef17bd3e67856cb6c6fc6c92522b4bb79cc9e
JavaScript
yanniznik/bitcoin-exchange
/bitcoin/static/js/steps.js
UTF-8
5,210
2.5625
3
[ "MIT" ]
permissive
var form = $("#send-form"); var wallet_is_stranger = 0; var adding_contact = 1; form.children("div").steps({ headerTag: "h3", bodyTag: "section", transitionEffect: "none", onStepChanging: function (event, currentIndex, newIndex) { if (currentIndex > newIndex) { return t...
true
2564214320003ceb49c42afebc1a65c263fdafda
JavaScript
sandeepsj/photo-gallary-server
/loglib.js
UTF-8
1,199
2.65625
3
[]
no_license
var fs = require("fs"); var baseDir = "./storage"; isDir = function (path) { console.log(path); if (!fs.existsSync(path)) throw `path doesnt exists - ${path}`; if (path === undefined) throw `path is undefined - ${path}`; }; createLogFile = function (user) { const logPath = `${baseDir}/${user.userid}/log.json...
true
68948aca74db8e1657a10528a10e817eb07a9858
JavaScript
AnITgo/personal_website
/node/events.js
UTF-8
1,237
2.96875
3
[]
no_license
var EventEmitter = require('events').EventEmitter var life = new EventEmitter() life.setMaxListeners(11) function water(who){ console.log('给' + who + '倒水') } life.on('求安慰',water) life.on('求安慰',function(who){ console.log('给' + who + '揉肩') }) life.on('求安慰',function(who){ console.log('给' + who + '倒水') }) life.on...
true
d10270445374b9d1b2517026e9daa19c2c1d7451
JavaScript
soham-alatekar/Week1_Function_API_Task
/problem8.js
UTF-8
644
3.421875
3
[]
no_license
var rotate = ((arr,k) => { let leftRorate = []; let rightRotate = []; let len = arr.length; let newArr = arr; newArr = [... newArr, ...arr]; if(k > len){ k = k % len; } //Left rotatation for(let i=k; i<k+len; i++){ leftRorate.push(newArr[i]); } ...
true