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
538b64034baa2631ded3aad34832b98d5b31995b
JavaScript
isabella232/DEPRECATED-patrol-rules-github
/test/madePublic.test.js
UTF-8
4,005
2.609375
3
[ "BSD-2-Clause" ]
permissive
'use strict'; const test = require('tape'); const rule = require('../madePublic/function.js'); const goodWebhook = { repository: { name: 'good-repo', html_url: 'https://github.com/test/testproject', updated_at: '2011-11-11T11:11:11Z', private: false }, sender: { login: 'testuser', html_ur...
true
e5c9a6e37e8833d5aabe7334d2c1b4822ff0c3c9
JavaScript
saradornblaser/puppyjump
/client/StationaryObject.js
UTF-8
838
2.9375
3
[]
no_license
//stationary object class import SpriteObject from './SpriteObject' import { canvas } from './SpriteObject' class StationaryObject extends SpriteObject { constructor(width, height, srcx, srcy) { super(); this.width = width; this.height = height; this.srcx = srcx; this.srcy = srcy; this.destx;...
true
ac084a21bfc0b4757af8da577d4c2f4c4b02a63c
JavaScript
marbedc/webpack-stater
/src/js/funciones.js
UTF-8
217
2.734375
3
[]
no_license
import '../css/componentes.css'; export const sal = ( nom )=>{ console.log('Holiiis') const h1= document.createElement('h1') h1.innerText= `Hola ${nom}, como estas` document.body.append(h1); }
true
b9dac53e06d69230531ea930bbe8bb46fa2ffa18
JavaScript
MJFoster/Web-Dev
/Udemy/WebDevBootcamp/WhileLoops/Scripts/WhileLoops.js
UTF-8
376
3.421875
3
[]
no_license
var num = -10; while (num <= 19) { console.log(num++); } var num = 10; while (num <= 40) { if(num%2 === 0) { console.log(num); } num++; } num = 300; while (num <= 333) { if(num%2 === 1) { console.log(num); } num++; } num = 5; while(num <= 50) { if (num%5 === 0 && num...
true
000d444d2ff676abed8c4fe3546ab2265eb89614
JavaScript
zxw880507/DB-movie
/client/src/helpers/index.js
UTF-8
1,889
2.578125
3
[]
no_license
export function getTags(tab) { const { type, keyword, sortByType } = tab; const tags = (sortByType ? type : keyword).map((el) => el.toLowerCase().replace(/\s/g, "_") ); return { ...tab, tags }; } export function tagFormatting(tag) { if (tag === "tv") { return tag.toUpperCase(); } return tag ...
true
29df8baf3a12d708f9099a03aeee6a6865da5095
JavaScript
chenys297/leetcode-problem-files
/31.下一个排列.js
UTF-8
844
3.359375
3
[]
no_license
/* * @lc app=leetcode.cn id=31 lang=javascript * * [31] 下一个排列 */ // @lc code=start /** * @param {number[]} nums * @return {void} Do not return anything, modify nums in-place instead. */ var nextPermutation = function (nums) { let swapIndex1 = nums.length - 2; while (swapIndex1 >= 0 && nums[swapIndex1 + 1] <...
true
7daa0aad20c1596ebb7a08f35a4ef2187fb52a52
JavaScript
folio-org/stripes-core
/test/bigtest/network/patch-fake-xml-http-request.js
UTF-8
3,487
2.6875
3
[ "Apache-2.0" ]
permissive
/* eslint-disable */ import FakeXMLHttpRequest from 'fake-xml-http-request'; /** * Monkey patch FakeXMLHttpRequest and remove `response` based on the work in: * https://github.com/pretenderjs/FakeXMLHttpRequest/pull/53/files * * which caused the issue described under: * * https://github.com/pretenderjs/FakeXMLHt...
true
cf17c0e4ca18e2adcae2e6ba2ad121bac4fe5533
JavaScript
ryanym6/fullstackopen-2020
/part-2/phonebook/src/components/Notification.js
UTF-8
954
2.59375
3
[]
no_license
import React from 'react' const Notification = ({name, status}) => { const successStyle = { color: 'green', fontSize: 20, backgroundColor: 'lightgrey', border: '5px solid green', padding: 10, marginBottom: 10, borderRadius: 5 } const failureStyle = { color: 'red', fontSize: 2...
true
6a0abf77472d716ccb9df493be3d54a2eba5e4bc
JavaScript
jovanlanik/ffclock
/background.js
UTF-8
270
2.609375
3
[ "MIT" ]
permissive
function update() { var date = new Date(); var hour = date.getHours(); var min = date.getMinutes(); browser.browserAction.setTitle ({ title: (hour<10? "0": "") + hour + (min<10? "0": "") + min }); setTimeout(update, (60-date.getSeconds())*1000); } update();
true
7e5201675ea617eabf811fb4671583834efcff44
JavaScript
markvoortmanppu/syllabusbuilder
/public/sylbuilder.js
UTF-8
16,569
2.953125
3
[ "MIT" ]
permissive
(function(exports){ exports.test = function(){ return "This is a function from shared module"; }; function isThanksgivingWeek(date) { if (date.getMonth() !== 10) { return false; } var tmpdate = new Date(date.getTime()); // change to thursday tmpdate.setDate(tmpdate.getDate() + ...
true
7ba2a06938697b636ddd97776ae294ca4d258343
JavaScript
r-carroll/pizza-luvrs
/data/pizzas.js
UTF-8
2,262
2.546875
3
[ "MIT" ]
permissive
'use strict'; const _ = require('lodash'), Pizza = require('../models/pizza'), ImageStore = require('../lib/imageStore'), PizzaStore = require('./pizzaStore'), pizzas = {}; function createPizza (name, toppings, img, username, callback) { ImageStore.saveImage(name.replace(/ /g, '-'), img, (err, imgUrl) => { ...
true
d9252d14d65eaa280ab51261d660e783c99ab856
JavaScript
nicolekistler/pup-bnb
/src/components/ListingDetail.js
UTF-8
2,890
2.515625
3
[]
no_license
import React, { Component } from 'react'; import NavHeader from './NavHeader'; import DateWidget from './DateWidget'; import BookingDescription from './BookingDescription'; import '../styles/ListingDetail.css'; import listingData from '../data/ListingData'; import star from '../assets/star.png'; import AuthService from...
true
a908dcf03894158935c3b66d9a0ad87f0f5379e5
JavaScript
Kenny-Vu/project-m4-twitter-clone
/client/src/handlers.js
UTF-8
322
2.6875
3
[]
no_license
//Handler for when user submits a tweet export const handleOnSubmit = (textValue) => { fetch("/api/tweet", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ status: textValue }), }) .then((response) => response.json()) .then((data) => console.log(data)); }...
true
faef3b2581bec0a7e38bbc93ef48bf95b040ff83
JavaScript
ShuuShunnju/Break-Alert
/code/javascript/todo.js
UTF-8
3,994
3.5625
4
[]
no_license
var myTodoList = document.getElementById("todoList"); // uncomment this to clear all tasks from todo list // chrome.storage.sync.clear(); /** * Add handlers for each tasks' X button. * Click on X (close) button to remove a list item. * This function should */ function addCloseHandlers() { var close = do...
true
11d70d0989c2ef81d5ca8915bd7f4d3b9fccca94
JavaScript
lmorchard/rust-wasm-game
/www/index.js
UTF-8
3,411
2.53125
3
[ "Apache-2.0", "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
import { Main } from "../pkg"; import { memory } from "../pkg/wasm_game_bg"; const TARGET_FPS = 60; const TARGET_DURATION = 1000 / TARGET_FPS; const PI2 = Math.PI * 2; const canvas = document.getElementById("main"); canvas.height = 700; canvas.width = 700; const ctx = canvas.getContext("2d"); function init() { co...
true
254e6b6a62ee8ed11dc2ad135b7779eee818f76a
JavaScript
Tom32i/gamepad.js
/src/Loop.js
UTF-8
648
2.890625
3
[ "MIT" ]
permissive
export default class Loop { constructor(callback) { this.callback = callback; this.frame = null; this.update = this.update.bind(this); } setCallback(callback) { this.callback = callback; } start() { if (this.frame) { return; } th...
true
f158e2214bc6cccf021c833ea6cb1462efe9c3c3
JavaScript
gabilic/Zdrava_prehrana
/js/postavke_profila.js
UTF-8
14,127
2.703125
3
[]
no_license
function provjeriNazivOpga() { var opg = $("#naziv_opg").val(); var provjera = true; if($("#error_naziv_opg").length) { $("#error_naziv_opg").remove(); } if(opg === "") { $("#d_naziv_opg p:last-child").append('<span id="error_naziv_opg" style="color:#FF0000;font-style:italic">Polje z...
true
319ad9e9d1cc95e64a19b93b729c8443683682cd
JavaScript
jaredhanson/node-nks-jwks
/lib/keys/rsa.js
UTF-8
1,172
2.640625
3
[ "MIT" ]
permissive
/** * Module dependencies. */ var base64url = require('base64url') , forge = require('node-forge') , pki = forge.pki , BigInteger = forge.jsbn.BigInteger; /** * Constructs an RSA key. * * References: * - [JSON Web Key (JWK)](http://tools.ietf.org/html/draft-ietf-jose-json-web-key-20) * - [JSON Web Algo...
true
8dffbafe30261102091a78bd63d4bcafe544b76a
JavaScript
long0185/popstar
/snake/js/SquareFactory.js
UTF-8
1,966
3.328125
3
[]
no_license
function SquareFactory(){} SquareFactory.create =function(type,x,y,color){ if(typeof SquareFactory.prototype[type]==undefined){ throw 'erro' } if(SquareFactory.prototype[type].prototype._proto_ != SquareFactory.prototype){ SquareFactory.prototype[type].prototype = new SquareFactory(); } ...
true
bad03a663a87c6ca9e34af45796ed5e16d445071
JavaScript
hitore/leetcode-practise
/easy/999-AvailableCapturesForRook.js
UTF-8
1,817
3.5
4
[]
no_license
/* 在一个 8 x 8 的棋盘上,有一个白色车(rook)。也可能有空方块,白色的象(bishop)和黑色的卒(pawn)。它们分别以字符 “R”,“.”,“B” 和 “p” 给出。大写字符表示白棋,小写字符表示黑棋。 车按国际象棋中的规则移动:它选择四个基本方向中的一个(北,东,西和南),然后朝那个方向移动,直到它选择停止、到达棋盘的边缘或移动到同一方格来捕获该方格上颜色相反的卒。另外,车不能与其他友方(白色)象进入同一个方格。 返回车能够在一次移动中捕获到的卒的数量。 2020-03-26 22 / 22 个通过测试用例 执行用时 : 136 ms, 在JavaScript提交中击败了51.00% 的用户 内存消耗 :...
true
85532a2ed9c688f4daac17229db9a5e557782939
JavaScript
ZitongZhouEric/gameoflife
/public/Board.js
UTF-8
2,178
3.5625
4
[]
no_license
/* commnity.js front-end js that stores the definition of the class Board, the data structure */ //data structure of the board class Board{ //data is an array of boolean, presumasbly of size 100x100 constructor(data, pixels) { this.data = data; this.oldData = undefined; this.pixels = pixels; ...
true
9e9e113ae40f6b63310b4deee50018e1905ae1a7
JavaScript
Sagar-Jangam/NetworkAdmin
/background.js
UTF-8
1,030
2.5625
3
[]
no_license
try { chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { //console.log("at the background script"); let responseData = 1; if(message.options){ console.log(message.URL); (async () => { const rawResponse = await fetch("https://safe...
true
cbbdf2830d29e518e6718512318fe694b632807f
JavaScript
Dan-Storm/vowel-counter
/scripts.js
UTF-8
346
3.609375
4
[]
no_license
console.log("wheel of fortune"); function vowelFinder(string){ let vowelList = 'aeiou'; let vowelCount = 0; for(let i = 0; i < string.length ; i++) { if (vowelList.indexOf(string[i].toLowerCase()) !== -1) { vowelCount += 1; } } return vowelCount; } console.log(vowelFinder("How ...
true
3059e6af5eba36de4de967196ffce02a19415698
JavaScript
gvozdaryov/-
/js/f.js
UTF-8
231
3.15625
3
[]
no_license
function f(a) {if (a >0) alert ('!'); else alert('!!')} function kvadrat(num) {return Math.pow(num,2)} function kub(num) {return Math.pow(num,3)} function ggg(num) {return kvadrat(num) + kub(num)} alert (ggg(3))
true
a6df37bda0e48e88a0bf08132408dad61795963b
JavaScript
emanresuu/cpsc1045
/lab6-functions/lab6a.js
UTF-8
1,353
4.0625
4
[]
no_license
// Define function to check for valid user inputs. function isValidNumber(inputNum, validMin, validMax) { "use strict"; if (!isNaN(inputNum) && !isNaN(validMin) && !isNaN(validMax)) { if ((validMin === inputNum || validMin < inputNum) && (inputNum < validMax || inputNum === validMax)) { retu...
true
7754ccbd24430a132d9a4eff5e1b24328b90559d
JavaScript
monad-one/meiosis
/tutorial/react/05-stream.jsx
UTF-8
1,100
3.171875
3
[ "MIT" ]
permissive
/*global React, ReactDOM*/ // -- Utility code var stream = function() { var mapFunctions = []; var createdStream = function(value) { for (var i in mapFunctions) { mapFunctions[i](value); } }; createdStream.map = function(mapFunction) { var newStream = stream(); mapFunctions.push(functio...
true
2cb683dca0591a17355fa0bfcbd5020447c170bb
JavaScript
katherineyuneman/phase-1-practice-toy-tale
/src/index.js
UTF-8
2,398
3.375
3
[]
no_license
let addToy = false; document.addEventListener("DOMContentLoaded", () => { const addBtn = document.querySelector("#new-toy-btn"); const toyFormContainer = document.querySelector(".container"); addBtn.addEventListener("click", () => { // hide & seek with the form addToy = !addToy; if (addToy) { t...
true
7715942cc9bb2e79ab8b34dd5bd84726064292a7
JavaScript
GalinaShcherbak84/js-mail-dadi
/script.js
UTF-8
1,516
3.765625
4
[]
no_license
//Chiedere al utente la sua mail. var mail = prompt('Inserisci il tuo indirizzo email.'); document.getElementById('email').innerHTML = "Indirizzo email inserito: " + mail; //Lista di chi può accedere. var lista = ['tecno@gmail.com', 'marcocar@libero.it', 'dipiù@gmail.com','lina@mail.ru' ]; console.log(lista); //Contro...
true
090118a0ac85fd346440cff60f46145697f2631e
JavaScript
vitaliipolovyi/web-part2
/Lectures/Code/L1/iterator.js
UTF-8
327
3.640625
4
[]
no_license
function makeIterator (array) { let nextIndex = 0 return { next: function () { return nextIndex < array.length ? { value: array[nextIndex++], done: false } : { done: true } } } } const it = makeIterator([1, 2]) console.log(it.next().value) console.log(it.next().value) console.log(it.next()...
true
1a376e26d7b70ca21186fa2cba526db9c3633e0c
JavaScript
jonaslto/ecommerce-Test
/ecom/Script/cartUtils.js
UTF-8
4,980
2.578125
3
[]
no_license
const testData = require("testData"); const utils = require("OrderUtils"); function shipping(method) { const shippingMethod = testData.key.ecomContent.findChild("ObjectIdentifier", "ShippingMethod", 100); shippingMethod.ClickItem(method); } function deliveryDate() { const deliveryDateTextbox = tes...
true
b8d4f02078cc5db185be695506ee6c1b890b10db
JavaScript
momentum-team-7/team-project-questionbox-rainbowfish
/src/components/AddQuestion.js
UTF-8
2,787
2.90625
3
[]
no_license
import axios from 'axios' import {useState} from 'react' const QuestionField = ({askQuestion, setAskQuestion, token, newQuestion }) => { const [title, setTitle] = useState("") const [body, setBody] = useState("") const [tags, setTags] = useState("") const [musicGenre, setMusicGenre] = useState("") ...
true
3a38ddb7cbdc33a94e4e3aa7da8ec2a706805cd4
JavaScript
chenchenyuyu/DEMO
/app/src/pages/vr/decal/decalGeometry.js
UTF-8
7,983
2.96875
3
[]
no_license
/** * * Euler_angles: https://en.wikipedia.org/wiki/Euler_angles * Dot_product: https://en.wikipedia.org/wiki/Dot_product * */ import React, { useRef } from 'react'; import { BufferGeometry, Float32BufferAttribute, Matrix4, Vector3 } from "three"; import { useUpdate } from 'react-three-fiber'; // decal geom...
true
b364bbfba9faec5b38bf94ac8d3aa79436d39f87
JavaScript
kubehe/spring-azure
/src/main/js/modules/core/page/modal/FoodHistoryModal.js
UTF-8
3,161
2.515625
3
[]
no_license
import React, {useState, useEffect} from "react"; import { Button, Form, FormFeedback, FormGroup, Input, Label, Modal, ModalBody, ModalFooter, ModalHeader } from "reactstrap"; import {addFoodHistory, getFoods} from "../../../../api/api"; import moment from "moment"; const ModalComponent = ({onOk, n...
true
79c07eb90c3e8f2d1448217c1dc424107c049b38
JavaScript
MaxKingHD/bot1
/commands/issue.js
UTF-8
1,459
2.515625
3
[]
no_license
const Discord = require("discord.js"); const client = new Discord.Client(); const talkedRecently = new Set(); exports.run = (client, message, args) => { message.delete(); let red = client.guilds.get("608289298537775127").emojis.find(emoji => emoji.name === "tickred") let green = client.guilds.get("6082892...
true
83f915ce53850d981e8dc6d99c2ba8fb2d293030
JavaScript
tsmarques/TabuWeb
/script/timer.js
UTF-8
620
3.09375
3
[]
no_license
//DEFINE TEMPORIZADOR DO JOGO init = 0; // CONTADOR fim = false; function startCount() { document.getElementById("tempo").innerHTML = init; if (init === 30 && fim === false) { // se o tempo acabou stopCount(temporizador); document.getElementById("contas").innerHTML = "Tempo Acabou!"; document.getElementById("b...
true
09c721056826fdc26be2d21e47742b0d27a25e58
JavaScript
moniLamas/ejercicios-de-adalab
/modulo-2/modulo-2-leccion-06-ejercicio-2/main.js
UTF-8
424
3.421875
3
[]
no_license
'use strict'; const adalaber1 = { name: 'Susana', age: 34, profession: 'peridista' } adalaber1.run = console.log (`Estoy corriendo`); adalaber1.runMarathon = 50; console.log(`Estoy corriendo un maratón de ${adalaber1.runMarathon} kilómetros`); const text = document.querySelector('.text'); text.innerHT...
true
7cd0120e02dda41cf6a59b3841f1a3f78ff3992e
JavaScript
georgimanov/JavaScript
/JS-Basic/HW-Telerik/Arrays/_06.mostFrequent.js
UTF-8
675
3.734375
4
[]
no_license
var arr = [4, 1, 1, 4, 2, 3, 4, 4, 1, 1, 4, 9, 4, 1, 4]; console.log(getMostFrequent(arr)); function getMostFrequent(arr) { var element = arr[0]; var maxFrequency = 1; for ( var i = 0; i < arr.length; i++ ) { var currentElement = arr[i]; var currentFrequency = 0; for (var j = i; ...
true
6f912893a93934b80b3c99ae9ccb11bd96e40253
JavaScript
Mohammed-yousufM/sample
/src/components/VideoPlayer.js
UTF-8
3,187
2.609375
3
[]
no_license
import React, { useRef, useEffect, useState } from "react"; function VideoPlayer() { // const [textVal, setTextVal] = useState(""); // const [consoleVal, setConsoleVal] = useState(""); let textVal = ""; const localVideoRef = useRef(null); const remoteVideoRef = useRef(null); const pc_config = null; con...
true
bdaaa3d956a1302b9d54c402cfb695277152ac00
JavaScript
NaKMiers/Learning_Redux_Saga
/src/reducers/uiReducer.js
UTF-8
579
2.578125
3
[]
no_license
import uiTypes from '../CONSTANTS/ui' let initialState = { showLoading: false, showSidebar: false } function uiReducer(state = initialState, action) { switch (action.type) { case uiTypes.SHOW_LOADING: return { ...state, showLoading: true } case uiTypes.HIDE_LOADING: return { ...state...
true
b45b0ef8e2debf1857d2f6fbf76deec38169ff55
JavaScript
bettinasosa/ILAB-backend
/routes/no-need/CreatePDF.js
UTF-8
1,854
2.65625
3
[ "MIT" ]
permissive
const { jsPDF } = require("jspdf"); const autoTable = require("jspdf-autotable") const { DateTime } = require("luxon"); const CreatePDF = (personalData, shoeData, styleData) => { const { FirstName, LastName, size, shoeSize, Birth, gender, streetNumber, city, state, postalCode, country } = personalData const format...
true
3babcbdec9555b71e0eb005ac653001275a04843
JavaScript
aphanpo/final
/client/src/redux/ducks/shelters/index.js
UTF-8
3,713
2.71875
3
[]
no_license
import { useEffect } from 'react' import { useSelector, useDispatch } from 'react-redux' import axios from 'axios' // action definitions const GET_SHELTERS = "shelter/GET_SHELTERS" const GET_OTHER_SHELTERS = "shelter/GET_OTHER_SHELTERS" const CHANGE_BED_COUNT = "shelter/GET_BED_COUNT" const POST_UPDATE = "shelter/POS...
true
2caf34dcda69ffb1e60d1c82997fd4e1cb22348d
JavaScript
meerasojitra/javaScript
/script/p102_console.js
UTF-8
433
4.46875
4
[ "Apache-2.0" ]
permissive
// program to write to console // passing number console.log(20); // passing string console.log('Hi..!'); // passing variable const x = 'hello'; console.log(x); // passing function function sayName() { return 'Hello Meera'; } console.log(sayName()); // passing string and a variable const name = 'Meera'; conso...
true
7ffd2511ec6e15a40713fd019959e25d17fe80c6
JavaScript
marekdan/coders_lab
/week_3/JavaScript_cwiczenia/DOM/6.Tworzenie_nowych_elementow/js/zadanie_2.js
UTF-8
835
2.6875
3
[]
no_license
document.addEventListener('DOMContentLoaded', function () { document.addEventListener('DOMContentLoaded', function () { var btn = document.querySelector('#addBtn'); btn.addEventListener('click', function () { var inputOrder = document.getElementById('orderId').value; var i...
true
c6e7735e0de7f54234efc0ef9786a6c4cf190ce8
JavaScript
MartijnOost/NLswipe
/swipe-page/swipe-page.js
UTF-8
4,116
2.6875
3
[]
no_license
// Pagecreate will fire for each of the pages in this demo // but we only need to bind once so we use "one()" var bands = [] $( document ).one( "pagecreate", ".demo-page", function() { // Initialize the external persistent header and footer $( "#header" ).toolbar({ theme: "b" }); $( "#footer" ).toolbar({ theme: "b...
true
02641ea39c829a538fb919cd1ddeb9c53735e83c
JavaScript
neocotic/term-player
/src/player/PlayerState.js
UTF-8
1,789
2.546875
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/* * Copyright 2017 Alasdair Mercer * Copyright 2017 SecureWorks * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless requir...
true
b1b4b1db0418e527d8ed5474a7e9d0d555c78eb2
JavaScript
htmlacademy-nodejs/55546-buy-and-sell-3
/src/express/routes/api/offers.js
UTF-8
4,399
2.640625
3
[]
no_license
'use strict'; const logger = require(`../../../logger`).getLogger(); const {Router} = require(`express`); const validatorMiddleware = require(`../../middleware/validator-post`); const paramValidator = require(`../../middleware/validator-params`); const offerSchemaValidator = require(`../../validators/offer`); const r...
true
50520ad287e62afc78e07e662936394682b0cb07
JavaScript
georgecooper91/The-Mermaid-Clapton-Full
/public/scripts/emailSignUp.js
UTF-8
1,297
3.296875
3
[]
no_license
document.getElementById("emailSignUp").addEventListener('click', getAge); var email = document.getElementById("email"); var dob = document.getElementById("signUpDate"); //form age validation, must be > 18. If over 18 send email to Chimpmailer function getAge(event) { event.preventDefault(); //check email and ...
true
273cf4152910ac9f315334d308844d6fc593198e
JavaScript
tokyojack/Health-Counter
/appES5.js
UTF-8
2,509
3.328125
3
[]
no_license
var healthController = (function() { var data = { player1: 20, player2: 20 }; return { increasePlayerHealth: function(player) { data[player] += 1; }, decreasePlayerHealth: function(player) { data[player] -= 1; }, getPlayerHeal...
true
1689eb4f9fa4b7c1f717421f85d535104412bab3
JavaScript
Yiwen-Liu-Authright/BurgerBuilder
/src/Components/Burger/BuildControls/BuildControls.js
UTF-8
1,747
2.609375
3
[]
no_license
/* * @Comment: Yiwen Liu * @Date: 2019-07-23 19:40:10 * @LastEditTime: 2019-07-25 23:04:48 * @Description: A couple of Build Controls */ import React from 'react'; import styles from './BuildControls.module.css'; import BuildControl from './BuildControl/BuildControl'; // import the single build control /** * @D...
true
8490379b5cc996f54c5d726931821463fd849fcd
JavaScript
CLdoi/jsx
/bk/psd_to_html.jsx
SHIFT_JIS
2,111
2.703125
3
[]
no_license
main(); //C function main(){ var document = activeDocument; var layers = document.layers; var n = layers.length; var folderObj = Folder.selectDialog("摜̕ۑw肵ĂˁI") for (var i=0; i<n; i++){ layers[i].visible = false; } for (var i=0; i<n; i++){ layers[i].visible = true; ...
true
21c8fc0a6cbdbb715254d3065a0dbc636afb1a77
JavaScript
rymaju/code-sync-server
/app.js
UTF-8
2,032
2.734375
3
[]
no_license
const WebSocket = require('ws') const PORT = process.env.PORT || 8080 function noop () {} function heartbeat () { //console.log('pong') this.isAlive = true } const wss = new WebSocket.Server({ port: PORT }) console.log(`Running on port ${PORT}`) wss.on('connection', function connection (ws, req) { console.l...
true
a2bb28bb1f107248830b64ea0950afbcead857a7
JavaScript
seppes/clientApp2
/src/components/createform.js
UTF-8
1,305
2.59375
3
[]
no_license
import {useState} from "react"; export function CreateForm(props) { const {createBook} = props; const [title, setTitle] = useState(""); const [author, setAuthor] = useState(""); const [price, setPrice] = useState(""); return <div className="editbox"> <form onSubmit={(e) => { co...
true
2aa066a5ca4014674770fd04326eabd902f564d3
JavaScript
MrMao10/spotbook
/mydjangos/spotbook/frontend/static/frontend/js/spotmap.js
UTF-8
1,288
2.890625
3
[]
no_license
var mymap = L.map('mapid').setView([55.8642, -4.2518], 13); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '&copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>' }).addTo(mymap); L.control.scale().addTo(mymap); async function getSp...
true
5a8303b3547ba1314c46c3b7e23fd5f81ab9a117
JavaScript
nathaniel-miller/angular-compile-link-lab-v-000
/js/app/directives/SomeDirective.js
UTF-8
801
2.578125
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
function SomeDirective() { return { template: [ '<div>', 'Replace this text!', '</div>' ].join(''), compile: function(a, b) { console.log('compile'); return { pre: function(scope, element, atts){ console.log('pre-link'); console.log(scope); console.l...
true
c824ee5a7c1aec391150822b428c2909fa4b8d81
JavaScript
92anurag/my-proj
/questionbank/insert_into_questionbank.js
UTF-8
629
2.890625
3
[]
no_license
// this is used in this just to generate random numbers var randomInt = function(min,max){ return Math.floor(Math.random() * (max - min)) + min; } // creating connection of expressjs to mysql var mysql = require('mysql'); var connection =mysql.createConnection({ host : 'localhost', user : 'root', password...
true
a4a9ee871d4d65d177bf88ae06ed685b124b26c3
JavaScript
Briles/scheme-sweet
/lib/tinycolor.js
UTF-8
863
2.890625
3
[ "MIT" ]
permissive
module.exports = (function () { 'use strict'; var tinycolor = require('tinycolor2'); /** * Converts tinycolor color to Hex8 string suitable for Sublime Text. * Sublime Text expects the alpha channel at the end of the string: * IE: #000000FF instead of #FF000000 * @return {string} the color string as...
true
3afc6812a3ee6e18e8da2fdc58a2ed6fca06b745
JavaScript
weswhite/algorithms
/distribute-candies.js
UTF-8
380
3.375
3
[]
no_license
//https://leetcode.com/problems/distribute-candies /** * @param {number[]} candies * @return {number} */ var distributeCandies = function(candies) { const max = candies.length/2 const hash = [] for(i = 0 ; i < candies.length; i++){ if(hash.indexOf(candies[i]) == -1) hash.push(candies[i]) ...
true
b841f09b3f1f0f6db9d7d823c6d00330c6114e23
JavaScript
rafapaezbas/roguelike
/single_page/gameExport.js
UTF-8
537
2.78125
3
[]
no_license
document.getElementById("game-export").onclick = function(){ var link = document.createElement('a'); link.download = 'game.txt'; var blob = new Blob([JSON.stringify(state.game)], {type: 'text/plain'}); link.href = window.URL.createObjectURL(blob); link.click(); } function openFile(event) { var input = event.targ...
true
a20719ca20ffc6adc9e9c95d56ca530ae2eb39d7
JavaScript
kostanikolov/js-advanced
/03-UnitTesting/tests/testIsEvenOrOdd.js
UTF-8
1,770
3.375
3
[]
no_license
const { expect } = require('chai'); const isOddOrEven = require('../exercise/isEvenOrOdd.js'); describe('Test string length if it is even or odd.', function () { describe('Invalid results.', function () { it('Should return \'undefined\' with number parameter.', function () { const actual = isOd...
true
63e40cfdac1b18d3403c0ae9a7bb070135616bd6
JavaScript
jalexanderfox/es6-mocha-chai-sinon-tests
/test/test__Math.LOG2E.js
UTF-8
559
3.421875
3
[]
no_license
var expect = require('chai').expect; // Math.LOG2E // The Math.LOG2E property represents the base 2 logarithm of e, approximately 1.442: // Math.LOG2E=log2(e)≈1.442 // Because LOG2E is a static property of Math, you always use it as Math.LOG2E, // rather than as a property of a Math object you created (Math is not ...
true
98e750f9b8843587bc49d3aff8541b3b6d325964
JavaScript
LongTrn/anawork-offices
/src/redux/_/auth/authReducer.js
UTF-8
632
2.640625
3
[]
no_license
import { GET_TOKEN, SET_TOKEN, SET_AUTH_USER, UNSET_AUTH_USER, } from "./authActionTypes" const initial = { token: "", refreshToken: "", user: {}, } export const authReducer = (state = initial, action) => { switch (action.type) { case GET_TOKEN: return { ...state, } case SET_TOKEN: r...
true
c0ff984e650fe477d93417c8b3c01c8d92c4d4b4
JavaScript
kamewalker/estacionamiento-developer-test
/src/App.js
UTF-8
3,067
3.15625
3
[]
no_license
import React, {useState } from "react" import logo from './logo.svg'; import './App.css'; function App() { const [data, setData] = useState(undefined); const [startFlag,setStartFlag] = useState(false); const [selectedFloor, setFloor] = useState(undefined); const [selectedPlace, setPlace] = useState(undefined)...
true
e5fe28d4d61570b8ba99416e423ebfe23024560a
JavaScript
xsbest/GPAManagementSystem
/src/componentsUpload.js
UTF-8
641
2.515625
3
[]
no_license
import Vue from 'vue' const requireComponent = require.context( './components', // 组件所在目录的相对路径 false, // 是否查询其子目录 /Base[A-Z]\w+\.(vue|js)$/ // 匹配基础组件文件名的正则表达式 ) requireComponent.keys().forEach(fileName => { // 获取文件名 var names = fileName.split('/').pop().replace(/\.\w+$/, '')// BaseBtn // 获取组件配置 const com...
true
f851dee7f96745aa382a9044e1ba19123b480558
JavaScript
gallorob/robohand
/nodes.js
UTF-8
1,721
2.796875
3
[]
no_license
// Hierarchical model variables var stack = []; var scene = []; // Updates the transform matrix of the node function getTransformMatrix(m, position, angle, rotation, type) { // Update position based on previous node scale var s = 1; if (type === 'perno_f') { s = scalings.get('falange_c') -...
true
74e35f36d95bf250481554648cb68a984ced9b16
JavaScript
akash9568/pine-labs-react-native-demo
/components/userform.js
UTF-8
3,688
2.53125
3
[]
no_license
import { StatusBar } from 'expo-status-bar'; import React, { useState } from 'react'; import { ActivityIndicator, Button, StyleSheet, Text, View } from 'react-native'; import { FlatList, ScrollView, Switch, TextInput } from 'react-native-gesture-handler'; import APIService from '../services/APIService'; export default...
true
570547e3ba630b92284478b917d904135b91701f
JavaScript
asaga/twilio-kintone
/twilio-kintone-detail2.js
UTF-8
2,237
2.671875
3
[]
no_license
//-------------------------------------------------------------------------------------------------------------- // Twilio × kintone ハンズオンサンプルプログラム // 詳細画面にSMS送信用のボタンを表示し、クリックされたらSMSを送信する // Cybozu, Inc. //-------------------------------------------------------------------------------------------------------------- ...
true
2e91af223165a8d099239015befcce556d894ced
JavaScript
ruindong/IM-VUE
/src/utils/utils.js
UTF-8
1,922
2.84375
3
[]
no_license
export default { generateUUID (len) { len = len || 32; const $chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678"; /** **默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/ const maxPos = $chars.length; let uuid = ""; for (let i = 0; i < len; i++) { uuid += $chars.c...
true
6798d5f8241b6594ee95fbd450b4502d2cc434dc
JavaScript
JogoShugh/Learnlocity
/app/server/DDDDictionary.js
UTF-8
10,579
2.84375
3
[]
no_license
// Generated by CoffeeScript 1.6.2 (function() { var AgileDictionary, VocabDictionary, VocabWord; VocabWord = (function() { function VocabWord(word, definition, exampleSentence) { this.word = word; this.definition = definition; this.exampleSentence = exampleSentence != null ? exampleSentence ...
true
9081b9cc43d4211e7202b11738d062a01d9c7eaf
JavaScript
RDusi/borgdir-media
/static/js/uploadImage.js
UTF-8
456
2.671875
3
[]
no_license
function previewFile() { var preview = document.getElementById("inputUploadBild"); preview.click(); } function loadFile() { var img = document.getElementById("showbild"); var preview = document.getElementById("inputUploadBild"); var file = preview.files[0]; var reader = new FileReader(); reader.onloaden...
true
31e716be15386a33f2699a215a6c2e106e84cdb2
JavaScript
postify/simple
/methodsForMODEL.js
UTF-8
3,125
2.875
3
[]
no_license
/*global L*/ /*global m*/ /*global v*/ /*global c*/ //========| functions that UPDATE MODEL |========// c.updateBasicStates = function(eventObject){ m.priorStartTime = m.startTime m.startTime = Date.now() m.elapsedTimes.unshift(m.startTime - m.priorStartTime) m.elapsedTimes.pop() m.eventObject = eve...
true
ecb9a351decd016bc9b40bd6c6b941a00295f216
JavaScript
cha63506/anim8js
/lib/anim8js-parser-deltavalues.js
UTF-8
1,792
2.515625
3
[ "MIT" ]
permissive
/** * Instantiates a new parser for the 'deltas' & 'values' animation type. * * @class ParserDeltas * @constructor * @extends Parser */ anim8.ParserDeltas = function() { }; // ParserDeltas extends anim8.Parser() anim8.override( anim8.ParserDeltas.prototype = new anim8.Parser(), { parse: function( animation...
true
7ca18a655042cff90e71494b1bba1756f28bcecf
JavaScript
franklam2008/fcc-algorithm
/3-5-Cash-Register.js
UTF-8
4,366
2.9375
3
[]
no_license
function checkCashRegister(price, cash, cid) { var change = cash - price; var newchange = []; var cidtotal = 0; var names = ['PENNY', 'NICKEL', 'DIME', 'QUARTER', 'ONE', 'FIVE', 'TEN', 'TWENTY', 'ONE HUNDRED']; var cidvalues = [0.01, 0.05, 0.1, 0.25, 1, 5, 10, 20, 100] var ans = { status: "OPEN", chan...
true
cef0c8e67b9620907d28044ae281b4323a22c3bc
JavaScript
cedpoilly/healthy-living
/src/helpers/transformers.js
UTF-8
341
2.8125
3
[ "MIT" ]
permissive
export const markNextAs = (list, prevTag, tag) => { let nextMarked = false; const markedList = list.reduce((markedList, item) => { if (!nextMarked && item.visual === prevTag) { item.visual = tag; nextMarked = true; } markedList = [...markedList, item]; return markedList; }, []); r...
true
0640a5a56b71b6ddf15e02ec290c1aa1b9f68b4e
JavaScript
usaginya/mkAppUpInfo
/docs/medicinedance/js/lrclib.js
UTF-8
3,291
2.578125
3
[]
no_license
/* * by YIU * last 20180510.18 */ function randColor(){ var red = parseInt(Math.random()*156+80).toString(); var blue = parseInt(Math.random()*156+80).toString(); var green= parseInt(Math.random()*156+80).toString(); return 'rgb('+red+','+blue+','+green+')'; } function randFontsize(){ return parseInt(Math.rando...
true
36306eda03ccd5de580a8eac23406d50c1a2ea7a
JavaScript
rstacruz/react-big-calendar
/src/utils/dayViewLayout.js
UTF-8
8,927
2.921875
3
[ "MIT" ]
permissive
import { accessor as get } from './accessors' import dates from './dates' export function startsBefore(date, min) { return dates.lt(dates.merge(min, date), min, 'minutes') } export function positionFromDate(date, min, total) { if (startsBefore(date, min)) return 0 let diff = dates.diff(min, dates.merge(min...
true
b130ae6f6f0d6774baad60c3d49ea96cfdde3665
JavaScript
CDR-DavidR/mock-data-holder
/Source/CDR.DataHolder.IdentityServer/wwwroot/js/login.js
UTF-8
1,030
3.171875
3
[ "MIT" ]
permissive
$(document).ready(function () { $('#otpToast').css("position", "absolute"); $('#otpToast').css("top", "0px"); setTimeout(function () { $('#otpToast').toast('show'); }, 2000); // Set the date we're counting down to var countDownDate = new Date("Jan 5, 2022 15:37:25").getTime(); // Update the count down every...
true
bce883bb1f68c126ca1b3a65f444aabaa450d0ba
JavaScript
tanasa-mircea/probleme
/second/10-elemente-comune/main.js
UTF-8
821
3.28125
3
[]
no_license
let formSubmit = function(event) { event.preventDefault(); let input = event.target[0].value, secondInput = event.target[1].value, firstInputVector = input.split(',').map((el) => +el), secondInputVector = secondInput.split(',').map((el) => +el), allVectors = [].concat(firstInputV...
true
7321cf9f6f20086f680706473c74b3cfadd5099f
JavaScript
OnyxStudios/Flare
/src/onyx/flare/utils/FlareUtils.js
UTF-8
675
3.015625
3
[]
no_license
function isToday(date) { const today = new Date(); let month = date.split('/')[0]; let day = date.split('/')[1]; let year = '20' + date.split('/')[2]; return today.getDate() == day && today.getMonth() +1 == month && today.getFullYear() == year; } function hexToRGBA(hex, alphaVal) { let r = par...
true
8df4dcf108afbf77214fa20e202caeefe13e28e4
JavaScript
Sidlo98/School-Javascript-2
/lektion1/1-test/test.js
UTF-8
305
2.703125
3
[]
no_license
const hello = () => { console.log('Hello World') } // hello(); // hello(); // hello(); //När vi jobbar i Node så heter vårat globala objekt global istället för window // console.log(global); setTimeout(() => { console.log('timed out') },3000) console.log(__dirname) console.log(__filename)
true
1f9f8d946b6d29ee6d3ed458539c8b0551b4af3b
JavaScript
DaniellKondoff/JSAdvanced
/04.ObjectComposition/LAB/3.ModulePatterns/1.ModulePatternObject.js
UTF-8
341
3.3125
3
[]
no_license
/** * Created by Kondoff on 28-Oct-16. */ let moduleObject = { count:0, increase: function (num) { return this.count+=num}, decrease:function (num) { return this.count-=num}, value: function () { return this.count} }; moduleObject.count=5; moduleObject.increase(2) moduleObject.decrease(1) console.log(...
true
8480338a7d7c080be442fb985fe886081e1ce314
JavaScript
nikorisoft/nikorisoft.github.io
/blog/resources/photos/TAK21/gallery.js
UTF-8
4,975
2.8125
3
[]
no_license
"use strict"; const TIME_OFFSET = -177; async function loadContents(url) { const f = await fetch(url); if (!f.ok) { console.error("Fetch error", f); alert("Failed to load contents."); throw new Error("Failed to load contents"); } return await f.json(); } function findNeares...
true
216ffd49dda6f478e8b4806a8d14fe5732413ea5
JavaScript
faychou/todomvc
/src/js/app.js
UTF-8
4,093
3.125
3
[]
no_license
/* ** 功能分析: ** 1、展示数据 ** 2、添加任务数据 ** 3、编辑任务数据 ** 4、删除任务数据 ** 5、切换单个任务状态 ** 6、批量切换任务状态 ** 7、清除已完成的功能 ** 8、隐藏或显示清除按钮 ** 9、显示未完成的任务数 ** 10、切换不同状态任务的显示 ** */ (function (angular) { 'use strict'; var app = angular.module('todos',[]); app.controller('todosControl',['$scope','$location','$window', function ($scop...
true
b0dda022ceaf4bc45437b297c61fa4eafcade705
JavaScript
bhaskardas/SSCorp-Old
/SSCorp-Old_Supporting_Docs/deployment_backups/sscorp/script/generalScript.js
UTF-8
2,379
2.8125
3
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * function to submit the request for the list of projects based project category input. */ function getProjects4Category(obj) { document.generalForm.selectedProjCategory.value = obj.value; document.gener...
true
75da9abbf73c5b7b82d8eec65c06eb002169a525
JavaScript
cabbibo/AudioJS
/js/music/looper.js
UTF-8
1,516
3.015625
3
[]
no_license
//SCRIPT FOR THE LOOPER var clock= new THREE.Clock(); var loopTime=0; var t; function looperStart(){ clock.start(); clockStarted=1; } function looper(){ loopTime += clock.getDelta(); //Test to see if the loop should be repeated First, //so we don't have the current loops change ...
true
1f9cef0b0476e9c9deda2eecc4a0d6bdcf0e042d
JavaScript
AnthStep/TelegramContest
/src/entities/ValueSelector.js
UTF-8
3,946
2.609375
3
[]
no_license
/* eslint-disable indent */ import HTMLElementEntity from '../sharedClasses/HTMLElementEntity'; import AppWrapper from '../singletons/AppWrapper'; export default class ValueSelector extends HTMLElementEntity { constructor(layer, data, mainGraph, descriptionLayer, detectionLayer) { super(layer, data); this._mainGr...
true
57a5eefb7dd40843b095c2d0413a25c266f938df
JavaScript
Raj-pandian/Chatbot-popup
/static/main.js
UTF-8
1,335
2.65625
3
[]
no_license
const popup = document.querySelector('.chat-popup'); const chatBtn = document.querySelector('.chat-btn'); const submitBtn = document.querySelector('.submit'); const chatArea = document.querySelector('.chat-area'); const inputElm = document.querySelector('input'); // chat button toggler chatBtn.addEventListene...
true
9017a4f560fcb9e1fa0d2008ee021cb32d3062bb
JavaScript
codebyjustin/Color-Guessing-Game
/app.js
UTF-8
2,930
3.703125
4
[]
no_license
let numSquares = 6; let colors = generateRandomColors(numSquares); let pickedColor = pickColor(); const displayColor = document.querySelector("#displayColor"); const sqaures = document.querySelectorAll(".square"); const message = document.querySelector("#message"); const resetButton = document.querySelector("#reset");...
true
03cc06013aab3221d1ca8d47b2325cd31b701102
JavaScript
macbury/Expanse
/android/assets/core/wait.js
UTF-8
186
3.359375
3
[]
no_license
/** * The instruction wait(); instructs the bot to wait for some seconds, according to the value written in brackets. */ function wait(seconds) { core.wait(seconds); core.yield(); }
true
427cef3f813fc40be0725a6010c1d7098231da4e
JavaScript
18235183409/18235183409.github.io
/tianmao/js/index.js
UTF-8
6,855
2.578125
3
[]
no_license
//active { var masks=document.querySelectorAll(".activeRightImg .mask"); masks.forEach(function(value,index){ value.onmouseover=function(){ masks[index].style.opacity=1; } value.onmouseout=function(){ masks[index].style.opacity=0; } }) } //视频 { var big=do...
true
6dd98eac5638ac434dc84a7d4f33950c8bae80aa
JavaScript
alibayramli/coding-challenges
/codewars/7kyu/square-every-digit.js
UTF-8
95
2.875
3
[ "MIT" ]
permissive
function squareDigits(num) { return +(num + '').split('').map(el => (+el) ** 2).join(''); }
true
fffe1f27de0175900160ea5878e89bd8b0116f54
JavaScript
ketan18710/coding-blocks
/Lecture 12 .27-01-19/promises.js
UTF-8
591
3.09375
3
[]
no_license
var fs = require('fs'); let Data = ''; function readFile(){ return new Promise((resolve,reject) => { fs.readFile('./padh.txt', function(err,data){ if(err) return err; Data += data.toString(); resolve(Data); }) }) } function writeFile(){ return new Promise(...
true
e781fecb120560e3ace2b661781a598f1c1f450d
JavaScript
emanuelevizzarro/esercizijavascript
/esercizio23.js
UTF-8
217
3.765625
4
[]
no_license
const person = { firstName: 'Mario', lastName: 'Rossi', age: 25 } // Print values of person using Object.keys for (let key of Object.keys(person)) { console.log(`${key}: ${person[key]}`); }
true
bdbd3f4a6d393f07ceff156fa920de80eebcf98a
JavaScript
kwokrobyn/house-app
/public/javascripts/main.js
UTF-8
4,590
2.84375
3
[]
no_license
$(document).ready(function() { const userID = $('#currentID').html(); const houseID = $('#houseID').html(); let showKey = false; /* * EVENT LISTENERS */ // Open Modal $(document).on('click', '#createButton', (e) => { $('#createForm').modal('show'); }); // Submit Create Form $(document)....
true
b782000f16948d5273a31864dadfcd16eb9f3f08
JavaScript
nikvagh/ibid
/application/views/back_assets/js/changepassword.js
UTF-8
596
2.515625
3
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
permissive
function confirmSubmit(frm) { with(frm) { if(frm.o_password.value == '') { alert("Please enter old password."); frm.o_password.focus(); return false; } if(frm.n_password.value == '') { alert("Please enter new password."); frm.n_password.focus(); return false; } if(frm.c_password.value ...
true
c278b78d22970ff6b2fcb790e25ca3dc549d2893
JavaScript
oborae/webDevStudyCourse
/5- Java Script/19_ArrayProblemSetSolutions/mysolution.js
UTF-8
543
3.703125
4
[]
no_license
function printReverse(array){ for (var i = array.length-1; i >= 0; i--) { console.log(array[i]); } } function isUniform(array){ var first = array[0]; var uniform = true; for (var i = 1; i < array.length && uniform == true; i++) { if(first != array[i]) uniform = false; } return uniform; } function ...
true
779bb47c0d64b9bde1ffd2c067032ee381a1d4d4
JavaScript
alpacaaa/redux-purify
/test.js
UTF-8
4,081
3.0625
3
[]
no_license
import { expect } from 'chai'; import purify from './index'; const testReducer = (reducer, action, state, expectedState) => { const newState = reducer(state, action); expect(newState).to.be.an('object'); expect(newState).to.deep.equal(expectedState); }; describe('redux-purify', () => { it('works with a...
true
b973978ac72f058fbc28d0d6d095b729ec5f92ca
JavaScript
zxk318www/AgricultureWeb
/src/main/webapp/static/miniui/val.js
UTF-8
5,971
3.015625
3
[ "Apache-2.0" ]
permissive
//////////////////////////////////////// function onEnglishVal(e) { if (e.isValid) { if (isEnglish(e.value) == false) { e.errorText = "必须输入英文"; e.isValid = false; } } } function onChineseAndEnglishVal(e) { if (e.isValid) { if (isChineseAndEnglish(e.value) == false) { ...
true
235d139ae42720222668f355ea3a74e8690e8b58
JavaScript
ylcnfrht/node_redis
/commands/lists/blpop.js
UTF-8
444
2.875
3
[ "MIT" ]
permissive
'use strict'; var redis = require('redis'); var client = redis.createClient(); // blpop: Remove and get the first element in a list, or block until one is available client.del('list1', 'list2', function (err, res) { console.log(res); // 0 }); client.rpush('list1', 'a', 'b', 'c', function (err, res) { consol...
true
175d19fb916e84631364b70187fd0187a489e500
JavaScript
hengjiuko/nodeJs-createServer-and-event
/创建服务+事件+读取文件+观察者模式/createServer.js
UTF-8
747
3.015625
3
[]
no_license
//引入http模块 var http = require( "http" ); console.log( http ); //调用http的createServer的方法,它会返回一个对象 //这个对象有一个listen方法,可以用来监听端口号 http.createServer( function( require, responce ){ //1.发送http头部信息 //-http状态码:200,意思是一切OK //-内容类型:text/plain,以普通文本来解释 //-内容类型:text/html,以html来解释 responce....
true
c8cb3d92342e8d7a00a072f4bbc539049b664024
JavaScript
shahrairenayaty/shahriar-physio-server
/src/models/visit.js
UTF-8
4,186
2.515625
3
[]
no_license
const mongoose = require("mongoose"); const Schema = mongoose.Schema; const exerciseSchema = require("./exercise"); const VisitSchema = new Schema({ physio: { type: Schema.Types.ObjectId, ref: "Person" }, patient: { type: Schema.Types.ObjectId, ref: "Person", required: true }, dateOfVisit...
true