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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
78971ac2a17230f4f32b1cf4e97de2d25a887e40 | JavaScript | gitranxu/mfe | /src/utils/index.js | UTF-8 | 1,767 | 2.75 | 3 | [] | no_license | export function prefix_uuid() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the ... | true |
b3a62bc402e725dfc9e9f3faf122f78fb23f8719 | JavaScript | muhammednafih09/moneymanager | /transactions.js | UTF-8 | 1,104 | 2.828125 | 3 | [] | no_license | function getTransactions() {
const transactions = localStorage.getItem("transactions") ? JSON.parse(localStorage.getItem("transactions")) : [];
return transactions;
}
// const getTransactions = () => localStorage.getItem("transactions") ? JSON.parse(localStorage.getItem("transactions")) : [];
const allTransac... | true |
2cd25f7ae811559ec1e7f47521d9ab9dc566d4f6 | JavaScript | dididi1234/node.js | /nodejs2/02file.js | UTF-8 | 1,373 | 3.390625 | 3 | [] | no_license | /*
文件操作
*/
//写入文件
var fs=require("fs");
fs.writeFile("text.txt","我是写入的内容",{
ecoding:"utf8",
flag:"a"//追加
},function (err) {
if (err){
console.error(err);
}
console.log("写入成功")
})
//追加写入,异步地追加数据到一个文件,如果文件不存在则创建文件。
fs.appendFile("text.txt","我是追加的内容",function (err) {
if (err){
console... | true |
7412b4bbb23d3127f27e97e98634f1660e6159fc | JavaScript | aaljuhani/library | /js/library.js | UTF-8 | 2,936 | 2.515625 | 3 | [] | no_license | // JavaScript Document
function libamongfriends () {
Parse.initialize("67LqpjS8Yc0XXOP7CJnOOo9cyy5RzJWsjs6NCqNm", "LAr7wmvZWJcXykD6jxE57yNkhYVDfxG2CfblenU0");
/*
$( '#login' ).live( 'pagebeforecreate',function(event){
alert( 'This page was just inserted into the dom!' );
});
$( '#login' ).live( 'pageshow',functi... | true |
4d4de768cf657b63c0734bd52854bdf28bbab04a | JavaScript | zfq218910/sh_livevideo | /roomServer.js | UTF-8 | 1,546 | 2.578125 | 3 | [] | no_license | const express = require('express')
const app = express()
var server = require('http').Server(app);
var io = require('socket.io')(server);
//监听连接事件(注意:由于js的异步无阻塞的特性,这里的监听事件也是异步的,所以需要把
//断开连接的事件监听放在回调函数里)
io.on('connect',(client)=>{
//接受客户端连接时的频道名称
let chan = client.handshake.query.chan
//群发消息到chan频道
io... | true |
8eac09f5b9b29102e16cf7f22049ddbafde3803a | JavaScript | katesuzannah/GlobalGameJam2018 | /JS/public/javascripts/player.js | UTF-8 | 1,042 | 3.21875 | 3 | [
"MIT"
] | permissive | const socket = io();
// function setDisplay(element) {
// element.style.display = element.style.display==="none" ? "inline" : "none";
// }
function main() {
const submitButton = document.querySelector(".submitbtn");
const text = document.querySelector(".word");
submitButton.classList.add("invis");
text.classLis... | true |
21a2c9736a5340575857548adc187bcd91cc4304 | JavaScript | ffonseca1985/jorney-react-redux-konvajs | /src/jorney/components/community/case/reducers/caseReducer.js | UTF-8 | 958 | 2.5625 | 3 | [
"MIT"
] | permissive | import {actionCaseFormTypeConstant, actionPropertiesFormTypeConstant } from '../constants/index'
const initialState = {
activeCaseForm: false,
activePropertiesForm: false,
data: null
}
const caseReducer = function (state = initialState, action) {
var newState = Object.assign({}, state)
switch (a... | true |
fca0ec2d4c2dd5f4933e96fe657cb632b97d1864 | JavaScript | GeorgeIwu/Pokedex | /src/pages/pokemon/actions.js | UTF-8 | 1,502 | 2.578125 | 3 | [] | no_license | import api from '../../utils/api';
const initialState = {
error: null,
loading: false,
data: {}
};
const constants = {
POKEMON_FETCHED: 'POKEMON_FETCHED',
POKEMON_NOT_FETCHED: 'POKEMON_NOT_FETCHED',
};
export const checkIfFavourite = (state, ownProps) => {
const currentName = ownProps.locati... | true |
8312a4041260c44efb7c55fc045e348cc5789803 | JavaScript | yimpetit/baekjoon | /sesson2/n10799.js | UTF-8 | 743 | 3.609375 | 4 | [] | no_license | // var input = require('fs').readFileSync('/dev/stdin').toString().split('');
var input = require('fs').readFileSync('n10799.txt').toString().split('');
var stack = [];
var answer = 0;
for(var i=0;i<input.length;i++){
if(input[i]=='(') stack.push(i);
else if(input[i]==')'){
var last = stack[stack.length -1];
... | true |
d836dab14081543cdfb7b3ab46f24a813acfef68 | JavaScript | SWEN-789/dhh-project-arkuhn | /server.js | UTF-8 | 1,465 | 2.6875 | 3 | [] | no_license | const express = require('express');
const app = express();
const cheerio = require('cheerio');
var request = require('request');
app.use(express.static(__dirname + '/views')); // html
app.use(express.static(__dirname + '/public')); // js, css, images
const urlbase = 'https://www.signingsavvy.com/'
const serv... | true |
a55cef60ed2dc7ec10f6146ad8e2d739bd1fe38e | JavaScript | Wizcorp/tina.js | /src/Player.js | UTF-8 | 7,245 | 2.734375 | 3 | [
"MIT"
] | permissive | var Playable = require('./Playable');
var DoublyList = require('./DoublyList');
/**
* @classdesc
* Manages the update of a list of playable with respect to a given elapsed time.
*/
function Player() {
Playable.call(this);
// A DoublyList, rather than an Array, is used to store playables.
// It allows for fast... | true |
6a3286f30fb93059f4925daa91bf6c909afa9661 | JavaScript | kmorimatsu/kmbasic | /webm/display.js | UTF-8 | 1,385 | 2.546875 | 3 | [] | no_license | /************************************
* MachiKania web written by Katsumi *
* This script is released *
* under the LGPL v2.1. *
************************************/
/*
Public methods:
display.init(FontData);
display.write(addr,data);
*/
display=new Object();
display.fonts=new Image();
disp... | true |
85b776a27c85c66197ac89d86ba049a830b5a17a | JavaScript | BW-FT-Weight-Lifting-Journal/Front-End | /weight-lifting-trainer/src/components/exerciseForms/ViewExercisesList.js | UTF-8 | 1,011 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect, useContext } from 'react';
import { Link, useParams, useHistory } from 'react-router-dom';
import { axiosWithAuth } from '../axiosWithAuth';
import { ExercisesContext } from '../context/ExercisesContext';
const ViewExercisesList = (props) => {
const [Exercises, setExercises] = ... | true |
32ccf5f7c1bf2f0a1b3354d5d5f00b25035fc847 | JavaScript | EvelynSharp/node-auth-p1 | /services/passport.js | UTF-8 | 2,285 | 2.625 | 3 | [] | no_license | const passport = require('passport');
const User = require('../models/user');
const config = require('../config');
const JwtStrategy = require('passport-jwt').Strategy;
const ExtractJwt = require('passport-jwt').ExtractJwt;
//in passport, a strategy is a method for authenticating user
//req -> hit passport, check login... | true |
80a4ccdf0f53d3687245ee0f04aee3dec4e9ed96 | JavaScript | rdtsc/codeeval-solutions | /src/moderate/valid-parentheses/solutions/javascript/solution.js | UTF-8 | 854 | 3.328125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
'use strict';
const lineReader = require('readline').createInterface(
{
input: require('fs').createReadStream(process.argv[2])
});
function isBalanced(line)
{
if(line.length & 1) return false;
let parentheses = [];
for(let i = 0; i < line.length; ++i)
{
const c = line[i];
if(... | true |
29d52281e20d66f4bafe05f6d91f3ec3aeb135a8 | JavaScript | pamtabak/EpisodeVIII | /js/menu.js | UTF-8 | 4,163 | 2.828125 | 3 | [] | no_license | var container, stats;
var scene, camera, renderer, raycaster;
var planeStart, planeDifficulty, planeInstructions, planeCredits;
var raycaster;
var mouse = new THREE.Vector2(), INTERSECTED;
init();
animate();
function init() {
container = document.createElement( 'div' );
document.body.appendChild( container );
// ... | true |
42a9004fd7f44e6a31fe33c9ea3cc48158b68d47 | JavaScript | qlqhqo2341/3-2_computer_graphics | /Project3/my_utils.js | UTF-8 | 2,066 | 2.890625 | 3 | [] | no_license | function getVariableLocations(gl, program_name, attrib_list, uniform_list){
var program = gl[program_name+"_program"];
var variable = {};
for(var a of attrib_list)
variable[a] = gl.getAttribLocation(program, a);
for(var u of uniform_list)
variable[u] = gl.getUniformLocation(program, u);
... | true |
dd76ef757560589c2a91e137ededc8e8311f7b18 | JavaScript | brhui/Challenge3_Hsu_Hui | /Challenge3/block.js | UTF-8 | 1,072 | 3.375 | 3 | [] | no_license | var count = 0;
function Block() {
this.top = random(height / 2);
this.bottom = random(height / 2);
this.x = width;
this.w = random(10,30);
this.speed = 2;
this.highlight = false;
this.show = function() {
fill(86, 53, 30);
noStroke();
if (this.highlight) {
fill(241, 153, 83);
}
... | true |
72f9408f20857bf266479d569c788feaccd7c942 | JavaScript | eHanlin/language-utils | /src/English.js | UTF-8 | 1,274 | 2.75 | 3 | [
"MIT"
] | permissive |
var i18n = {
'zh':require('./i18n/i18n.zh')
};
var vowels = ['aɪ','aʊ','ɔɪ','i','ɪ','e','ɛ','æ','ɑ','o','ɔ','u','ʊ','ʌ','ə','ɝ','ɚ'];
function highlight(text, original, decorate) {
var result = [];
var isCut = new RegExp(text);
var isStringEnding = new RegExp(original +'$');
if (original === text) return ... | true |
f762be97e82d6e1ce43c02557f9cdc0d5c201c55 | JavaScript | processing/p5.js-website | /src/assets/learn/curves/curve_ex/sketch.js | UTF-8 | 1,423 | 3.234375 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | let x1 = 80;
let y1 = 80;
let x2 = 160;
let y2 = 120;
let x3 = 200;
let y3 = 200;
let x4 = 120;
let y4 = 240;
let d1 = false;
let d2 = false;
let d4 = false;
let d3 = false;
let d5 = false;
function setup() {
createCanvas(300, 300);
}
function draw() {
background(255);
stroke(0);
curve(x1... | true |
dea5d2c2665d60e117e289ab04b224142812c3c5 | JavaScript | ssthouse/office_automation_frontend | /src/components/tools/questionnaire/bean/question.js | UTF-8 | 1,256 | 2.953125 | 3 | [] | no_license | class Question {
/**
* 传入Json的存数据对象
* @param questionData
*/
constructor (questionData) {
Object.assign(this, questionData)
}
isEmpty () {
switch (this.type) {
case QUESTION_TYPES.RADIO:
if (this.title.length === 0) {
return false
}
if (this.selections.... | true |
8871b3e59edaf62e529f6227b02ecfcced424918 | JavaScript | loicfrance/VisualScripting | /js/libList.mod.js | UTF-8 | 2,050 | 2.75 | 3 | [] | no_license |
const rootElementSym = Symbol("root HTML element");
const boardSym = Symbol("FBP design board");
class LibraryTreeView {
[boardSym];
[rootElementSym];
constructor(board, rootUlElement) {
this[boardSym] = board;
this[rootElementSym] = rootUlElement;
}
update() {
const libLo... | true |
75243086838f389ccdca5b68692e0e80a5a6732c | JavaScript | Dev-MJ/Study_Node-React | /ex_express/routes/posts.js | UTF-8 | 8,064 | 2.578125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var postModel = require('../models/postmodel.js'); //생성한 postmodel.js를 가져옴
var CommentModel = require('../models/CommentModel.js');
//로그인 체크 미들웨어 require.
var loginRequired = require('../libs/loginRequired');
//이미지 저장되는 위치 설정
var path = require('path'... | true |
696c5612e50e819c40b581f931e492a13ef69ca6 | JavaScript | bwen1/React_Website_Frontend | /src/pages/LoginPage.js | UTF-8 | 3,593 | 2.765625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
const jwt = require('jsonwebtoken');
const LoginPage = (props) => {
const [email, setEmail] = useState(''); // State of email input box
const [password, setPassword] = useState(''); // State of password input box
useEffect(() => {
// If token alre... | true |
339e1a3030382bb2fe62cd2fc2bbcae27c6e4576 | JavaScript | samjarzembowski/cookie-stand-1 | /app.js | UTF-8 | 1,828 | 2.875 | 3 | [] | no_license | var CookieStand = function(place, minCustHour, maxCustHour, avgCookCust, id) {
this.place = place;
this.minCustHour = minCustHour;
this.maxCustHour = maxCustHour;
this.avgCookCust = avgCookCust;
this.id = id;
this.cookiesByHourList = [];
this.dailyCookies = 0;
this.hoursOfOperation = [10, 11, 12, 1, 2, ... | true |
111d8ff1a9cf5105788b99c7b5ca74dca0e68fea | JavaScript | Salasar/mahjongg | /src/js/model/tilesPack.js | UTF-8 | 919 | 2.59375 | 3 | [
"MIT"
] | permissive | import { TILES_TYPES, TILE_IMG } from './tiles';
export let tiles = (function() {
let result;
for (let type in TILES_TYPES) {
let quantifier = TILES_TYPES[type].QUANTIFIER;
let imgPath = TILE_IMG.PATH + TILES_TYPES[type].IMG_PREFIX;
let packOfTiles = [...TILES_TYPES[type].VALUES].map... | true |
3a88acb7a83195783599a86824728962bd35565f | JavaScript | fathed/subnettingIMI | /js/build.js | UTF-8 | 17,534 | 2.9375 | 3 | [] | no_license |
/*********************************************************
*
* INIT
*
*
*********************************************************/
function init(){
var refToClicked = 0;
var startingIP = [];
var cidr = [24,25,26,27,28,29,30,31,32];
//i want to keep a reference to the ip address. it is random for the ... | true |
a3374798c606e6616caa4d6e0fcba2fb326574d6 | JavaScript | ShellyYang481/FinalProjectShelly | /target/classes/static/js/register.js | UTF-8 | 1,569 | 2.6875 | 3 | [] | no_license | $("#clientInputEmail").on("change", function () {
$("#emailBlock > span,img").remove();
let inputNode = $("#clientInputEmail");
let clientInputEmail = inputNode.val();
let result = isEmailExits(clientInputEmail);
result.then((resp) => {
if (resp) {
let errNode = document.createElement("span");
... | true |
91b3096260084290de1df7a8a361ed9319d7de4d | JavaScript | deepakduggirala/chrome-snippets | /set.js | UTF-8 | 701 | 3.203125 | 3 | [] | no_license | function difference(set1, set2) {
return new Set([...set1].filter(x => !set2.has(x)));
}
function intersection(set1, set2) {
return new Set([...set1].filter(x => set2.has(x)));
}
function union(setA, setB) {
var _union = new Set(setA);
for (var elem of setB) {
_union.add(elem);
}
return _union;
}
fun... | true |
0ab5930a29165e21c3663bc46a5c0c1926511a46 | JavaScript | dvasquezjr/FizzBuzz | /js/site.js | UTF-8 | 2,200 | 3.953125 | 4 | [] | no_license | //Get values from the input
//Controller function
function getValues (){
//Get Buzz Value and Fizz Value
let fizzValue = document.getElementById("fizzValue").value;
let buzzValue = document.getElementById("buzzValue").value;
//Parse for numbers
fizzValue = parseInt(fizzValue);
buzzValue = parseInt(buzzVal... | true |
3e34433e5929a60f64e9a7f96ba4d2c4df09f66e | JavaScript | yanceyy/Social-Media-Sites | /backend/src/rounters/users.js | UTF-8 | 4,453 | 2.515625 | 3 | [] | no_license | const router = require('express').Router();
const bcrypt = require('bcrypt');
const User = require('../models/User')
const mongoose = require('mongoose')
const RESPONSESTATUS = require('../utils/responseStatus')
const {ValidaToken} = require('../utils/jwt')
// update user info
router.put("/", ValidaToken, async (req, r... | true |
049a1d0472f05f6e6bef96075c225ea945ac7638 | JavaScript | Samizen/Modern-JS-from-Novice-to-Ninja | /12_Async_JS/12_Async_and_await/12_async_and_await.js | UTF-8 | 411 | 3.90625 | 4 | [] | no_license | // Async is placed in a function:
const getTodos = async() => {
// fetch API is place inside the async function:
const response = await fetch("luigi.JSON");
const data = await response.json();
return data; // Is still a promise
};
// Asyncronous programming in action:
console.log(1);
console.log(2);
... | true |
bcbe6fa3867c0b911c66f2499889afa7d34d39de | JavaScript | anlena/learn-up | /new/03数据结构/code/1.判断字符串里的括号是否合法.js | UTF-8 | 746 | 4.34375 | 4 | [] | no_license | //判断字符串里的括号是否合法
function is_leagl_brackets(string) {
var stack = new Stack();
for (var i = 0; i < string.length; i++) {
var item = string[i];
// 遇到左括号入栈
if (item == "(") {
stack.push(item);
} else if (item == ")") {
//遇到右括号,判断栈是否为空
if (stack.i... | true |
4299fb6220e7aaaadf2827466e75fbf16a09d138 | JavaScript | yongeshi/in-ur-area | /yelp.js | UTF-8 | 2,883 | 2.921875 | 3 | [] | no_license | $(document).ready(function () {
// Executes once the page has completely loaded
// Form Related
const $searchForm = $("#submit-search");
const $searchTerm = $("#restaurant_input");
const $searchBy = $("input[name='search']:checked"); //correct? **************
const $searchLatitude = $(... | true |
713d01bf7855286dcbf3eb9c7daa33bbcf10b6f8 | JavaScript | winniecjy/formula-calculator | /src/js/calculator.js | UTF-8 | 4,250 | 3.5625 | 4 | [] | no_license | /**
* 描述:带括号的四则运算
* 作者:caijieying
*/
import { Stack } from "./dataStructure"
import _ from "lodash"
function isBracket(c) {
return c === "(" || c === ")"
}
function isOper(c) {
return c === "(" || c === ")" || c === "+" || c === "-" || c === "*" || c === "/"
}
function getPriority(oper) {
switch (oper) {
... | true |
53dff9607c57739485582927c9ba219de897fcee | JavaScript | thiagoaslima/fatoresApp | /scripts/encrypt/encryptservice.js | UTF-8 | 772 | 2.609375 | 3 | [
"MIT"
] | permissive | ;
(function (angular, undefined) {
'use strict';
angular
.module('encrypt')
.factory('encryptService', ['cryptojs', encryptService]);
function encryptService(cryptojs) {
var cipher = cryptojs.AES;
var service = {
hash: hash,
encrypt: enc... | true |
94ca9f59070a61b6b3a6f3a1882117a91d0d4c50 | JavaScript | simstu/storiaWebApp | /js/libs/dictionary/dictionary.js | UTF-8 | 6,314 | 2.6875 | 3 | [] | no_license | /* Author: Bernard Lin
Dictionary
*/
var dictionaryLoader = function ($bookFrame, $dicAudio, age) {
var isAudible = !($.browser.msie && $.browser.version.substr(0, 1) < 9);
var dictionaryOn = true;
var dictionaryClickHandler;
var $thisWord;
var $pronIcon = $('.pron-icon');
var clickEv... | true |
e9d659e227232387c15a22c10aeae8a7e1454359 | JavaScript | SergeyRZN/external-courses | /src/ex4_js-objects-part2/task-11.js | UTF-8 | 526 | 3.640625 | 4 | [
"MIT"
] | permissive | "use strict";
function countCharacters (string) {
let arrayString, objectString = {};
arrayString = string.split("");
for (let i=0; i<arrayString.length; i++) {
if (arrayString[i] in objectString) {
continue;
};
let characters = 0;
for (let j=0; j<arrayString.length; j++) {
if (arrayString[i]===array... | true |
ed55a9d6a162dff2757ce832bcf1a97b8df45737 | JavaScript | nallabolu/MyAngularDemo | /ES6/FoodManager.js | UTF-8 | 360 | 2.9375 | 3 | [] | no_license | exports.displayItems = function (...foodList) {
for (let i = 0; i < foodList.length; i++) {
console.log(foodList[i].toString());
console.log('value of i :' + i);
}
}
exports.discount = function (item, discount = 0.10) {
console.log(item.name);
console.log(item.ratePerUnit);
cons... | true |
89aca59c096e055cb6b62eac1fe691794e342531 | JavaScript | addaskogberg/1dv22Exa3 | /src/js/desktop.js | UTF-8 | 11,990 | 2.953125 | 3 | [] | no_license | function desktop () {
// Wait for HTML to load
document.addEventListener('DOMContentLoaded', function () {
if (typeof (Storage) === 'undefined') {
document.getElementById('header').innerHTML = 'Sorry, your browser does not support Web Storage...'
document.getElementById('button2').disabled = true
... | true |
7358f8c22389d3307911bf0ddaa21baf5c259e56 | JavaScript | Detrius1B/FullStack_Individual_Tests | /frontend-test-chess/src/possibleMoves.js | UTF-8 | 2,235 | 3.890625 | 4 | [] | no_license | export function chessKnight(x, y) {
let possibleKnightCoordinates = [];
// all possible X positions
let xPositions = [x + 2, x - 2, x + 1, x - 1].filter(cellPosition => (cellPosition >= 0 && cellPosition < 8))
// all possible Y positions
let yPositions = [y + 2, y - 2, y + 1, y - 1].filter(cellPosi... | true |
1d1d1e56640efea2b4272280314b9ca3fc070dbb | JavaScript | Sergio2431/programacion | /New/new.js | UTF-8 | 979 | 3.296875 | 3 | [] | no_license | //Inicialización de fechas
var fechaHoy=new Date();
var fechaCumpleSergio=new Date(2018,9,31);
var fechaCumpleSergio=new Date(2018,9,31,3);
//Muestro el dia de hoy
console.log(fechaHoy);
console.log(fechaCumpleSergio);
console.log("Sergio cumple el dia:"+fechaCumpleSergio.getDate());
console.log("Sergio cumple el dia... | true |
8489082c99dca178ee5bcf68fa4bb2c17c19f3b5 | JavaScript | karolkt1/electron-navbar | /timer.js | UTF-8 | 2,850 | 3.28125 | 3 | [] | no_license | let startTime;
let elapsedTime = 0;
let timerInterval;
let disabled = false;
function timeToString(time) {
let diffInHrs = time / 3600000;
let hh = Math.floor(diffInHrs);
let diffInMin = (diffInHrs - hh) * 60;
let mm = Math.floor(diffInMin);
let diffInSec = (diffInMin - mm) * 60;
let ss = Mat... | true |
68e62d9e7cb61cd029fd5ae6d1ab71ed7d672c06 | JavaScript | jacobemerick/advent-of-code-2016 | /01/2.js | UTF-8 | 1,100 | 3.28125 | 3 | [] | no_license | const fs = require('fs');
const input = fs
.readFileSync('input')
.toString()
.split(',')
.map(value => value.trim());
let direction = 0;
let path = [[0,0]];
let crossPath = false;
input.every(instruction => {
const turn = instruction.substring(0, 1);
const steps = parseInt(instruction.substring(1));
... | true |
91f920f210ae656043bb292e5942a87d75481ff2 | JavaScript | snatalija002/quotation-generator | /quotation generator/javascript.js | UTF-8 | 1,970 | 3.203125 | 3 | [] | no_license | const trivia=[
{
start: "You're",
middle: "a wizard",
end: "Harry",
},
{
start: "He called",
middle: "me",
end: "a Mudblood",
},
{
start: "they",
middle: "want me",
end: "to tap-dance",
},
{
start: "That",
mi... | true |
ceb9ee47b02fdba0a2a31ec16b74d931b6e4b261 | JavaScript | raagasarraff/Crumpled-Balls-2-3 | /sketch.js | UTF-8 | 1,111 | 2.578125 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var paper;
var ground;
var r1,r2,r3;
function preload()
{
}
function setup() {
createCanvas(800, 700);
engine = Engine.create();
world = engine.world;
ground = new Ground(width/2, 670, width,2... | true |
13454136d290de76fab91e1eeb146aa619c99967 | JavaScript | SamvelRaja/google-maps-markup | /addon/utils/paths-to-bounds.js | UTF-8 | 176 | 2.53125 | 3 | [
"MIT"
] | permissive | export default function pathsToBounds(paths) {
var bounds = new google.maps.LatLngBounds();
paths.forEach(latlng => {
bounds.extend(latlng);
});
return bounds;
}
| true |
34353f124043237a2740c9d9a0536ba942a4b72e | JavaScript | wofockham/sei-43 | /14-advanced/js-gotchas/this.js | UTF-8 | 1,425 | 4.0625 | 4 | [] | no_license | // `this` lets us access the current object (from inside a method)
// without needing to know the name of the variable containing the object.
const groucho = {
fullname: 'Groucho Marx',
greeting: function () {
return 'Good evening, my name is ' + this.fullname;
}
};
console.log('Calling the method:', grouch... | true |
dfd768ac34fa9e01ef25aeaae266226852fb06ff | JavaScript | akshsharma1/tap-movies-app | /client/src/pages/Home.js | UTF-8 | 1,982 | 2.53125 | 3 | [] | no_license | import { useState, useEffect } from "react";
import { Alert, Button, Card, CardImg } from "react-bootstrap";
import axios from 'axios';
import { useHistory } from "react-router";
import SearchBar from "../components/SearchBar";
import Loader from "../components/Loader";
function Home() {
const [movies, setMovies... | true |
2928e32306773a1901a81092add1f5204d2f1028 | JavaScript | pesto-students/project-delta | /packages/api/src/helper/auth/isAuthenticated.js | UTF-8 | 880 | 2.578125 | 3 | [
"MIT"
] | permissive | const { invalidToken, expiredToken } = require('../../../constants/ERR_MSGS');
const tokenService = require('../../services/token');
// Checks that the user who sent the request has a valid token
// If authenticated, the decoded token is made available to next middleware at req.decoded
// else, a 400 response is return... | true |
5606761f8daeadd6e59bb781fcd5ae19ba847e3a | JavaScript | Ranlevi/MobileMud_RN_Client | /App.js | UTF-8 | 11,776 | 2.515625 | 3 | [] | no_license | import React, { useState, useRef } from 'react';
import { StyleSheet} from 'react-native';
import {Box, NativeBaseProvider, Input, FlatList, Button, FormControl, Stack } from 'native-base';
import { Actionsheet, Text, Modal } from 'native-base';
import Ma... | true |
b120dd8648806106eaec5dde7dc74a1629bf3b7a | JavaScript | jubileus/HTP | /WebContent/pages/project_js/userinfo.js | UTF-8 | 2,063 | 2.765625 | 3 | [] | no_license | //修改用户昵称
function modifyNickname(){
var nickname=$("#nickname").val();
if(trim(nickname).length>0){
//新昵称不为空,可以修改
var url="ModifyNicknameAction.action?nickname="+nickname;
$.ajax({
type:'get',
url:url,
dataType: 'json',
success:function(){
//修改后,保存新昵称到隐藏域
$("#old_nickna... | true |
9fd93602938362415b01e2ae7402f8271288d252 | JavaScript | Itsstraining/Train2020A-HTML-Shopping | /demo/script/main.js | UTF-8 | 75 | 2.734375 | 3 | [] | no_license | alert("Hello World");
let a = prompt("what's your name ?");
console.log(a); | true |
e055c82a85a81eb27075ca5f3ee90108ccf2d6c6 | JavaScript | fabio-infotech/trybe-exercises | /exercises/higher-order-functions-do-javascript-es6_2/aula_ao_vivo/map.js | UTF-8 | 2,257 | 3.953125 | 4 | [] | no_license | const states = [
{ short: "AM", name: "Amazonas" },
{ short: "PA", name: "Pará" },
{ short: "TO", name: "Tocantins" },
{ short: "MG", name: "Minas Gerais" },
{ short: "BA", name: "Bahia" },
{ short: "PR", name: "Paraná" },
{ short: "SP", name: "São Paulo" },
{ short: "RN", name: "Rio Grande do Norte" },... | true |
87d25fd2a931672625167dde2e18e30f66196f8c | JavaScript | Migsect/Diarlog | /modules/models/content/Content.js | UTF-8 | 7,809 | 2.546875 | 3 | [] | no_license | "use strict";
const path = require("path");
const Hashids = require("hashids");
const Uuid = require("uuid/v4");
const Utils = require(process.cwd() + "/modules/Utils");
const DatabaseManager = require(process.cwd() + "/modules/database/DatabaseManager");
const Logger = require(process.cwd() + "/modules/Logger");
co... | true |
55dd8b7802a278d3a5b376084d5ffd34b3761d93 | JavaScript | JakeHildy/your-day-client | /src/utils/dateTime.js | UTF-8 | 379 | 3.234375 | 3 | [] | no_license | export function displayTime(timestamp) {
let date = new Date(+timestamp);
let dateNow = new Date();
let deltaT = dateNow.getTime() - date.getTime();
let differenceInHours = deltaT / (1000 * 3600);
if (differenceInHours < 24) {
return `Today: ${date.toLocaleTimeString()}`;
} else {
return `${date.to... | true |
1e87d7cb0a84b3c41c564994a42b26af7d3ec259 | JavaScript | xiakeweian/intervew-questions | /src/questions/类型检查.js | UTF-8 | 1,473 | 4.125 | 4 | [] | no_license | // 基础数据类型 Number,String,Boolean,Undefined,Null,Symbol
// 引用数据类型 Array,Object,Function,Set,Map
const num = 2
const str = 'aaa'
const boolean = false
const symbol = Symbol()
let obj = {}
let arr = []
let set = new Set()
let map = new Map()
function fn() {}
console.log(typeof num, 'number')
console.log(typeof str, 'strin... | true |
08f880c69ffda4cdade70722349a3631d9716569 | JavaScript | aneurycasado/Treehouse-Node-Dynamic | /app.js | UTF-8 | 858 | 2.546875 | 3 | [] | no_license | var router = require("./router.js")
//Problem: We need a simple way to look at a user's badge count and JavaScript point from a web browser
//Solution: Use Node.js to peform the profile look ups and servor our template via HTTP
//Create a web server
var http = require('http');
http.createServer(function (request, r... | true |
122ac9fc92573e6590ef45438daff78b9d28c5b3 | JavaScript | velezjose/data-structures | /sprint-two/spec/setSpec.js | UTF-8 | 1,257 | 3.359375 | 3 | [] | no_license | describe('set', function() {
var set;
beforeEach(function() {
set = Set();
});
it('should have methods named "add", "contains", and "remove"', function() {
expect(set.add).to.be.a('function');
expect(set.contains).to.be.a('function');
expect(set.remove).to.be.a('function');
});
it('should... | true |
814a5f974779d4e75c61ec3f8d88c3fbb986e31b | JavaScript | mel-lim/persistent-listmaker-front-end | /src/components/Login/ValidateCredentials.js | UTF-8 | 8,571 | 2.703125 | 3 | [] | no_license | import React, { useState, useContext, useEffect } from "react";
import { Link } from "react-router-dom";
import { LoadSpinner } from "../LoadSpinner/LoadSpinner";
import { UserContext, CookieExpiryContext, GuestUserContext } from "../../UserContext";
import { delay, checkUserCredentialsApi } from "../../api";
import c... | true |
d8bf93482c5b606f89583b997b26c96230a25778 | JavaScript | richker/memory-game | /src/services/playService.js | UTF-8 | 1,489 | 3.15625 | 3 | [] | no_license | export const checkMatch = (gameBoard, firstIndex, secondIndex) => {
let amount = 0;
if (firstIndex !== secondIndex) {
let firstCard = gameBoard[firstIndex];
let secondCard = gameBoard[secondIndex];
if (
// CARDS MATCH
firstCard.color === secondCard.color &&
firstCard.pattern === second... | true |
7c57d131a6070bd35a8b220d496fd84917625f7a | JavaScript | aivantuquero/MERN-Todo-App | /api/routes/UserRoutes.js | UTF-8 | 4,170 | 2.625 | 3 | [] | no_license | const express = require('express');
const User = require('../models/Users.js');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const validateRegisterInput = require('../validation/register');
const validateLoginInput = require('../validation/login');
const router = express.Router();
//You ca... | true |
e0fe87997bec39cb5833b22927bb8726ba5cab45 | JavaScript | volny/HN-postbot | /login.js | UTF-8 | 650 | 2.5625 | 3 | [] | no_license | const secrets = require('./secrets.js')
const URI = 'https://news.ycombinator.com/login'
const USERNAME_SELECTOR = 'input[type="text"][name="acct"]'
const PASSWORD_SELECTOR = 'input[type="password"][name="pw"]'
const BUTTON_SELECTOR = 'input[type="submit"][value="login"]'
module.exports.login = async (page) => {
tr... | true |
27bac249423da2e110a275249004f7b1ad1ba2c7 | JavaScript | shakuu/Homework | /javascript-applications/promises-primes/app.js | UTF-8 | 277 | 3.09375 | 3 | [
"MIT"
] | permissive | const findPrimes = require('./scripts/find-primes');
const res = findPrimes(1, 100000);
checkState();
function checkState() {
if (!res.isComplete) {
console.log(res);
setTimeout(checkState, 1);
}
else {
console.log(res.isComplete);
}
} | true |
83457d420d0aea86d315375353a865bfe1b23d3f | JavaScript | raquelfishes/soccer_play | /Assets/Scripts/GoalKeeperController.js | UTF-8 | 4,178 | 2.515625 | 3 | [] | no_license | var soccerBall:Transform;
var targetGoal:Transform;
var targetGoalKeeper:Transform;
// The speed when walking
var walkSpeed = 5.0;
// when pressing "Fire3" button (cmd) we start running
var runSpeed = 8.0;
var kickSpeed = 40;
var passSpeed = 20;
var rotateSpeed = 500.0;
var targetPoint:Transform;
var canMove:boo... | true |
ee9326a09cd60bca494d102236dc350d17183994 | JavaScript | sz-sebestyen/ttv-chat-search | /frontend/src/getTimestamp.js | UTF-8 | 605 | 2.875 | 3 | [] | no_license | const minutesInAnHour = 60;
const secondsInAMinute = 60;
const secondsInAnHour = secondsInAMinute * minutesInAnHour;
const getTimeStamp = (content_offset_seconds) => {
let secondsLeft = Math.floor(content_offset_seconds);
const hours = Math.floor(secondsLeft / secondsInAnHour);
secondsLeft -= hours * secondsIn... | true |
8414cc2efc3834c630564ed4b7f87e7054b3f67f | JavaScript | BangNguyen1992/Luke-Admin-v2 | /components/users/UserCtrl.js | UTF-8 | 1,700 | 2.53125 | 3 | [] | no_license | (function () {
'use strict';
angular
.module('app')
.controller('UserCtrl', UserCtrl);
UserCtrl.$inject = ['apiService', '$scope', '$state'];
function UserCtrl(apiService, $scope, $state) {
var vm = this;
getAllUser();
$scope.users = [];
// fetch all the users including admins and super admins
... | true |
cd0f87d1b671170cc0432ee8345dabfd7ca7429e | JavaScript | giordancodes/fstack | /week6-backend/express-sample/express-server.js | UTF-8 | 474 | 2.71875 | 3 | [] | no_license | var express = require('express');
var app = express();
app.get('/hello', (req, res) => {
res.send("Hello, " + req.query.name + "!");
});
app.get('/goodbye', (req, res) => {
res.send("Goodbye, " + req.query.name + "!");
});
app.get('/hello/:name/:lastname', (req, res) =>{
res.send("Hello, " + req.params.name + " ... | true |
7b4540d018d78121538c82fbb8cd21aed69ed532 | JavaScript | zmcdaniel/zoe-site | /js/main.js | UTF-8 | 850 | 2.78125 | 3 | [] | no_license | "use strict";
var clickEvent = "ontouchstart" in window ? "touchend" : "click",
classMethods = ["remove", "add"];
function vanillajQuery(id, textArr, className) {
var el = document.getElementsByTagName("html")[0];
var acbox = document.getElementById(id),
textNode = acbox.firstChild,
toggled... | true |
9b9a8de3745fe1adcdc1c8f596c6a83356b8e7e2 | JavaScript | upatel88/react-native | /src/containers/PlayGame.js | UTF-8 | 1,909 | 2.75 | 3 | [] | no_license | import React, { Component } from "react";
import data from "../config/data.json";
import "./container.css";
class PlayGame extends Component {
constructor(props) {
super();
this.state = {
data: data,
score: 0,
highestScore: 0
};
}
onImageClick = id => {
let find = false;
co... | true |
de1982426cdabb1f8f769ae4c526b09b27ea73b3 | JavaScript | paulovieira/js-lab | /air.nullschool.net/db.js | UTF-8 | 13,996 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* db - a module that handles talking to the database (in this case, postgres).
*
* This module attempts to treat the database as an implementation detail. Methods are made available to
* create tables, drop tables, insert rows, select rows, etc., without the caller needing to deal with SQL.
*/
"use strict";
... | true |
1694ea81031bcd2f0b61d4ffc3d5b49a202a87a5 | JavaScript | fwip/exercism-solutions | /javascript/hamming/hamming.js | UTF-8 | 311 | 3.21875 | 3 | [] | no_license | module.exports.compute = function(a, b){
if (a.length != b.length) {
throw Error("DNA strands must be of equal length.");
}
// Naive approach, step through and compare each character
var diff = 0;
for (var i=0; i<a.length; i++){
if (a[i] != b[i]){
diff ++;
}
}
return diff;
};
| true |
08adb88bbc01457413ccdd4c44fb1b9cdeb2e37b | JavaScript | Nick-Andrews/json-object-editor | /joe-core.js | UTF-8 | 16,435 | 2.859375 | 3 | [] | no_license | /**
* JSON tree walker object
* @type {Object}
*/
var WK = {
obj : null,
ID: null,
path:[],
nunode:null,
nupath: [],
keys: [],
type: 0,
loca: "",
rel: null,
/**
* add event actions to save and close buttons
*
* @param {int} id , current user id for authentication on data post
*... | true |
8e08eed2ef5204dc46d8d43838a9ed522b50555b | JavaScript | smilegse/Javascript-All-You-Need-to-Know | /Chapter#2/statemetnts.js | UTF-8 | 123 | 2.796875 | 3 | [] | no_license | console.log('Hello World')
var str = 10
var number = 10 + (30/5) * 5
var a = 10
var b = 20
var c = a >= b
console.log(c)
| true |
402fe19a32eb92edefad70b01e857029f30f3885 | JavaScript | Ben-vbg/updater | /main.js | UTF-8 | 2,103 | 2.609375 | 3 | [] | no_license | // Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const { ipcMain } = require('electron');
const path = require('path')
const Store = require('electron-store');
function createWindow () {
// Create the browser window.
const win = new BrowserWin... | true |
1fdcf0c4038d4ed9a47c8339eea1cfaf5035a77f | JavaScript | green-fox-academy/YanqingYao | /week-02/day-5/Envelope star/Envelope star.js | UTF-8 | 751 | 2.921875 | 3 | [] | no_license | 'use strict';
const canvas = document.querySelector('.main-canvas');
const ctx = canvas.getContext('2d');
for (let i = 0; i < canvas.width / 6; i += 3) {
ctx.strokeStyle = 'green';
ctx.beginPath();
ctx.moveTo(canvas.width / 2, i * 3);
ctx.lineTo(canvas.width / 2 + i * 3, canvas.height / 2);
ctx.stroke();
... | true |
1f13e4832bd70dd18963c69b8d6b3a7af345cc9b | JavaScript | ThomasBuyens/ThomasBuyens.github.io | /pukeEducator/script.js | UTF-8 | 2,889 | 3.15625 | 3 | [] | no_license |
let startButton = document.getElementById('startButton');
startButton.addEventListener('click', ()=> {
document.getElementsByClassName('questionBox')[0].style.display = 'block';
console.log('test');
startButton.style.display = 'none';
})
let images = document.getElementsByTagName('img');
let an... | true |
82cef79ca12697a7de3ade57f8daa5a64b7ea3d1 | JavaScript | rkaneko/learn-es-async-functions | /src/async-func-nested.js | UTF-8 | 171 | 3.09375 | 3 | [] | no_license | 'use strict';
async function asyncAnotherFunc() {
return 5;
}
async function asyncFunc() {
return asyncAnotherFunc();
}
asyncFunc()
.then(x => console.log(x));
| true |
f7a303a293d96afa5f2f9cda88270d0cdc08c59f | JavaScript | Nesterrr/EpamHW-toDoList | /js/module.js | UTF-8 | 6,715 | 2.859375 | 3 | [] | no_license | var initHTML = document.querySelector('.toDoList');
var MODULE = (function() {
var htmlTemplate = {
wrap: 'section',
html: ' <input type=\"checkbox\" class=\"task__checkbox\" {{state}}>' +
' <label class=\"task__title\ {{state}}">{{title}} {{date}}</label>' +
' <button class=\"dele... | true |
7e16af5b6b29afb311a58ed466876482b9f9d6ca | JavaScript | raklevan/User-Directory | /src/App.js | UTF-8 | 2,033 | 2.796875 | 3 | [] | no_license |
import React, { useState, useEffect } from 'react';
import axios from "axios";
import "./App.css"
import {Jumbotron, Table } from "react-bootstrap";
import "bootstrap/dist/css/bootstrap.min.css";
const App = () => {
const [users, setUsers] = useState([]);
const [inputValue, setInputValue] = useState("");
use... | true |
bf1edcb4611b2cb0556c03a3e6319e0ae8050cbe | JavaScript | casualuser/useless | /base/reflection.js | UTF-8 | 14,525 | 2.515625 | 3 | [
"MIT"
] | permissive | /* Self-awareness module
======================================================================== */
_.hasReflection = true
_.tests.reflection = {
'file paths': function () {
$assert ($sourcePath .length > 0)
$assert ($uselessPath.length > 0) },
'readSource': function () { var uselessJS... | true |
a2e69948fa5feeb558c2f41568f7a0496d02f61f | JavaScript | alberndt/aem-app-integration | /sample-apps/newsletter/js/subscribe.js | UTF-8 | 1,183 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | console.log("subscribe");
window.onload = function () {
const form = document.querySelector("form");
form.onsubmit = submitHandler.bind(form);
console.log("onsubmit registered");
}
function submitHandler(event) {
event.preventDefault();
// var xmlhttp = new XMLHttpRequest(); // new HttpReque... | true |
eeee25af51dee1cb9983c94964e4b595b5c4d213 | JavaScript | imyawar/initials-avatar | /script.js | UTF-8 | 1,022 | 2.578125 | 3 | [
"MIT"
] | permissive | require("./style.pcss");
function createAvatar(el){
const colors = [
"#626be0", "#e06277", "#b467da",
"#e09862", "#1abc9c", "#f44336",
"#3498db", "#673ab7", "#34495e",
"#8bc24a", "#27ae60", "#2980b9",
"#8e44ad", "#6c3244", "#f1c40f",
"#2266e6", "#e74c3c", "#50e3c2",
"#4498ae", "#f39c12", ... | true |
6b945b61fe01c6b9d8d5a65efe47e272aa0337ae | JavaScript | yiranni/dvia-2019 | /1.mapping-time/examples/4.analog-clock/sketch.js | UTF-8 | 2,308 | 3.4375 | 3 | [] | no_license | /* Adapted from https://processing.org/examples/clock.html */
var cx, cy; // center position of canvas
// Radius for hands of the clock
var secondsRadius
var minutesRadius
var hoursRadius
var clockDiameter
var dotRadius
var tickRadius
var discrete = true
function setup() {
createCanvas(640, 360)
stroke(255)
... | true |
8b57a351ea4ff95f12d442d467ad96be3fcc74f4 | JavaScript | salhindi/ez_trav_frontend | /index.js | UTF-8 | 3,365 | 3.09375 | 3 | [] | no_license | const endPoint = "http://localhost:3000/api/v1/travel_plans"
document.addEventListener('DOMContentLoaded', () => {
getTravelPlans()
const createTravelPlanForm = document.querySelector("#create-travel-plan-form")
createTravelPlanForm.addEventListener("submit", (e) => createFormHandler(e))
})
... | true |
694ea8f72f766e6320bf8ae4976b945e4f0a6a38 | JavaScript | lakkineni/golfcourseswiki | /lib/hole-handicap-validator.js | UTF-8 | 1,327 | 3.296875 | 3 | [] | no_license | // usage: validateHoleHandicaps(handicaps)
//
// returns an array of errors
module.exports = function validateHoleHandicaps(handicaps) {
var prev, parity, errors = [];
for (var i = 0, il = handicaps.length; i < il; i++) {
var handicapVal = handicaps[i];
// nulls and empty strings are always valid
// i... | true |
6ea598300fe73e83d2eb04189c583fadebcc64db | JavaScript | hudora/huSoftM | /softm_express/lib/pool.js | UTF-8 | 3,836 | 2.546875 | 3 | [
"BSD-3-Clause"
] | permissive | // from https://github.com/mikeal/node-utils/raw/master/pool/main.js
var sys = require('sys')
, http = require('http')
, events = require('events')
;
function Pool (port, host, https, credentials) {
this.port = port;
this.host = host;
this.https = https;
this.credentials = credentials;
this.clients = ... | true |
6795e5b01e5253c556c4c273b6cc84106384629b | JavaScript | Sandradan/Project | /js/07function/huakuai/demo.js | UTF-8 | 1,364 | 3.015625 | 3 | [] | no_license | window.onload = function() {
var btn = document.querySelector('.btn'); //滑块
var box = document.querySelector('.box'); //盒子
var bg = document.querySelector('.bg'); //背景
var text = document.querySelector('.text');
var flag = false;
//事件 onmousedown onmousemove
btn.onmousedown = function(e) {
... | true |
97d79d120dcaee11d5e1794070bd8ca5731b5c8f | JavaScript | jeromebravo/record-management | /client/src/reducers/record.js | UTF-8 | 1,305 | 2.546875 | 3 | [] | no_license | import {LOAD_RECORD, GET_RECORD, CREATE_RECORD, UPDATE_RECORD, DELETE_RECORD, GET_ONE_RECORD, LOADED_RECORD, RETURN_ITEM} from '../actions/types';
const initialState = {
records: [],
record: {},
loading: true
};
const record = (state = initialState, action) => {
const {type, payload} = action;
sw... | true |
374b9fa7d4d529354a412fb1401b2a19096f22f5 | JavaScript | yiannisk/lunchbag | /lunchbag.js | UTF-8 | 3,844 | 2.65625 | 3 | [] | no_license | // a list of lists
Lists = new Meteor.Collection('lists');
// the list's schema
function List(id, title, owner, items) {
this.id = id;
this.title = title;
this.items = items;
this.owner = owner;
}
function log() {
if (typeof console !== 'undefined')
console.log(arguments);
}
if (Meteor.is... | true |
b6ad7704d512cb3e8768d18b9eded2650244a190 | JavaScript | playdices/playdices.github.io | /js/connectivity.js | UTF-8 | 1,458 | 2.875 | 3 | [] | no_license | function doesConnectionExist() {
var xhr = new XMLHttpRequest();
var file = "https://playdices.github.io/images/connected.png";
var randomNum = Math.round(Math.random() * 10000);
xhr.open('HEAD', file + "?rand=" + randomNum, true);
xhr.send();
xhr.addEventListener("readystatechange", pro... | true |
9158b511d6ed2ec2824ad88bb5763b98ae41dc06 | JavaScript | TahaBenchikhi/AirFly | /AirFLy/template/Reservation/js/index.js | UTF-8 | 2,889 | 2.5625 | 3 | [] | no_license | var object ;
var table = [];
$(function(){
for (var i = 1; i < 19; i++) {
$("div.first_class").append("<div id='f"+i+"'></div>");
};
for (var i = 1; i < 49; i++) {
$("div.midle_class").append("<div id='m"+i+"'></div>");
};
for (var i = 1; i < 121; i++) {
$("div.last_class").append("<div id='l"+i+"'></div>"... | true |
ebb7822757c25626281c0c78f1e2a1968ccebce9 | JavaScript | tatianasim/qa8-api-test2 | /create_test.js | UTF-8 | 1,991 | 2.828125 | 3 | [] | no_license | // const expect = require('chai').expect;
// const supertest = require('supertest');
// const faker = require('faker');
// const request = supertest('https://nazarov-kanban-server.herokuapp.com');
// let response;
// // let cardsId = []
// describe('GET ALL CARDS', () => {
// before(async () => {
// const c... | true |
95d33dc1f4f488273fa785b7b8ffbb9952849843 | JavaScript | jonestristand/diff-state | /index.js | UTF-8 | 1,918 | 3.40625 | 3 | [
"MIT"
] | permissive |
module.exports = function diffState(newState, oldState)
{
var patch = {};
for(var key in newState) {
if (oldState.hasOwnProperty(key)) {
if (typeof newState[key] === 'object' && !Array.isArray(newState[key])) {
if (newState[key] !== null) {
// Object type, recur deeper
... | true |
adad9ea2332482b5e3e2d475dbe2cd2cc478217f | JavaScript | MatanYemini/files_upload | /client/src/utils/Alert.js | UTF-8 | 1,258 | 2.59375 | 3 | [] | no_license | import React, { useEffect } from 'react';
import {
BADACHIM_FOLDER_PATH,
HOWTO_FOLDER_PATH,
UTILS_FOLDER_PATH
} from './types';
import { useAlert } from 'react-alert';
import axios from 'axios';
let messages = '';
// // Option if you want to check the pathes using the api
// export const checkPathesViaServer = ... | true |
57deb35c3e0207c1935d3f761c4f7473ddeb3323 | JavaScript | xuj2017/jsLeetcode | /412.fizz-buzz.js | UTF-8 | 490 | 3.359375 | 3 | [] | no_license | /*
* @lc app=leetcode id=412 lang=javascript
*
* [412] Fizz Buzz
*/
// @lc code=start
/**
* @param {number} n
* @return {string[]}
*/
var fizzBuzz = function(n) {
let res = [];
for(let i = 1;i<=n;i++){
if(i % 15 === 0){
res.push("FizzBuzz")
}else if(i % 3 === 0){
... | true |
ab64545575faaf1b55e901e0ad9f44ae69855622 | JavaScript | ajrice1018/RPG_Game | /assets/JavaScript/RPG_JavaScript.js | UTF-8 | 8,801 | 3.3125 | 3 | [] | no_license | $(document).ready(function() {
//Character Variable and Attributes
//================================================================
var characters ={
"Archer": {
name: "Archer",
health: 140,
attack: 18,
imageUrl: "assets/images/archer.jpeg",
... | true |
00ea2431e32e3274c07bcb1b283effd0e77d103a | JavaScript | parv24/Two-Dice-Roller | /index.js | UTF-8 | 555 | 3.640625 | 4 | [] | no_license | var randomNumber1=Math.ceil(Math.random()*6);
var randomNumber2=Math.ceil(Math.random()*6);
var a=document.querySelector(".img1");
var b=document.querySelector(".img2");
var sa ="images/dice"+randomNumber1+".png";
var sb ="images/dice"+randomNumber2+".png";
a.src=sa;
b.src=sb;
if(randomNumber1>randomNumber2)
{... | true |
dc1d99d1fee88875327f695c202446046490070e | JavaScript | AnithaAnand/imad-2016-app | /ui/main.js | UTF-8 | 2,810 | 3.359375 | 3 | [] | no_license | //counter code
//var button = document.getElementById('counter');
//button.onclick = function (){
// Create a request object
//var request = new XMLHttpRequest();
//capture the response and store it in a variable
//request.onreadystatechange = function(){
// if (request.readyState === XMLHttpRequest.DO... | true |
0e11760b2f0b6fdbf4fb09d1d91720fa6127e9ed | JavaScript | Rishabh7777/smart-brain-frontend | /src/components/register/Register.js | UTF-8 | 2,556 | 2.703125 | 3 | [] | no_license | import react from "react";
class Register extends react.Component {
constructor(props) {
super(props);
this.state = {
name: "",
email: "",
password: "",
flag: false
}
}
onNameChange = (event) => {
// setState() will add field if it does not found it
this.setState({name: event.target.value});
... | true |