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
576ffe1dd02d2576cdee670f4717b5fda0875962
JavaScript
MichaelBurak/AlgoCasts
/exercises/bst/index.js
UTF-8
1,970
4.21875
4
[]
no_license
// --- Directions // 1) Implement the Node class to create // a binary search tree. The constructor // should initialize values 'data', 'left', // and 'right'. // 2) Implement the 'insert' method for the // Node class. Insert should accept an argument // 'data', then create an insert a new node // at the appropriate ...
true
9f5e9a26832dd9b04a9149db25fb311058f6dfed
JavaScript
tebasar/CursoBasicoJs
/filtros.js
UTF-8
1,149
3.734375
4
[]
no_license
var articulos = [ { nombre: "Bici", costo: 3000 }, { nombre: "TV", costo: 2500 }, { nombre: "Libro", costo: 320 }, { nombre: "Celular", costo: 10000 }, { nombre: "Laptop", costo: 20000 }, { nombre: "Teclado", costo: 500 }, { nombre: "Audifonos", costo: 1700 }, ]; //filter Genera un nuevo ar...
true
bf395ba5da3996370fc4fddcfa4afa53a0936d28
JavaScript
Prince-Csaba/express_upload
/frontend/script.js
UTF-8
310
2.53125
3
[]
no_license
const pageLoad = () => { console.log("Im running"); const handleSubmit = (e) => { e.preventDefault(); console.log("Upload blocked by server"); }; const form = document.getElementById("uploadForm"); form.addEventListener("submit", handleSubmit); } window.addEventListener("load", pageLoad);
true
6f9d344a3f9a9c44cc5d8b4cdced2f407342f502
JavaScript
la-celton/zen-pokeapi
/sources/pokemon-ui/app/jspm_packages/npm/twit@2.2.4/lib/file_uploader.js
UTF-8
2,764
2.546875
3
[ "MIT" ]
permissive
/* */ var assert = require('assert'); var fs = require('fs'); var mime = require('mime'); var util = require('util'); var MAX_FILE_SIZE_BYTES = 15 * 1024 * 1024; var MAX_FILE_CHUNK_BYTES = 5 * 1024 * 1024; var FileUploader = function(params, twit) { assert(params); assert(params.file_path, 'Must specify `file_path...
true
e13c67450285984cfca9661e2bd118392e37dbca
JavaScript
anthonyzhu132/lighthouse-web-notes
/Week_1/lotide/findKey.js
UTF-8
577
3.421875
3
[]
no_license
const findKey = function(object1, cb) { for (let key of Object.keys(object1)) { if (cb(object1[key])) { return key; } } return undefined; }; console.log(findKey({ "Blue Hill": { stars: 1 }, "Akaleri": { stars: 3 }, "noma": { stars: 2 }, "elBulli": { stars: 3 }, "Ora": { sta...
true
fd6795f33d6b7e5e7286311d7403b1f2cc9028b0
JavaScript
Davi-Serrano/Port-Responsivo
/src/Pages/Sites/index.js
UTF-8
1,896
2.8125
3
[]
no_license
import "./index.css" function Page(){ const sites = [ { id: 1, name: "CRUD", desc: "Um site simples, mas totalmente funcional, lá mostro meu conhecimento usando express, mongoose e ejs para fazer um CRUD(Create, Read, Uptade e Delete). " ...
true
c9dfb858d6551c16179b8583ec9e69796258df73
JavaScript
CesarSBraga/javascript
/cursojs/aula16/funcao03.js
UTF-8
52
2.703125
3
[ "MIT" ]
permissive
let v = function(x){ return x**3 } console.log(v(5))
true
29e488d12430322ad470b8793ad8e64aa4b2ead8
JavaScript
joychowdhury-Git/Protractor-Framework
/All.js
UTF-8
963
3.0625
3
[]
no_license
describe('All locator Tutorial', function() { // function will have all test cases (it block) function addnumber(a,b) { element(by.model('first')).sendKeys(a); element(by.model("operator")).element(by.css("option:nth-child(4)")) .click(); element(by.model('second')).sendKeys(b); element(by.id('gobutton...
true
7b3fff1f18199778f1b872d76f2fe055fb3be03f
JavaScript
IvanPaponin/Cinder
/front/src/redux/reducers/SuperLikesFilmsReducer.js
UTF-8
497
2.609375
3
[]
no_license
import {UPDATE_SUPERLIKES_USER, GET_SUPERLIKES_USER, DELETE_SUPERLIKES_USER} from '../types'; export default function SuperLikesFilmsReducer(state =[], action){ const {type, payload} = action; switch (type) { case GET_SUPERLIKES_USER: { return payload } case UPDATE_SUPERLIKES_USER: ...
true
1dfa6b3c1468d8bd3020657f168a1aea610754a6
JavaScript
bartekma89/Node.js_13.5
/modules/Time.js
UTF-8
412
2.796875
3
[]
no_license
function getTime(time) { var hours = Math.floor(time / 3600); var minutes = Math.floor(time / 60) - hours * 60; var seconds = Math.floor(time % 60); if (time < 60) return seconds + ' sec.' else if (time < 3600) return minutes + " min " + seconds + " sec"; else return hours + ' h ...
true
b9a692bec7579ba507acaa9150740ede22d8e0c0
JavaScript
miguelalvinflores/sacTownMunch
/frontend/src/components/EditRatingForm/index.js
UTF-8
1,923
2.609375
3
[]
no_license
import { useState } from 'react'; import { useDispatch, useSelector } from "react-redux" import { updateRating as updateReview } from '../../store/rating'; import './EditRatingForm.css'; const EditRatingForm = ({ ratingId, set }) => { const review = useSelector(state => state.ratings[ratingId]); const dispatch = ...
true
07d8a671960e231321c353230493882620ed09ee
JavaScript
ChaitanyaCodes/doYouKnowChaitanya
/index.js
UTF-8
1,446
3.890625
4
[]
no_license
// imports var readLineSync = require('readline-sync'); var chalk = require('chalk'); // declarations var score = 0; var scoreMessage = "Your score is "; // functions function askQuestion(question, correctAns) { var userAnswer = readLineSync.question(question); if (correctAns.toLowerCase() === userAnswer.toLowe...
true
098c009fe8be763f0e467cc71f5c2fdfe1b2a417
JavaScript
GromovaJ/project-lvl2-s273
/src/renderers/plainRenderer.js
UTF-8
1,381
2.609375
3
[]
no_license
import _ from 'lodash'; const propertyActions = [ { check: value => value instanceof Object, process: () => 'complex value', }, { check: (value, type) => !(value instanceof Object) && type === 'changed', process: value => `'${value}'`, }, { check: value => !(value instanceof Object), ...
true
9a5a28115647f027d774fce070eb107702640cdd
JavaScript
jcleefw/WDI-Coursework
/week7-tdd-rails/morn_exe/anagramdetector/anagram_detector.js
UTF-8
646
3.578125
4
[]
no_license
array = ["enlists", "google", "inlets", "banana"] test_word = "listen".split("").sort(); array.forEach(function(word) { letters = word.split(""); /* solution 2 with function*/ // if(findAnagram(letters, test_word)){ // console.log(word); // } /* Solution 2 */ if(letters.sort().join("") === test_word...
true
806c92082c52d54c05f2bcd91f67f8c0d01be099
JavaScript
paolooo/teach-myself
/indexed-db/todo/4-retrieve-by-index/retrieve-by-index.js
UTF-8
1,736
2.734375
3
[]
no_license
;(function(){ var TASK_TABLE = 'tasks'; var USER_TABLE = 'users'; var tbody = document.getElementsByTagName('tbody'); var on_ready = function() { var transaction = db.transaction([USER_TABLE, TASK_TABLE], 'readwrite'); // Do something when all the data is added to the database. transaction.oncomp...
true
9537f7a59d06d4f5a4c04e7066dfb4d4606da683
JavaScript
R-Oscar/LoftSchool-JS
/hm2/03/app.js
UTF-8
893
4.09375
4
[]
no_license
function calculator(firstNumber) { return { sum: function() { var result = firstNumber; for (var i = 0; i < arguments.length; i++) { result += arguments[i]; } return result; }, dif: function() { var result = firstNumber; for (var i = 0; i < arguments.length; i++) { result -= arguments[...
true
0a1ef33fdd714e6f592d16b445cf8e24e14ef136
JavaScript
adridierdorp/oefening
/html/html/js/ontbind.js
UTF-8
3,172
3
3
[]
no_license
function wwp_GetGameName() { return "ONTBINDEN oefenen"; } function wwp_CreateLevel() { var levels = [ { name : 'Langzaam', value : 1 }, { name : 'Normaal', value : 2 }, { name : 'Snel', value : 3 } ]; return levels; } function wwp_CreateQuestions(level) { var length = gameLength...
true
6df0cd6176a3e1a338ab08c5296edb02b73cfacc
JavaScript
dx859/node
/design_mode/single/single_class.js
UTF-8
456
2.796875
3
[]
no_license
var _instance = null; // 初始化_instance, 储存Class类和方法 module.exports = function(time) { function Class(time) { this.name = 'danli'; this.time = time; } Class.prototype.show = function() { console.log(this.name, this.time); }; this.getInstance = function() { i...
true
99eb192cfb75496816b9bd3f815e0e65f826c991
JavaScript
lshumlich/evolveu-progress
/src/components/graphs/learner-line-chart.js
UTF-8
3,658
2.65625
3
[]
no_license
import React from "react"; // import LineChart from 'react-d3-components'; // import Brush from 'react-d3-components'; var LineChart = ReactD3.LineChart; var Brush = ReactD3.Brush; class Learner_line_chart extends React.Component { generateData = () => { console.log(this.props); const questions = this.props...
true
82da2a5e601a24e119bb30556d183a0adddb62da
JavaScript
Kevjinx/week2-practice-assessment
/assessment-for-week-02-version-b-unit-test-problems-main/problems/05-push-creator.js
UTF-8
1,363
3.703125
4
[]
no_license
/*********************************************************************** Write a function called `dynamicPush` that accepts an array. The dynamicPush function will return a new function that will allow us to create new separate custom pushing functions. Examples: const addToArray = pushCreator(['hello']); // returns...
true
638331cbe03bcc04e3c062323d1dd04ed00aea53
JavaScript
fillippohosang/webpro2020-S21810008
/Pertemuan12/index.js
UTF-8
654
4.21875
4
[]
no_license
//Arrow Function' //single // const calAge = (currentYear) => { // return = currentYear // }; // console.log(calAge(2020)); // //multi // const calAge = (birthYear , currentYear) => { // return = currentYear-birthYear; // }; // console.log(calAge(2020,2001)); // //implicit // const calAge = () => 2020 - 200...
true
7fbac659a9fdaec91858a40da19c8a23980fa60c
JavaScript
nss-cohort-37/nutshell-squirm-of-worms
/src/components/messages/MessageForm.js
UTF-8
2,788
2.6875
3
[]
no_license
import React, { useContext, useState, useEffect } from "react" import { MessageContext } from "./MessageProvider" import "./Messages.css" export default props => { const { addMessage, updateMessage, messages } = useContext(MessageContext) const [message, setMessage] = useState({}) const editMode = props.m...
true
3db131c57119ab88cdc871b54a1f82a0b75ee365
JavaScript
Coi-GH/grace-shopper
/client/store/category.js
UTF-8
4,007
2.640625
3
[ "MIT" ]
permissive
import axios from 'axios' import history from '../history' // ACTION TYPES const SET_ALL_CATEGORIES = 'SET_ALL_CATEGORIES' const SET_SINGLE_CATEGORY = 'SET_SINGLE_CATEGORY' const SET_CATEGORY_ITEMS = 'SET_CATEGORY_ITEMS' const ADD_CATEGORY = 'ADD_CATEGORY' const DELETE_CATEGORY = 'DELETE_CATEGORY' const SET_PRODUCT_CA...
true
bd6438bbe08e65043bd1b598a5d1f10306d91adb
JavaScript
AtharvaThorve/starfish
/Chrome Extension/src/scripts/options.js
UTF-8
343
2.609375
3
[]
no_license
$(() => { chrome.storage.sync.get('allUrl', (val) => { let ol = document.createElement('ol'); let allUrl = val.allUrl; allUrl.forEach((urlItem) => { let li = document.createElement('li'); li.innerHTML = `<b>url:</b> ${urlItem.url}, <b>feature:</b> ${urlItem.feature}`; ol.append(li); }); $('#history'...
true
c9369555008ff2af6235c7c86b8d24db07ee192b
JavaScript
RehbergAJ/Node.JS_Self-Directed
/CodeSchool/Module3.js
UTF-8
2,097
3.421875
3
[]
no_license
//Network Access //Keep an eye on how the data is transferred back and forth //Access data piece by piece via streams //Readable and Writable type streams //http.createServer(function(request,response)) is a read streams //the response.writeHead is a write streams //-------------- APPROACH I // http.createServer(funct...
true
d85374e34c899ac34d5edfe6d14f20db89dd35c9
JavaScript
addiallred/Exercism
/javascript/simple-cipher/simple-cipher.js
UTF-8
1,290
3.015625
3
[]
no_license
function Cipher(key){ if(key == ''){throw Error('Bad key');} this.key = key || 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'+ 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'; if(this.key == key) { for(i = 0; i < key.length; i++) { if(key.charCodeAt(i) < 97 || key.c...
true
f7f0437110383009a606aff01d47f58a66271796
JavaScript
a1ex7/canvas-test-particle
/app.js
UTF-8
2,084
3.28125
3
[]
no_license
var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var opt = { width: 800, height: 800, background: 'rgb(29, 30, 33)', speed: 3, count: 300, radius: 4, }; var w = ctx.canvas.width = window.innerWidth; var h = ctx.canvas.height = window.innerHeight; var particles = []; Part...
true
b482c207bc2001016a14267e2a7ea8147d0a1685
JavaScript
abferris/data-structures-and-algorithms
/code-challenges/daily/CDP/conwayLife/__tests___/conwayLife.test.js
UTF-8
3,121
3.203125
3
[ "MIT" ]
permissive
'use strict' const functions = require('../conwayLife.js') const conwayLife = functions.conwayLife; const findNeighbors = functions.findNeighbors; const transform = functions.transform; //test board const test = [['*','.','*','*','*','*','.','*'], ['*','.','*','*','*','.','.','.'], ['.','....
true
f0f08c56366f723995c70806555fa84f2c1820f4
JavaScript
sureshlodha/GeoMapping_Countries
/Countries/Mauritania/mrt.js
UTF-8
3,607
3
3
[]
no_license
//Width and height var margin = { left: 10, right: 10, top: 0, bottom: 0 }, width = 920 - margin.left - margin.right, height = 620 - margin.top - margin.bottom; //Define map projection var projection = d3.geoMercator() .scale([2300]) .transl...
true
8230c21f165c3d481565253d3cda3aa4452c33fa
JavaScript
Resolut/learn.javascript
/chapter-4/section-2/ex2-8/js/app.js
UTF-8
107
3.0625
3
[]
no_license
function getRandom(min, max) { return Math.random() * (max - min) + min; } console.log(getRandom(1, 5));
true
9882bf8cdbfa96913c8b1f78230cd0455911a54c
JavaScript
Nahid1010/employee_tracker
/src/actions.js
UTF-8
1,304
2.546875
3
[ "MIT" ]
permissive
// actions const viewTable = require('./viewTable'); const addRec = require('./addRec'); const delRec = require('./delRec'); const departmentBudget = require('./departmentBudget'); const viewEmployeeByManager = require('./viewEmployeeByManager'); const updateEmployeeManager = require('./updateEmployeeManager'); const u...
true
5bc364855a914a350798e22b884559b7c004bac7
JavaScript
dtchiong/React-Nodejs-Login-Example
/server.js
UTF-8
1,736
2.921875
3
[]
no_license
var admin = require("./config/firebaseAdmin/fire").admin; //the firebase admin object const express = require('express'); const bodyParser = require('body-parser'); //for console.log(req.body) inside post requests const app = express(); const port = process.env.PORT || 5000; app.use(bodyParser.json()); app.use(body...
true
f04c243f3084876b860be34627daf12105786583
JavaScript
trever/localCollection
/lib/main.js
UTF-8
1,626
2.578125
3
[]
no_license
var sift = require('sift'); var localCollection = function(target){ if (!target || typeof target != "object") throw new Error('Requires Target Array to Instantiate'); this.target = target; return this; }; localCollection.prototype.find = function(query){ var _this = this; var x = sift(query, this.targ...
true
693de8c8d63ef852f9c0672ab0771940a28f866f
JavaScript
Milan-Pro/SharePoint
/SPFX_Leaning/TypescriptLearn/dist/enum.js
UTF-8
341
2.9375
3
[]
no_license
"use strict"; // Enumeration Demo var ColorTypes; (function (ColorTypes) { ColorTypes[ColorTypes["Red"] = 0] = "Red"; ColorTypes[ColorTypes["Blue"] = 1] = "Blue"; ColorTypes[ColorTypes["Green"] = 2] = "Green"; })(ColorTypes || (ColorTypes = {})); ; let color = ColorTypes.Red; console.log(color); console.log...
true
fcabb55f666e3f723d6d43a71c760036c91f2c27
JavaScript
bethazari/react-todo
/src/js/todo-app.js
UTF-8
2,084
2.84375
3
[ "MIT" ]
permissive
import { Map, List } from 'immutable'; import { createStore } from 'redux'; import React from 'react'; import TodoItem from './todo-item.js'; const bootstrap = new Map({ newTodo: '', todos: new List([ new Map({ todo: 'test1', completed: false, }), new Map({ todo: 'test2', comp...
true
1c9e808f9209840d33524f46ea896fee5d07a3fd
JavaScript
travisbaratcart/mmonster
/server/models/ffxivModel.js
UTF-8
882
2.625
3
[]
no_license
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var ffxivSchema = new Schema({ dps: Number, main: String, // IDEA: we should validate strings coming in, at least emails, toLowerCase jobs: String, // need to convert input into a String with JSON stringify, cleared: String, // maybe for jobs a...
true
a6812684944b4b022221bccdbdd9a5d00d8bfae2
JavaScript
oliveroneill/tod
/src/utils/Utils.js
UTF-8
1,535
2.59375
3
[ "MIT" ]
permissive
import { Linking, } from 'react-native'; var transportModes = [ {name:'transit', icon:'directions-transit'}, {name:'driving', icon:'directions-car'}, {name:'walking', icon:'directions-walk'}, {name:'bicycling', icon:'directions-bike'} ]; var transportDict = {}; for (var i = 0; i < transportModes.length; i++...
true
8fecd41a24f611b818026cf2b88cfb105a7c5899
JavaScript
shmuel7e/Apsus
/notes/cmps/NoteTodos.jsx
UTF-8
1,344
2.640625
3
[]
no_license
export default class NoteTodos extends React.Component { handleClick = () => { this.props.openModal(this.props.note); } onToggleTodo = (todo) => { this.props.toggleTodo(this.props.note,todo); } onSetDateFormat = (todoTime) => { if (Date.now() - todoTime <= 60000) return '...
true
0d959be6141f04efba4ef900cefa2b71eacb5ed5
JavaScript
shree214ram/DSA
/Algorithms/Dynamic Programming(33)/MaxHeightInBoxArrangeProblem/gfgSolution.js
UTF-8
3,048
3.78125
4
[]
no_license
/* Dynamic Programming implementation of Box Stacking problem in Javascript*/ /* Representation of a box */ class Box { // h --> height, w --> width, // d --> depth // h, w, d, area; // for simplicity of solution, // always keep w <= d /*Constructor to initialise object*/ constructor(h,...
true
895848af4c26a99c08a1f4de67d212dd5b7e0a6b
JavaScript
dimafeoktistov/codewars-kata
/katas/8kyu/sheep.js
UTF-8
410
4.75
5
[]
no_license
// Task: // Given a number, 3 for example, return a string with a murmur: "1 sheep...2 sheep...3 sheep..." // // Note: // You will always receive a positive integer. let str = null; const countSheeps = num => { str = ''; for (let i = 1; i <= num; i++) { str += `${i} sheep...`; } return str; }; countSheeps(...
true
baa9c189cb05b0beb5861dbc02ca69c1e5fd7818
JavaScript
lucaspany/PrimerSitioWeb
/scripts/contacto.js
UTF-8
1,661
3.359375
3
[]
no_license
function validate() { const name = document.getElementById("name").value; const subject = document.getElementById("subject").value; const phone = document.getElementById("phone").value; const email = document.getElementById("email").value; const message = document.getElementById("message").value; const erro...
true
e965a31022c30abdfb8e498d51a9da65fcb78d49
JavaScript
lingsoul/ngrinder
/ngrinder-controller/src/main/resources/static/js/utils.js
UTF-8
9,261
2.625
3
[ "Apache-2.0" ]
permissive
function isRunningStatusType(statusType) { return statusType == "TESTING"; } function isFinishedStatusType(statusType) { return statusType == "FINISHED" || statusType == "STOP_BY_ERROR" || statusType == "STOP_ON_ERROR" || statusType == "CANCELED"; } function checkStringFormat(str, ruleStr) { return new RegExp(ruleS...
true
fef816a476571136a75e370e8bc20c5e16ac2ab5
JavaScript
ericposas/adstage
/adstage/square.js
UTF-8
6,928
2.765625
3
[]
no_license
/*global window, console, adstage, TweenLite, TimelineLite*/ // Square object constructor - takes a params object {} function Square(params){ function checkParams(self){ if(self.params){ if(self.params.width){ self.div.style.width = self.params.width + 'px'; }else{ self.div.style.widt...
true
02fb8453a6d00aa502d15b8ecfe0118f3d9ebd7b
JavaScript
saucey/vitl-health
/statics/vitamin-d-calc/assets/main.js
UTF-8
4,016
2.625
3
[]
no_license
$(document).ready(function () { $('#start').click(function () { $('#home').hide(); $('#questions').show(); $('html, body').animate({ scrollTop: $("#questions").offset().top - 100 }, 1500); }); $('input:radio').click(function () { $(this).parent().parent().parent().find('.radio-buttons').rem...
true
ea0d06d699eecac9355960dccca9a9e5606a8354
JavaScript
anjathiart/cart-api
/test/test-specs/cart.js
UTF-8
4,943
2.5625
3
[]
no_license
const expect = require('chai').expect; module.exports = (app, api) => { const productA = app.config.testProductA; const { userEmail, userPass } = app.config.testUser let accessToken = ''; let cartItem = {}; describe('User interaction with open cart', () => { describe('Authenticate / Login user', () => { it...
true
ac052cde45aaf2083e5ba6dbee99c29ea4396b68
JavaScript
ClusterH/fish-admin-react
/src/app/components/week-calendar.js
UTF-8
3,042
2.546875
3
[]
no_license
import React, {Component} from 'react'; import "../css/popup.css"; import {connect} from "react-redux"; import * as UIActions from "../actions/ui-actions"; /** * @param selected {Date|null} * @param proc {fn} fnProc(date) */ class WeekCalendar extends Component{ constructor(props){ super(props); this.picked_d...
true
5340c5ae99a01b854beaa5c6550199e0866c33bd
JavaScript
maja669e/eksamen
/src/main/resources/static/infectionajax.js
UTF-8
1,474
2.9375
3
[]
no_license
$(document).ready(function () {//kald først jQuery-funktioner,når siden er klar $.ajax({ url: "/commune", type: "GET", contentType: "application/JSON", success: function (communeData) { $.each(communeData, function (index, commune) { //iterer over collection i data ...
true
f074a53ea43fe1f8c607034ecfd0f52c4d8dc9da
JavaScript
d90375/reactjs-films-homework
/src/modules/headerData/headerActions.js
UTF-8
862
2.53125
3
[]
no_license
import axios from "axios"; import { FETCH_CURRENT_MOVIE_PENDING, FETCH_CURRENT_MOVIE_FULFILLED, FETCH_CURRENT_MOVIE_REJECTED } from "../actionTypes"; import { API, KEY, LANG } from "../../constants"; const startFetchMoviesById = () => ({ type: FETCH_CURRENT_MOVIE_PENDING }); const finishFetchMoviesById = (dat...
true
36e249cc46ef294c9ec8993c631dae9f9ddfb114
JavaScript
alhridoy/Node-Site
/index.js
UTF-8
1,188
2.734375
3
[]
no_license
var fs = require('fs'); var http = require('http'); // readStream.on('data', function(chunk){ // console.log("Creating"); // myShort.write(chunk) // })// only pipe() will do // readStream.pipe(myShort); var server = http.createServer(function(req,res){ console.log("url" + req.url); if(r...
true
badede492783091f58c4a3daab5030dd317e105c
JavaScript
JonFerraiolo/BPLearn
/test/client/util/cls.js
UTF-8
6,317
2.75
3
[ "MIT" ]
permissive
describe('cls.js', function() { describe('cls.add(e,"foo"), e has no existing classes', function() { it('foo should be added as a new class', function(done){ require(['../../client/util/cls'], function(cls) { var e = document.createElement('div'); cls.add(e, 'foo'); assert(e.className == 'foo'); d...
true
9db6fd0c3cc09c3152b29779ad4cab3f824d42af
JavaScript
scholarj/hello_world_react
/test/unit/util.test.js
UTF-8
649
3.109375
3
[ "MIT" ]
permissive
/* eslint-env node, mocha */ 'use strict' let assert = require('chai').assert // chai API http://chaijs.com/api/assert let myutil = require('../../src/util') describe('basic acceptance tests', () => { it('true is true!', () => { assert(true) }) it('add(1, 2) -> 3', () => { assert.equal(myutil.add(1, 2)...
true
06d507d1f064f858bd918f34858de3b576ff205e
JavaScript
stehar14/portfolio
/assets/js/app.js
UTF-8
2,301
2.609375
3
[]
no_license
$(document).ready(function() { if (window.pageYOffset >= 101) { $(".navbar").addClass("collapsed") } }); $(function() { var header = $(".navbar"); $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 101) { header.addClass("collaps...
true
ec9df89d570938c5ef230a80259fa90fb5fb57cf
JavaScript
camisminei/Exercicios-Praticos-Resolvidos-e-Refeitos
/Ex6/js/script.js
UTF-8
1,372
3.390625
3
[]
no_license
class Gerenciador { constructor (){ this.nome = "" this.marca="" this.ano="" this.vetor= [] this.contador=0 } validar (carro){ if(carro.nome != "" && carro.marca != "" && carro.ano != ""){ return true }else{ return false } } salvar(){ } calcularResultado(){ let maior =0 ...
true
f2de6b2e8be934432a4bc7160f12d092d7d13422
JavaScript
DarylsJoy/JavaScript-data-structure
/stack.js
UTF-8
1,633
4.03125
4
[]
no_license
function Stack() { // 用数组来保存栈中的元素 var items = []; // 添加新元素到栈顶 this.push = function (element) { items.push(element); }; // 移除栈顶的元素,并将其返回 this.pop = function () { return items.pop(); }; // 仅返回栈顶元素,不做任何修改 this.peek = function () { return items[items.length - 1]; }; // 判断栈是否为空,若空返回tr...
true
a06745f56a8c141d19d04338cc6774397e932d89
JavaScript
wangcylive/code
/javascript/test/Array/reduce.js
UTF-8
1,406
3.765625
4
[]
no_license
/** * Created by silent on 2014/11/23. */ (function() { /** * arr.reduce(callback,[initialValue]) * reduce 为数组中的每一个元素依次执行回调函数,不包括数组中被删除或从未被赋值的元素 * reduce() 方法接收一个函数作为累加器(accumulator),数组中的每个值(从左到右)开始缩减,最终为一个值 * 执行数组中每个值的函数,包含四个参数:previousValue-上一次调用回调返回的值,或者是提供的初始值(initialValue), * curren...
true
2999bb5e9eb15123f6e15fb88df3b53aab925054
JavaScript
LeonEsquire/React-19.04
/IlyaKamnev/hw_6/src/app/pages/Users.js
UTF-8
1,235
2.515625
3
[]
no_license
import React, { Component } from 'react'; import UsersList from '../components/UserList'; import { addUser, getUsers } from '../actions/userActions'; import store from '../stores/userStore'; export default class Users extends Component { constructor(props) { super(props); this.state = { users: [] ...
true
b01da17f23d4b535f00a932fc14e76d652cd8210
JavaScript
IsmailTitas1815/javascript_projects
/Book List/js/script2.js
UTF-8
3,199
3.53125
4
[]
no_license
let form = document.querySelector("#book-form"); let bookList = document.querySelector("#book-list"); class Book{ constructor(title,author,isbn){ this.title = title; this.author = author; this.isbn = isbn; } } class UI{ static addBookToList(book){ let list = document.query...
true
ab26db87cfad1f50201b694df42cc7fe2ffbd834
JavaScript
DavidMoritz/init-angular
/src/js/services/mc.js
UTF-8
1,473
3.296875
3
[]
no_license
/** * Moritz Company utility functions (for use anywhere) with mc.pluralize() **/ var mc = { pluralize: function pluralize(str) { return str.replace(/y$/, 'ie') + 's'; }, camelToTitle: function camelToTitle(str) { // convert camelCaseString to Title Case String return _.capitalize(str.replace(/([A-Z])/g, ' $1...
true
af266cc646401a94c98b6661fb379f591fbedb9c
JavaScript
yagovv/Ironhackers-of-the-Caribbean
/js/cannonball.js
UTF-8
1,116
3.40625
3
[]
no_license
class CannonBall { constructor(ship, cannon, side, inertia) { this.canvas = ship.canvas; this.cannon = cannon; this.ctx = ship.ctx; this.side = side; this.angle = cannon.angle; this.x = this.cannon.x; this.y = this.cannon.y; this.radius = 2.5; this.speed = 1; this.lifetime = 17...
true
b4ce334a8cff4299a474933e4a6b3986c495993e
JavaScript
digicannon/pths-computer-club
/js/handle_mobile.js
UTF-8
289
2.703125
3
[ "CC0-1.0" ]
permissive
window.onload = function(event) { window.onresize(); } window.onresize = function(event) { // display link to home if navbar is in mobile mode var home_link = document.getElementById("nav-home-link"); home_link.style.display = screen.width <= 600 ? "initial" : "none"; };
true
1b6c8322f5c36212fa5e3c91843a121e93d118e7
JavaScript
ehudkaldor/multi-mopidy
/src/services/state.js
UTF-8
1,266
2.5625
3
[]
no_license
export class State { _playingState = false _playingType = "none" libraryURI = null _tracklist = [] _timePosition = 0 _timeLength = -1 seeking = false volume = 0 isMute = false _currentTrack = null nextTrack = null prevTrack = null title = "" playlists = [] connected = false get trac...
true
f4a2ebe89f5883147302c19519f6bd0601464282
JavaScript
dondiego4697/swimming-pool-process-modeler
/utils.js
UTF-8
1,007
2.90625
3
[]
no_license
const crypto = require('crypto'); const randomInInterval = (min, max) => { return Math.round(Math.random() * (max - min) + min); }; const timeToSeconds = (time) => { const split = time.split(':'); return split[0] * 60 * 60 + split[1] * 60; } const getId = () => { const currentDate = (new Date()).valu...
true
5e5f2b9898755037700de6a6f15386b3955ca3c7
JavaScript
linkmatgit/linkmatmod
/assets/Elements/AjaxDelete.js
UTF-8
1,292
2.671875
3
[]
no_license
import { jsonFetch } from '/functions/api.js' import { closest } from '/functions/dom.js' /** * Bouton pour appeler une URL avec la méthode DELETE et masquer le parent en cas de retour */ export class AjaxDelete extends HTMLElement { connectedCallback () { this.addEventListener('click', async e => { ...
true
9dcd4d3a0b6fc27e438660dcc0b1ddb4e0e62008
JavaScript
WWiteriM/NodeJs_winterExam_ThirdCourse_2020
/NodeJS_Exam/Практика/42. Файловая система, создание, слежение за файлом, запись, запись в конец/index.js
UTF-8
726
3.0625
3
[]
no_license
fs = require('fs') fs.open('new.txt', 'w', (e, file) => { if(e) throw e; console.log('файл создан'); }) try { fs.watch('new.txt', (event, filename) =>{ if(filename) console.log(`folder: ${filename}, event: ${event}`) }) } catch (e){ console.log('e = ', e) } //это асинхронно fs.writeFile('n...
true
348935966da7f289a9b4018c6d0a5c53b79bb37b
JavaScript
jaiderbernal90/p_montechelo
/js/photo.js
UTF-8
759
2.953125
3
[]
no_license
document.getElementById("img_profile").addEventListener("change", () => { var archivoseleccionado = document.querySelector("#img_profile"); var archivos = archivoseleccionado.files; var imagenPrevisualizacion = document.querySelector("#mostrarimagen"); // Si no hay archivos salimos de la función y quita...
true
bd16ec718daea9d6e0f09347d291ee7e76f83407
JavaScript
hdd42/Angular_codes
/node_server/models/user.js
UTF-8
3,538
2.5625
3
[]
no_license
const mongoose = require('mongoose') const argon2 = require('argon2') const ObjectId = mongoose.Schema.Types.ObjectId; const UserSchema = new mongoose.Schema({ name: { type: String, required: true, min: 3, max: 50 }, email: { type: String, ...
true
1291ec6000761d4ef2438a1a560ffbb3b89bbb54
JavaScript
brianneisler/stutter
/src/lang/util/arrayShift.test.js
UTF-8
327
2.859375
3
[ "MIT", "Apache-2.0" ]
permissive
import arrayShift from './arrayShift' describe('arrayShift', () => { test('shifts a value and returns a new Array with the first value removed from the front of the Array', () => { const array = [1, 2, 3] const result = arrayShift(array) expect(result).toEqual([2, 3]) expect(result).not.toBe(array) ...
true
9badb1f1a432982bdd2c1752215722479fe3363e
JavaScript
antroar/8-semestre
/PAW/practicas/s1/pk03_funcionesPrimera/index.js
UTF-8
357
3.75
4
[]
no_license
// funciones como primera clase var funcionSaludar = function (nombre){ console.log("hola %s",nombre); }; var funcionDespide = function (nombre){ console.log("Adios "+nombre); }; // construir manejadores (handlers - delegados) var mensaje = function(nombre, handler){ handler(nombre); }; // usando la funcion mensa...
true
07f7c5ebe34586d0db47ee4aba888de9c5c1d722
JavaScript
Oxion/WeatherWebApp
/src/server/middlewares/auth.js
UTF-8
1,714
2.546875
3
[]
no_license
var loggers = require('../loggers'); function getAuthToken(req) { var authHeader = req.get('Authorization'); if (!authHeader) { return } var authHeaderParts = authHeader.split(" "); if (!authHeaderParts || authHeaderParts.length != 2) { return } if (!authHeaderParts[0] || authHeaderParts[0].toLow...
true
1b7404e16005ef66ec2c7db034a334de395daf2e
JavaScript
goodlucky1215/lab_spring4
/spring4_1_1/WebContent/study_js/ch02/obj.js
UTF-8
297
3.328125
3
[]
no_license
'use strict' class Mycolor{ constructor(color){ this.color = color; } draw(){ console.log("나의 색깔은",this.color) alert("나의 색깔은",this.color); } }; class usercolor extends Mycolor{}; const user1 = new usercolor('red'); user1.draw(); console.log(user1.draw());
true
1e99b4408ed73ccfc30e2b5f825ec16fbf7668aa
JavaScript
mmpadget/lab-01-modular-patterns
/lab-padget/test/hello-test.js
UTF-8
481
2.84375
3
[]
no_license
'use strict'; console.log('evaluating hello.js'); const assert = require('assert'); const hi = require('../lib/hello.js'); let name = 'Michael'; describe('hello.js', function() { describe('#greetObject', function() { it('should return a string with greeting and name', function() { assert.equal(hi.greetOb...
true
2d1e0dfcab87f286188d24353b6ca164202fe1f9
JavaScript
zuramai/laravel-restaurant-lsp
/public/pages/chartist.init.js
UTF-8
8,661
2.921875
3
[ "MIT" ]
permissive
/* Template Name: Lexa - Responsive Bootstrap 4 Admin Dashboard Author: Themesbrand File: Chartist init js */ //smil-animations Chart var chart = new Chartist.Line('#smil-animations', { labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], series: [ [12, 9, 7, 8, 5, 4, 6, 2, 3, 3, 4...
true
9bd7c0310b2709b85639eb870fd7febfc9a9ece3
JavaScript
tiberlas/Doctor-Help
/react/src/components/clinic/MapContainer.jsx
UTF-8
3,796
2.859375
3
[]
no_license
import React, {Component} from 'react'; import {Map, InfoWindow, Marker, GoogleApiWrapper} from 'google-maps-react'; /* THIS COMPONENT SHOWS ADDRESS OF CLINIC IN GOOGLE MAPS, IT USES 2 API-ES OpenCage Gecode API (https://opencagedata.com/) for getting the longitude and latitude of the address, city and state Google ...
true
eb1cc58435fb775fc338865dee188780c2352d83
JavaScript
RafaelM-DEv/Motion
/js/bag.js
UTF-8
270
2.59375
3
[]
no_license
var text = '' var slot = []; export default function bag (model) { slot.push(model) for (let index = 0; index < slot.length; index++){ text += slot[index] + "<br>" document.getElementById("items").innerHTML = text } } // usar local storage
true
bc42420a81a51ae0a4df5f488f93e0de7ded36d4
JavaScript
sesong11/MkDocsPlus
/docs/chartistjs/data.js
UTF-8
1,491
3.328125
3
[ "BSD-2-Clause" ]
permissive
var data = { // A labels array that can contain any sort of values labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'], // Our series array that contains series objects or in this case series data arrays series: [ [5, 2, 4, 2, 0] ] }; // Create a new line chart object where as first parameter w...
true
bd42af1e347e8ba1ddd08c855cb3b2906d74cb17
JavaScript
tylerthecoder/Tyler-Tracy-Front-Page
/src/componets/title_screen/titleScreen.jsx
UTF-8
2,024
2.625
3
[]
no_license
import React, { useState, useEffect } from "react"; import { Parallax } from "react-parallax"; import API from "../../api"; import { wait } from "../../utils"; import HeadShot from "../headshot"; import NowPlaying from "../nowPlaying"; import "./styles.css"; // function useTypeyText(message) { // const [text, setTex...
true
633f08bfdf666cff48968694b38c1f136b816d1b
JavaScript
lrogeriocs/NodeExpress
/Express101/expressRouting.js
UTF-8
472
2.984375
3
[]
no_license
const express = require('express'); const app = express(); app.listen(3000, ()=>console.log('Listening port 3000')); // app object has some methods // HTTP verbs // 1- get // 2- post // 3- put // 4 -delete //all those methods take 2 args // 1 path // 2 callback app.get('/', (req, res)=>{ res.send('<h1>GET EXPRES...
true
c791a0c58b73322257ae9f0a475f9a81f95f6306
JavaScript
Sardonic1999/JavaScript_exercises
/test06.js
UTF-8
1,114
3.65625
4
[]
no_license
// const arr = [1, 4, 3, 4, 5, 6, 2]; const number1 = 123; const number02 = 45567; const arr1 = Array.from(String(number1), Number); const arr2 = Array.from(String(number02), Number); const arr = arr1.concat(arr2); function median(arr){ const Sorted = arr.sort((a, b)=> a-b); return Sorted.length % 2 ===0 ? (S...
true
801177554e7746013f0106d70b47378b9812954c
JavaScript
woleEkanola/snakee
/app.js
UTF-8
7,010
3.234375
3
[]
no_license
const canvas = document.getElementById('canv') let wiw = window.innerWidth canvas.width = wiw > 750 ? 600 : 320 canvas.height = 520 const gameSpeed = 500 function reset(){ snake= [] snake[0]= {x:0, y:0} snake[1]= {x:1, y:0} snake[2]= {x:2, y:0} score = 0 scores= [] } let snake= [] snake[0]= {x:0, y:0} ...
true
d6133272721d0aa5da69d6f0069aae2b6800826b
JavaScript
guxianggzd/muke
/src/redux/chat.redux.js
UTF-8
3,128
2.703125
3
[]
no_license
import axios from 'axios' // 全局请求 import io from 'socket.io-client' // 将输入信息发送 const socket = io('ws://localhost:9093') // 获取聊天列表 const MSG_LIST = 'MSG_LIST' // 标识已读 const MSG_READ = 'MSG_READ' // 接收后端消息 const MSG_RECV = 'MSG_RECV' const initState = { // 所有消息 chatmsg : [], users:{}, //未读信息 unread...
true
4e8991073bb54ee4803428a4d0e2e65b00cb900b
JavaScript
syed-786/spinny-test
/src/Redux/Reducers/animeReducer.js
UTF-8
1,165
2.609375
3
[]
no_license
import { FETCH_ANIME_REQUEST,FETCH_ANIME_SUCCESS,FETCH_ANIME_FAILURE,PAGE_RESET,SEARCH_TEXT} from '../Actions/animeAction'; const initialState = { animeData:[], isLoading: false, page:1, searchText: undefined, limit:16, error:'' } const animeReducer = (state = initialState, action) => { s...
true
c6841553df29181c518c5a4e413cab86941e97ce
JavaScript
craniatechnology/charter
/fptcore/test/utils/time_test.js
UTF-8
6,375
2.640625
3
[]
no_license
const _ = require('lodash'); const assert = require('assert'); const sinon = require('sinon'); const moment = require('moment-timezone'); const TimeUtil = require('../../src/utils/time'); const sandbox = sinon.sandbox.create(); describe('TimeUtil', () => { afterEach(() => { sandbox.restore(); }); describ...
true
1bf63f70810ca7f76c7cd0b3bfd59891abd39b88
JavaScript
ITTrain/SSaleContract
/src/main/webapp/static/JS/User/UserList.js
UTF-8
1,713
2.609375
3
[]
no_license
/* ****************************/ /*ユーザー一覧画面用JavaScript */ /* UserList.js */ /* ****************************/ function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.val...
true
04ccb6c7fe4f61986d05ce1faec07510623d719f
JavaScript
yiyada77/algorithm
/leetcode/15-链表/21. 合并两个有序链表.js
UTF-8
1,506
3.859375
4
[]
no_license
/** * Definition for singly-linked list. * function ListNode(val, next) { * this.val = (val===undefined ? 0 : val) * this.next = (next===undefined ? null : next) * } */ /** * @param {ListNode} list1 * @param {ListNode} list2 * @return {ListNode} */ // 递归 // 时间复杂度O(m+n),m、n为两个链表的长度,每次递归排除掉一个节点,总递归次数是m...
true
5d2a8ec124e68d2d4cac8e1ccb0c89607461af1c
JavaScript
carloscesarvalle/lab-react-ironcontacts
/src/App.js
UTF-8
4,969
3.609375
4
[]
no_license
// ----------------------------------------------------------------------------------------------------------- // This solution uses hooks import React, {useState} from 'react'; import contacts from './contacts.json'; const App = () => { const [celebrities, setCelebrities] = useState([...contacts].splice(0,5)) const...
true
c9197f257bdea9923a20790e6b111ca8b9e3a6d2
JavaScript
ws7one/RNCarouselImageVideo
/src/redux/reducers/Carousel/CarouselReducer.js
UTF-8
1,177
2.609375
3
[]
no_license
import { GET_TABS, IS_TABS_LOADING, SET_ACTIVE_TAB } from '../../constants/actionTypes'; const INITIAL_STATE = { isLoading: false, tabsForCarousel: [] }; export default (state = INITIAL_STATE, action) => { switch (action.type) { case IS_TABS_LOADING: return { ...
true
19d100c995cfbfba86e4c1771d86c7e7cf283b5a
JavaScript
Nomadcheng/JS-data-structures
/binarySearchTree.js
UTF-8
4,751
3.703125
4
[]
no_license
const insertNode = Symbol('insertNode') const inOrderTraverseNode = Symbol('inOrderTraverseNode') const preOrderTraverseNode = Symbol('preOrderTraverseNode') const postOrderTraverseNode = Symbol('postOrderTraverseNode') const searchNode = Symbol('searchNode') const removeNode = Symbol('removeNode') const findMinNode = ...
true
79fc1c78c7a94f588bafba3ed1e88bd7c0690b57
JavaScript
DanielOjcius/bus-frequency-vis
/lib/parse-data.js
UTF-8
2,460
2.875
3
[ "MIT" ]
permissive
'use strict'; var _ = require( 'lodash' ); /* RESPONSE DATA STRUCTURE ========================================================================== data = [ ..., { // Day Object stop_id: '2681', stop_name: 'Highland Ave @ Benton Rd', mode: [ ..., { // Mode...
true
79bcb1641dfdd12aaf842997e84ab0fb31dcfe45
JavaScript
Raziyehbazargan/DataStructures
/3-interview-questions/array/array-sorted-opt.js
UTF-8
835
3.78125
4
[]
no_license
'use strict'; // in Sorted array for search we can use BS (Binary Search) function searchBST(value, arr) { let low = 0; high = arr.length - 1, mid; if (high < low) return -1; while (low <= high) { mid = Math.floor((low + high) / 2); if (value === mid) return mid; // we return index else if (value...
true
7dca6bf4dcdaf0d3cc5d23e10bc6608766d55781
JavaScript
ridoy/coordinates-web
/server.js
UTF-8
3,466
2.953125
3
[]
no_license
/* * Coordinates Multiplayer * Author: Ridoy Majumdar (ridoymajumdar@gatech.edu) * Version: 0.0.1 */ /* * Setup: imports, starting server */ var express = require('express'), app = express(), http = require('http').Server(app), io = require('socket.io')(http), uuid = require('nod...
true
4cd154556e6f81b4e8eea21cad56abed8a119729
JavaScript
victorcastelan/cursoCanvas
/tareaCanvas/js/Pistola.js
UTF-8
436
2.90625
3
[]
no_license
function Pistola() { this.x = 0; this.y = 0; this.rotation = 0; } Pistola.prototype.draw = function(context) { context.save(); context.translate(this.x, this.y); context.rotate(this.rotation); // context.moveTo(-50, -25); context.drawImage( js.fotos[0], // 400, // jss.lienzo.height/2-jss.fotos[0].h...
true
c058cbacaa55ec0dd7bda96fd771bd28d134e99a
JavaScript
ashun989/Yuketang_Helper
/js/content_script.js
UTF-8
4,107
2.5625
3
[]
no_license
// 后台脚本 var apiBase = "" var pageBase = "" var cids = [] // classroom_id var aids = [] // activities_id var cnames = {} // classroom_name var tasks = [] init() function init() { var currUrl = window.location.href; var lastInd = currUrl.lastIndexOf('/'); if (currUrl.substr(lastInd + 1, 5) == "index") { ...
true
1e398b22cf88e70406862223cc719ff57b51f6b1
JavaScript
AthenaBird/Sun-God-Bot
/commands/events.js
UTF-8
3,205
2.875
3
[]
no_license
const Discord = require("discord.js"); const SQLite = require("better-sqlite3"); const sql_calendar = new SQLite("./databases/calendar.sqlite"); module.exports = { name: 'events', aliases: ["calendar"], description: 'Retrieves all upcoming discord events with clickable hyperlinks.', category: "Events/Calendars",...
true
c5791a2eee9accf740bd336c04ae0fbbf84b1486
JavaScript
jmarin4777/algos
/javascript/slist_reverse.js
UTF-8
520
2.953125
3
[]
no_license
// list = // [1]<-[5]->[8]->[3]->[9] function reverse(list){ runner = list.head next = 0 while(runner != null){ follower = runner if(next == null){ list.head = runner break } if(runner != list.head){ runner = next next = runn...
true
86278b1cbfdd612fb1995f1cb3e3c372817731b8
JavaScript
sgravrock/typescript-migration-demo
/jasmine/spec/storageServiceSpec.js
UTF-8
1,715
2.703125
3
[ "MIT" ]
permissive
define(["storageService"], function(ss) { var StorageService = ss.StorageService; describe("storageService", function() { "use strict"; beforeEach(function() { var that = this; this.items = {}; var localStorage = { getItem: jasmine.createSpy("getItem"), setItem: jasmine.cr...
true
e3ec9a0cb5101d2ca08e34b06e8964fc3d818524
JavaScript
dataiku/handsontable
/src/plugins/manualColumnFreeze/test/manualColumnFreeze.spec.js
UTF-8
9,705
2.765625
3
[ "MIT" ]
permissive
describe("ManualColumnFreeze plugin:", function () { var id = 'testContainer'; beforeEach(function () { this.$container = $('<div id="' + id + '"></div>').appendTo('body'); }); afterEach(function () { if (this.$container) { destroy(); this.$container.remove(); } }); describe("addF...
true
c060a9aa455c427d6ff17015ad88fb0ecc94d0e2
JavaScript
ratta2ii/celebrity-dating
/js/scripts.js
UTF-8
1,477
2.984375
3
[]
no_license
$(document).ready(function() { var age = $("#age").val(); var food = $("input:radio[name=food]:checked").val(); var date = $("#date").val(); $("#userQuiz").submit(function() { event.preventDefault(); if (age < 25 && date === "walk") { $("#result").text("Miley Cyrus"); $(".result").show(); ...
true
a34ba657867594a64c4adb007a3cde94470067c3
JavaScript
chakradeb/todo-debuc
/src/todo.js
UTF-8
1,039
3.125
3
[]
no_license
let Item = require('../src/todoItem.js'); class Todo { constructor(title,description='') { this.title = title; this.description = description; this.items = []; } getTitle(){ return this.title; } updateTitle(title){ if (title) this.title=title; } getDescription(){ return this.descr...
true
796c63c67a180ae5362f772d5182cfa20cd3ec51
JavaScript
ryanbarringtoncox/gameoflife
/app/main.js
UTF-8
4,752
3.09375
3
[]
no_license
(function() { var World = require('world'), Canvas = require('canvas'), PianoSprite = require('./audio/pianosprite'), DrumSprite = require('./audio/drumsprite'), BassSprite = require('./audio/basssprite'), pianoSprite, w, canvas, startBtn, interval, slider, resetBtn, isRunning, pianoSpriteSiz...
true
f492fcf57eb2ba3c555209363b9cbe99049d2356
JavaScript
miles-fitzsimons/haiku
/components/submitForm.js
UTF-8
2,871
2.90625
3
[]
no_license
import React, { Component } from 'react' import getSyllables from '../lib/getSyllables' import data from '../database/haikus.json' class SubmitForm extends Component { constructor (props) { super(props) this.state = { count1: 0, count2: 0, count3: 0, class1: 'incorrectCount', class2: 'inco...
true