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
6e2785e1281580101da5c0bbd427955cb94c2a56
JavaScript
zmallah/tutorlink
/api/Group.js
UTF-8
2,697
2.546875
3
[]
no_license
const mongoose = require('mongoose'); const schema = mongoose.schema; const GroupSchema = require('./schemas/GroupSchema'); const Group = mongoose.model('Groups', GroupSchema); const create = (req) => { var newGroup = new Group({ _id: new mongoose.Types.ObjectId(), name: req.body.name, own...
true
61018b7bb552f8f3e815620b8de566c7cc90c1f8
JavaScript
RisingGeek/nextjs-redux
/pages/index.js
UTF-8
1,479
2.515625
3
[]
no_license
import Head from 'next/head' import React, { useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { INCREMENT_COUNT_KEY, UPDATE_PROFILE } from '../redux/actionTypes'; export default function Home() { const [nameInput, setNameInput] = useState(""); const [emailInput, setEmailInput...
true
c58214883e126e960e0ea001249c456a31ec742d
JavaScript
AlexZeDim/hybrid
/level2.js
UTF-8
1,371
2.703125
3
[]
no_license
const Jimp = require('jimp'); const { createWorker } = require('tesseract.js'); const captureImage = require('./captureImage'); const { sleep } = require('./module/getters'); (async function level2 () { try { await sleep(2500) /** Level2 quotes */ //first row x: 408, y: 211, w: 70, h: 20 ...
true
8959da02a957116cadda4bca606f6376c2984ba6
JavaScript
gorugo/LoneWolfTP5
/routes/creationJoueur.js
UTF-8
4,209
2.640625
3
[]
no_license
var express = require('express'); var rest = require('restler'); var u = require("underscore"); var constantes = require('../lib/constantes.js') var router = express.Router(); var Joueur = require('../models/joueur'); var Avancement = require('../models/avancement'); // GET page de création du joueur. router.get('/cr...
true
6237fbd3e7c1c644d39ebac8ebf36c1594a2ef89
JavaScript
cquezpro/Hans
/js/main.js
UTF-8
24,513
2.515625
3
[]
no_license
/*---Copyright by: Matthias Zubke, 75196 Remchingen, Germany--*/ var currLang = 0; var questionList = []; var navigationList = []; var mealHistoryList = []; var defaultDate = "15.04.2015"; //Variables for Re-enter of meal history var bReEnter = false; var indexReEnter = -1; //Cordova library ready function document...
true
d5ad2f54244b9b206f59cf93ac51a340887339fb
JavaScript
keithbabinec/SampleAADImplicitGrantFlow
/TestAuthReactWebClient/src/Services/Api/Api.js
UTF-8
1,191
2.75
3
[ "MIT" ]
permissive
import axios from 'axios'; // a simple class wrapper around the API service. class Api { // constructor that requires a base URI and a bearer token. // note: this doesn't include any code to refresh the token over time. constructor(baseUri, token) { if (!baseUri) { throw new Error('the...
true
078d04371fff9cdf5a4f239507d19406ef89e7cf
JavaScript
bipinkalra-scaler/scaler-edge-ui
/app.js
UTF-8
1,371
3.0625
3
[]
no_license
let trackCards = document.querySelectorAll(".track-card") let theme = null trackCards.forEach((trackCard) => { if (trackCard.classList.contains("track-card--active")) { theme = trackCard.classList[trackCard.classList.length - 1] // console.log(theme) } }); function setTrack(event) { // console.log(even...
true
53b0b663da73e881064d8bedc6869dda40ec4471
JavaScript
brendan-kellam/GCS-On-Call-System
/OnCallSystem/static/js/oncall_request.js
UTF-8
1,547
2.9375
3
[]
no_license
//handles submit button $(document).on("click", ".submit_button", function(e) { //pull data from form var date = getComp("inputDate"); var week_id = getChoiceComp("inputWeek_id"); var period = getChoiceComp("inputPeriod"); var course_code = getChoiceComp("inputCourse_code"); var slot = getChoiceComp("inputSlot"...
true
835be452b25fb80f926fce8146de6fe90a53353b
JavaScript
ST0n1K/what
/src/pages/Question8/index.jsx
UTF-8
2,846
2.546875
3
[]
no_license
import { Card, Col, Row, Image, Select, Form, Button, message } from 'antd'; import React from 'react'; import image from '../../assets/15.jpg'; import image1 from '../../assets/16.jpg'; import './Question8.scss'; import { motion } from 'framer-motion'; const Question = (props) => { const { Option } = Select; cons...
true
e6f1886939920767cc7f66305cd9c29129750a54
JavaScript
Michael-KD/rockpaperscissors
/js/script.js
UTF-8
2,901
3.953125
4
[]
no_license
// *************************** YOUR CODE BELOW ******************************* //******************TEST EARLY AND OFTEN USING console.log() ****************** //****************** SERIOUSLY TEST USING console.log()!!! ****************** //GLOBAL VARIABLES /* global $ */ let userChoice = ""; let compChoice = ""; let wi...
true
328156991d9de6fffa3cf5e05d6ff7197205d926
JavaScript
hammer-io/tyr
/src/utils/credential-validator.js
UTF-8
1,709
3.171875
3
[ "MIT" ]
permissive
import validator from 'email-validator'; /** * Determines if a string is blank or not * @param value the value to check * @returns {boolean} true if blank, false otherwise */ function isBlank(value) { return (typeof value === 'undefined') || value === '' || value.trim().length < 1; } /** * Validates a username...
true
d8c0de5ee7663a56e4c5d856a80d8adced65fca3
JavaScript
alexanderpugh/forensic-calc
/src/pages/HeatOfExplosion.js
UTF-8
2,887
2.546875
3
[]
no_license
import React from 'react'; import { Link } from 'react-router-dom'; import _ from 'lodash'; import { Container, Row, Col, Button, Panel } from '../components/Bootstrap'; import NumberInput from '../components/NumberInput'; import { heatOfExplosion } from '../lib/explosionsAndFire'; class HeatOfExplosion extends React...
true
c0792240ce7bd1d329f38fe81e87720d1289f9d9
JavaScript
lk-developers/Rem
/src/commands/fun/remme/remme.js
UTF-8
982
2.71875
3
[]
no_license
const { MessageAttachment } = require("discord.js"); const Canvas = require("canvas"); const handle = async (message) => { // if there a member mentioned, use that member's avatar const member = message.mentions.members.first() || message.member; const canvas = Canvas.createCanvas(633, 800); const ctx = canvas.g...
true
1ae7e04f5411415ceff3debbc472ce608f2acc54
JavaScript
vicki388/refiner
/lib/fuel1.js
UTF-8
1,073
2.875
3
[]
no_license
var through2 = require('through2'), request = require('request') // // take the value in the column as a city's name to lookup // the sunrise time using the open weather API // module.exports = function(columnId) { return new through2.obj(function(row, enc, callback) { var fuel_type = row[columnId] ...
true
b300562f5a12f5752de304f1f6eeeb00eba505b8
JavaScript
Owen2008/leTao0926
/public/back1/js/user.js
UTF-8
1,825
2.578125
3
[]
no_license
// 页面渲染和分页 $(function(){ var currentPage=1; var pageSize=5; function render(){ $.ajax({ type:"get", url:"/user/queryUser", data:{ page:currentPage, pageSize:pageSize }, dataType:"json", success:function(info){ console.log(info) $("#paginator"...
true
19ee15078384eb3a130b729f8e4ff45d4050d972
JavaScript
kybernetikos/SocialChoice
/demo/js/VoteCounter.js
UTF-8
1,174
3
3
[]
no_license
var VoteCounter = function(voterHandler, voteHandler) { this.voterHandler = voterHandler; this.voteHandler = voteHandler; this.voteResult = ko.observable(""); this.selectedVotingType = ko.observable(""); this.voteOptions = ko.observableArray([]); this.addVoteOptions(); ko.applyBindingsToNode(docum...
true
62c68b1262f7adc190d13f2d0c305e7a867c79dc
JavaScript
TgeFreakScott/YouthWorkProject
/scripts/Scene.js
UTF-8
1,078
2.78125
3
[]
no_license
class Scene { /** Inialises the sceneName for the class. @param {string} sceneName - The title for the scene. **/ constructor(sceneName,sceneManager, context) { this.title = sceneName; this.sceneManager = sceneManager; this.ctx = context; this.sceneTitles = {Tuto...
true
5cb085ac3cdb84e1c9148f2fb091f383cb44409d
JavaScript
timothylevi/exercism-js
/rna-transcription/rna-transcription.js
UTF-8
707
3.140625
3
[]
no_license
var DnaTranscriber = function() { this.rnaComplements = { 'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U' }; }; DnaTranscriber.prototype.getRnaComplement = function getRnaComplement(nucleotide) { // Return the RNA complement of the passed DNA nucleotide or throw an error. var complement = this.rnaComple...
true
53b99e841e2954d4c2dbbf9ffb1495d0553915ef
JavaScript
jonathonlaylo/selection-sort
/selection-sort.js
UTF-8
562
3.515625
4
[]
no_license
/*jshint esversion: 6 */ let myArray = [9,2,5,6,4,3,7,10,1,8,11]; function swap(myArray, i, j){ var tmp = myArray[i]; myArray[i] = myArray[j]; myArray[j] = tmp; } function selectionSort(myArray) { for (var i = 0; i < myArray.length; i++) { var min = i; for (var j = i + 1; j < myArray.length; j++) { ...
true
c9993f279da9503a57d96c7a6566c8613f73380b
JavaScript
ethical-jobs/sdk-js-archived
/test/mocks/fetchResponseMocks.js
UTF-8
778
2.6875
3
[ "MIT" ]
permissive
import 'isomorphic-fetch'; export function jsonOkResponseMock (body) { var mockResponse = new window.Response(JSON.stringify(body), { status: 200, ok: true, headers: { 'Content-type': 'application/json' }, }); return Promise.resolve(mockResponse); } export function jsonErrorResponseMock (...
true
2bee3bf285cde18ce8cca82e36a5e5f4f6b9c24e
JavaScript
dragosbln/quiz-game
/index.js
UTF-8
10,490
2.71875
3
[]
no_license
const questionsContainerContent = document.querySelector('.question-content'), questionCongradulation = document.querySelector('.congradulation'), questionElem = document.querySelector('.question'), answerContainers = document.querySelectorAll('.answer'), answerElems = document.querySelectorAll('.answer...
true
cccdee702ad5cc44b58aab0f3a7d3a8cbbece9c1
JavaScript
Ivilili/cars
/src/services/VehicleService.js
UTF-8
3,058
2.734375
3
[]
no_license
import firebase from '../utilities/firebase'; import { runInAction } from 'mobx'; import storeInstance from '../stores/VehicleStore'; class VehicleService { //get data fetchData = () => { firebase .firestore() .collection('VehicleMake') .orderBy('name', 'desc') .limit(storeInstance.carsPerPage) .onS...
true
c9ed8b9f4578f5fdaf8fe679e21db59255cf200b
JavaScript
liuyiju0926/MyCalculator
/index.js
UTF-8
1,468
3.5
4
[]
no_license
var firstNum = 0; var op = 0; //讀取數值 function numClick(num) { if (document.getElementById("result").value == 0) { document.getElementById("result").value = num; } else { document.getElementById("result").value = document.getElementById("result").value + num; } } function ope...
true
a2f835562c6f8d0b52fd8e90dbb48fab59664fde
JavaScript
OscarLopera/sofka-okr-c2
/BackNode/__test__/domain/okr/okr/valueObjects.spec.js
UTF-8
2,356
2.53125
3
[]
no_license
const valueObjects = require("../../../../domain/okr/okr/valueObjects"); describe("validations value Objects Okr", () => { it("Objective Errors (null)", () => { try { valueObjects.ObjectiveValueObject(null); } catch (e) { expect(e).toEqual(new Error("Debe contener un objetivo")); } expect...
true
b5345a9ba1b207258f344b15c182ba2f8b2f9013
JavaScript
redbearin/skill-work
/reformat-string/answer.js
UTF-8
957
3.84375
4
[ "MIT" ]
permissive
function reformat(s) { sArray = s.split(''); numArray = []; charArray = []; finalArray = []; //saves numbers and chars separately //saves in reverse order so not same string, if already alternating for (let index = sArray.length - 1; index >= 0; index--) { if (/[0-9]/.test(sArray[index])) { nu...
true
769c0a2607405f81a6e12946b3e44e63a59ec753
JavaScript
localnerve/ui-elements
/src/horizontal-pager/test/browser-tests/get-horizontal-pager.js
UTF-8
1,601
2.625
3
[ "BSD-3-Clause" ]
permissive
/** * Get horizontal-pager from iframes. * * Copyright (c) 2017-2023 Alex Grant (@localnerve), LocalNerve LLC * Copyrights licensed under the BSD License. See the accompanying LICENSE file for terms. */ /* global window, document */ /* eslint-disable func-names, no-underscore-dangle */ (function () { const mainF...
true
3c46cf78018921a138ff696d3ec1fb226d70b9cc
JavaScript
jkmarvelmani/sharepoint-utilities
/src/sputils.lib.js
UTF-8
1,758
3.25
3
[ "MIT" ]
permissive
/** @namespace sputils.lib */ /** * "taps" a function to produce a side effect * but wrap it in an identity fn. * * @function sputils.lib.tap **/ var tap = function (fn) { return function (value) { fn(value); return value; }; }; /** * Get a value deeply from an object without crashing on nulls. * * This ...
true
15ab34fc3627f0ba14115bc0fdade3edfeeef650
JavaScript
daviteixeira-btm/Exercicios-do-URI-Online-Judge
/1016 - Distância.js
UTF-8
227
2.984375
3
[]
no_license
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var lines = input.split('\n'); var distancia = parseInt(lines.shift()); var quantidade_minutos = (60 * distancia)/30; console.log(quantidade_minutos + " minutos");
true
03d75af8b9e16aee689be027656ceea8c8da8093
JavaScript
see-bet-code/react-state-self-assessment-091420
/src/App.js
UTF-8
628
2.734375
3
[]
no_license
import { object } from 'prop-types'; import React, {useState} from 'react'; import './App.css'; import {yes, no} from './objects'; function App() { const [active, setActive] = useState(false) const [yesObj] = useState(yes) const [noObj] = useState(no) const statementMapper = { true: yesObj["yes-statement"...
true
741539b92ddd08b47d265f325803978552c63845
JavaScript
kirans08/advent-of-code
/2020/04/04A.js
UTF-8
212
2.5625
3
[]
no_license
const fs = require('fs'); var input = fs.readFileSync('input', 'utf8'); var result = input.split("\n\n").filter( s => s.split(/\s/).length + (s.includes('cid:') ? -1:0) == 7 ).length; console.log(result);
true
cfa66df31d6e1b2f2d398b487f6474c287c203f8
JavaScript
BenJohnK/pythonprograms
/javascript_programs/js_word_count.js
UTF-8
79
2.96875
3
[]
no_license
var text="you are there there" for(let word of text){ console.log(word) }
true
2f08589ef83430c7b276a0601bdca11911a1b110
JavaScript
Joegxx/Analysis-Hub
/Twitter-Analysis-Hub-master/TwitterAnalysisHub/WebContent/js/productjs.js
UTF-8
4,224
2.78125
3
[]
no_license
/* CODE FOR PRODUCT */ var prequest; function sendProduct(){ var product = document.searchProduct.productName.value; if (product==null || product=='') errorSnackBar('Enter a Product Name to Analyze'); else { var progress="<div class='progress' style='width:600px;margin:auto'><div class='indeterminate'></div></d...
true
f91b78937ab5e522a02e501542734447ffe0416f
JavaScript
ahmedhoummani/nguoianphu
/init_liquid/game/prefabs/levelcompleteboard.js
UTF-8
2,268
2.5625
3
[]
no_license
var SimpleButton = require('./simplebutton'); 'use strict'; var Levelcompleteboard = function(b, c, d) { Phaser.Group.call(this, b, c, "Level Complete Board"); this.levels_num = this.game.global.levels_num; this.levelNumber = d; this.addBackGround(); this.board = this.game.add.image(-10, 250, "bggroup", "credit...
true
355cdaa334501f2e9fd68395977fe0f0997f5f4c
JavaScript
PascalUlor/portfolio
/UI/public/js/main.js
UTF-8
2,575
2.5625
3
[]
no_license
const backdrop = document.querySelector('.backdrop'); const toggleButton = document.querySelector('.toggle-button'); const mobileNav = document.querySelector('.mobile-nav'); const backDrop = () => { backdrop.classList.remove('open'); }; const mobileButton = () => { mobileNav.classList.add('open'); backdrop.clas...
true
5c98d2a1f975dbf5e13cb376bc623ebb5cd365ea
JavaScript
hasanthex/node-server-create
/app.js
UTF-8
490
2.796875
3
[]
no_license
const http = require('http'); console.log(http); // Create a server and response text. const server = http.createServer((req, res)=>{ console.log('Request URL : ' + req.url); // Get request URL on Console. res.writeHead( 200 , {'Content-Type':'text/plain'}); // set status code and type res.end('Its ...
true
2c39aaef6ba1feea1fb28d8e6e680bef59e49de5
JavaScript
vudat412/DATV-Algroithm
/Algriothm Sortting Tower of Hanoi/Queue.js
UTF-8
554
3.21875
3
[]
no_license
// Xây dựng cho hàng đợi function Queue() { this.list = new LinkedList(); } // Enqueue một yếu tố để xếp hàng Queue.prototype.enqueue = function(e) { this.list.add(e); } // Xóa một phần tử khỏi phần đầu của hàng đợi Queue.prototype.dequeue = function() { return this.list.r...
true
6ff1c57b48aff6dc0edfdecad9397d13a5891e0f
JavaScript
Gabbendorf/React-Weather-Man
/src/api.js
UTF-8
729
2.875
3
[]
no_license
import "whatwg-fetch" import { APIKey } from "./APIKey" const rootUrl = "http://api.openweathermap.org/data/2.5/forecast?q=" const parameterForTemperatureInCelsius = "&units=metric" function checkStatus(response) { if (response.status >= 200 && response.status < 300) { return response } else { let error = ...
true
b11a6ed1aadd6111eaa86be5a9cdeb654ae27aca
JavaScript
VidithAgarwal/Movie_App
/routes/movies.js
UTF-8
1,955
2.59375
3
[]
no_license
var express = require("express"), router = express.Router(), Movie = require("../models/movies"); // Index - Shows all movies router.get("/", (req, res)=> { Movie.find({}) .then((movies)=> { res.render("index", {movies: movies}); }) .catch((error)=> { console.log(error.message); }) }) // ...
true
6d000266f040d23c531b8fb58548b6376f6ce599
JavaScript
orlando/angular-primes-calculator
/app/scripts/services/prime.service.js
UTF-8
3,393
2.765625
3
[]
no_license
'use strict'; angular.module('fc.services.prime', []) .factory('fcPrimeService', [ '$rootScope', '$q', function fcPrimeService($rootScope, $q) { var worker, workerPath; workerPath = 'app/scripts/worker.js'; // Karma prepends 'base' to all scripts paths // since this is not inclu...
true
1a4ca417f11b7bcfc3b1fe8226892e1a2bd8a2e9
JavaScript
z17/home-accounting-system
/app/backend/Backup.js
UTF-8
860
2.515625
3
[ "MIT" ]
permissive
const fs = require('fs'); const moment = require('moment'); const path = require('path'); function Backup(databasePath, folder) { this.folder = folder; this.databasePath = databasePath; } Backup.prototype.makeBackup = function (lastBackupTimestamp) { if (!this.folder) { console.log('cant find a fo...
true
4577e1e5dcad7f2f75837abbda1f794bae845404
JavaScript
Labvanced/exp-design
/contentElements/InitialSurveyDialog.js
UTF-8
4,617
2.59375
3
[]
no_license
/** * Creates a new Dialog and directly creates and initializes a new factor. * * @param {ExpTrialLoop} task - The data model of the task * @param {number} factorGroupIdx - The index of the factor group for the factor that is being created. * @constructor */ var InitialSurveyDialog = function (expData) { thi...
true
54d82ffd608e285e05e0473a245a2ed225acefe0
JavaScript
thitoribeiro/programming
/modern-javascript/section 1-3/aula14/index.js
UTF-8
431
3.546875
4
[]
no_license
let num1 = 0.7; let num2 = 0.1; //console.log(num1.toString() + num2); //console.log(typeof num1); //console.log(num1.toString(2)); //console.log(num1.toFixed(2)); //console.log(Number.isInteger(num1)); //let temp = num1 * 'Ola'; //console.log(temp); //console.log(Number.isNaN(temp)); //num1 += num2; //num1 += num2; ...
true
7f6ecdf4fd22ff4b1bfbb65ce3ae1c1df44f7839
JavaScript
artandrey/games
/bubbles-demo/index.js
UTF-8
11,873
2.96875
3
[]
no_license
const FPS = 60; const PADDING_X = 40; const BUBLES_COLORS = ['yellow','green','red','blue', 'soap']; const canvas = document.createElement('canvas'); const gameBox = document.getElementById('game-box'); const menu = document.getElementById('game-menu'); const form = document.getElementById('option-form'); const buttons...
true
2e7ce8703c634a89257332aad11e9842a68fb152
JavaScript
Asraf-Uddin-Ahmed/CatCatchTheRat
/js/main.js
UTF-8
2,792
2.90625
3
[]
no_license
$(function () { var board = [false, false, false, false, false, false, false, false, false]; var penalty = 0; var score = 0; var seed = 0; var time = 0; var interval = 3000; function showImageByBoard() { for (var I = 0; I < 9; I++) { var id = "#img" + I; ...
true
f26f26f35e0c3fcd248c09377e1746d9611cedf0
JavaScript
Hendori/WebApps
/le5/Eigen oefeningen/rijen.js
UTF-8
474
3.1875
3
[]
no_license
var rijen = []; rijen.push([0, 0, 1, 0, 1]); rijen.push([1, 0, 1, 1, 1]); rijen.push([1, 1, 1, 0, 0]); rijen.push([1, 1, 1, 0, 0]); rijen.push([0, 1, 0, 0, 0]); var kolommen = []; rijen.forEach(function() { kolommen.push([]); }); rijen.forEach(function(rij, rijIndex) { rij.forEach(function(e1, kolomIndex) { ...
true
ee646735cb58974b7b668ef81010e99308b10a47
JavaScript
vinhtran169/AwesomeProject
/globals.js
UTF-8
629
2.53125
3
[]
no_license
var React = require('react-native'); var SQLite = require('react-native-sqlite-storage'); class Globals{ static db = null; static dbName = 'MyDB.db'; static openDB(){ this.db = SQLite.openDatabase( {name : this.dbName, createFromLocation: '~ReactDB.db'}, () => {console.log('====Success open dat...
true
3d3954060e88254b4eb8c730e865e8f9423a3f53
JavaScript
lucianomazzuca/blustech-ecommerce
/server/src/module/brand/service/brandService.js
UTF-8
900
2.546875
3
[]
no_license
const Brand = require('../entity/Brand'); const BrandIdNotDefinedError = require('../error/BrandIdNotDefined'); const BrandNotDefinedError = require('../error/BrandNotDefinedError'); class BrandService { constructor({ brandRepository }) { this.brandRepository = brandRepository; } async getAll(offset, limit,...
true
a4350435286d95e25ce7877948875c55a6835901
JavaScript
Abdelhadi-Amhamdi/Pets
/frontend/src/components/auth/register-f.js
UTF-8
1,777
2.546875
3
[]
no_license
import React , {useState} from 'react' import axios from 'axios' import {Url} from '../Data/content' const RegisterSection = () =>{ const [username, setusername] = useState('') const [email, setemail] = useState('') const [pass, setpass] = useState('') function sentData(e) { e.preventDefau...
true
60aa1c52ce3777eb84fa9decde94b926f54327de
JavaScript
Light2Dark/Etch-A-Sketch
/scripts/script.js
UTF-8
3,492
3.359375
3
[]
no_license
let numSquares = 16; let color = "black"; let brushToggle = true; let eraserToggle = false; let musicToggle = false; let eraseSound = document.getElementById("eraseSound"); let shakeSound = document.getElementById("shakeSound"); let music = document.getElementById("music"); music.volume = 0.05; music.loop = true; let ...
true
ed17ea1d9ff9ee66f2b8f412767b0ea36f234a15
JavaScript
pjalmighty42/PJ_Laudun_CodeSamples
/WebDev/FrontEnd/Work Examples/IAS/EAppJS/Components/CollapsibleGroupCard.js
UTF-8
11,534
2.875
3
[]
no_license
//Objects function CollapsibleCardObj( divID, parentID, accordionID, buttonClass, buttonValue, autoShow, cardBodyItems, enabled, required ) { this.divID = divID; this.parentID = parentID; this.accordionID = accordionID; this.buttonClass = buttonClass; this.button...
true
adcd80df90097ff554c06aff55cde4440db397ce
JavaScript
kuukienator/livoq_angular
/js/canvas.js
UTF-8
9,167
2.8125
3
[]
no_license
/** * Created with JetBrains WebStorm. * User: Emmanuel Meinike * Date: 29/09/13 * Time: 13:40 * To change this template use File | Settings | File Templates. */ var pieCanvas,barCanvas,results; var topGreen = '#8ae234' var frontGreen ='#73d216' var sideGreen = '#4e9a06'; var topPurple = '#ad7fa8'; var frontPu...
true
7c6893a20ccf1b60e8fbb9fb2168553adc9d93d6
JavaScript
mattthompson22/feb-lessons
/conditional-intro/index.js
UTF-8
1,826
4.28125
4
[]
no_license
// true // false // var didBobEatBreakfast = true; // if (didBobEatBreakfast) { // //do this code // console.log("I'm full from my yogurt"); // } // comparison operators < > <= >= === == ! !== // var myAge = -5; // if (myAge >= 18) { // console.log("Welcome to Friday 13th") // } else if (myAge >= 13) { ...
true
9bc97de4ed671765728aceb382422cff5708a467
JavaScript
antwebstudio/yii2-core
/src/widgets/assets/nestedSortable/jquery.structure.js
UTF-8
200,134
2.640625
3
[ "MIT" ]
permissive
(function($){ if (typeof Ant == 'undefined') { Ant = {}; } $.extend(Ant, { left: "left", right: "right", /** * Returns a hidden CSRF token input, if CSRF protection is enabled. * * @return string */ getCsrfInput: function() { if (Ant.csrfTokenName) { return '<in...
true
c9178110e0be581cb6b42fd955ab13b68a51e672
JavaScript
lbailey143/Peretz_Jay
/scripts/menu_selection.js
UTF-8
797
2.90625
3
[]
no_license
function updateSelectedMenu() { var loc = document.location.href; var scripts = document.getElementsByTagName('script'); var parentNode = scripts[scripts.length - 1].parentNode; var parentTag = parentNode.tagName.toLowerCase(); if (parentTag == "li") { parentNode = parentNode.parentNode; parentTag = parentNod...
true
e2056bd3ebb5fe07b767578e0368fe69224a05c5
JavaScript
2943785277/xcx
/pages/gouwuche/gouwuche.js
UTF-8
4,635
2.84375
3
[]
no_license
Page({ data: { iscart: true, carts: [ { id: 1, tit: '美素佳儿(Friso)金装幼儿配方奶粉 3段(1-3岁幼儿适用)1200克(荷兰原装进口)', img: 'http://localhost:8080/images/img1.jpg', num: 4, price: 99.00, select: "success", }, { id: 2, tit: '美素佳儿(Friso)金装幼儿配方奶粉 3段(1-3岁幼儿适用)1200克(荷兰原装进口)', img: 'http://localhost:8080/images/img1.jpg'...
true
dd7db8d73c11e0f717c0e781e9dffa5984129fed
JavaScript
mdraselmiah95/tricky-concept-js
/call-back.js
UTF-8
924
3.46875
3
[]
no_license
/* function welcomeMessage(name) { console.log(name); name(); } */ function welcomeMessage(name, greetHandler) { // console.log(greetHandler); greetHandler(name); } // const names = ['Tom Hanks', 'Tom Brady', 'Tom Cruse']; // const myObj = { // name: 'Tom Brady', // age: 44 // }; // welcom...
true
9bfd82d3c3ea5ea2507f696223300da496e86a43
JavaScript
markeggensperger/askthepros
/client/components/communications.js
UTF-8
1,277
3.0625
3
[ "MIT" ]
permissive
export const mainSentence = (tagObj, initial = false) => { if (!tagObj.id) return `We have no more questions to ask, please click the "Enough!! I'm Thirsty" link below.` const { tag, type } = tagObj; const tagL = tag.toLowerCase(); const ingredient = type === 'ingredient'; const tagPhrase = ingredient ? `have...
true
c1191826dc907aebaa4f9559d9ea1fd0a3473c00
JavaScript
stringparser/practice
/algorithm/warmup/solve-me-second.js
UTF-8
341
3.09375
3
[]
no_license
'use strict'; var sum = 0; process.stdin.setEncoding('utf8'); process.stdin.on('data', function(data){ if(!data){ return; } data.split('\n').forEach(function(line){ var num = line.match(/(\d+)[ ]*?(\d+)?/g); if(num === null){ sum = 0; } else if(num[1]){ console.log(Number(num[0]) + Number(num[1...
true
eac75f455783a656023b35de08e8bca9d884a67b
JavaScript
mukeshatlabs/FE
/african-marketplace/src/components/ItemList.js
UTF-8
2,250
2.71875
3
[ "MIT" ]
permissive
import React, { useState, useEffect } from "react"; import axiosWithAuth from "../utils/axiosWithAuth"; import ItemAdd from "./ItemAdd"; import ItemEdit from "./ItemEdit"; import { ItemContexts } from '../contexts/ItemContexts'; const initialItemToEdit = { product_name: "", description: "", price: "", location...
true
e485bc3057faa7f854bc1e27c003dca07741c628
JavaScript
amatkins/asteroid
/src/visuals/twinkle.js
UTF-8
1,295
3.890625
4
[]
no_license
/* twinkle.js */ /** @class Twinkle * A twinkling star visual effect. * @type {Twinkle} */ export default class Twinkle { /** @constructor * Constructs a new 'twinkle' visual effect. * @param {Object} pos The position of the twinkle. * @param {Number} size The size of the the twinkle. * @para...
true
c5de9b018ac2e24b335f22ef3629f2ad7a40ffb7
JavaScript
groovelb/groovelb.github.io
/mobile_ver2_bootstrap/js/usp2_animation.js
UTF-8
1,459
2.703125
3
[ "MIT" ]
permissive
/*SVG Animation*/ fetch('img/svg_usp2.svg') .then(r => r.blob()) .then(b => svg_usp2.data = URL.createObjectURL(b)); svg_usp2.onload = function(){ console.log("load"); var svg_usp2 = this; var svg2 = d3.select(svg_usp2.contentDocument).select("svg"); /*Map & Land Selection*/ var map = svg2.select("#ma...
true
6883771297a3087bf880a38b880890882662e236
JavaScript
franklin777888/CST-8285-Web-Programming-Project
/js/search.js
UTF-8
3,335
3.40625
3
[]
no_license
// display feature products in the index page // select products from first 3 items in the array function displayFeatureProducts(products){ for(let i=0; i<3; i++){ document.write(productDetails(products[i])); } } // display certain products in the search page function displaySearchedProducts(products){...
true
45b9d950b0dae3a39d8d1a89b3118c671128ba3a
JavaScript
GaryFishback/BryanUniversity_WebDev
/FSW-130/Week1/ContextPractice/context-practice/src/componentPerPiece/Home.js
UTF-8
2,073
2.5625
3
[]
no_license
import React, { Component } from "react"; import NavBar from "./navbar"; import Main from "./main"; import Footer from "./footer"; import ThemeContext from "./../themeProvider/themeProviderComponent"; import StyleContext from "./../themeProvider/styleProviderComponent"; import styled from "styled-components"; ...
true
4225fb66fdc08493d1d4ad307a3d26a7aded07cd
JavaScript
jerryjcchang/react-pokemon-searcher-dc-web-111918
/src/components/PokemonCollection.js
UTF-8
702
2.609375
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain" ]
permissive
import React from 'react' import PokemonCard from './PokemonCard' import { Card } from 'semantic-ui-react' class PokemonCollection extends React.Component { filteredPokemon = () => { if(this.props.filter === ""){ return this.props.pokemon } else { return this.props.pokemon.filter(pokemon => po...
true
2dc4920613c617ffeab03a3b7de05817f9bcc844
JavaScript
gwillig/octocat
/homepage/static/js/test.js
UTF-8
14,195
3.09375
3
[ "MIT" ]
permissive
//========= Also reco_name_2 wird 10 mal wiederholt async function reco_name_2(resolve) { beep(100, 450, 200) window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; var recognition = new SpeechRecognition(), heardOutput = document.querySelector('.heard-output'), ...
true
8e13228fe6c902178fdb657afdd439b786c66d6b
JavaScript
HectorWD/react-gifApp
/src/components/AddCategory.js
UTF-8
814
2.625
3
[]
no_license
import React, { useState } from 'react' import PropTypes from 'prop-types'; const AddCategory = ({setCategories}) => { const [category, setCategory] = useState(''); const reset=()=>{ setCategory(''); } const handleAdd=(e)=>{ setCategory(e.target.value); } const handleSubmit=(e)=...
true
97ae59268a40e9564bc13560877d1663d98a47f2
JavaScript
ShandonFleming948/CART253
/CART 253 - projects/project 2 prototype/js/script.js
UTF-8
15,481
3.265625
3
[]
no_license
"use strict"; /************************************************** Shandon Fleming CART 253 - Project 2 -this code displays a maze with moving walls that the user has to make their way through by collecting a series of golden apples whilst dodging red circles and avoiding contact with the walls ************************...
true
072e323ca3d0a2af3f9cfa955a4d5ba6c9d00fc9
JavaScript
vol4tim/dapp-wallet
/src/modules/accounts/reducer.js
UTF-8
622
2.59375
3
[]
no_license
import { LOAD, UPDATE_BALANCE } from './actionTypes' const initialState = { items: [] } export default function accounts(state = initialState, action) { switch (action.type) { case LOAD: return { ...state, items: action.payload} case UPDATE_BALANCE: var items = state.i...
true
02545a30eb41024189fedfbebf1a2243e0e966f1
JavaScript
carrosa/it2810
/prosjekt4/api/app/models/User.js
UTF-8
965
2.765625
3
[]
no_license
import mongoose from 'mongoose'; import bcrypt from 'bcrypt'; const Schema = mongoose.Schema; const UserSchema = new Schema({ username: { type: String, unique: true, required: true }, password: { type: String, required: true } }); /* * Hashes password when user is created or password is ...
true
ec9a85ae0b8d47fc51c8ed71cba415213fb2b4f3
JavaScript
deepakbhattmits/food-app-rn
/src/screens/CategoryMealsScreen.js
UTF-8
1,516
2.53125
3
[]
no_license
/** @format */ import React from 'react'; import { useSelector } from 'react-redux'; import { CATEGORIES } from '../../data/dummy-data'; import MealItem from '../components/MealItem'; import MealList from '../components/MealList'; const CategoryMealsScreen = props => { const catId = props.navigation.getParam('catego...
true
952ba899965f2f7b36697e74dd40249eb4c814b0
JavaScript
SpookyArif/40-JavaScript-Projects-for-Beginners
/quote/app.js
UTF-8
2,851
2.921875
3
[]
no_license
'use strict'; const link = 'https://api.quotable.io/random?tags=technology,famous-quotes'; const newBtn = document.querySelector('.new'); const h3 = document.querySelector('h3'); const h5 = document.querySelector('h5'); const markBtn = document.querySelector('.mark'); const bookmarks = document.querySelector('.bookmark...
true
790fd4aa1cc422d3eb2b3124ed8b5b71fe57e879
JavaScript
allenevans/node-githooks-precommit-blog
/calc.js
UTF-8
567
3.359375
3
[]
no_license
/* * File : calc.js * Description : A calculator node command line interface app. * ------------------------------------------------------------------------------------------------ */ var argv = require('minimist')(process.argv.slice(2)); /** * Sum two numbers together * @param {number} num1 * @para...
true
3b2dee06cf2d8b315ab552b64685c7a0fc36c46c
JavaScript
natalie-gorban/di-exercises-natalie
/nodejs_week7/day3/script.js
UTF-8
471
2.796875
3
[]
no_license
const fs = require('fs') // console.log(fs) // read file fs.readFile('./text.txt',(err,data) => { if(err) { console.log(err) } else { console.log(data.toString()) } }) const data = fs/fs.readFileSync('./text.txt') console.log(data.toString()) console.log('afterreading file') // write ...
true
cb2c65376c713fe49d22a0e9efacff9520540b80
JavaScript
lizardlove/leetcode
/82.删除排序链表中的重复元素-ii.js
UTF-8
893
3.234375
3
[]
no_license
/* * @lc app=leetcode.cn id=82 lang=javascript * * [82] 删除排序链表中的重复元素 II */ // @lc code=start /** * Definition for singly-linked list. * function ListNode(val) { * this.val = val; * this.next = null; * } */ /** * @param {ListNode} head * @return {ListNode} */ var deleteDuplicates = function(head) {...
true
30b4b0215de697564ed3c7c68c7322d1e6acc25d
JavaScript
justjohking/lab-javascript-vikings
/src/viking.js
UTF-8
3,979
3.828125
4
[]
no_license
// Soldier class Soldier { constructor(health, strength) { this.health = health; this.strength = strength; } attack() { return this.strength } receiveDamage(damage) { this.health = this.health - damage } } // Viking class Viking extends Soldier { constructor(name, health, strength) {...
true
c647c04d6f2c779640fec032c594e9fca3c10129
JavaScript
sevdas/speed-typing-game
/src/hooks/useWordGame.js
UTF-8
1,752
3.59375
4
[]
no_license
import { useState, useRef, useEffect } from "react"; export default function useWordGame(startingTime = 10) { //Keep track of the state of the text //Hold current value of the count down timer and display const [text, setText] = useState(""); const [timeRemaining, setTimeRemaining] = useState(startingTime); ...
true
0b1f416facfb31cd1a0e9555ec1ee3078ad128e1
JavaScript
1-krishna/chat-app-frontend
/src/redux/messages/messages.utils.js
UTF-8
586
2.890625
3
[]
no_license
export const getUsers = messages => { let users = []; messages.forEach(element => { if (!users.includes(element.fromUser)) { users.push(element.fromUser) } if (!users.includes(element.toUser)) { users.push(element.toUser) } }); return users; } exp...
true
88161168c285a73946a9436741564b077dd34f35
JavaScript
Mnrikard/pasty
/editors/columnAlign.js
UTF-8
1,872
2.6875
3
[]
no_license
exports.calledName = ""; exports.names=["columnAlign","align"]; const os = require("os"); exports.parms=[{ name:"number of spaces", value:null, defaultValue:"2" },{ name:"delimiter", value:null, defaultValue:"\t" }]; exports.getParms = function(){ return exports.parms; }; exports.helpText = ...
true
5df5a69f53fa2e13137f4806717ddbb9be3613c5
JavaScript
raiyan1789/GIthub-Files
/RR_If_statement/sketch.js
UTF-8
967
3.890625
4
[]
no_license
/* Example that reverses drawn shapes acrodd the canvas/window using variables, incrementors and conditional logic (if statement) in the draw () loop. */ var circX = 200; var circY = 200; var circStroke = 125; var circR = 55; var circG = 135; var circB = 225; var circSize = 75; var recX = 100; var recY = 300; var rec...
true
a9da33e52745f4a8313e39cd05269600910b398d
JavaScript
KishoreBabu420/cash-denominator
/scripts/script.js
UTF-8
2,007
3.34375
3
[]
no_license
'use strict'; const billAmount = document.getElementById('bill-amount'); const amountPaid = document.getElementById('amount-paid'); const btnCalculate = document.getElementById('btn-calculate'); const errorMessage = document.getElementById('error-message'); const successContainer = document.getElementById('success-con...
true
6c776caf1b9d9e40c617b9934c66031ce76b5e40
JavaScript
bimonestle/digiroin_website
/assets/js/signin_page.js
UTF-8
2,078
2.640625
3
[]
no_license
// BOTTOM LINE FOR HEADER WHEN SCROLLED & SCROLLSPY window.onscroll = function () { var body = document.body; var html = document.documentElement; var navHead = document.querySelectorAll("header.header"); if (body.scrollTop >= navHead[0].clientHeight || html.scrollTop >= navHead[0].clientHeight) ...
true
8b0fb4020af23827ec0093af314a1ac0edc8fec9
JavaScript
MiyanagaTeru/danmuku
/src/danmu.js
UTF-8
662
2.53125
3
[]
no_license
import React from 'react'; const SPEED = 2; const DELAY = 0.2 * SPEED; const HEIGHT = 300; const WIDTH = 400; const FONT_SIZE = 16; const childGen = (child, index) => { const text = child.props.children; const style = { top: (20 + FONT_SIZE * 2 * index) % HEIGHT, animationDelay: index * DELAY ...
true
b2fe57935ec12fef1124a0566243379af254073c
JavaScript
argelius/rxjs-marble-testing
/model.js
UTF-8
384
2.671875
3
[ "MIT" ]
permissive
function model(query$, COUNTRIES) { return query$ .map((query) => { if (query.length < 2) { return { countries: [] }; } const countries = COUNTRIES.filter( country => country.toLowerCase().indexOf(query.toLowerCase()) === 0, ); return { countries, }; ...
true
d397041608b049893d1e3b675467fad560e2798f
JavaScript
SpCreator/js-school-task-smoliak-sergei
/static/js/forms.js
UTF-8
5,022
2.71875
3
[]
no_license
(function() { const login = document.querySelector("#login"); const password = document.querySelector("#password"); init = () => { const loginForm = document.querySelector("#login-from"); const regForm = document.querySelector("#register-from");; if (loginForm) loginForm.addEventLi...
true
787ea250e0414f6145af0ee0051670f997e5f969
JavaScript
cicipp/buy-buddy-javascript-client
/src/utils/injectScopeValidator.js
UTF-8
1,173
3.171875
3
[ "MIT" ]
permissive
import _ from 'lodash'; class InvalidScopeError extends Error { } /** * Injects a validator routine for given scopes. Scope `'all'` would be * included as a default to contain all of the scopes. * * `injectScopeValidator(fetchUsers, ['some', 'valid', 'scope', 'values'])` * * @throws InvalidScopeError * @throws...
true
bc83af81763c6c8c630d6ed683f1f37bd06cc3e1
JavaScript
hellogoogle/Protect-your-family
/js/sliding_effect.js
UTF-8
1,163
2.796875
3
[]
no_license
$(document).ready(function() { slide("#sliding-navigation", 10, 10, 150, .8); }); function slide(navigation_id, pad_out, pad_in, time, multiplier) { // creates the target paths var list_elements = navigation_id + " li.sliding-element"; var list_elementsTwo = navigation_id + " li"; var link_elements = list_element...
true
42621a4594330088343463e14d8c13c3ef6ef0b7
JavaScript
emileypalmquist/language-exchange-client
/src/components/Avail.js
UTF-8
1,437
2.578125
3
[]
no_license
import React, {Component} from 'react' class Avail extends Component { state = { language_id: this.props.lang[0].id, date: '' } createAppointment = (e) => { e.preventDefault() const userToken = localStorage.getItem("token") const {date, language_id} = this.state fetch('http://localhost...
true
417aa27bb543bb6cef4df17d98993ba6d2c5d3d7
JavaScript
Rejuyan-Hossain-Shawon/milestone-4
/module-16/conversion.js
UTF-8
604
4.125
4
[]
no_license
var price = '23.34'; var price2 = '54.34'; // string to int convert var sum = parseInt(price) + parseInt(price2); console.log(sum); // string to float conversion var result = parseFloat(price) + parseFloat(price2); console.log(result); // boolean var coming = true; // determine of data types console.log(typeof pri...
true
c52075fa2c0fb8f802b7b68aa930be49401307c8
JavaScript
Lindani-zz/bin-bot
/tutorials/timeOut.js
UTF-8
162
2.859375
3
[]
no_license
var hello = setInterval(function () { console.log("Hello") }, 1000); setTimeout(function() { clearInterval(hello); console.log("..... interval") }, 6000);
true
c7a8bdaa97968bd41b9b456b3d11f91bccd6cddc
JavaScript
drdynscript/nmdad-i
/les9/nmdadi_canvas_b_animation/scripts/app.js
UTF-8
7,571
3.203125
3
[ "MIT" ]
permissive
/* Canvas Tutorial ================================================= * Course: NMDAD-I * Programmed by: Philippe De Pauw - Waterschoot * Last updated: 20/11/2013 * Version: v0.1.0 ================================================= * Setting up canvas * Drawing some cool shit * Suc...
true
8aef340fbc5758ee27c017c530332bd4ade4231d
JavaScript
LibertyNJ/cytoxan-label-maker
/src/util/camel-case/index.js
UTF-8
378
3.09375
3
[]
no_license
export const camelCase = { removeFirstWord, sliceFirstWord, }; function removeFirstWord(string) { return string.replace(/^[a-z]+[A-Z]/, sliceLastCharacterAndConvertToLowerCase); } function sliceLastCharacterAndConvertToLowerCase(string) { return string.slice(string.length - 1).toLowerCase(); } function slice...
true
efaf74fb7a2f25be21d6d7a2afd3ed716e4ddb33
JavaScript
Liam-Zhou/CMPE275-DirectExchange
/src/front-end/src/store/reducer/counterOffers/reducer.js
UTF-8
574
2.515625
3
[]
no_license
import { GET_COUNTER_OFFERS_RECEIVED, GET_COUNTER_OFFERS_MADE } from '../../action-types'; const initialState = { } const counterOffers = (state = initialState,action) => { switch(action.type){ case GET_COUNTER_OFFERS_RECEIVED: return Object.assign({},state, {counterOffersReceived: action...
true
89807bb95f5aad76709a5024da172e75afc80265
JavaScript
HristoMachikov/Cherry_Web
/cherry-web-app/src/components/Cherry/Create/Create.jsx
UTF-8
7,324
2.5625
3
[]
no_license
/* eslint-disable no-undef */ import React, { Component } from 'react'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import cherryService from '../../../services/cherry-service'; import { cloudinaryWidget } from '../../../config/web-config'; const camelCase...
true
d17fd3a761fd2dbc8af29dddef6b7e9f54643ac1
JavaScript
sourabhsen/admin-dashboard
/src/app/modules/d3-charts/miso/area/area.miso.js
UTF-8
8,719
2.671875
3
[]
no_license
'use strict'; d3.chart('Area', { initialize: function(config){ let chart = this; let base = this.base.append('g') .attr('transform', 'translate(' + config.margin.left + ',' + config.margin.top + ')'); chart.config = config; chart.config.parent = this; chart.dotradius = 3 ; chart.axisWi...
true
284c7f200b06d0acc1cfbb2e0e6925b36e7432b3
JavaScript
hhl-web/vue-learn
/untils/events.js
UTF-8
2,571
3
3
[]
no_license
/** * 先订阅 on * 后发布 emit * 那如果是先发布怎么办呢 ? */ // /** * _hasHookEvent不是表示是否存在钩子,它表示的是父组件有没有直接绑定钩子函数在当前组件上。源码须知 * 比如这种形式的绑定 * <child @hook:created="hookFromParent"> */ class Event { constructor() { this._events = Object.create(null); this.stackArr = []; //订阅数组,用来存放先发布后订阅的数据 } } Even...
true
5ada869e20897450ffc9bade240f4bbf9cc5cd3a
JavaScript
jh26marines/calc
/test/calculator.test.js
UTF-8
1,403
3.21875
3
[]
no_license
test('constructor', function(){ var c = new Calculator(); ok(c instanceof Calculator, 'new演算子を付けてコンストラクタを呼び出す'); }); test('getExpression', function(){ var c = new Calculator(); var result = c.getExpression(); equal(result, ''); }); test('append', function(){ var c = new Calc...
true
1a1848c02dc0643add1513289c1b6fbbb48be61d
JavaScript
stoyanov7/SoftwareUniversity
/JavaScriptCore/Archive/JavaScriptFundamentals/Strings-and-Regular-Expressions-Lab/03.countOccurences.js
UTF-8
260
3.21875
3
[ "MIT" ]
permissive
function countOccurences(targetString, text) { let count = 0; let index = text.indexOf(targetString); while (index !== -1) { index++; count++; index = text.indexOf(targetString, index); } return count; }
true
2c6761587992a66a36b5547feb689eca91b0b88f
JavaScript
mamta-dhaka/google-c
/client/src/demo.js
UTF-8
1,400
2.703125
3
[ "MIT" ]
permissive
import React from "react"; import { BrowserRouter as Router, Switch, Route, Link, NavLink } from "react-router-dom"; // This site has 3 pages, all of which are rendered // dynamically in the browser (not server rendered). // // Although the page does not ever refresh, notice how // React Router keeps the URL...
true
1f6fd6640dfba36345d2466595f9c595a9b880ca
JavaScript
Suddenly-Entertainment/Mewars
/socket/chess_socket.js
UTF-8
4,122
2.890625
3
[]
no_license
var pieces = { }; //0-7: pawns, 8-15: left->right in pairs from white perspective, 16-31: repeat for black var moves = { }; // moves[0] = { x: 1, y: 2} = 1 to the right and 2 up var enPassantMove; //piece, vulnerable to en passant var enPassantATK = 0; //0 = false, 1 = left, 2 = right var users = { }; var turn = false;...
true
b0f70d1da886a02537b968e1d0db088e8631bc53
JavaScript
mcolomerc/serverless-slack-bot
/handler.js
UTF-8
1,500
2.5625
3
[]
no_license
'use strict'; const axios = require('axios'); const getRandom = (min, max) => { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min; } const url = `https://api.themoviedb.org/3/discover/movie?api_key=${process.env.API_KEY}&page=${getRandom (1,10)}&release_dat...
true