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
34092bfdd0fb4c780711030fc23281e7c4d9aad2
JavaScript
julessplvd/spa-solar-system
/array-methods.js
UTF-8
1,371
4.4375
4
[]
no_license
// I couldn't get the planets to print in a sentence like I did with the words array? I'm confused on how to chain the reduce onto them? or how to make it into a sentence?? var planets = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune"]; var newArr = []; /* Use the forEach method to ad...
true
6dd49514add4f6b8b83a5c391813afd1d52ff3e0
JavaScript
SarikaRPh/js-exercises
/js2-functions-loops-arrays/opening-exercises/9.js
UTF-8
83
3.015625
3
[]
no_license
// 9) Use a for loop to loop through the array and log the array index and values
true
1cda411b29047b60ba7559097268b45a8f4cb0c3
JavaScript
HristoNakov13/SoftUni-Javascript
/Essentials/Objects&DOM/01. Cards/solution.js
UTF-8
4,203
3.234375
3
[]
no_license
function solve() { const ELEMENTS = { firstPlayerDeck: document.getElementById("player1Div").getElementsByTagName("img"), firstPlayerResult: document.getElementById("result").getElementsByTagName("span")[0], secondPlayerDeck: document.getElementById("player2Div").getElementsByTagName("img"),...
true
f5d96bfe74c103994d6ffc4279de6118fe6b4ef0
JavaScript
williamblair/williamblair.github.io
/pages/webgl_programming_guide/objectOrientedTest/GLTFModel.js
UTF-8
6,872
2.765625
3
[]
no_license
class GLTFModel { constructor(filename, scale = 1.0) { var request = new XMLHttpRequest(); request.open("GET", filename, false); // false makes it synchronous request.send(null); if (request.status === 200) { this.OnGltfLoad(request.responseText, scale); ...
true
cd880e84e1e15ee8069192b12733b1e88b417306
JavaScript
david-campos/reversi
/chrome/neural_network.js
UTF-8
15,029
3.375
3
[]
no_license
/** * Code made by David Campos Rodríguez * All rights reserved */ /** * Population of a generation, it should be a even number * @type {number} */ const GENERATION_POPULATION = 1000; /** * Number of survivors when we decide to kill some individuals * of the generation * @type {number} */ const GENERATION_SU...
true
5676030477557f5af64b057f3486b061caf53b8a
JavaScript
nkrish/weather-dashboard
/assets/js/script.js
UTF-8
8,276
3.34375
3
[ "MIT" ]
permissive
var APIKey = "b0cd62d5d1c72e893766baa50b0b9970"; // Remove all child elements function removeAllChildElements(parentElem) { while (parentElem.firstChild) { parentElem.removeChild(parentElem.firstChild); } } // Convert the input text to Title Case function toTitleCase(str) { var result = ""; for (var i = 0...
true
e661c47f1d673bee74f728cc31ebe114a2161f82
JavaScript
aeolusheath/FrontExersize
/data-structure-algorithm/1619. Mean of Array After Removing Some Elements.js
UTF-8
2,522
3.640625
4
[]
no_license
/** * Given an integer array arr, return the mean of the remaining integers after removing the smallest 5% and the largest 5% of the elements. Answers within 10-5 of the actual answer will be considered accepted. Example 1: Input: arr = [1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3] Output: 2.00000 Explanation: Aft...
true
51d85b58d49d322472d34e2113eddd86033475bf
JavaScript
iansan5653/typescript-build2016-demos
/controlFlow-nonNull/union.js
UTF-8
831
2.765625
3
[]
no_license
var A = (function () { function A() { } return A; }()); var B = (function () { function B() { } return B; }()); var C = (function () { function C() { } return C; }()); var D = (function () { function D() { } return D; }()); var E = (function () { function E() { } ...
true
a156e055391c81c8190f4bdc27af51943260807b
JavaScript
AndresGodinez/unici
/js/hambre.js
UTF-8
399
3
3
[]
no_license
var hambre = true; var precioTorta= 12.5; var cantidadTortas = prompt("Ingrese cantidad de Tortas"); cantidadTortas = parseFloat(cantidadTortas); cantidadTortasComidas=0; while(cantidadTortasComidas != cantidadTortas){ cantidadTortasComidas = cantidadTortasComidas +1; console.log("Cantidad de tortas comidas "+ can...
true
8324d5921f233bcd717aab1a47a74ed32737c247
JavaScript
dpak1999/github-wars
/src/utils/api.js
UTF-8
1,183
2.6875
3
[]
no_license
export const getPopularRepos = (language) => { return new Promise((resolve, reject) => { fetch( `https://api.github.com/search/repositories?q=stars:>1+language:${language}&sort=stars&order=desc&type=Repositories` ) .then((res) => res.json()) .then((data) => resolve(data)) .catch((err) ...
true
5b9f338ee3bdbbf3d48043417613a39668dc57bd
JavaScript
RAJINIA/MathQuizProject
/src/Pages/Addition.js
UTF-8
2,340
3.03125
3
[]
no_license
import React from 'react'; import {useHistory} from 'react-router-dom'; import Level1 from './Level1'; import Level2 from './Level2'; import Level3 from './Level3'; import Level4 from './Level4'; import Level5 from './Level5'; function Addition(){ let[level, setLevel] = React.useState(''); let history = useHi...
true
e90ef257a5df25571c36f25019166c874b11b587
JavaScript
eecs394-spr15/FeldcoLoanRequest
/webserver/routes/services.js
UTF-8
6,811
2.609375
3
[]
no_license
// EXAMPLES: var PythonShell = require('python-shell'); var fs = require('fs'); var fakeLogin = [ { username: 'Tim Smith', password: 'password', clients: [0, 1, 2] }, { username: 'John Smith', password: 'password', clients: [3, 4, 5, 6] }, { ...
true
fd3fe99dcd53fbde55a2df3061367a3261e3008d
JavaScript
xu-xiaoya/JavaScript-exercise
/对象/对象-使用方法/返回对象的值valueOf.js
UTF-8
98
2.828125
3
[]
no_license
var o = new Date(); alert(o.valueOf());//返回当前时间距离1970年1月1日午夜的毫秒数
true
8b9e38161dc06a6be3d66ea25d2217dc43a89a14
JavaScript
GaganTut/SortingAlgorithms
/js/selectionSort.js
UTF-8
508
2.828125
3
[]
no_license
/*jshint esversion: 6*/ const checkData = require("./checkData.js"); const selectionSort = (collection) => { checkData(collection); if (collection.length === 1) { return collection; } let maxNum = [collection[0]]; for (var i = 0; i < collection.length; i++) { if (collection[i] >= maxNum[0]) { ...
true
89c2aa5774bfa6a5081be2b91bed1ae6f162b770
JavaScript
NadJoe/Plateau
/js/joueurs.js
UTF-8
2,664
3.09375
3
[]
no_license
// partie de la creation de l'objet JOUEUR // *************GESTION DE LA PARTIE DES JOUEURS POUR LA CRÉATION, LA GENERATION ET L'AFFICHAGE*************** // class Joueur{ // CHAQUE joueur à une image qui lui est propre donc il faut la mettre à la création de chaque objet de type joueur constructor (numero, n...
true
59ef5b9503dfd116cdfe3bddcf0513a1b9249c4b
JavaScript
THeK3nger/airoboexamples
/robregulation/reg.js
UTF-8
1,627
3.296875
3
[]
no_license
var workcanvas = document.getElementById("workspace"); var workspace = workcanvas.getContext("2d"); workspace.translate(150,150); // ROBOT PARAMETERS var x = -140; var y = -140; var theta = 0; var xdot = 0; var ydot = 0; var thetadot = 0; // CONTROL INPUT var v = 0; var omega = 0; // ANIMATION CONSTANT var gamma ...
true
7282a070c2c303be7b4d853773928abb59a2e6f6
JavaScript
zz1995zz/exercise
/jdM/js/index.js
UTF-8
5,139
2.9375
3
[ "MIT" ]
permissive
window.onload = function () { // 首页搜索效果 search(); // 轮播图 banner(); // 倒计时 downTime(); }; //首页搜索 function search() { // 获取元素 var searchBox = document.querySelector('.jd_search_box'); var banner = document.querySelector('.jd_banner'); var height = banner.offsetHeight; // 页面卷曲高度和轮播...
true
686bdf8f4163f082aded8014b6a6e320d89da745
JavaScript
FarhanMobashir/problem-solving
/propel-problems/factorial.js
UTF-8
218
3.765625
4
[]
no_license
function fact(n) { if (n == 1) { return 1 } else { console.log("n: " + n) let x = n * fact(n - 1); console.log("n: " + n) console.log(x) return x } } fact(5)
true
635860905f4d35082812e9760c5f92448868dadf
JavaScript
lavi1221/LMTacadmey
/public/js/reg.js
UTF-8
274
2.875
3
[]
no_license
var frm = document.getElementById("regis"); frm.addEventListener('submit',function(e){ var t = frm.querySelectorAll('input'); var tpass = t[1].value; var cpass = t[2].value; if(tpass != cpass){ e.preventDefault(); swal("Password doesnt Match"); } });
true
68cb71945526504358d5ef7a377487e214ce1e2c
JavaScript
Karaina/scl-2018-01-ProyectoFinalCore
/assets/js/adminlogin.js
UTF-8
1,913
2.78125
3
[]
no_license
function adminLog() { window.location.href = '../html/loginadmin.html' } function showVisits() { const alert = document.getElementById('errorAlert'); const loginValue = document.getElementById('loginAdmin').value; if (loginValue === 'admin123') { window.location.href = '../html/showRegisteredVi...
true
c3745fa9714d99f8149f70ed6c1cd4e680158ec0
JavaScript
jiangshanmeta/meta
/src/1423.maximum-points-you-can-obtain-from-cards.1538/solution.js
UTF-8
721
3.21875
3
[ "MIT" ]
permissive
/** * @param {number[]} cardPoints * @param {number} k * @return {number} */ var maxScore = function (cardPoints, k) { const sum = cardPoints.reduce((sum, item) => { return sum + item; }, 0); const windowLength = cardPoints.length - k; if (windowLength === 0) { return sum; } ...
true
3738df834694afb28ff4bcffd7a6ed5f7fbe7347
JavaScript
mj-lopes/bauDoJS
/efeitos-no-DOM/timeout-interval/js/modules/outsideclick.js
UTF-8
2,050
3.75
4
[]
no_license
// element -> elemento que chamou a função // events -> tipo de eventos para os listeners // callback -> função para retirada da classe export default function outsideClick(element, events, callback) { const html = document.documentElement; // selecionado o elemento html <html></html> const outside = 'data-outside...
true
0f88ae1ff1d9129b32ec90be76f4fd431eafe7c3
JavaScript
GrosSacASac/server-in-the-browser
/tools/buildall.js
UTF-8
991
2.609375
3
[ "CC0-1.0" ]
permissive
/* todo make promises cahin so that cleanup promise can run after the others */ "use strict"; const buildjs = require("./buildjs.js"); const buildcss = require("./buildcss.js"); const buildhtml = require("./buildhtml.js"); const builddoc = require("./builddoc.js"); const cli_inputs = process.argv.slice(2); // command...
true
ed295be4638ed070c8de84bd6b74a9dd1bfc8032
JavaScript
LG-17864078090/leetcode
/28.实现-str-str.js
UTF-8
358
2.9375
3
[]
no_license
/* * @lc app=leetcode.cn id=28 lang=javascript * * [28] 实现 strStr() */ // @lc code=start /** * @param {string} haystack * @param {string} needle * @return {number} */ var strStr = function (haystack, needle) { let r = -1; haystack.replace(needle, function (match, offset) { r = offset return '' })...
true
9856f2bc6f7a6e574013f93b3959a82661d54a12
JavaScript
sivadass/heroku-sleepless
/index.js
UTF-8
1,549
2.703125
3
[ "MIT" ]
permissive
const express = require("express"); const fs = require("fs"); const path = require("path"); const request = require("request"); const cron = require("node-cron"); const { PORT, URL, TIMEZONE } = require("./config"); const app = express(); function logData(value = "NO DATA RECEIVED!") { const file = "log-data.json";...
true
624a4653ac50386f94806712e57b72b662643d8b
JavaScript
Nayron-Hollupi/desafio2MarioSigna
/ajax2.js
UTF-8
480
2.65625
3
[]
no_license
$(function(){ $('#form').on('submit', function(e){ e.preventDefault(); var txt = $(this).serialize(); console.log(txt); $.ajax({ type:'GET', url:'ajax2.php', data:txt, success: function(resultado){ ...
true
def4916eecea579eb57a79cebb4bd2ab63b0d67b
JavaScript
wojciechlasak/faceAuth
/server.js
UTF-8
3,683
2.765625
3
[]
no_license
var express = require('express'); const cv = require('opencv4nodejs'); var path = require('path'); const fs = require('fs'); var bodyParser = require('body-parser') var app = express(); // for middleware app.use(express.static(path.join(__dirname, 'public'))); app.use(bodyParser.urlencoded({limit: "50mb", extended: tr...
true
938af61d43eb8bebd0c2a756d0f4628020291068
JavaScript
TotallyNotAHaxxer/web
/main.js
UTF-8
404
3.03125
3
[]
no_license
class DigitalClock { constructor(element) { this.element = element; } getTimeParts() { const now = new Date(); return { hour: now.getHours() % 12 || 12 minute: now.getMinutes(), isAM: now.getHours() < 12 }; } } const clockElement = d...
true
eb9b1966a1c3349d7cee0a2340b86ebcbb6c0000
JavaScript
annathai/web-front-end-assignment-session1
/assignment4/assignment4.js
UTF-8
202
3.34375
3
[]
no_license
var person = { age: 18, name: 'John', city: 'San Francisco' }; (function(aPerson) { console.log("name: " + aPerson.name + "; age: " + aPerson.age + "; age: " + aPerson.age); })(person);
true
d76c5eb1fe55ea0cedf53f94e2ca43e51bffef01
JavaScript
VishuCricky/JSExerciseFiles
/Async/Promises/PromiseResolve.js
UTF-8
1,127
4.21875
4
[]
no_license
/* Example 1 */ var p1 = new Promise( function(resolve,reject){ resolve( 42 ); } ); var p2 = Promise.resolve( 42 ); /* Example 2 */ /* But if you pass a genuine Promise to Promise.resolve(..), you just get the same promise back: */ var p1 = Promise.resolve( 42 ); var p2 = Promise.resolve( p1 ); p1 === p2; // t...
true
0fc07c079c6b4ef652facccfbf386fec39958a8b
JavaScript
firebase/quickstart-testing
/unit-test-cloud-functions/functions/test/functions.spec.js
UTF-8
3,002
2.828125
3
[ "CC-BY-4.0", "Apache-2.0", "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-unknown-license-reference" ]
permissive
const { expect } = require("chai"); const admin = require("firebase-admin"); // Initialize the firebase-functions-test SDK using environment variables. // These variables are automatically set by firebase emulators:exec // // This configuration will be used to initialize the Firebase Admin SDK, so // when we use the A...
true
12b73811e3f6bd5e0d6facfe4be0d8b2a929b46f
JavaScript
pradipamate/Taskbooks
/src/practice/reducers/TaskBookReducer.js
UTF-8
860
2.640625
3
[]
no_license
const TaskBook = []; export default (state = TaskBook, action) => { switch (action.type) { case "ADD_LIST": return [...state, action.payload]; case "REMOVE_ITEM_FOM_LIST": var selected = action.payload; var index = state.findIndex(x => x.id == selected); state.splice(index, 1); r...
true
8efcf15791f051dc2cd9d97d31be5e7f48129c01
JavaScript
gkspranger/sooper-simple-hubot-slack-setup
/scripts/jump.js
UTF-8
1,070
2.984375
3
[]
no_license
// Commands: // hubot jump - neat example using hubot-conversation const HubotConversation = require("HubotConversation.js"); const HubotDialog = require("HubotDialog.js"); const logger = require("winston"); module.exports = function(robot) { var conversation = new HubotConversation(robot); conversation.listen(...
true
bca7f5af1111f4eb74d007ff08190e9c3451a8f1
JavaScript
eblee/web2
/hw4/site3.js
UTF-8
567
3.015625
3
[]
no_license
function hexa(size) { rotate(30); forward(size); rotate(60); forward(size); rotate(60); forward(size); rotate(60); forward(size); rotate(60); forward(size); rotate(60); forward(size); } speed(90000000000000000000000000000000000000000000000000000000000000000000000000000000) function shape(offset) { for(var x = 0; ...
true
d218110aa1504a8db12082a71e42be60b3761a3b
JavaScript
cskladz/cskladz.github.io
/coderBytes/5Simple-Adding.js
UTF-8
559
3.96875
4
[]
no_license
#!/usr/bin/env node 'use strict'; // Challenge // Using the JavaScript language, // have the function SimpleAdding(num) add up all the numbers from 1 to num. // For example: if the input is 4 then your program should return 10 because 1 + 2 + 3 + 4 = 10. // For the test cases, the parameter num will be any number ...
true
f53574adf37bda8afec25fb1f00e82ca0a91440e
JavaScript
Koilada-Rao-au16/Back-End
/node/routing_module/main.js
UTF-8
200
2.765625
3
[ "MIT" ]
permissive
const {square} = require("./math") // const mathOperations = require("./math") const userInput = 10 const sq = square(userInput) // const sq = mathOperations.square(userInput) console.log(sq);
true
2ca967d9e39c453d3cf03174c39bde021cd9c845
JavaScript
TennisRunner/Speed-Reader-User-Script
/speed-reader.user.js
UTF-8
972
2.734375
3
[]
no_license
// ==UserScript== // @name Speed Reader // @version 1 // @include * // @grant GM.setValue // @grant GM.getValue // ==/UserScript== function SetSetting(name, value) { (async () => { await GM.setValue(name, value); })(); } function GetSetting(name, callback) { ...
true
edfb7fae22fdb3e082d834396c174e7f7debee40
JavaScript
future4code/caio-gomes
/FutureTube Frontend/src/reducers/authReducer.js
UTF-8
587
2.625
3
[]
no_license
const initialState = { loginError: "", successMessage: "", selectedUser: "" }; const auth = (state = initialState, action) => { switch (action.type) { case "SET_ERROR_MESSAGE": return { ...state, loginError: action.payload.message }; case "CLEAR_ERROR_MESSAGE": return { ...state, loginError...
true
3e6049568a0cc26bdd92d49e7fbca3c69d145f39
JavaScript
Amita999/User_details_typescript
/user_details.js
UTF-8
1,120
3.375
3
[]
no_license
function UserDetails() { var user = [ { id: 1, name: "Amita", section: "Bio", avl: false }, { id: 2, name: "Neha", section: "Chem", avl: true }, { id: 3, na...
true
5f1ee67d7a0b23ec329cc93a4f5f2574091a7fb8
JavaScript
harineem1/JS-DOM--manipulation
/JS1 HW/HW9 - Javascript/StarterCode/static/js/app.js
UTF-8
2,547
3.296875
3
[]
no_license
// from data.js var tableData = data; var filteredTable = tableData; // YOUR CODE HERE! var submit = document.getElementById("login"); // Get references to the tbody element, input field and button var $tbody = document.querySelector("tbody"); var dateInput = document.querySelector("#datetime"); var $dateInput = docum...
true
2faef2e18a30845a234c80b586fa990c2842d0be
JavaScript
HMtsumura/nextjs-test
/src/pages/test.jsx
UTF-8
4,558
2.734375
3
[]
no_license
import App from '../components/App' import Router from 'next/router' import axios from 'axios'; import withAuth from '../helpers/withAuth'; class Test extends React.Component { constructor(props) { super(props); this.state = { word: "", answeredCount: 0, typoCoun...
true
6f9404e60e0bbf7e8b77768b78ece8329a40a0da
JavaScript
liuzongshi123/cege0043-apps-liuzongshi123
/js/participationRate.js
UTF-8
7,525
2.65625
3
[]
no_license
function participationRateAll() { const svg = d3.select("#participationRateAll"), margin = {top: 20, right: 20, bottom: 30, left: 50}, width = +svg.attr("width") - margin.left - margin.right, height = +svg.attr("height") - margin.top - margin.bottom, x = d3.scaleBand().range...
true
44fbce7e9400764ac10bf764715bcf5461fe69b5
JavaScript
csenn/schesign-js-mongoose
/src/index.js
UTF-8
5,676
2.84375
3
[ "MIT" ]
permissive
import isString from 'lodash/isString' import isArray from 'lodash/isArray' import isNumber from 'lodash/isNumber' import fs from 'fs' import path from 'path' const filePath = path.resolve(__dirname, '..', 'templates', 'model.txt') const getTab = num => { let result = '' for (let i = 0; i < num; i++) { result...
true
274074345f50e6c3f5371bb1d4ea6a7876ee3f80
JavaScript
devCoderian/ts-basic
/calculator.js
UTF-8
242
2.796875
3
[]
no_license
"use strict"; // function add(a, b){ // if(typeof a !== 'number' || typeof b !== 'number'){ // throw new Error('숫자가 아님'); // } // return a+b; // } // function add(a: number, b: number){ // return a + b; // }
true
f2b072868e649c99fc771e1202763034732a4606
JavaScript
atotmakov/chrome_ext
/tfswihistory/time.js
UTF-8
1,537
3.1875
3
[ "MIT" ]
permissive
function formatDateTime(str) { //str //2019-10-17T08:56:08.573Z //2020-11-29T21:00:00Z - not working var res = str; if (str && typeof(str) == 'string' && str.length > 19 && str[4] == '-' && str[7] == '-' && str[10] == 'T' && str[13] == ':' && str[16] == ':' && (str[19] == '.' || str[19] == 'Z')) { ...
true
4eb34921ef009536393de100d3feb2c31289ac24
JavaScript
QiuMingXX/full-stack
/04-node/05-http-res.js
UTF-8
313
2.609375
3
[]
no_license
var http = require('http') var server = http.createServer(); server.on('request',function(request,response){ console.log('收到客户端请求了'+request.url); response.write('hello'); response.write('nodejs'); response.end() }) server.listen(3000,function(){ console.log('服务器已启动'); })
true
a0b6d01dca347b547af2397b4467cd7dca067a7e
JavaScript
Sunny-zz/1808
/react-redux-demo/src/components/Post/Post.js
UTF-8
2,158
2.609375
3
[]
no_license
import React, { Component } from 'react' import { connect } from 'react-redux' import PostBody from '../PostBody/PostBody' import PostComment from '../PostComment/PostComment' import { addComment, getComments, delComment } from '../../actions' // import { bindActionCreators } from 'redux' class Post extends Component ...
true
2f5fcbe6d6cb847a0de64968b739952b2aee5840
JavaScript
FrancoisPog/Punto
/public/chat.js
UTF-8
27,195
2.59375
3
[]
no_license
"use strict"; const { log, assert, error, table } = console; const numbers = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]; document.addEventListener("DOMContentLoaded", function () { // Socket connection let sock = io.connect(); let pseudo = null; let connected = false; let lis...
true
728eae7e8bea1e0d86fb157b269ef901853bac27
JavaScript
ivliag/favorites_redux_middleware
/cookieAdapter.js
UTF-8
1,898
2.75
3
[]
no_license
import Cookies from 'cookies-js' export function getFavoriteDeals(user) { let currFav = normalizeCookies(Cookies.get('daitel_favorites')) currFav = numberizeCookieArr(currFav) return new Promise(resolve => { resolve({ response: { favorite_deal_ids: currFav } }) }) } export function addDealToFav...
true
19f93947cce9fe9a54a8b304961f3a42026e7005
JavaScript
KerstingJ/React-Insta-Clone
/instagram/src/components/PostContainer.js
UTF-8
3,746
2.53125
3
[]
no_license
import React from 'react' import Styled from 'styled-components' // import PropTypes from 'prop-types' import getAuthToken from './Authenticate.js' import CommentSection from './CommentSection.js' class PostContainer extends React.Component { constructor(props) { super(props) // I know they wan...
true
a178879c7b34a93e23b0c7100c141b1a508414a1
JavaScript
LuisDeCasas/PostsAPP
/src/components/PosterForm.js
UTF-8
2,549
2.546875
3
[]
no_license
import React, { Component } from 'react'; import {Jumbotron , Input, Button} from 'reactstrap' import {connect} from 'react-redux' class PosterForm extends Component { state={ name:"", subject:"", content:"" } handleOnChange = (e) => { const {name, value} = e.target th...
true
bd905c2cd2361d7175b1d703bcb72d1f23dd420d
JavaScript
madoos/functional-javascript-workshop
/_exercises/implement_map_with_reduce/solution/solution.js
UTF-8
184
2.53125
3
[ "MIT" ]
permissive
module.exports = function arrayMap(arr, fn, thisArg) { return arr.reduce(function(acc, item, index, arr) { acc.push(fn.call(thisArg, item, index, arr)) return acc }, []) }
true
ccf9cf9e7b6b189d52a3be68b30e79cb51f98ad0
JavaScript
Kalande/PAY-DAY-game-dev
/JS/script.js
UTF-8
17,201
2.78125
3
[]
no_license
//======================= // DOM MANIPULATIONS //======================= let canvas = document.querySelector('canvas') canvas.style.backgroundColor = 'lightgrey' let brush = canvas.getContext('2d') let startBtn = document.querySelector('#startBtn') let restartBtn = document.querySelector('#restartBtn') let introBtn = ...
true
b73b1fff1545bbb2adb0ca3d8b47868907ab0edc
JavaScript
roy-tan/plugin_shoppingthestore
/cartridge/models/stores.js
UTF-8
2,929
2.734375
3
[]
no_license
'use strict'; var renderTemplateHelper = require('*/cartridge/scripts/renderTemplateHelper'); var storeHelpers = require('*/cartridge/scripts/helpers/storeHelpers'); var StoreModel = require('*/cartridge/models/store'); /** * Creates an array of objects containing store information * @param {dw.util.Set} storesObje...
true
eda71ff78093812b8c3d36986649b5fcdf84187d
JavaScript
Evelyn651/frontend-practice-review
/js/main.js
UTF-8
1,452
4.21875
4
[]
no_license
let favoriteFood = "pizza"; let numOfSlices = 8; console.log(favoriteFood); console.log(numOfSlices); let changeMe = true; changeMe = false; console.log(changeMe); const entree = "Enchiladas"; console.log(entree); // entree = "Tacos"; throws an error message because const's cannot be reassigned values // const tes...
true
f76d6e586479c44a0487fc370b8308a9aa5a87bd
JavaScript
anako18/BabylonJs3D
/js/constants.js
UTF-8
1,596
2.546875
3
[]
no_license
//Character settings /*export const characterMeshName = "man" export const characterMeshPath = "models/man/" export const characterMeshFile = "man.babylon" export const characterMeshName = "crypto" export const characterMeshPath = "models/crypto/" export const characterMeshFile = "crypto.babylon" export const charact...
true
c6e1919a8f2cc3f8dcc68ef0d55463b160f3814d
JavaScript
wgaetan/JS_OnlinePaint
/app.js
UTF-8
812
3.359375
3
[]
no_license
const canvas = document.getElementById('draw'); const context = canvas.getContext('2d'); const mouseCursor = {prevX: 0, prevY: 0}; /** * Draw in canvas if mouse leftclick is pressed on it. * @param {MouseEvent} e - event interface generated on mouse * movement in canvas. */ function draw(e)...
true
a4dce326f674bd430fc70d6d236f38120229716b
JavaScript
Juliusath/Juliusath.github.io
/projects/scratch-pad/day-4/contact-list.js
UTF-8
4,515
3.828125
4
[]
no_license
// #!/usr/bin/env node 'use strict'; /** * 4: Contact List * * a. Create a factory Function called makeContact(id, nameFirst, nameLast) * that returns a contact object. * * ex: makeContact(1, 'Max', 'Gaudin'); // => {id: 1, nameFirst: 'Max', nameLast: 'Gaudin'} * * b. Create a facto...
true
978e32a04ee48a5e34c97867c6bf1fe7259a5d2c
JavaScript
milovanov-crd/RehaBruck
/script.js
UTF-8
1,382
2.90625
3
[]
no_license
var menu = document.getElementById('mobile-only-menu'); var close = document.getElementById('close'); var menuWindow = document.getElementById('modal'); var header = document.getElementById('header'); menu.addEventListener('click', showMenu); close.addEventListener('click', hideMenu); window.addEventListener('scroll',...
true
dfc50b12fd614e6b5a5404535449eede2b865411
JavaScript
CCCVLMAlgorithmStudy/AlgorithmStudy_1st
/hmk20000/Code/1stWeek/124나라의 숫자.js
UTF-8
228
3.0625
3
[]
no_license
function solution(num) { var rtn = []; for(var i=0; num>0; i++){ //console.log(num); rtn.push((num-1)%3+1); num = (num - rtn[i])/3; } return rtn.reverse().join('').replace( /3/gi, '4'); }
true
c67e6efa06d45097081d85e5963988b0987bca2f
JavaScript
Aknya-PvP/AknyaBot
/src/Utils/Utils.js
UTF-8
1,311
2.859375
3
[]
no_license
class Utils { parseMessage(content){ if(!content) throw new Error("Pas de contenue envoyer dans la fonction 'parseMessage'") return content.replace(/@(everyone|here)/g,"@\u200b$1").replace(/\u202e/g,"") } resolveUser(message,member, permission){ if(!message.member.permissions.has(pe...
true
76f3c836a94c3e07768227859fe0abc860ee78c0
JavaScript
phuochung/Senior_Project
/fsa-server/services/localization.service.js
UTF-8
1,089
2.65625
3
[]
no_license
const Localization = require('mongoose').model('Localization'); let fields; module.exports.loadFields = (callback) => { if (fields) { if (callback) callback; return; }; Localization.find().then(locals => { // don't remove this console console.log('LOCALIZATION CACHED!'); ...
true
bac1e60f5e66cb4667f58c70f22d56f1aeb90f30
JavaScript
VUAN86/d3n
/d3n/backend_nodejs-services/libs/backend_nodejs-database/app/migrations/20170424-task-6866-fix.js
UTF-8
1,315
2.53125
3
[]
no_license
// Fix statuses for Application, Game, Advertisement, Voucher var logger = require('nodejs-logger')(); var _constants = { STATUS_INACTIVE: 'inactive', STATUS_ACTIVE: 'active', STATUS_DIRTY: 'dirty', STATUS_ARCHIVED: 'archived' }; module.exports = { up: function (queryInterface, Sequelize) { ...
true
401ccd88d1b21a92ff2f09987fc252fcab295c72
JavaScript
embreev/javascript2
/hw3/script.js
UTF-8
4,018
3.125
3
[]
no_license
const BASE_URL = 'https://raw.githubusercontent.com/GeekBrainsTutorial/online-store-api/master/responses'; function makeGETRequest(url) { return new Promise((resolve, reject) => { const xhr = window.XMLHttpRequest ? new window.XMLHttpRequest() : new window.ActiveXObject('Microsoft.XMLHTTP'); xhr.onreadystat...
true
a9e14e937546a8da743b3dc6cb5028b80d858423
JavaScript
coreyc/scalling
/public/playback.js
UTF-8
621
2.53125
3
[]
no_license
const sequence = () => { } const createActions = () => { } const setTransitions = () => { } setTimeout(() => { document.getElementById('buttonToClick').focus() }, 3000) setTimeout(() => { document.getElementById('pb_cursor').style.left = '25px' document.getElementById('pb_cursor').style.top = '25px' }, 3000) ...
true
ee725dba2472c8f678cfe4e3a0c44c16dfadb682
JavaScript
gistol/symfony-form-builder-vue
/public/app.js
UTF-8
646
2.78125
3
[]
no_license
// when the form changes (one of the inputs), update the form with the incoming new result var $post_category = $("#post_category") var $_token = $("#post__token") $post_category.change(function () { var $form = $(this).closest('form') var data = {} data[$_token.attr('name')] = $_token.val() data[$post_ca...
true
c799300ce634c23a4f5a7595e98954e649bde8a7
JavaScript
waldenermonteiro/schoolofnet
/TypeScript/firstExample.js
UTF-8
497
3.21875
3
[]
no_license
function soma(x, y) { return x + y; } soma(1, 2); var test = 'Junior'; var num = 2; var juniorsName = 'Junior Monteiro'; var juniorsYearsOld = 23; var arrayStrings = ['a', 'b', 'c']; var arrayAny = ['a', 'b', 'c']; var civilState; (function (civilState) { civilState[civilState["Solteiro"] = 0] = "Solteiro"; ...
true
1b85183021d6f8f35abd7cf695595f4c9c1c89e2
JavaScript
filipecsant-dev/landding-page-01
/js.js
UTF-8
644
2.84375
3
[]
no_license
$(document).ready(function(){ $(".suave").click(function(event){ event.preventDefault(); $('html, body').animate({ scrollTop: $( $.attr(this, 'href') ).offset().top }, 1500); }); }); const animationClass = 'animate'; function animeScroll(){ const windowTop = window.pageYOffset + ((window....
true
87c518d9d63c7b34eadb883add4552797fad80a9
JavaScript
praveen2512/covid-support
/src/Components/CoreComponent/AutoComplete.js
UTF-8
1,036
2.5625
3
[]
no_license
/* eslint-disable no-use-before-define */ import React, { useState, useEffect } from "react"; import TextField from "@material-ui/core/TextField"; import Autocomplete from "@material-ui/lab/Autocomplete"; const axios = require("axios"); export default function ComboBox({ district, handleDistrictChange }) { const [op...
true
29631b9db43bbf9b5d44add50ccb53b02af0534b
JavaScript
VisanAlex/lamborghini-site
/masini/huracan.js
UTF-8
10,425
2.671875
3
[]
no_license
document.addEventListener("DOMContentLoaded", function () { var elems = document.querySelectorAll("select"); var instances = M.FormSelect.init(elems, instances); }); let details = []; let imagine = document.querySelector(".imagineconfigurator"); let culoare = document.querySelector(".selectcolor"); culoare.addEve...
true
b38f098bd0f3267e64d2479cfbdff7308010c33c
JavaScript
phongle12300/dexlab
/src/Components/Readings.js
UTF-8
1,967
2.6875
3
[]
no_license
import React, {useState, useEffect} from 'react'; import moment from 'moment' import Chart from 'react-apexcharts' const dateCleanUp = (orignalDate) => { return moment(orignalDate).format('MMMM Do YYYY, h:mm:ss a') } const Readings = ({readings, days, dataHasLoaded}) => { const TotalResults = () => { return...
true
f035efde0209a0e97bc055b199d19edd85aeb8d1
JavaScript
ngmango/todo-app
/src/FormGroup.js
UTF-8
1,491
2.8125
3
[]
no_license
import React, {Component} from 'react' import axios from 'axios' class FormGroup extends Component{ constructor(){ super() this.state = { text: '' } this.changeHandler = this.changeHandler.bind(this) this.handleSubmit = this.handleSubmit.bind(this) } changeHandler(e){ this.setState...
true
a9014c1f85fe321976906a8339e5f3bceb09e588
JavaScript
Leticia-Mendiola/Team_Profile_Generator
/_tests_/Manager.test.js
UTF-8
635
2.65625
3
[]
no_license
const Manager = require("../lib/Manager.js"); describe("Manager", () => { describe("getOfficeNumber", () => { it("should return the office number of a new Manager", () => { const getNumber = new getOfficeNumber(); const officeNumber = "1"; const newnumber = Manager.getNumber(officenumber); ...
true
4715a156f281d964a76dd6fb1231f6a57babf5da
JavaScript
maanderz/simple-timer
/src/Timer.js
UTF-8
793
2.84375
3
[]
no_license
import React, { Component } from 'react' class Timer extends Component { componentDidMount(){ this.timer = setInterval(this.ticker, 1000) } ticker(){ this.setState({ clock: new Date() - this.props.start }) } constructor(props){ super(props); this.state = { clock: 0 }; this.ti...
true
4f9c7196878006f91733467f5be2d5fe1da85ef6
JavaScript
diegofernandesrego/jasmine-notes
/spec/toBeNullSpec.js
UTF-8
684
3.4375
3
[ "MIT" ]
permissive
/** * toBeNull * * #Realiza a comparação de um objeto como sendo NULL * #Usamos null para dizer que uma variável nao possui um valor * #O valor null se difencia de undefined pelo fato de null ser um tipo e * undefined ser uma variável ainda nao definida */ describe("Teste do toBeNull", function(){ it("d...
true
f9fceae422c9f4ce19b0fb0022288695569720d7
JavaScript
thapasya-m/app-kudos
/client/src/components/Header.test.js
UTF-8
496
2.625
3
[]
no_license
//check if props contains value //check if compt contains header elt on passign value {username} //check if compt contains logout btn import React from 'react'; import { shallow } from 'enzyme'; import Header from './Header'; let wrapper = {} beforeAll(() => { wrapper = shallow(<Header value={{ username: 'seinfeld',...
true
36138e8483d1132230c0cf7403e3ea9c37f87a88
JavaScript
intactile/dom-to-image-next
/src/embedFonts.js
UTF-8
1,257
2.578125
3
[ "MIT" ]
permissive
import * as inliner from './inliner'; function filterWebFontRules(cssRules) { return cssRules .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE) .filter((rule) => inliner.shouldProcess(rule.style.getPropertyValue('src'))); } function newWebFont(webFontRule) { const { href: baseUrl } = webFontRule.par...
true
18569c3b3a6ed75299162e68d565e6bcb3d80652
JavaScript
Ivnchev/JS-Advanced-January-2021
/Arrays and Nested Arrays - Lab/09. Biggest Element.js
UTF-8
176
2.9375
3
[]
no_license
function foo(input) { let m = [] for (let i = 0; i < input.length; i++) { m.push(...input[i])} console.log(Math.max(...m)); } foo([[20, 50, 10], [8, 33, 145]])
true
3ee4883db57940edd2ed1306d6029f45ff51b685
JavaScript
rpg-maker-repo/rmmv-api
/WebContent/js/jsdoc-parser.js
UTF-8
5,401
2.8125
3
[]
no_license
(function(exports) { "use strict"; /** * Handler used when no handler is passed to the * JSDocParser constructor. */ var DefaultHandler = { handle: function(current) { current.meta = current.meta || {}; current.meta[current.tag] = { type: current.type, ident: current.ident, text: curre...
true
b2436de8da5e5a298d8db7c6f601728859c1243a
JavaScript
AndrewEHarding/Farscape-Trivia-Game
/assets/javascript/app.js
UTF-8
6,726
3
3
[]
no_license
// I love waiting to see how things go South. $(document).ready(function () { var questions = [ { question: "What is the name of the star ship that Farscape takes place on?", correctAnswer: "Moya", incorrectAnswers: ["Talyn", "Rygel", "Serenity"], answerImage:...
true
58d54f67507a1c794080d4f60e144b10e8b38052
JavaScript
yarik2512/avito
/scripts/script.js
UTF-8
8,914
2.59375
3
[]
no_license
'use strict'; const dataBase = JSON.parse(localStorage.getItem('awito')) || []; let counter = dataBase.length; const modalAdd = document.querySelector('.modal__add'), addAd = document.querySelector('.add__ad'), modalBtnSubmit = document.querySelector('.modal__btn-submit'), modalSubmit = docum...
true
d56dd3e55c52cbe0aec59184f07b428c726cf286
JavaScript
gurigura0052/tmpl_PHPmailer
/js/jquery.js
UTF-8
3,375
2.9375
3
[]
no_license
var send = { methods: { // sendが発動した時の動作 send: function () { // フォームが正しく入力されている場合 if (this.isValid) { $.ajax({ url: this.request.url, type: 'post', dataType: 'json', data: this.request.data }) // 通信が成功した場合 .done(function(res...
true
18c2cfc2f4d196dd28aff0176a1dc5943e3807c8
JavaScript
happyhani/node-mysql
/json.js
UTF-8
396
3.734375
4
[]
no_license
var jsonstr = '{"name":"哈尼","age":18,"sex":"女神"}' var strjson = JSON.parse(jsonstr) var obj = {name:"哈尼",age:18,sex:"女神"} var str = JSON.stringify(obj); console.log(strjson); //{name:'哈尼',age:18,sex:'女神'} console.log(str); //{"name":"哈尼","age":18,"sex":"女神"} //console.log(str instanceof Object) //...
true
0dc96c5a7a5d0ac09f9d2fb104dc3bf4424e5c32
JavaScript
DanielACummings/Rock-Paper-Scissors
/app.js
UTF-8
1,436
3.640625
4
[]
no_license
let options = ['rock', 'paper', 'scissors']; function play(playerChoice) { let compChoice = options[Math.floor(Math.random() * (3 - 0))] debugger; switch (playerChoice) { case 'rock': if (compChoice == 'rock') { document.querySelector("#resultHeader").innerHTML = `<h5>Tie</h5>` } else if (compChoice ...
true
5fcd695a0896e5720fbb3a3a59b4f8ca19736a77
JavaScript
wanga7/Solitaire
/src/server/api/v1/game.js
UTF-8
9,220
2.734375
3
[]
no_license
/* Copyright G. Hemingway @2018 - All rights reserved */ "use strict"; let Joi = require("joi"); const _ = require("underscore"); const { initialState, filterGameForProfile, filterMoveForResults, validateMove, executeMove, findAutoMove, isGameEnd } = require("../../solitare"); module.exports = app => { ...
true
46a55c108a075c6ed6e0442a3d6aee14401b7f5f
JavaScript
PetyaKatsarova/softuni_js_advanced_21
/3.syntax/validityChecker.js
UTF-8
1,028
3.9375
4
[]
no_license
function validityChecker(x_1,y_1,x_2,y_2){ //x_1,y_1 to 0,0 if valid isValid = true; let one = Math.sqrt((x_1*x_1) + (y_1*y_1)); let two = Math.sqrt((x_2*x_2) + (y_2*y_2)); let three = Math.sqrt((x_2-x_1)*(x_2-x_1) + (y_2-y_1)*(y_2-y_1)); // console.log(one + ' / ' + two + ' / ' + three); i...
true
0bf863f985d64bdb0b544f233f63af9e8b02cd19
JavaScript
Serg4554/CoronaCheckBackend
/server/modules/user/riskDetection.js
UTF-8
653
2.53125
3
[]
no_license
const { getConnection } = require('../../db/connect') const { searchFeatures } = require('../../db/features') /** * Checks if the user visited an infected location (or been somewhere near) * and if yes and it was at the time when the virus is still active then mark a user as at risk */ const figureIfPersonIsAtRisk ...
true
dfdec5b4cf23e5e8a4ed6da9326da8c86f74f4ef
JavaScript
carderne/leaflet-gsheets
/main.js
UTF-8
6,953
2.796875
3
[ "MIT" ]
permissive
/* global L Papa */ /* * Script to display two tables from Google Sheets as point and geometry layers using Leaflet * The Sheets are then imported using PapaParse and overwrite the initially laded layers */ // PASTE YOUR URLs HERE // these URLs come from Google Sheets 'shareable link' form // the first is the geom...
true
c197c018e0192c6103d96b99c559b78cccfce118
JavaScript
Machyne/wordcloud
/app/assets/javascripts/file_loader.js
UTF-8
3,048
2.625
3
[]
no_license
function loadText(readFile) { var reader = new FileReader(); reader.readAsText(readFile); // Handle progress, success, and errors reader.onprogress = doNothing; reader.onload = loaded(readFile.name); reader.onerror = errorHandler; }; function doNothing(evt) {}; function loaded(fname) { return...
true
d139770eec318ad2cc8af027fa83b99353cbf0e5
JavaScript
deepam1982/sde-test
/main.js
UTF-8
2,931
2.921875
3
[]
no_license
const args = process.argv; const fs = require('fs') if(!process.argv[2]){ console.log("Error:first arguement missing") return } var argOffset = (process.argv[2] === "test")?1:0 var is_run_for_test = (process.argv[2] === "test")?true:false if(!process.argv[argOffset+2]){ console.log("Error:input file arguement ...
true
f773844287c2a19686a059b6267c6ae73b0f79dc
JavaScript
ironhack-paris-webdev-may-2018/express-users
/public/javascripts/script.js
UTF-8
2,121
3.40625
3
[]
no_license
// Google Maps script tag defines the "google" variable and its "maps" property console.log("Google Maps", google.maps); const mapDiv = document.querySelector(".my-google-map"); const locationInput = document.querySelector(".location-input"); const latInput = document.querySelector(".lat-input"); const longInput = doc...
true
ffb80af1dd291f6be37a05d2838e18176d61ef3f
JavaScript
markau/jsonresume-theme-futura
/index.js
UTF-8
1,720
2.625
3
[ "MIT" ]
permissive
var fs = require("fs"); var _ = require('lodash'); var Mustache = require('mustache'); var useGravatar = false; function render(resumeObject) { _.each(resumeObject.work, function(w){ w.startDateYear = w.startDate.substr(0,4); if(w.endDate) { w.endDateYear = w.endDate.substr(0,4); } else { w.endDateYear ...
true
b49d1e31627b56e9de99da180aa13257fb7117d1
JavaScript
tomskateboarder/bookmarksApp
/index.js
UTF-8
2,005
2.984375
3
[]
no_license
/* As a user: I can add bookmarks to my bookmark list. Bookmarks contain: title url link description rating (1-5) I can see a list of my bookmarks when I first open the app All bookmarks in the list default to a "condensed" view showing only title and rating I can click on a bookmark to display the "detailed" view...
true
63a6a38c4606390e3ccf3df083752063dac2fd3f
JavaScript
dsongman/convert-wordpress-posts
/tmdb_cache.js
UTF-8
9,208
2.671875
3
[]
no_license
'use strict'; const _ = require('lodash'); const fs = require('fs'); const moment = require('moment'); const request = require('request'); const tmdbAPIKey = require('./_private').tmdb_api_key; const MovieDB = require('moviedb')(tmdbAPIKey); const configCacheFilePath = './tmdb_cache/configuration.json'; const infoCach...
true
0847277bc700cbdc93846ac8e2b876bc868ee031
JavaScript
2812906800/student_guanlixitong
/学生管理系统/static/js/admin.js
UTF-8
2,669
2.828125
3
[]
no_license
window.onload = function() { let layer = layui.layer; updateclass(); addclass(); delclass(); } function updateclass(){ let btn = document.querySelector(".myupdateclass"); btn && (btn.onclick = function() { //判断btn存在后,才执行事件 //获取数据并检查//获取要修改的信息的cid, let cid = document.querySelector("input[name='cid']").value...
true
33b9d2ffef79197dedc5dc057813cf4de971a5f3
JavaScript
mzunino/syscope
/public/javascripts/modal.js
UTF-8
3,921
2.84375
3
[]
no_license
$(document).ready(function(){ //parametros principales var contenidoHTML = '<h1>No hay contenido para mostrar</h1><%=@contenido_modal%><button onclick=\"closeModal()\">Cerrar</button>' var ancho = $(window).width() * 0.75; var alto = $(window).height() * 0.75; $(windo...
true
96ef5201088622a7803c8b4e4d06d12ed013ba41
JavaScript
talos/dhcr-rent-stabilized-data
/index.js
UTF-8
4,382
3.0625
3
[]
no_license
// Convert a DHCR Xcel file to a condensed CSV. // Takes an xlsx file as `inFile` representing the DHCR's rent stabilized building list // and combines the xlsx sheets into an output csv as `outFile` with boro numbers // modules var fs = require('fs'); var xlsx = require('xlsx'); var xls = require('xlsjs'); var _ = ...
true
98fc0b3602fb9e9d15997a98556bc04ce9e6db44
JavaScript
ErnaniThum/algorithims
/twoSumV2.js
UTF-8
631
4.0625
4
[]
no_license
// Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. // You may assume that each input would have exactly one solution, and you may not use the same element twice. // You can return the answer in any order. var twoSum = function(nums, target) { ...
true
583d889f3ef3012afc419cd684d03fffa9a2dff5
JavaScript
Typhoid-fever/discord-bot
/commands/music/skip.js
UTF-8
832
2.671875
3
[]
no_license
module.exports = { name: "skip", description: 'Skip the current track.', aliases: ['s'], usage: '.skip', category: 'music', execute: (client, message) => { const player = message.client.manager.get(message.guild.id); if (!player) return message.channel.send("There is no player for t...
true
d05e0dfa12b0d53b9dcbd42634e6e2c3044041ec
JavaScript
izosimovnikita/nc_study_2021
/src/assets/learn-js/chapter-6/chapter-6.3/task-2.js
UTF-8
353
3.890625
4
[]
no_license
const inBetween = (a, b) => { return function (item) { return item >= a && item <= b; } } const inArray = (arr) => { return function (item) { return arr.includes(item); } } let arr = [1, 2, 3, 4, 5, 6, 7]; console.log( arr.filter(inBetween(3, 6)) ); // 3,4,5,6 console.log( arr.filte...
true