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
34709ebff99ae333c144029f50fb582d2bfb7905
JavaScript
sehandev/web-text-viewer
/web/static/js/txt_ajax.js
UTF-8
6,041
2.984375
3
[]
no_license
let content_string = "" let content_arr = [] let page_index = 0 let max_page_index = 0 function getType(tmp) { return Object.prototype.toString.call(tmp).slice(8, -1) } function isString(tmp) { let type = getType(tmp) if (type == "String") { return true } return false } // split_txt_conte...
true
9f0d6a25d5a07b85520eb4d3de2b877c09751c4c
JavaScript
remy-auricoste/adriatik
/old/services/randomFactoryBuilder.js
UTF-8
3,978
2.53125
3
[]
no_license
var StateSync = require("../model/tools/StateSync"); var logger = console; function randomFactoryBuilder(randomSocket, hashService) { if (randomSocket) { var hashesMap = {}; var generatedMap = {}; var deferMap = {}; var hashSync = new StateSync(randomSocket.hashSocket); hashSync.syncListener( ...
true
25a30ae58b71779392c5baf649935dcf31b7b0e7
JavaScript
Henriquedevb/logicajs
/aula (prof)/aula10/aula10/anilho.js
UTF-8
972
4.03125
4
[]
no_license
/* A entrada do programa deve receber: As coordenadas do ponto P1, que representa o centro dos círculos concêntricos; o valor “r” para o raio do círculo inscrito, o valor “R” para o raio do círculo circunscrito e as coordenadas de um outro ponto P2 qualquer. */ const receber = require('prompt-sync')({sigint: true}); ...
true
3278836faebb91410c7ce5e41bf47bc1cdefcc33
JavaScript
Itcast-ZhaoXiaoyan/Web-Case-Code
/DataStructure/希尔排序.js
UTF-8
1,575
3.984375
4
[]
no_license
/*希尔排序原理 首先,将待排序数列按照一定的增量分为若干子数列,不是连续的,它是按照一定的增量进行分割, 再对各个子数列进行插入排序,接着增量都要减少,然后对每部分进行插入排序 第一趟m1=n/2——(增量为m1) 第二趟m2=m1/2——(增量为m2) 第三趟m3=m2/2——(增量为m3) 与插入排序不同的是,需要额外操作的只有对增量的处理及对数列的分块处理 */ public class ShellSort { private int[] array; public ShellSort(int[] array) { this.array=...
true
ff12639176e8f8351b9d1687716bead68ea00322
JavaScript
fterdal/2001-fsa-ch-await-demo
/main.js
UTF-8
355
3.03125
3
[]
no_license
const { waitForIt } = require("./waitForIt") async function main() { try { console.log("Starting the promise") const message = await waitForIt("Hello World", 1000, true) console.log("Finished awaiting the promise") console.log(message) } catch (error) { console.log("caught the error! ✅") c...
true
50a02084581a1b3cfd8b6804f4bc552d445abcfd
JavaScript
rwong210/Comp3512-f2020-chapter08
/f2020-chapter08/js/lab08-ex20.js
UTF-8
1,380
4.0625
4
[]
no_license
/* To refresh your memory, here are two complex objects created using object literal syntax. If we have many objects with the same structure, this is a time- and space-consuming way of doing so. */ const apple = { symbol: "AAPL", name: "Apple Inc.", location: { address: "One Apple Park Way", ...
true
2bcea35bcc9351a84880ea89ee36d7d6e098a1de
JavaScript
ross-ferreira/bootcamp--week-10--advanced-react
/notes/04-hooks/figures/04-reducer-id.js
UTF-8
237
3.65625
4
[]
no_license
// the reducer const reducer = state => { return state; }; // our state const initial = { player1: 0, player2: 0, }; // run the reducer, passing in state let newState = reducer(initial); console.log(newState); // same as initial
true
07baa325fa18972142e1cef170b0816418f18f07
JavaScript
JoshuaSheng/bettersurveys-frontend
/src/components/questioninput.jsx
UTF-8
2,580
2.53125
3
[]
no_license
import TextInput from "./textinput.jsx"; import RadioInput from "./radioinput"; import ScaleInput from "./scaleinput"; import "../css/questioninput.css"; import React, { Component } from "react"; class QuestionInput extends Component { render() { return ( <div className="inputContainer"> {this.getQ...
true
1ee37fca657b7979de82c676455692d37a3661f6
JavaScript
DmitryBoboshko/webProgrammingLabs.github.io
/Case 2/js/task_2.js
UTF-8
475
3.03125
3
[]
no_license
'use strict' window.onload = function () { let textHead = document.querySelectorAll(".text-block__header"); let text = document.querySelectorAll("p"); console.log(textHead); console.log(text); for (let i = 0; i < textHead.length; i++) { textHead[i].addEventListener("click", function(){ ...
true
c31b97fe8328cb5bf916c9dd5ea16b4b6d51b606
JavaScript
yannicksandler/DCL
/htdocs/Backend/scripts/isMenorFechaInicio.js
UTF-8
2,617
3.515625
4
[]
no_license
function isMenorFechaInicio(timeFrom, timeTo) { if((timeFrom == '') || (timeTo == '')) { return false; } // seperar hora de am/pm var arrayTimeFrom = timeFrom.split(" "); var arrayTimeTo = timeTo.split(" "); //alert(arrayTimeFrom[1]); // son los dos AM o PM if (arrayTimeFrom[1] == arrayTimeTo[1]) { //...
true
3b8864b4fe6a5969a82a45df0be196c462e4ee40
JavaScript
mhlee80/playground-nodejs
/yield-promise.js
UTF-8
1,003
3.546875
4
[]
no_license
// const p = () => {new Promise((res, rej) => { // setTimeout(() => { // res('!!!!!'); // }, 1000); // })}; async function *gen() { function asyncfunc() { return new Promise((res, rej) => { setTimeout(() => { res('!!!!!'); }, 1000); }); } yield asyncfunc(); // async functio...
true
cf0afba31b080082b21fa5337ed87e97266256e1
JavaScript
adityarachmanp/adityarp.github.io
/script.js
UTF-8
414
3.09375
3
[]
no_license
const output = ['Siswa Hacktiv 8', 'Web Developer', 'Graphic Designer']; let count = 0; let index = 0; let currentTxt = ''; let words = ''; (function ngetik(){ if(count == output.length){ count = 0; } temp = output[count]; words = temp.slice(0, ++index); document.querySelector('.efek-ngetik').textContent = w...
true
b9b43522afaf5e751633e843201928ed7381f31e
JavaScript
MohammedAyman2018/preview
/Quaed/api/controllers/post-controller.js
UTF-8
2,201
2.625
3
[]
no_license
var { validate, Post } = require("../model/Post"); exports.count_articles = async (req,res , next) => res.json(await Post.countDocuments()) /** Get All Posts */ exports.list_articles = async (req, res, next) => res.json(await Post.find({})).status(200); /** Get post */ exports.get_article = async (req, res) => res...
true
bf3f692a15884fc663a4fd81549a72585a062f63
JavaScript
nick-bryan/nba-shot-charts
/shot_chart_d3.js
UTF-8
6,098
2.890625
3
[]
no_license
// Global variables var w = 500, //width of court h = 440, //height of court margin = { //padding top: 20, right: 20, bottom: 20, left: 50}, col = 30, //number of hexagons from left to right r = w / (Math.sqrt(3) * col), //radius ...
true
ed41107bba0998185114f1af86001f51444ececb
JavaScript
bryanringor13/AskAnExpertSystem
/src/redux/reducers/topicReducers.js
UTF-8
764
2.5625
3
[]
no_license
import { act } from 'react-dom/test-utils' import { ALL_TOPICS_RETRIEVED, TOPIC_LOADING } from '../actions/topicActions' // Define your state here const initialState = { topics: [], loading: false, } // This export default will control your state for your application export default(state = initi...
true
686daf833d4b4015a026fa69761ee7802886d053
JavaScript
Adammonast/JavaScript-Practice
/01-Basics/06-Arrays.js
UTF-8
988
4.8125
5
[]
no_license
// Arrays are a data structure that can store a list of multiple values // arrays use brackets // brackets are array literals, indicate an empty array // syntax ---> [value, value, value] // primitive type rules apply to array values (strings need quotes, etc) let selectedColors = ["red", "blue"]; console.log("Array: "...
true
b78846cdf0e71aa9e195d779925962b82b8454ac
JavaScript
Crio-Winter-of-Doing-2021/GROWW-T11
/chatbot-frontend/src/chatbot-widgets/CategorySubQuestion.js
UTF-8
1,729
2.625
3
[]
no_license
import '../components/App.css'; import axios from 'axios'; import { useState, useEffect } from 'react'; import { useSelector} from 'react-redux'; import Cookies from "js-cookie"; export default function CategoryQuestions(props) { const currentLoc = window.location.pathname; const [options,setOptions]=useState(...
true
334590f2a5621d36bbf1c5b7e91734f039737821
JavaScript
pandyatama17/camrent_siska
/public/jplist/test/selenium-tests/specs/2-text-filter-with-sort-dd.js
UTF-8
5,343
2.65625
3
[ "MIT" ]
permissive
var assert = require('assert'); describe('filter with oo and then sort z-a (top)', function() { beforeAll(function(done){ browser.url('/test/pages/2-text-filter-with-sort.html') .setValue('(//input[@data-path=".title"])[1]', 'oo') .click('(//div[@class="jplist-dd-panel"])[1]') ...
true
2c1006797e765ed93002f2cb8063240bf79d1f9d
JavaScript
shemeerkodanad/mywork
/src/redux/modules/Contact/Contact.js
UTF-8
432
2.65625
3
[]
no_license
const types = { ADD_CONTACTS : 'ADD_CONTACTS' } const initialstate = { contacts: [] } export const actions = { addMyContacts : (contact) => ( {type:types.ADD_CONTACTS, payload: contact} ) } export const ContactReducer = (state = initialstate, action) => { switch(action.type){ case types.ADD_CONTACTS...
true
1ec5cca817b5eb62b7a94fadb11b20245a4d82df
JavaScript
dmserrano/ReactWorkshop
/jsx/StateApp.jsx
UTF-8
789
2.890625
3
[]
no_license
import React from 'react'; class StateApp extends React.Component { constructor() { super(); this.state = { data: [ { id: 1, name: 'One' }, { id: 2, name: 'Two' }, { id: 3, name: 'Three' } ] }; }; render() { return ( <div> <Header/> ...
true
b7d24994a933baeb0508982c3592a1c3bd5d0c40
JavaScript
Aigerim-serdaliyeva/todo-list-js-vue
/js/main.js
UTF-8
1,378
3.09375
3
[]
no_license
let newId = 0; const app = new Vue({ el: '#app', data: { newCar: '', cars: [ { id: ++newId, name: 'Toyota', complete: false }, { id: ++newId, name: 'Huyndai', complete: false } ], filter: 'all', searchText: '' }, metho...
true
49cef8f0ae2bd9a95cc1cecdfd645582f856c244
JavaScript
xhra/exref
/jsfb/jalaali-js.js
UTF-8
644
3.1875
3
[]
no_license
// not available for browser (convert to umd with browserify) var jalaali = require('jalaali-js'); // npm install jalaali-js --save jalaali.toJalaali(2016, 4, 11) // { jy: 1395, jm: 1, jd: 23 } jalaali.toJalaali(new Date(2016, 3, 11)) // { jy: 1395, jm: 1, jd: 23 } jalaali.toGregorian(1395, 1, 23) //...
true
5f567d8c3e94e27ee14dbf13a9439f64fccd5de1
JavaScript
aneeshbharadwajka/functionalJS
/filterExample.js
UTF-8
812
3.171875
3
[]
no_license
function getShortMessages(messages) { var errorMessage = 'Incorrect input.Array does not have message property', isValid = true; if (messages instanceof Array) { var filteredMessageObjects = messages.filter(function checkLength(messageObject) { if (messageObject.message === undefined) ...
true
5ef611eea7865551c593d430cbf4010430457117
JavaScript
AhmedBadryy/PhoneBook
/JavaScript/Script.js
UTF-8
3,766
2.828125
3
[ "MIT" ]
permissive
// For Hand Every Thing is Going To Do A Reaction On It var sort = document.querySelector(".list-input"); var search = document.querySelector(".search-input"); var inputs = document.querySelectorAll(".input"); var buttonAdd = document.querySelector("#add"); var contactCounter = document.querySelector(".contactcounter"...
true
d7ee1f2e7dad1c2f74ece3a75c42171a85838693
JavaScript
maro14/express-customer-api
/controllers/user.js
UTF-8
2,084
2.6875
3
[]
no_license
const user = require('../models/user'); const crateuser = (req, res) => { const name = req.body.name; const age = req.body.age; user.create({name, age}) .then(creates => { res.status(201).json(creates); console.log("User saved"); }).catch(err => { res.status(404).s...
true
d11ae147d81a8169571421e112324c8b304d96aa
JavaScript
TatriX/6a6ax
/src/state.js
UTF-8
6,745
2.578125
3
[]
no_license
/* global Phaser */ class State extends Phaser.State { constructor() { super(); this.safeTiles = [1,2,3]; this.threshold = 3; this.gridSize = 64; this.direction = Phaser.NONE; this.lastCollision = new Phaser.Point(); this.turning = { point: new Ph...
true
1ad6811970897c087f52b63ac16ae98b685d3e41
JavaScript
mladenilic/sc-changelog-formatter
/convert.js
UTF-8
663
3.015625
3
[]
no_license
const ucfirst = function (s) { return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase(); }; module.exports = function (line) { let matches = line.match(/[##|###] (Unreleased):*/i); if (matches && matches.length > 1) { line = `## [${ucfirst(matches[1])}]`; } matches = line.match(/[##|###] (ADDED|CHANG...
true
b4cc784b14b141db3ec7fd163ac4bbd6094511fb
JavaScript
SowmyaaRamesh/Voice-Actuation-Without-ML-frontend
/static/script.js
UTF-8
404
2.5625
3
[]
no_license
const playAudio = () => { let audioFile = document.getElementById("audioFile").value; let audioSrc = audioFile.substr(12); let AudioController = document.getElementById("audioSource"); AudioController.setAttribute("src", audioSrc); var audio = document.getElementById("audio"); audio.load(); // audio.pl...
true
bb7e0c7cc4a6685e7084a10af43686f4e78d5f55
JavaScript
captain-xu/reunite
/src/service/index.js
UTF-8
2,118
2.515625
3
[]
no_license
import Axios from 'axios'; import { ApiRequestError, ApiResultError } from './error'; function obj2str(obj) { let arr = []; for (let [k, v] of Object.entries(obj)) { arr.push(`${k}=${v}`); } return arr.join("&"); } let client = Axios.create({ timeout: 5000, paramsSerializer: params => obj2str(params),...
true
40b1d129cb91681bdaef8d87339e5684afb6584b
JavaScript
MIraK1E/Node-course-2-Todo-Api
/playground/bcrypt.js
UTF-8
379
3.015625
3
[]
no_license
const bcrypt = require('bcryptjs'); const password = '123abc!'; // how to hash password bcrypt.genSalt(10, (err, salt) =>{ bcrypt.hash(password, salt, (err, hash) => { console.log(hash); }); }); const hashedPassword = '$2a$10$SHGuhTzsrWw46uozuPL25OtHLRavoSsoryS4im3OnagTyKRb8VkD.'; // how to check ha...
true
421c52504880b657b93ea76fe4f56d012ef9460a
JavaScript
Erynvorn/CodeWars
/DecodeMorsekyu6.js
UTF-8
352
2.796875
3
[]
no_license
decodeMorse = function(morseCode){ console.log(morseCode); var mc = morseCode.trim().split(" "); console.log(mc); for ( i=0 ; i<mc.length ; i++) { if (mc[i] === '') {mc[i] =" "} else { mc[i]=MORSE_CODE[mc[i]] }} console.log(mc); return mc.toString().replace(/,/g,"").replace(/ /g," "); //your code ...
true
71fd66db7a2c1cecca0a557b814fc9e4d039353a
JavaScript
MassiGy/codeTricks
/asyncJs/catchAsync.js
UTF-8
1,128
3.5625
4
[]
no_license
// ExpressJS based async function handler // basic version (without passing the error to an third party express error handler middelware ). const catchAsync = fn => { // accepts a function return function(req, res) { // retun a function that will be executed on calling the catchasync function fn(...
true
e4d4ab061f5ebe67a0a9cf15e558c7f8306c6a89
JavaScript
AlexKVal/LearnYouNode
/10_time_server.js
UTF-8
562
3.09375
3
[]
no_license
var net = require('net'); var port = process.argv[2]; // 'YYYY-MM-DD hh:mm' function twoDig(num) { return ("0" + num).slice(-2); } var server = net.createServer(function (socket) { // console.log('client connected'); var now = new Date(); var response = '' + now.getFullYear() + '-' + twoDig(now.getM...
true
42d8e8af2fd25f45d4d8dbbdab3a1685c0bad90e
JavaScript
lilfish/Delta-Paaspop-Server
/adminpanel/src/front-end/public/js/game_controls.js
UTF-8
2,136
3
3
[]
no_license
// Start a game function start_game(game_id = false) { var url = "/game/start"; if (!game_id || game_id == "null") { openDanger("Game id is null?", 4000) return false } let json = JSON.stringify({ game_id: game_id, }); console.log("start", game_id); var request = new XMLHttpRequest(); request.open('POST'...
true
6b0cc53905fd22462b6f44ff7edc672c5e427d24
JavaScript
flylancoco/GamePlay
/basketmanagerconfig/convert/convertExcel.js
UTF-8
7,548
2.671875
3
[ "MIT" ]
permissive
var fs = require('fs') var path = require('path') var xlsx = require('xlsx') var workbook var sheetNames var dirOutPath = 'E:/GameplayFramework/basketmanagerconfig/output' var excelFilePath = 'E:/GameplayFramework/basketmanagerconfig/' function getLastChar(str) { let len = str.length if (!len || len < 1) { return -...
true
c89cfce8c809af49494b101d2b2363289e9e44b7
JavaScript
jatinbhikadiya/raySphereIntersection
/WebContent/CS 410 Example 5._files/example05.js
UTF-8
5,979
3.03125
3
[]
no_license
var ox // X coordinate of Sphere Center var oy // Y coordinate of Sphere Center var oz // Z coordinate of Sphere Center var radius// radius of Sphere var ex // X coordinate of Ray Origin var ex // Y coordinate of Ray Origin var ex // Z coordinate of Ray Origin var px // X coordinate of Point on Ray var px // Y coordi...
true
562940c09efaa8606125b9e47e29313e7ba48597
JavaScript
superdrew100/js-diagnostic-exercise
/app.js
UTF-8
2,913
3.5625
4
[]
no_license
console.log("Hello from app.js") //const //if (click checking deposit){ //add moneyamount value to checking //} //if (click checking withdraw ) //when you click the deposit button you should add the //value in the field to the current balance //This is creating the objects for the buttons const checkingDepositB...
true
0234716e550705f33ad48211c595fcc327307e5a
JavaScript
dordal/userballot
/app/scripts/directives/equal.js
UTF-8
912
2.703125
3
[]
no_license
/** * File : equal.js * * This file contains a custom directives for use with angular * form validators. */ 'use strict'; /** * equal * * Determines whether two values are equal or not and validates form * accordingly. * * http://stackoverflow.com/a/18014975 */ userballotApp.directive('equal', function ()...
true
6e48e0621c0485c85c739c1d5aca8a899d74c041
JavaScript
JesperLarsen117/INFORMATION-BOARD
/routes/index.js
UTF-8
801
2.53125
3
[]
no_license
const express = require('express'); const app = express(); const fetch = require('node-fetch'); module.exports = (app) => { app.get('/', (req, res) => { //Fetch API data fetch('https://infoboard.mediehuset.net/api/') //parse data as json .then(response => response.json()) ...
true
652f01d35f7120d191b3c9a611490cc4d2867bde
JavaScript
lbarney/FullStackDogs
/index.js
UTF-8
1,426
3.078125
3
[]
no_license
var dogs = [{ //data reserve name: "Fido", breed: "Doberman" }, { name: "Toby", breed: "Beagle" }, { name: "Max", breed: "Bulldog" }]; var express = require('express');//makes coding node way nicer var cors = require('cors'); // Takes care of headers var bodyparser = require('body-parser'); // parses obje...
true
87d6520c06ec234ca6b2b5931a623a894be61899
JavaScript
zhqjiang/whiteboard-interview-js
/src/03_throttle_timeout.js
UTF-8
789
3
3
[]
no_license
const throttle = (fn, wait) => { let timer return function (...args) { if (!timer) { timer = setTimeout(() => { fn.apply(this, args) timer = null }, wait) } } } const throttle2 = (fn, wait) => { let previous = 0 let timer, context, args const later = function () { ...
true
60a8755219c3687e034411608d0f824c0485cffe
JavaScript
toukubo/storyteller_cli
/models/framework.js
UTF-8
2,029
2.625
3
[]
no_license
class Framework { constructor() { this.frameworkDao = require('../daos/framework_dao.js') } instantiate(json) { var framework = new Framework() framework.name = json.name framework.json = json framework.tag = framework.json.tag // this is for nested models....
true
2c2b3686a84c4bc965596118f81cfd9ac52ac3d2
JavaScript
RodrigoAngeloValentini/pos-webmob-unoesc
/MEAN/unoesc-app-master/app/breweries/controllers/breweries.controller.js
UTF-8
2,019
2.546875
3
[ "MIT" ]
permissive
'use strict'; var mongoose = require('mongoose'), Brewery = require('../models/brewery.model'); exports.findAll = function(req, res) { Brewery.find({}).exec(function(err, breweries) { if (err) { console.error(err); res.status(400).json(err); } else { res.jso...
true
a5fd691df818d9ab388784b8cb39f848b493b36a
JavaScript
aerrity/msc-projects-react
/src/App.js
UTF-8
1,868
2.625
3
[]
no_license
import React, { Component } from 'react'; import 'bulma/css/bulma.css' import data from './data'; class App extends Component { titleCase(str) { return str.toLowerCase().split(' ').map(function(word) { return word.replace(word[0], word[0].toUpperCase()); }).join(' '); } render() { console.log(...
true
c82f547bf913ce58d17096e84fa8020c770e68ea
JavaScript
gmartinez31/Week6
/js-objects.js
UTF-8
3,827
4.0625
4
[]
no_license
///////////////////////////////// JavaScript Objects //////////////////////////////////// function Person(name, email, phone) { this.name = name; this.email = email; this.phone = phone; } Person.prototype.greet = function (other) { console.log('Hello ' + other.name + ', I am ' + this.name + '!'); }; /...
true
c864b9639377f4f9f847a8558e53ddbdafe69269
JavaScript
half-slice/programmers
/codingTest/MontyHall.js
UTF-8
1,087
3.34375
3
[]
no_license
function question(){ let first_pick_win=0; let first_pick_lose=0; let change_pick_win=0; let change_pick_lose=0; //let door=['goat','goat','porche']; 이렇게는 다음에 for(let i=0; i<1000000; i++){ let answer = Math.floor(Math.random()*3+1); let pick = Math.floor(Math.random()*3+1); let another = Math.floor(M...
true
33b34ede77e4d4a22335b4ff85ea6d1c8f42dde3
JavaScript
wk-js/lol.js
/js/math.js
UTF-8
1,268
2.890625
3
[]
no_license
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.map = exports.toPrecision = exports.toRadian = exports.toDegree = exports.clamp01 = exports.clamp = exports.DEG2RAD = exports.RAG2DEG = exports.PI2 = void 0; exports.PI2 = Math.PI * 2; exports.RAG2DEG = 180 / Math.PI; exports.DEG2RAD =...
true
e9868684037d55ae18d9c30818f4713c979e370f
JavaScript
tfan1811/GameIdea
/src/game/Game.js
UTF-8
2,134
2.953125
3
[]
no_license
import _ from 'lodash'; import { Screen } from './graphics/Screen'; import { KeyboardEvents } from './input/KeyboardEvents'; const DIMENSIONS = { width: 800, height: 600, }; /** * Base class that creates the game * @public */ export class Game { constructor(props, canvas, context) { this._width = props.w...
true
3adbc8682b0126eb566943dfc2f0824904e9e0d8
JavaScript
blanshec/snippets
/viber-app/utils.js
UTF-8
2,408
2.578125
3
[]
no_license
const request = require('request'); function createPromiseRequest(options) { return new Promise(function (resolve, reject) { request(options, (error, response, body) => { if (error || (response !== undefined && `${response.statusCode}`[0] !== '2')) { const errorObj = { ...
true
36c49b498cb0639596c8bb3b2ad94fd5ce61c3a8
JavaScript
meyer-mcmains/bee-remote
/src/nav/getCurrentRoute.js
UTF-8
880
2.65625
3
[]
no_license
import { get } from 'dot-prop'; /** * Returns the current route name for a given state * @param {Object} navigationState The current navigation state in a format * followed by `react-navigation` * @param {Number} [maxDepth=Infinity] The maximum number depth to search for ...
true
6fc1bc7d7c18bad05c545cd8dcaaf76187f277eb
JavaScript
alaynapuck28/redux-crm
/src/components/Customers.js
UTF-8
2,096
2.734375
3
[]
no_license
class Customers extends React.Component { state = { customers: [], searchTerm: "" }; componentDidMount() { const custs = store.getState().customers; this.setState({ customers: custs }); const st = store.getState().st; this.setState({ searchTerm: st }); store.subscribe(() => { con...
true
a6082de4c15ada697944ca573ec30b2afe704e0b
JavaScript
SheYueKai/static
/origin/js/interview/xhr.js
UTF-8
537
3.234375
3
[]
no_license
var xhr = new xmlHttpRequest; xhr.open('POST', url, true); xhr.send(); xhr.onReadyStateChange = function(){ if(xhr.readyState === 4 && xhr.status === 200){ console.log(xhr.responseText); } } // readyState 0-4 // 0 - 表示xhr对象已经存在,还未初始化 // 1 - 调用open方法,初始化并发送请求 // 2 - 调用send方法,接收服务器返回的数据,还未解析 // 3 - 解析服务器返回的数据,转换为re...
true
f513ea6c562c45708470dfc1e8a15a08d25f65bb
JavaScript
ahomentc/Vus
/vus-server/server/static/dino/vr_group_session.js
UTF-8
1,921
2.765625
3
[ "MIT" ]
permissive
function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie); var ca = decodedCookie.split(';'); for(var i = 0; i <ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.s...
true
427399558cd1f458750404e9dbf06fea6f73f9f0
JavaScript
DavidGiraldoDesign/hci_2_experimento
/public/js/sketch.js
UTF-8
5,505
2.59375
3
[]
no_license
/*var info = { preferencias: [200, 200, 200, 200, 200, 200, 200], cercania: [200, 180, 170, 150, 130, 110, 90, 70, 50] }*/ var metodos = []; var canvas; var runP5 = 0; var display = ["none", "block"] var fs = false; //if (this.runP5 == true) { var img = []; function preload() { img[0] = loadImage("imgs/i...
true
46ea42eac840d58a3a54ed2fe320008589caf479
JavaScript
johnreiley/venus-orbit
/dragHandler.js
UTF-8
2,708
2.90625
3
[]
no_license
export class DragHandler { _xPrev = 0; _xDiff = 0; _yPrev = 0; _yDiff = 0; _dragEl = undefined; _dragElContainer = undefined; handleX = false; handleY = false mousedown = false; isDragEl = false; constructor(dragEl, dragElContainer, settings) { this._dragEl = dragEl; this._dragElContainer...
true
245d9e40d3ad8acbeae7564fa7dae990da4f2be7
JavaScript
axxsxbxx/SSAFY5-Algorithm
/week19_8_3/PRG_부족한금액계산하기_상민.js
UTF-8
353
3.171875
3
[]
no_license
function solution(price, money, count) { let answer = 0; let totalPrice = 0 const range = Array.from({length: count}, (x, i) => i + 1); range.forEach(temp => { totalPrice += price * temp }) if (money > totalPrice) { answer = 0 } else { answer = Math.abs(money - totalP...
true
a51ef7d6e2d4e64db60e6438153191305ccd5264
JavaScript
marioa98/Eloquent-Javascript-Tuturial
/lesson2.js
UTF-8
528
3.671875
4
[]
no_license
function loopingTriangle(times) { let counter = 1; let hashes = "#"; while (counter <= times) { console.log(hashes); hashes += "#"; counter++; } } function fizzBuzz() { for (let index = 1; index <= 100; index++) { if (index % 3 == 0 && index % 5 != 0) console.log("F...
true
15f56612784237fefef398c618805ba6f6552c95
JavaScript
softwareclinic-nurse/featurebook
/test/lib/markdown-parser.spec.js
UTF-8
2,154
2.609375
3
[ "Apache-2.0" ]
permissive
'use strict'; var markdown = require('../../lib/markdown-parser'); describe('markdown-parser', function () { describe('#parse', function () { it('should parse emphasized text', function () { markdown.toHTML('I am __emphasized__.') .should.equal('<p>I am <strong>emphasized</st...
true
cd8c9395cf57e930939294878b49948c9ff89dd1
JavaScript
quirimmo/angular-upgrade-component-generator
/lib/OVUpgradeComponent.js
UTF-8
5,195
2.78125
3
[]
no_license
'use strict'; const fs = require('fs'); const ANGULARJS_COMPONENT_EXTENSION = 'component.js'; const ANGULARJS_DIRECTIVE_EXTENSION = 'directive.js'; const ANGULAR2_DIRECTIVE_EXTENSION = 'directive.ts'; class OVUpgradeComponent { constructor(input, output) { // get the component input provided as paramete...
true
bb66eb5d810cb429fe47432d427ed3e2d987c066
JavaScript
ComLife/JavaScript-study
/common.js
UTF-8
8,196
3.5625
4
[]
no_license
var commonUtils = { /** * 判断一个数是不是奇数 * @param {number} n */ isOdd: function (n){ return n % 2 === 0; }, /** * 判断一个数是不是素数 * @param {number} n */ isPrime: function (n){ var squareRoot = Math.sqrt(n); if(n < 2){ return...
true
43b34e20f5b0bc54a5657c5be2fdea91a5ed96ff
JavaScript
gaxoner1/RecipeAPI
/src/Recipe.js
UTF-8
4,045
2.8125
3
[]
no_license
/* API Project converted to try catch block with async-await methods*/ import React from "react"; import "./styles.css"; import firebase from "./firebase"; console.log(`process env: ${process.env.REACT_APP_API_KEY}`) const keys = { app_id: "5fb1cce8", apiKey: "b9ff5d5d50e22b60f7fcf4ef5c9344d7" }; class App ext...
true
2fdb02b1b0888db5576e0d820f25d8ecc38a6cbd
JavaScript
hughsk/bezier-tweaker
/index.js
UTF-8
3,863
2.546875
3
[ "MIT" ]
permissive
var Emitter = require('events/') var debounce = require('debounce') var bezier = require('bezier') var clamp = require('clamp') var ns = 'http://www.w3.org/2000/svg' var SVG = { line: require('svg-line') } module.exports = tweaker function tweaker(opts) { opts = opts || {} var svg = document.c...
true
4bfb2696651015882cbe292237a1f0d11fa1a317
JavaScript
andrew--r/pseudohover
/pseudohover.js
UTF-8
736
3.265625
3
[]
no_license
document.addEventListener('DOMContentLoaded', function() { var toArray = function(pseudoarray) { return [].slice.call(pseudoarray); }; var links = toArray(document.querySelectorAll('a')); links.forEach(function(link) { var href = link.getAttribute('href'); if (href == '#' || href == '') return; ...
true
0c6e2b5214f7575afb411af17759bbaaf4433b3d
JavaScript
StTronn/GroowWebMasters
/src/Store.js
UTF-8
928
2.53125
3
[]
no_license
import React, { useReducer } from "react"; export const Store = React.createContext(); const initialState = { notifications: [], }; function reducer(state, action) { console.log("reducer", state); switch (action.type) { case "ADD_NOTIFICATION": { const newList = [...state.notifications, ]; retu...
true
1b2ff8a7d48d9184122fe2c5acc2de9c1c8100ef
JavaScript
AdrianJazowski/cardGame
/src/reducers/reducer.js
UTF-8
1,905
2.765625
3
[]
no_license
/** @format */ import { actionsTypes } from "../actions/actionsTypes"; const initialState = { credit: 1000, playerHand: [], croupierHand: [], playerRoundsHistory: [], ourBid: 0, cashForWinInThisRound: 0, croupierRoundsHistory: [], deck: null, historicalScore: [], round: 0, playerTurnIsNow: true,...
true
ab39053cb37800c21b0bb2c40c39b1a8872cb742
JavaScript
Andrei0872/Algorithms
/JavaScript/Diverse/generate-hashtag.js
UTF-8
1,407
3.828125
4
[]
no_license
//* Generate Hashtag // https://www.codewars.com/kata/the-hashtag-generator/javascript function generateHashtag(str) { if(!str.trim()) return false; const res = "#" + str .replace(/^\w/, function (s) {return s.toUpperCase()}) // Capitalize first letter .replace(/\s+([a-z])/g,function(match,$1) {c...
true
382565ea89b04daa5f865b66b5470a93844a7e2d
JavaScript
gowthamrn4/WebRTCApp-ReactNative
/Server/index.js
UTF-8
1,284
2.65625
3
[]
no_license
var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); var connections = []; function listAllConnections(){ console.log("Conenctions", connections[0],connections[1]); } io.on('connection', function(socket){ var role = ''; if(Object.entries(connections)....
true
8167cdd3e1ef6e551dd8833d7b918b0cf1829ce4
JavaScript
piwanaga/jobly
/__tests__/integration/usersRoutes.test.js
UTF-8
4,802
2.546875
3
[]
no_license
process.env.NODE_ENV = "test" const request = require("supertest"); const app = require("../../app"); const db = require("../../db"); const User = require('../../models/user') const jwt = require('jsonwebtoken'); const { SECRET_KEY } = require('../../config') describe("test users routes", () => { let testUser ...
true
69cbefea141c40dfdf3cde63a6d2b3fa25fa4d59
JavaScript
vessos/Js-Core-Archive
/JsCore/08.Exercise(arrayAndMatrix-3.10.16)/printArrayWhithGivenDelimiter.js
UTF-8
229
2.765625
3
[]
no_license
/** * Created by MARK-Max on 1.10.2016 г.. */ function printArray(input){ let delimeter = input[input.length-1]; input.pop(); console.log(input.join(delimeter)) } printArray(['One','Two','Three','Four','Five','-'])
true
49b50bcb2e77f75353be4916aa502ce4a48d838e
JavaScript
Phlicess/FunWithWebGL2
/lesson_095_cylinder_wrapping_tappering/fungi/ECS.js
UTF-8
7,183
3.5
4
[]
no_license
/*------------------------------------------------------ Components Creates a Factory to generate new Components which for ECS should just be data only Ex: Components( class Test{ constructor(){ this.x = 0; } } ); var com = Components("Test"); // New Component by calling its name var com = Components(1); ...
true
0d8ebb164f6866c3141a7ef99440b81a11b9ae32
JavaScript
aaronpower2/Scrimba-JS-Intro
/Exercise 13 - Loop olympics/app.js
UTF-8
1,582
4.53125
5
[]
no_license
/* Make a unordered list of fruit on the HTML page */ let fruits = ["banana", "orange", "apple", "kiwi", "pear", "peach"]; function fruitList() { for (let i = 0; i < fruits.length; i++) { let node = document.createElement('li'); let fruitType = document.createTextNode(fruits[i]); node.app...
true
6c2ad782dc4e3394287187fdddefc8082bf6fe37
JavaScript
travisdoesmath/covid-viz
/line/linechart.js
UTF-8
3,311
3.046875
3
[]
no_license
class LineChart { constructor(opts) { this.x = d => d.x; this.y = d => d.y; this.data = opts.data; this.gridData = opts.gridData; this.element = opts.element; this.color = opts.color; if(opts.x) this.x = opts.x; if(opts.y) this.y = opts....
true
823197158c23eb5fe79bb07257c13aec25398599
JavaScript
mdn/interactive-examples
/live-examples/js-examples/set/set-prototype-delete.js
UTF-8
237
3.46875
3
[ "CC0-1.0" ]
permissive
const set1 = new Set(); set1.add({ x: 10, y: 20 }).add({ x: 20, y: 30 }); // Delete any point with `x > 10`. set1.forEach((point) => { if (point.x > 10) { set1.delete(point); } }); console.log(set1.size); // Expected output: 1
true
60e6096729565cc2e7a664a7e868cf756c014f42
JavaScript
pedrosouza423/Exercicios-JavaScript
/DesafiosJS/01-1-aposentadoria.js
UTF-8
649
3.625
4
[ "MIT" ]
permissive
/* Crie um programa para calcular a aposentadoria de uma pessoa. Obs.: Esse cálculo é fictício, dentro da aposentadoria existem muitos outros fatores para serem levados em conta :) */ const nome = 'Pedro' const sexo = 'M' const idade = 50 const constribuicao = 35 if(sexo=='M' && constribuicao >=35 || sexo=='F' && con...
true
eff9577adf66a653c0faec63f12e18549f0cfbab
JavaScript
Sajedurrahmanratul/side-toggle
/style.js
UTF-8
787
3.140625
3
[]
no_license
//select items const toggler = document.querySelector(".sidebar-toggle"); const close = document.querySelector(".close-btn"); const sidebar = document.querySelector(".sidebar"); const closeBtn = document.querySelector(".close-btn"); // so we can toggle it in two ways // One is if else condition toggler.addEventList...
true
18b320ec94a2e9d090b22eafd2f2601101c5585c
JavaScript
EstherpgTan/WDi18-Homework
/ned_pike/week_01/objects_homework/main.js
UTF-8
6,647
3.1875
3
[]
no_license
var recipe = { name: "Mole", serves: 2, ingredients: [ "Cinammon", "Cumin", "Cocoa" ], displayAllIngred: function() { var yum = "Recipe:" + "\n" + this.name + " " + "\n" + "Serves " + this.serves + "\n" + "Ingredients " + "\n" + this.ingredients[0] + "\n" + this...
true
4c12f3749a2b596b6c2055ff572c7347790fa542
JavaScript
future4code/Lucas-Campioto
/semana4/aula3 - classes/index.js
UTF-8
1,148
3.4375
3
[]
no_license
const arrayDePost = [] let tituloDigitado = document.getElementById("titulo").value let autorDigitado = document.getElementById("autor").value let mensagemDigitado = document.getElementById("mensagem").value function inserePost(){ let titulo = document.getElementById("titulo").value let autor = document.getElemen...
true
0b47c9867170c4aa0f8cb883501f3b43e4f06e98
JavaScript
wustxing/nodegit
/IPMail/app.js
UTF-8
1,547
2.71875
3
[]
no_license
//这里主要讲一下思路,如何获取外网ip的改变 //1、定时获取外网ip,抓取ip138网页。获得ip //2、发送邮件到邮箱或者存到mongodb //3,定时从mongodb去取。 var fs = require("fs") ; var netip=require("./getNetIp"); var sendmail=require("./sendmail"); setInterval(function() { netip.getNetIp(function(err,ip){ if(err=="error") { console.log("error"); ...
true
c170d12246c0a919372763f403214cf51a94a1a7
JavaScript
mdx-js/mdx
/packages/mdx/lib/util/estree-util-is-declaration.js
UTF-8
464
3.125
3
[ "MIT" ]
permissive
/** * @typedef {import('estree-jsx').Node} Node * @typedef {import('estree-jsx').Declaration} Declaration */ /** * Check if `node` is a declaration. * * @param {Node} node * Node to check. * @returns {node is Declaration} * Whether `node` is a declaration. */ export function isDeclaration(node) { retur...
true
c93153c8b26d88c99b62b13be99f7b257467c4ac
JavaScript
pnkosev/JS-CORE
/02.JS-Advanced/ExamPrepII/01.Notes.js
UTF-8
615
2.640625
3
[]
no_license
function addSticker() { let title = $('input.title'); let text = $('input.content'); let ul = $('#sticker-list'); if (title.val() !== "" && text.val() !== "") { let li = $('<li class="note-content">'); let closeBtn = $('<a class="button">x</a>').on('click', function () {$(this).parent()...
true
71b21c157988b098a109080f86f2f8da8d1f9db3
JavaScript
lsu-ub-uu/friday-monitoring
/WebContent/script/repoTags.js
UTF-8
4,649
2.8125
3
[]
no_license
/* * Copyright 2019, 2020 Uppsala University Library * * This file is part of Friday. * * Cora is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at ...
true
bf34eb3e8a45e40a41e0950dbb5ceca1f0c33fb7
JavaScript
553325521/orderApp
/pages/cashier/cashier.js
UTF-8
12,987
2.53125
3
[]
no_license
// pages/cashier/cashier.js var app = getApp() var pageTitle = "收银"; Page({ options: { addGlobalClass: true, }, data: { result: 0, process: '', newStr: '', noYH: true, isFocus:false, isComputeFocus:true, bdsArray:[], operateStr:0, yhMoney:"", isFirst:true, tempTime...
true
cff0f7c5145547649863b24c0279ae2a3f0fe3c0
JavaScript
BrunoBalbuena93/babySteps_django
/JS/Interaction_JS_HTML.js
UTF-8
1,364
4.28125
4
[]
no_license
// Primero sacaremos el encabezado del documento: var HH = document.querySelector("#one") var CH = document.querySelector("#two") var DCH = document.querySelector("#three") var n = 0; var m = 0; // Haremos una función que genere colores aleatorios function getRandomColor(){ var letters = "0123456789ABCDEF"; var...
true
379e65ec1daafa941f1fabe22235cc32ca1ca968
JavaScript
johnescobar/MarketJobs
/backsystem/jscript/sim.js
UTF-8
654
2.640625
3
[ "MIT" ]
permissive
function EvaluaReg( formEval ) { var fields = $( formEval ).find( ".mandatory" ).get(); for( var i = 0 ; i < fields.length ; i++ ) { if( $( fields[i] ).val() == "" ) { alert( "El campo " + $( fields[i] ).attr( "title" ) + " se encuentra vacio y es obligario" ); return false; } } return true; } funct...
true
8c29b84ed4cc08b9d8769ca67347c88a083094ee
JavaScript
Naytik-jain/FontManipulator
/main.js
UTF-8
623
2.671875
3
[]
no_license
function preload(){ } function setup(){ canvas=createCanvas(500,600); canvas.center(); video=createCapture(VIDEO); video.size(500,500); poseNet=ml5.poseNet(video ,modelLoaded); poseNet.on('pose', GetResult); } function modelLoaded(){ console.log("Po...
true
66c16cc66260175d84bf99bdd7181ae66ba3900d
JavaScript
Vitaminvp/stage-2-express-yourself-with-nodejs
/routes/index.js
UTF-8
1,058
2.609375
3
[ "MIT" ]
permissive
const express = require('express'); const fighters = require('../date/fighters'); const router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.send('Hello world!'); }); router.get('/fighters', function(req, res, next) { res.json(fighters); }); router.get('/fighters/:id', f...
true
369388ae8ab493c5d84476990a8ad69f931e6993
JavaScript
muzzley/generator-muzzley-manager
/app/templates/lib/provider/_index.js
UTF-8
3,147
2.609375
3
[]
no_license
//Dependencies var providerModule = require('provider_module'); var Credentials = require('lib/models/Credentials'); var Channel = require('lib/models/Channel'); var Subscription = require('lib/models/Subscription'); var log = require('lib/factory/log'); var async = require('async'); function Provider(options) { opt...
true
d1f26ca90ed5ead6e1f82f0b7704992ffbe64908
JavaScript
tcherokee/web-api-project
/js/scripts.js
UTF-8
10,154
2.84375
3
[]
no_license
$(document).ready(function() { var url = 'https://pokeapi.co/api/v2/pokemon/'; var pokemonOptions = { limit:8 } function mobileNavToggle() { $(this).toggleClass('open'); $('nav ul').toggleClass('open'); if($('nav ul').hasClass('open')){ $('nav ul').slideDown(); } else { $('nav...
true
b0e79337f55464f4f35b1fe8c84d3ed96b31ef28
JavaScript
LadnovSasha/table-editor
/src/components/Row.jsx
UTF-8
583
2.515625
3
[ "MIT" ]
permissive
import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Cell from './Cell'; export default class Row extends Component { static buildCell(x, y) { return ( <Cell x={x} y={y} key={`${x}-${y}`} /> ); } render() { const cells = []; con...
true
bb3c30530e5cb45e9ebd1cdb5efdc1b69ff6d890
JavaScript
Michael-Diaz/Virus.exe
/js/options.js
UTF-8
3,692
3.46875
3
[]
no_license
/* // Mark the button as selected let url = event.target.dataset.color; event.target.classList.add(selectedClassName); chrome.storage.sync.set({ color }); } // Create list of items // store in chrome storage // List starts as blank */ let page = document.getElementById("buttonDiv"); let selecte...
true
be0c7d0fb34b4c76e1de5cfeb66e07bc41d73556
JavaScript
SylvieStraum/Forge_to_mobile
/src/redux/reducers/newCharacterReducer.js
UTF-8
1,459
2.65625
3
[]
no_license
const newCharacterReducer = (state={race:'', class:'', equipment:[], stats:{}, skills:[], name:'', bio:'',portrait:'', health:'', saves:''}, action) =>{ switch(action.type){ case'NEW_CHARACTER_RACE': state.race = action.payload return state case'NEW_CHARACTER_CLASS': state.c...
true
d10eb6302b279825f0fc64f93f561e7217dbc55b
JavaScript
pabloskyDev/basicDev
/canvas/challenge/challenge.js
UTF-8
18,269
3.375
3
[]
no_license
/* * Global variables */ const nmr_lines = document.getElementById("nmr_lines"); let color_figures = "#ffffff"; let coord_1, coord_2, coord_3, coord_4, coord_5, coord_6, coord_7; const c = document.getElementById("canvas_figure"); const canvas = c.getContext("2d"); const width_canvas = c.width; /** * @function dra...
true
778f6c81a36347739f6d0cc628e51aa7cbc7fd38
JavaScript
ToniHalmetoja/community-calendar
/src/components/calendarCell.js
UTF-8
2,055
2.953125
3
[]
no_license
import React from 'react' import {format, isSameDay, startOfMonth} from 'date-fns' import dayName from './dayName'; import {ReadAll, ReadOne} from "./crud"; import "./style.css"; function CalendarCell({date, showEvents, wday, isTargetMonth, isSelectedDay, isToday, allEvents, holidays, children}) {...
true
16bf2dcd331dc2ce619595a59e2c2365adabfeae
JavaScript
anton-shumanski/atos
/lib/private/new/template/src/responses/notFound.js
UTF-8
660
2.71875
3
[]
no_license
import * as _ from 'lodash'; /** * 404 (Not Found) Handler * * Usage: * return res.notFound(); * return res.notFound(err); * return res.notFound(err, view); */ module.exports = function notFound (err, view) { // Get access to `req` & `res` const req = this.req; const res = this; // Set status c...
true
7547afe7a10049fbf737791ad3d460de2347e36f
JavaScript
RD-Harry/Blogs-
/static/js/index.js
UTF-8
8,453
3
3
[]
no_license
//发送axax请求 将轮播图加载到页面 // url /get_fader // get请求 // 响应数据类型json // 成功:遍历响应中的data数据 // 将页面中#fader中的内容重写 $(function(){ // 定义一个全局URL,data文件里面只写图片名字,没有写死路径 // 防止要修改图片路径 // 这里写的是图片的路径 var BASE_URL ='../static/images/' // 指定静态资源图片的路径 $.ajax({ url:'/get_fader', type:'get', dataT...
true
b82efa639f0c6ebf78ee4332ca72bb6881f80216
JavaScript
mastercactapus/Project-Euler--javascript-
/42.js
UTF-8
495
3.0625
3
[]
no_license
var fs = require("fs"); var out = require("./timer"); var numbers = require("./numbers"); var words = fs.readFileSync("words.txt") .toString().replace(/"/g,"").split(","); function wordValue(word) { var sum=0; word = word.toUpperCase(); for (var i=0;i<word.length;i++) { sum += word.charCodeAt...
true
75b89a2fbf14a1dd08908c31c8a469ed87f47c1b
JavaScript
emilychachian/github-search
/src/utils/dateFormatter.js
UTF-8
148
2.609375
3
[]
no_license
export default function dateFormatter(date) { let d = new Date(date) let formattedDate = d.toLocaleDateString('en-GB') return formattedDate }
true
ef68d1bdafdff76bf829510a5ac1cfb361a00220
JavaScript
zzid/Coding-Test-Practice
/2021_01_11/CodeWars_RGBToHex.js
UTF-8
286
3.140625
3
[]
no_license
function rgb(r, g, b) { return [r, g, b].reduce((hex, num) => { if (num < 0) return (hex += '00'); if (num > 255) return (hex += 'FF'); let hexNum = num.toString(16).toUpperCase(); if (hexNum.length < 2) hexNum = '0' + hexNum; return (hex += hexNum); }, ''); }
true
33c7f9252d289a639fd0955c2ed6c1cc2649c16e
JavaScript
BorsukPavlovich/lj
/es6/main.js
UTF-8
6,047
2.6875
3
[]
no_license
'use strict' document.addEventListener("DOMContentLoaded", function() { const nav = document.getElementsByClassName('nav')[0]; const toggle = document.getElementsByClassName('toggle')[0]; const tabs = document.getElementsByClassName('settings__tab'); const layoutChecks = document.getElementsByClassName...
true
50111d291db61ad54ea540c1c1a6db4c417c6fcb
JavaScript
sglord/boilermaker
/script/seed.js
UTF-8
2,882
2.84375
3
[ "MIT" ]
permissive
'use strict' const db = require('../server/db') const {User, Barge, Vessel, Claim} = require('../server/db/models') async function seed() { await db.sync({force: true}) console.log('db synced!') const users = await Promise.all([ User.create({username: 'stephen', password: 'timebar'}), User.create({user...
true