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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21919d0114b080ae3e33b12b70150d5be105ef13 | JavaScript | Tarshith-Vishnu-Teja/takehomeChallenge-backend | /TakeHomeChallenge-Backend/middleware/mysql.js | UTF-8 | 1,056 | 2.71875 | 3 | [] | no_license | /**
* New node file
*/
var mysql = require('mysql'); //importing module mysql
var pool = mysql.createPool({
connectionLimit : 600,
host : 'takehomechallenge.c5zubzjybfp7.us-east-1.rds.amazonaws.com',
user : 'takeHome1',
password : 'takeHome1',
port : 3306,
database : 'takeHomeChallen... | true |
d21cd075d861227b427083ac0879b0db6c2076bb | JavaScript | sgulb/Psychic-Game | /assets/javascript/game.js | UTF-8 | 1,109 | 4.03125 | 4 | [] | no_license | var alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];
var wins = 0;
var losses = 0;
var guessesLeft = 9;
var lettersGuessed = [];
var correctLetter = alphabet[Math.floor(Math.random() * alphabet.length)];
//Start listening for... | true |
5119da0ccbe70201eb4bd33afd64610599dbb29f | JavaScript | edgecase/vital_ruby | /src/methods_messages/greeter.js | UTF-8 | 95 | 2.703125 | 3 | [] | no_license | greeter = new Object();
greeter.greet = function() { print("Hello, World") };
greeter.greet();
| true |
49e5e8f4876114282fc342ddfd3cef7203fb769e | JavaScript | elzii/experiments | /tweet-highlight/js/app.js | UTF-8 | 3,384 | 2.515625 | 3 | [] | no_license | var App;
!(function ($) {
"use strict";
App = window.APPLICATION = {};
/**
* Config
*/
App.config = {
environment : (window.location.href.match(/(localhost)/g) ? 'development' : 'production' ),
api : window.location.protocol + '//' + window.location.host + '/admin/api/',
debug: true... | true |
d65a7fc63ba2aef34fb8b4603d42ee6ec56bcd6c | JavaScript | pwambach/drumhero | /src/libs/media-player.js | UTF-8 | 740 | 2.8125 | 3 | [] | no_license | export default class MediaPlayer {
constructor(audioContext) {
this.audio = document.createElement('audio');
this.audioContext = audioContext;
this.source = this.audioContext.createMediaElementSource(this.audio);
this.source.connect(this.audioContext.destination);
}
load(url) {
return new Pr... | true |
1138d5280a4f008aada6602d59b0f512bebc1c64 | JavaScript | PitneyBowes/LocationIntelligenceSDK-JavaScript | /src/main/javascript/geojs/v1/geoTime.js | UTF-8 | 2,019 | 2.53125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*Copyright 2016 Pitney Bowes Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | true |
d592bc3319803ef65fd51ca05a3142eba501f89b | JavaScript | housesink/housesink.github.io | /flutter/butterfly2.js | UTF-8 | 4,829 | 2.515625 | 3 | [] | no_license | var Ymax=8; // MAX # OF PIXEL STEPS IN THE "X" DIRECTION
var Xmax=8; // MAX # OF PIXEL STEPS IN THE "Y" DIRECTION
var Tmax=10000; // MAX # OF MILLISECONDS BETWEEN PARAMETER CHANGES
var swapspeed=200; // SPEED IN WHICH IMAGES CHANGE
// THE ARRAY BELOW CONTAINS A SUBAR... | true |
41eedfba10a80e197a04ce2139e90edd12de5618 | JavaScript | adambrgmn/frans | /src/__tests__/debounce.js | UTF-8 | 1,842 | 2.9375 | 3 | [
"MIT"
] | permissive | import { debounce } from '../debounce';
describe('Core.debounce', () => {
const delay = (wait) => new Promise((resolve) => setTimeout(resolve, wait));
test('will debounce a function', async () => {
const fn = jest.fn();
const debounced = debounce(fn, 0);
debounced('foo', 'bar');
expect(fn).not.to... | true |
6a258f21dd3f208e57059647dd069ffe40a642ad | JavaScript | DesBisous/vue2-mini | /src/code/vdom/rnode.js | UTF-8 | 2,218 | 2.9375 | 3 | [] | no_license | import { isDef } from '../../shared/util.js';
function createElement(vnode) {
const { tag, children, text } = vnode;
if (typeof tag === 'string') {
vnode.el = document.createElement(tag);
updateProps(vnode);
children.forEach(function (child) {
vnode.el.appendChild(createElement(child));
});
... | true |
3090b2531fb97b0b64f334025b6afa4a7e31bf94 | JavaScript | bolkonya/javascript-task-3 | /robbery.js | UTF-8 | 5,890 | 3.25 | 3 | [] | no_license | 'use strict';
/**
* Сделано задание на звездочку
* Реализовано оба метода и tryLater
*/
const isStar = true;
/**
* @param {Object} schedule – Расписание Банды
* @param {Number} duration - Время на ограбление в минутах
* @param {Object} workingHours – Время работы банка
* @param {String} workingHours.from – Вре... | true |
0ab561efc48d1217444ad906434eb431dbc99b01 | JavaScript | tomasyaya/appointment-testing | /server/src/appointments.js | UTF-8 | 3,245 | 3.03125 | 3 | [] | no_license | const stylists = [ 'Ashley', 'Jo', 'Pat', 'Sam' ];
const stylistServices = {
Ashley: ['Cut', 'Blow-dry', 'Extensions'],
Jo: ['Cut', 'Blow-dry', 'Cut & color' ],
Pat: ['Cut', 'Blow-dry', 'Beard trim', 'Cut & beard trim', 'Extensions'],
Sam: [ 'Cut', 'Blow-dry', 'Beard trim', 'Cut & beard trim' ]
};
const random... | true |
4a9c43e35b2b3e7e5d4bb85499ac6d4e418b1fb5 | JavaScript | zero0011/Winter-holiday-punch | /2020-1-17/25.k个一组翻转链表/test.js | UTF-8 | 551 | 3.953125 | 4 | [] | no_license | /**
* @description { 反转单链表 }
* @param {*} head
* @returns {*} List
*/
// 定义单链表
function ListNode (val) {
this.val = val;
this.next = null;
}
var reverseList = function(head) {
// 哑节点
let pre = null ;
while(head !== null) {
let nextNode = head.next;
head.next = pre;
... | true |
ee508570b7da76e04cf25c25fc7f0b19cc1a21cf | JavaScript | aarodrigues/blockchain_notary_service | /Blockchain.js | UTF-8 | 5,540 | 2.921875 | 3 | [] | no_license | /* ===== SHA256 with Crypto-js ===============================
| Learn more: Crypto-js: https://github.com/brix/crypto-js |
| =========================================================*/
const SHA256 = require('crypto-js/sha256');
let levelSandbox = require('./LevelSandbox');
/* ===== Block Class ======... | true |
76ac99ead5375ce525f34a77bfbe9dbe6f5280b8 | JavaScript | naskodaskalov/SoftUni-JS-Core-Course | /JavaScript Fundamentals/Homeworks/Conditional Statements and Loops/triangle-of-dollars.js | UTF-8 | 205 | 3.296875 | 3 | [] | no_license | "use strict";
function printTriangle(size) {
for (let row=1; row <= size; row++) {
//console.log(new Array(row+1).join('$'));
console.log('$'.repeat(row));
}
}
printTriangle([3]); | true |
5105ee2c7c0a673df347206c3cd17db6fcbe8735 | JavaScript | Yevheniia30/goit-basicJS-mod.01-06 | /js/module-02/task-2.3.js | UTF-8 | 852 | 4.3125 | 4 | [] | no_license | // поиск самого длинного слова
function findLongestWord(string = "") {
// преобразуем строку в массив
const words = string.split(" ");
// создаем переменную longestWord и даем ей значение первого элемента массива то есть первого слова
let longestWord = words[0];
// перебираем элементы массива и сравниваем их... | true |
f12849938fe529b99409cc8d7deb61133da4d676 | JavaScript | devbeatz/devbeatz | /src/redux/reducers/trackReducer.js | UTF-8 | 4,016 | 2.640625 | 3 | [] | no_license | import axios from "axios";
const initialState = {
tracks: [],
tracksGenre: [],
genre: "",
top5: [],
userBought: [],
userUploaded: [],
userSales: [],
loading: false
};
export const GET_ALL_TRACKS = "GET_ALL_TRACKS";
export const RESET_GENRE = "RESET_GENRE";
export const GET_TOP_5_TRACKS = "GET_TOP_5_TR... | true |
324e850b6d349863b9618a5d758a774988c30c9d | JavaScript | mirko93s/Chill | /slashs/Xp/xp.js | UTF-8 | 3,892 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | const Discord = require(`discord.js`);
module.exports = {
name: `xp`,
description: `Change user's XP points`,
userPerms: [`Administrator`],
options: [
{
name: `user`,
description: `User to change the xp to`,
type: Discord.ApplicationCommandOptionType.User,
required: true,
},
{
name: `mode`,
... | true |
0001221073dd5a0ba23d6ab9a56d0ee0dd5cee70 | JavaScript | bushblade/Algorithm-Solving | /js/codeFights-intro.js | UTF-8 | 6,434 | 3.8125 | 4 | [] | no_license | //##################### The Journey Begins ######################
function add(param1, param2) {
return param1 += param2
}
// console.log(add(1, 2))
function centuryFromYear(year) {
return Math.ceil(year / 100)
}
// console.log(centuryFromYear(1905))
function checkPalindrome(inputString) {
return inputString.t... | true |
a50dc881043f380767c88af715f368829b8f439f | JavaScript | stefanosc/twitter-mentions | /public/js/application.js | UTF-8 | 800 | 2.5625 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
$('a.screen_name').mouseenter(showProfileDiv);
$('.profile-card').mouseleave(closeProfileDiv);
$('.close-profile').click(closeProfileDiv);
var tId;
function showProfileDiv (event) {
var profileCard = $(event.target).parents('.profile-cell').children('.profile-card');
profileCard.s... | true |
b386da98571934b4ef975e41fd3321cf16eb7b9e | JavaScript | yjlk123/js-study | /src/topic/debounce.js | UTF-8 | 1,267 | 4.1875 | 4 | [] | no_license | // 函数防抖
// 在事件被触发 n 秒后再执行回调,如果在这 n 秒内又被触发,则重新计时
// 核心思想:每次事件触发都会删除原有定时器,建立新的定时器。通俗意思就是反复触发函数,只认最后一次,从最后一次开始计时。
// 1.防抖函数的实现
function debounce (fn, delay) {
let timer = null;
return function (...args) { // A 这种一般都是会返回一个函数,真正要执行的函数通过 参数传进去. 防抖和节流都是
let context = this
console.log(...args);
... | true |
5d6ccd7aa66e01c7c4b476ea3168fb66ea0494a5 | JavaScript | mibrede/udacity-project-frogger-clone | /js/app.js | UTF-8 | 4,782 | 3.296875 | 3 | [] | no_license | const fieldWidth = 101;
const fieldHeight = 83;
/*** Enemies ***/
var Enemy = function() {
this.x = -150;
this.y = getRandomInt(1, 5) * fieldHeight - (fieldHeight / 2) ;
this.speed = Math.floor(Math.random() * 50) / 10 + 1;
this.sprite = 'images/enemy' + getRandomInt(1, 3) + '.png';
};
// Update the enemy's posi... | true |
20175856a079193624e906f028d9d7f4d4ad723e | JavaScript | luxn/locomotion | /server/test/component_tests/api/v1/users.test.js | UTF-8 | 3,068 | 2.59375 | 3 | [
"MIT"
] | permissive | const request = require('supertest');
const app = require('../../../../app');
const { User, Verification } = require('../../../../models');
describe('Users Endpoints', () => {
const baseUrl = '/api/v1/admin';
const usersApiUrl = `${baseUrl}/users`;
let acToken;
const firstUserData = {
id: 'f8a0c5fc-9b4c-43... | true |
5a0a30f8e3c5695531e8d3d17691baa68b33c3f2 | JavaScript | jiangxueyang/cutterjs | /src/components/cutter.js | UTF-8 | 21,042 | 2.6875 | 3 | [
"MIT"
] | permissive | import {isObject, isEmpty, isNumber, warn, toFixed, isFunction} from '../utils'
export default class {
constructor(config = {}) {
this.rotate = 0 // 旋转角度
this.dragStatus = 0 // 拖拽状态
this.cursorEnums = ['default', 'nw-resize', 'w-resize', 'sw-resize', 'n-resize', 's-resize', 'ne-resize', 'e-resize', 'se-resize', ... | true |
fb95e7c2a97eb51333a685d4bc5d19e64bf9b594 | JavaScript | darkfusion90/chatrooms | /server/controllers/socketIoSessions.js | UTF-8 | 1,186 | 2.53125 | 3 | [
"MIT"
] | permissive | const SocketIoSessions = require('../models/SocketIoSession')
const getSocketIdListOfUserId = async (userId) => {
return new Promise((resolve, _) => {
const onPromiseRejected = (err) => {
console.log(`on error mapping userId ${userId} to socket list: `, err)
resolve([])
}
... | true |
4d42caaeac371ff2e95bf92d98b747fe2f5050b9 | JavaScript | dmitriyzyuzin/social-feed-react-app | /src/hoc/withPolling.js | UTF-8 | 1,113 | 2.59375 | 3 | [] | no_license | import React from 'react'
const withPolling = (Component, intervalInSeconds = 60) => {
class WithPolling extends React.Component {
componentDidMount () {
this.startPolling()
}
componentWillUnmount () {
this.stopPolling()
}
startPolling = () => {
if (this.interval) {
re... | true |
181713487742a08a4c6dad4994f346f951c3260c | JavaScript | anish0586/parser | /test/indexTest.js | UTF-8 | 4,405 | 2.5625 | 3 | [] | no_license | describe('Task API Routes', function() {
// This function will run before every test
beforeEach(function(done) {
done();
});
// Testing the v1 parse endpoint
describe('POST /api/v1/parse', function() {
it('Success: JOHN MICHAEL 9994567', function(done) {
request.post... | true |
a929a6ed2775558c9919b474adf72026c8c215ae | JavaScript | samuelchika/JSWebProject | /localTodo/js/maxNum.js | UTF-8 | 992 | 3.53125 | 4 | [] | no_license | window.addEventListener("load", function(e) {
e.preventDefault();
var number;
const span = document.getElementById("orange");
const p = document.getElementById("vals");
const p1 = document.getElementById("val");
var arr = [];
do {
number = prompt("Add an item to the array (it must be a number) \nTyp... | true |
1634d73607fc6553fc18e5546ef7e0720f251e18 | JavaScript | Leakune/Call-Out-Duty | /WEB/planning/planning.js | UTF-8 | 7,265 | 2.828125 | 3 | [] | no_license |
let onglet = document.getElementById('planning');
onglet.style.color = "#fff";
onglet.style.fontWeight ="bold";
onglet.style.fontSize ="100%";
onglet.style.textShadow = '8px 8px 12px rgb(0,0,0)';
//<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePages" aria-expanded="true" aria-... | true |
1e9f5053ecba44d626980cb12204c467f1c6f953 | JavaScript | 79534964/blog | /blog-api/server/includes/file/rewrite.js | UTF-8 | 1,858 | 2.640625 | 3 | [] | no_license | const path = require('path');
const {stat, mkdir, readFile, writeFile, unlink, readdir, rmdir} = require('./index');
const dirExists = async ({dir}) => {
let stats = await stat({path: dir});
if (stats && stats.isDirectory()) {
return true;
} else if (stats) {
return false;
}
//如果该路径... | true |
c7d2c0be331c184fef5f61c0f071d34c046aaa7f | JavaScript | liulinLL/canva | /canvas.js | UTF-8 | 4,770 | 3.296875 | 3 | [] | no_license |
// 初始化
var canvas = document.getElementById("Canvas");
var ctx = canvas.getContext('2d');
var flag = false;
ctx.lineWidth = 5;
drawSize();//初始化画布面积
window.onresize = function () {
drawSize();//使画布能适应窗口变换
}
var eraserEnabled = false;//设置橡皮擦初始使用情况
var LastPoint = { x: undefined, y: undefined };
// 画圆
function draw... | true |
3c5305ab119d3d4cd231d70a9ce323896aee6d6f | JavaScript | mmyatt91/divide-conquer-exercises | /sorted-frequency.js | UTF-8 | 1,262 | 3.6875 | 4 | [] | no_license | function firstBSearch(arr, x, leftIdx = 0, rightIdx = arr.length - 1) {
// Conditional to check if x is present; if so return the index of the first x
if (rightIdx >= leftIdx) {
let midIdx = Math.floor((leftIdx + rightIdx) / 2)
if((midIdx === 0 || x > arr[midIdx - 1]) && arr[midIdx] === x) {
retur... | true |
a162e2bba77003fccc28059c34cb7a37cbcf1ee7 | JavaScript | datadev23/frontend-nanodegree-arcade-game | /js/app.js | UTF-8 | 8,861 | 3.40625 | 3 | [] | no_license | // Enemies our player must avoid
"use strict";
var player;
var gem;
var score = 0;
var speed = 0;
var health = 100;
var allGems;
var gemitems;
var allItems;
var itemsArray;
// Enemy object
var Enemy = function(x, y, speed) {
// Variables applied to each of our instances go here,
// we've provided one for... | true |
7100b95c5f9de3e8b6898b5d8e277a2383137af8 | JavaScript | aritragster/ReactJS | /ReactJS/react-redux/es5-es6-app/src/index_5_object_oriented.js | UTF-8 | 4,461 | 4.6875 | 5 | [] | no_license | /**
* Object oriented concepted & implementaion
*
* Object: memory
* Object: data + behaviour
* Javascript is fundamentally class free object oriented pl.
* >no classes to create objects
*
* How to create object?
* Creational Pattern
* 1. constructor Pattern
* derived from java pl
* function Pat... | true |
0d28c26bb030439b2bdebc9015d9921693c3630a | JavaScript | Kry-dev/cabinfield | /app/libs/mmenu-light/src/polyfills/event.js | UTF-8 | 430 | 2.78125 | 3 | [
"CC-BY-4.0"
] | permissive | // from: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
(function() {
if (typeof window.Event === 'function') return false;
function Event(event, params) {
params = params || { bubbles: false, cancelable: false };
var evt = document.createEvent('Event');
evt.in... | true |
e63078b0dbe52feaafd0450496116184d254cb22 | JavaScript | Yuiham/loyal-promise | /src/interface/static/all.js | UTF-8 | 3,270 | 3.125 | 3 | [
"MIT"
] | permissive | import {
slice,
isArguments,
isConstructor,
isIterable,
hasIterator
} from 'util'
import { getNewCapability } from 'internal'
/**
* create a new promise which is fulfilled with an array of fulfillment values
* for the passed promises, or rejected with the reason of the first rejected
* promise
*
* @sta... | true |
185b28d263c10e2b31f4f041337dec6689eb76a9 | JavaScript | jchen0506/Leetcode-Warrior | /dailyChallenge0902ContainsDuplicate3.js | UTF-8 | 1,110 | 4.09375 | 4 | [] | no_license | /*
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference between i and j is at most k.
Example 1:
Input: nums = [1,2,3,1], k = 3, t = 0
Output: true
Example 2:
Input: nums... | true |
530042d3fba794c83970ed97c8655151ea752881 | JavaScript | asdbaihu/menu-porn-crawler-api | /src/controllers/base.cnt.js | UTF-8 | 1,028 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive |
const { mode } = require('../environment');
const baseController = {
index(req, res) {
res.send(`<center style="font-size: 5em; font-family: 'Arial'; line-height: 95vh;">Api works in ${mode}</center>`);
},
testSite(req, res) {
res.send(`<script>
const xml = new XMLHttpRequest();
xml
... | true |
60072c6ac4bb39da9201634f7b6e301634f7efa1 | JavaScript | ronaldram/area51meanone | /public/js/services/pokemonService.js | UTF-8 | 2,468 | 2.609375 | 3 | [] | no_license | angular.module('pokeApp.pokemonService',[])
.service('pokemonService', function($http,$q){
var _pokemons = [];
var _pokemon = {};
this.getPokemons = function(){
return _pokemons;
};
this.setPokemons = function(pokemons){
_pokemons = pokemons;
};
this.getPokemonsService = fun... | true |
dc754d8e17970e7f984906d26b066cf8e9326ae0 | JavaScript | DevOm4rHl10/calculator | /calculator.js | UTF-8 | 182 | 3.21875 | 3 | [] | no_license | function getFormula() {
let formula = document.getElementById("formula").value
let answer = eval(formula)
console.log(answer);
document.getElementById("result").value = answer;
} | true |
5bf17ae58d78a1eaeceaf54277e8ce3f23c3e4d7 | JavaScript | ilyris/LFGamer | /src/helperFuncs/cookie.js | UTF-8 | 535 | 2.546875 | 3 | [] | no_license | // const cookieValue = document.cookie ? document.cookie.split(';').find(row => row.startsWith('token=')).split('=')[1] : '';
// function clearOutputCookieValue() {
// let output = document.cookie;
// output = "token= ; expires = Thu, 01 Jan 1970 00:00:00 GMT"
// }
const decodeJWT = (jwt) => {
if(!jwt) retu... | true |
97a172fa51789476e755dbec54f15f1faf9209e3 | JavaScript | LukaszMiskowiak/colorgame | /app/containers/GameContainer.js | UTF-8 | 2,146 | 2.71875 | 3 | [] | no_license | var React = require('react'),
Game = require('../components/Game');
require('../styles/colors.css');
require('../styles/game.css');
var colors = ['black', 'white', 'blue', 'red', 'yellow', 'green', 'orange', 'purple'];
colors2 = colors
seconds = 3;
const
shuffle = (a) => {
for (let i... | true |
ed2a81238eb7e9f7c7e810331c9b17bd36bcf8a1 | JavaScript | johnynsk/sibsutis-labs | /avmo/test.js | UTF-8 | 4,919 | 2.75 | 3 | [] | no_license | 'use strict';
let lab1 = require('./lab1')
let lab2 = require('./lab2')
let lab3 = require('./lab3')
let simplex = require('./simplex')
let expect = require('chai').expect
let color = require("cli-color");
let coeff = [
[-6, -5, -1, 9, -10],
[-11, 1, 4, 6, -11],
[-7, 7, 9, 9, 4],
[-6, -1, -10, 14, -6]... | true |
36b23866b98aa58ae45f86e272bfca1afbf27ab2 | JavaScript | Zelenska-Inna/1135527-kekstagram-18 | /js/form.js | UTF-8 | 7,714 | 2.765625 | 3 | [] | no_license | 'use strict';
(function () {
var VARIABLE = 25;
var MAX_POINT = 75;
var MAX_RATE = 100;
var FILTER_BLUR = 3;
var FilterBrightness = {
MIN: 1,
MAX: 3,
};
var FILTERS = {
'none':'effects__preview--none',
'chrome': 'effects__preview--chrome',
'sepia': 'effects__preview--sepia',
'marvin': 'effects__pre... | true |
376d348f83903cec6f112deec08a2ca51d46bdaa | JavaScript | mircobabini/jaeenvie | /things/pacmanjs/core.js | UTF-8 | 18,035 | 2.65625 | 3 | [] | no_license | /**
*
* @author Kris Cieslak
* @version v1.0 (beta)
* @license (Creative Commons) http://creativecommons.org/licenses/by-nc-sa/3.0/
*
* //digitalinsane.com
*/
var YD=YAHOO.util.Dom;
var YE=YAHOO.util.Event;
var YA=YAHOO.util.Anim;
var $ = function (el) { return YD.get(el);}
var pos = function (id,x,y) { YD.setS... | true |
c9703382970f950e434e809cb03b13d5ad7692a5 | JavaScript | abdelmonem88/easy_shop_e_commerce | /assets/js/generalVars.js | UTF-8 | 1,465 | 2.75 | 3 | [] | no_license | //preloader
const prelouder = () => {
const prolouderWrapper = document.querySelector(".prolouder-wrapper");
setTimeout(() => {
prolouderWrapper.classList.add("hide");
}, 1000);
};
//get data from localStorage
const getLocalStorage = (item) => {
let storageItem = localStorage.getItem(item);
if (storageItem) {
... | true |
2d99e80729d5f34111f323741d4352d07ecc5b79 | JavaScript | tokasson/1x1 | /routers/main.js | UTF-8 | 1,783 | 2.734375 | 3 | [
"MIT"
] | permissive | const chalk = require('chalk');
const express = require('express');
const router = express.Router();
const getRandomNumber = (maxInt) => Math.floor(Math.random() * maxInt) + 1;
router.get('/', (req, res) => {
const currentSolutions = req.session.currentSolutions || [];
const randomNumber1 = getRandomNumber(10... | true |
49ac952f189decf6bd436f37e86ae06e72933709 | JavaScript | jimdvu/Ennovar-Training | /Weather/src/components/google_map.js | UTF-8 | 591 | 2.609375 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react'
class GoogleMap extends Component {
componentDidMount(){
//this is how we create an embedded google map inside our document
//takes HTML reference and finds element and renders it
new google.maps.Map(this.refs.map, {
zoom:12,
center: {
... | true |
8dff31c59a7cb31d840190388c074af24b5fb2f4 | JavaScript | iftodimihail/Javascript_algorithms | /palindrome.js | UTF-8 | 405 | 3.71875 | 4 | [] | no_license | function palindrome(str) {
var lowerStr=str.toLowerCase();
var strippedStr=lowerStr.replace(/[^A-Za-z0-9]/g, ''); //gets rid of any non-aplhanumerical characters
var reversedStr="";
var strArray = strippedStr.split("");
strArray.reverse();
reversedStr = strArray.join("");
if(strippedStr===reversedStr)
... | true |
4a409705a1016154ad0c982bfc98c7821415a0f4 | JavaScript | matthew5025/SGCS-Discord-Bot | /utils/reaction.js | UTF-8 | 1,807 | 2.59375 | 3 | [
"MIT"
] | permissive | module.exports = {
LoadSelfAssignRoleEmbed: function (client) {
// Load role changer embed if needed
client.on('ready', () => {
const embed = {
title: 'Self-assign your role here',
fields: [
{
name: '🟣 University',
value: '\u200b',
inline: true
},
{
name: '🟠 Poly... | true |
db91a3f906f2ec5da7a44b3809ebead89bf23349 | JavaScript | Amul745/error2 | /js/cannonball.js | UTF-8 | 498 | 2.96875 | 3 | [
"MIT"
] | permissive | class CannonBall{
constructor(x,y){
this.x=x;
this.y=y;
this.radius=40;
var options ={
isStatic=true,
restitution=1.0,
friction=1.0,
density=1.0
}
this.body = Bodies.circle(x, y,this.radius,options);
this.image=loadImage("./assets/cannonball.png")
World.add(world,this.body)
}
show(){
var pos =... | true |
d127ebb2f21602188b93092e0257c550145c56ca | JavaScript | tinapatidar/dexbytes | /reactjs/src/Component/HoverCounterTwo.js | UTF-8 | 569 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react'
class HoverCounterTwo extends Component {
constructor(props) {
super(props)
this.state = {
count:0
}
}
incrementCount = () => {
this.setState(prevState =>{
return{count:prevState.count+1}
})
... | true |
d3c3a27a4b5dc4bcd884169f0fc3f3e9ff65f5b2 | JavaScript | DavidRisch/kicker | /src/account_util.js | UTF-8 | 2,070 | 2.65625 | 3 | [] | no_license | const NotLoggedInException = class extends Error {}
function hashPassword (password, salt) {
const hash = require('js-sha256').create()
hash.update(salt + password)
return hash.hex()
}
function generateRandomString (length) {
const charset = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
l... | true |
082ff2897e6d71d6ccd7edc20de3365714265b81 | JavaScript | Vijay375-a/React_Training | /Toshiba-React-main -Day4/my-app/src/index-unidirectinaldataflow.js | UTF-8 | 585 | 2.75 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
const User = props => {
return <UserDetails id={props.id} name={props.name} city={props.city} />
}
const UserDetails = props => {
//props are read only : props are only for display not for mutation(changing)
// props.name = "foo";
return <div... | true |
ebf9b3918d2a2f84657fc17e4ccb8dd515ef5925 | JavaScript | Gensun/React_demo | /todolist/src/TodoItem.js | UTF-8 | 907 | 2.625 | 3 | [] | no_license | import React, { Component } from "react";
import PropTypes from "prop-types";
export default class TodoItem extends Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
render() {
const { content, test1 } = this.props;
// return <div onClick={this.hand... | true |
d7a50b2addbe0ac35b1f0cfc49ed42621c809676 | JavaScript | HaseebAHMED-afk/Reddit-Room-demo | /src/components/Reddit.jsx | UTF-8 | 779 | 2.609375 | 3 | [] | no_license | import React, { useState,useEffect } from "react";
import axios from 'axios';
function Reddit() {
const [posts, setPosts] = useState([]);
useEffect(()=>{
axios.get(`https://www.reddit.com/r/reactjs.json`)
.then(res=>{
const newPosts = res.data.data.children
.map(obj=>obj.data);
... | true |
5e522314feb66de2c3a6d58f002cfd22a9d9db17 | JavaScript | fahimc/CanvasRenderer | /app/lib/canvas/Canvas.js | UTF-8 | 2,560 | 3.296875 | 3 | [] | no_license | /**
* @constructor
*/
var Canvas = function() {
this.element = null;
this.children = [];
this.uid = null;
};
(function() {
/** @scope Canvas */
var _ = Canvas.prototype;
/**
build the Canvas
@public
@alias Canvas.build
@memberOf Canvas
*/
_.build = function() {
this.uid = CanvasRenderer.uid++;
t... | true |
590d8abb44f323c594cb78d57ed2845f53a07a83 | JavaScript | rocsea0626/nodejs-wage-calculator | /src/utils.js | UTF-8 | 797 | 2.84375 | 3 | [] | no_license | const csv = require('csvtojson')
exports.readCsv = function (filePath) {
const p = new Promise((res, rej) => {
const jsonObjs = []
csv().fromFile(filePath)
.on('json', function (jsonObj) {
jsonObjs.push(jsonObj)
})
.on('done', function (err) {
... | true |
24c37d7ff084bf8051888d22073df881071d4c0f | JavaScript | rooheengarg/DSAlgorithms | /checkSquarerootofnumber.js | UTF-8 | 473 | 3.375 | 3 | [] | no_license | /**
* @param {number} num
* @return {boolean}
*/
var isPerfectSquare = function(num) {
for (var i = 1; i * i <= num; i++) {
if ((num % i == 0) && (num / i == i)) {
return true;
}
}
return false;
}; //58ms
//30ms
/**
* @param {number} num
* @return {boolean}
*/
var... | true |
a0800f279b2f1095e0fac5deaf1f38a4644e4e74 | JavaScript | SkySpiral7/GoldenSon | /compile.js | UTF-8 | 2,884 | 2.75 | 3 | [] | no_license | 'use strict';
const fs = require('fs');
function rethrow(err) {if (err) throw err;}
function main()
{
//rm -rf generated/ &> /dev/null
fs.rmdirSync('generated/', {recursive: true});
fs.mkdirSync('generated/');
fs.access('node_modules/', (err) =>
{
if (err)
{
const execSync = requ... | true |
a57e55e09c825c1c7e11ffae36ee042b43b69fb0 | JavaScript | zenvercoder/gSpace-1 | /public/scripts/meetups.js | UTF-8 | 6,797 | 3.140625 | 3 | [] | no_license | var map;
function initMap() {
// Constructor creates a new map - only center and zoom are required.
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 18.7576313, lng: -95.0092089},
zoom: 4,
mapTypeControl: false
});
var zoomAutocomplete = new google.maps... | true |
6544cdad3208a61b6f2564f23ed08342214c6580 | JavaScript | nitundatta8/adventure-book-react | /src/actions/Login.js | UTF-8 | 1,335 | 2.578125 | 3 | [
"MIT"
] | permissive | import * as c from './ActionsType';
export const requestLogin = () => ({
type: c.REQUEST_LOGIN
});
export const getLoginSuccess = (user) => ({
type: c.GET_LOGIN_SUCCESS,
userInfo: user
});
export const getLoginFailure = (error) => ({
type: c.GET_LOGIN_FAILURE,
error
});
export const login = (usename, pass... | true |
5e7c163d7cb8ba91ef26a7a944b74b4e8b462ab2 | JavaScript | fritzgt/HTTP-AJAX | /friends/src/components/NewFriend.js | UTF-8 | 2,183 | 2.8125 | 3 | [] | no_license | import React from "react";
class NewFriend extends React.Component {
constructor() {
super();
this.state = {
name: "",
age: "",
email: ""
};
}
//change handler
handleChange = event => {
// console.log("event name", event.target.name);
// console.log("event value", event.t... | true |
e231fb6c519f85c14a3fc61f26971f26842ce693 | JavaScript | farzamtn/ShakingSalt | /src/services/LocalStorageService.js | UTF-8 | 9,750 | 2.953125 | 3 | [] | no_license | import { AsyncStorage } from 'react-native';
const REC_SEARCHED_STORAGE_KEY = 'REC_SEARCHED_ITEMS_STORAGE';
const SEARCH_RESULTS_STORAGE_KEY = 'SEARCH_RESULTS';
const LOG_ITEMS_STORAGE_KEY = 'LOG_ITEMS_STORAGE';
// Function for reading the recently searched items from local storage (reading)
export const retrieveRece... | true |
3c9f1df1b2ef14d19b1650591f7aafe3f6e01e9f | JavaScript | Code-Institute-Submissions/DjangoShoppingList | /static/js/calc_total_price.js | UTF-8 | 1,412 | 3.578125 | 4 | [] | no_license | let price = document.getElementById('id_unit_price');
console.log("The Price is: ", price);
price.addEventListener('change', function(event) {
let newPrice = parseFloat(price.value);
console.log("The New Price is: ", newPrice);
let qty = document.getElementById('id_quantity');
console.log("The Quantity... | true |
d295b7fc5da97af364712a731cbb936dc9975f12 | JavaScript | Moult/playground | /finger/default.js | UTF-8 | 3,902 | 3.0625 | 3 | [] | no_license | window.addEventListener("load", Main, false);
var ctx;
var WIDTH;
var HEIGHT;
var rFilt, gFilt, bFilt;
var table, rVal, gVal, bVal, aVal, xVal, yVal;
var rNew, gNew, bNew;
var imgData;
var colorOffset = {red: 0, green: 1, blue: 2, alpha: 3};
function loadImage () {
WIDTH = myCanvas.width;
HEIGHT = myCanvas.hei... | true |
c0c0d6fd882ef15739ea3c04800858b5d75ae2ee | JavaScript | khurtado801/chuck_norris | /src/components/jokes/jokesList/JokeList.js | UTF-8 | 1,303 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import { connect } from 'react-redux';
import { viewedJokes } from '../../../redux/viewedJokes';
import '../../../styles/jokes.css';
// #Start of JokeList component
class JokeList extends Component {
// #Call render method
render() {
let { icon_url, value } = this.props.jo... | true |
0efd89af8619f84cee7ef1fc98579a91e807a6f0 | JavaScript | atheist1/sundries | /面试题一些/this进阶/softBind.js | UTF-8 | 869 | 3.1875 | 3 | [] | no_license | if (!Function.prototype.softBind) {
Function.prototype.softBind = function(obj) {
// this是当前的fn
let args = Array.prototype.slice.call(arguments, 1)
let fn = this
var bound = function() {
return fn.apply(
(!this ||
(typeof window !== 'undefined' && this === window) ||
... | true |
bc59d7fa4119667fd990063d052cdb18c52ef0bf | JavaScript | RYS2016/CodeFights | /longestWord.js | UTF-8 | 851 | 4.1875 | 4 | [] | no_license | function longestWord(text) {
// Let's create function to check if a character is a letter
function isLetter(char){
return ("a" <= char && char <= "z") || ("A" <= char && char <= "Z")
}
//find all the words in text
let words = [];
let word = "";
for (let i = 0; i < te... | true |
7fa47bc25497d26ce1933a55d2deacaf23a1387f | JavaScript | shp54/blog-spa | /app/assets/javascripts/articles/main-view.js | UTF-8 | 1,118 | 2.515625 | 3 | [] | no_license | //= require articles/data
//= require articles/form-view
//= require articles/display-view
//= require articles/model-view
let ArticlesView = Backbone.View.extend({
el: "#articles",
events: {
"click #new-article": "newArticle"
},
initialize(opts){
this.render()
this.listenTo(this.collection, "change", this.... | true |
4c6ae0abbc70867ee97e8bd69b076acf535b7294 | JavaScript | smcotugno/super-activities | /client/app/spike/04-stack-test/stack-test.spec.js | UTF-8 | 398 | 2.59375 | 3 | [] | no_license | import {describe, expect, it} from '../test-helper';
function makeStack() {
function isEmpty() {
return true;
}
return {
isEmpty: isEmpty
};
}
describe('stack test', () => {
it('prove the test infrastructure works', () => {
expect(true).to.equal(true);
});
it('empty stack', () => {
le... | true |
719a425cb4e9e3b1f5b433ce6f1addef57a231cf | JavaScript | GilangR18/js-basics | /count-the-gap.js | UTF-8 | 1,611 | 4.65625 | 5 | [] | no_license | // Write a function that could receive a number as parameter.The function should convert the parameter to binary number.Then, find the highest gap(zeros that between number 1) in one binary number.Return the highest gap of the binary number.
// Example 1:
// Input: 9
// Output: 2
// Why ?
// The binary number of 9 ... | true |
5fb05a72795390ce8bcf6118680a61d26dc0a27a | JavaScript | sshahu2/mixerrors | /mixerrors/New folder (3)/FullStack-Application-master-93c54fd7ca581a7559f51e8d97289bcc402822fb/src/assets/stockGraphs/d3RevChart.js | UTF-8 | 14,393 | 2.953125 | 3 | [] | no_license | var formatAsPercentage = d3.format("%"),
formatAsPercentage1Dec = d3.format(".1%"),
formatAsInteger = d3.format(","),
fsec = d3.time.format("%S s"),
fmin = d3.time.format("%M m"),
fhou = d3.time.format("%H h"),
fwee = d3.time.format("%a"),
fdat = d3.time.format("%d d"),
fmon = d3.time.format("%b");
var... | true |
cf3800cb99e2782cd1a1ad18d0e45d4bf76cce76 | JavaScript | radtket/soundcloud-redux-hooks | /src/store/player/audio-service.js | UTF-8 | 1,841 | 3 | 3 | [] | no_license | // Actions
import {
audioEnded,
audioPaused,
audioPlaying,
audioRepeatChanged,
audioTimeUpdated,
audioVolumeChanged,
} from "./actions";
let audioElement;
const getTimes = ({ buffered, currentTime, duration }) => {
const bufferedTime = buffered.length ? buffered.end(0) : 0;
return {
bufferedTime,... | true |
688be49f2b425a472f8ab7212a8a95a79b8aecb6 | JavaScript | namanattri/ts-promise | /index.js | UTF-8 | 1,445 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive | let MyPromise = require('./lib/MyPromise').default;
console.log("promise 1");
let promise1 = new MyPromise((resolve, reject) => {
setTimeout(() => resolve('hello'), 5 * 1000);
});
promise1.then(value => {
console.log("promise resolved with value: "+ value);
});
promise1.then(value => {
console.log("promise res... | true |
0b65eb24432aee5fbe88696bd88d81a0e6589fe4 | JavaScript | ecodistrict/DesignModule | /WebClient/bower_components/d3-collection/test/entries-test.js | UTF-8 | 1,062 | 3 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | var tape = require("tape"),
d3 = Object.assign({}, require("d3-array"), require("../"));
require("./isNaN");
tape("entries(object) enumerates every entry", function(test) {
test.deepEqual(d3.entries({a: 1, b: 2}).sort(ascendingKey), [{key: "a", value: 1}, {key: "b", value: 2}]);
test.end();
});
tape("entries... | true |
22ad32565f55d305005884122324b6139beb5300 | JavaScript | chrisSowerby/mofo | /mixitup/js/startMix-homePage.js | UTF-8 | 5,789 | 2.640625 | 3 | [] | no_license | $(function(){
$activeOrder = 0;
// how to move nodes to other parts of the node tree.
// this is the final submit btn. it needs to come out at the bottom not the top.
$('#Container').append($('.outputPostOptions'));
//////////////////////////////////////////////////////////
$('#reset-back').click(rese... | true |
5453fb982b2a0de0486bbbd4bb7f2d607bf8140c | JavaScript | Hangover0/RUIFENG | /项目/美食节/js/health.js | UTF-8 | 695 | 2.546875 | 3 | [] | no_license | (function () {
var oContainer = getEl(".pagebox");
GET({
url:"./JSON/health.json",
success: function (response) {
for(var i = 0, len = response.length; i < len; i++){
oContainer.innerHTML +=`
<div class="item">
<div class="itemimg">
... | true |
52bf4101d843ca9bc24e6ba757ae48dbc91adf44 | JavaScript | ifjso/microdust-web | /src/utils/helper/color-helper.js | UTF-8 | 1,638 | 2.84375 | 3 | [] | no_license | export const getColor = value => {
let num = 255;
const numVal = Number(value);
if (numVal >= 0 && numVal < 20) {
num = 255;
} else if (numVal >= 20 && numVal < 30) {
num = 237;
} else if (numVal >= 30 && numVal < 40) {
num = 232;
} else if (numVal >= 40 && numVal < 50) {
num = 209;
} els... | true |
2b5e4c912e0185ab54c9edb8a4133f22123586c5 | JavaScript | Jmarc725/JeanmarcLemaire_7_04052021 | /js/ustensils.js | UTF-8 | 3,770 | 3.40625 | 3 | [] | no_license | // Ustensils
function retrieveAllUstensilsFromRecipes(recipes) {
for (let i = 0; i < recipes.length; i++) {
for (let y = 0; y < recipes[i].ustensils.length; y++) {
const ustensilName = recipes[i].ustensils[y][0].toUpperCase() + recipes[i].ustensils[y].substr(1)
// Ici je cherch... | true |
361f685f6b41357c2bf41449ed7f8e820ec719ce | JavaScript | iljoong/azure-azbox | /public/javascripts/upload.js | UTF-8 | 5,527 | 2.8125 | 3 | [
"MIT"
] | permissive | /*
* upload.js: modified from original MSFT sample
*/
function showStatus(ajaxRequest, blobSasUri) {
if (ajaxRequest.readyState == 4) {
// xmlhttp.status==200 == successful request
//var $image = $('<img src="' + blobSasUri + '" alt="" />');
//$("#uploadedImage").prepend($image);
... | true |
1437dce4ec304be9ccb701453df932892f843e08 | JavaScript | fidelmak/codewars-hackerrank-freecodecamp-leetcode-solutions | /lengthOfLongestSubstring.js | UTF-8 | 770 | 4.5 | 4 | [] | no_license | // Given a string, find the length of the longest substring without repeating characters.
// Given "abcabcbb", the answer is "abc", which the length is 3.
// Given "bbbbb", the answer is "b", with the length of 1.
// Given "pwwkew", the answer is "wke", with the length of 3. Note that the answer must be a substring, "p... | true |
ed418f2136785149902987889d3bf049a9a79735 | JavaScript | Brein-369/breintertainme | /server/services/movies/controllers/controller.js | UTF-8 | 2,144 | 2.625 | 3 | [] | no_license | const Movies = require('../models/movies')
class MovieController {
static getAll(req, res, next) {
Movies.find()
.then(data => {
res.status(200).json(data)
})
.catch(err => {
console.log(err);
})
}
static getOne(req, r... | true |
7f51065b109499bd0021345128999019ef3b81ec | JavaScript | SvenjaHolzinger/SoftwarePraktikum | /frontend reportClient/frontend/src/api/API.js | UTF-8 | 4,498 | 2.6875 | 3 | [] | no_license | import StatistikBO from "./StatistikBO";
import StatistikHaendlerBO from "./StatistikHaendlerBO"
import StatistikHuZBO from "./StatistikHuZBO"
import StatistikZeitraumBO from "./StatistikZeitraumBO"
export default class API {
static #api = null;
//diese Klassenmethode realisiert die Umsetztung als Singelton,... | true |
dd5b5de0db599df503f0c4d11438be9e7d8d0dcb | JavaScript | jaguarj/Trivia-Game | /js/secCopy.js | UTF-8 | 4,627 | 2.828125 | 3 | [] | no_license | window.onload = function() {
console.log("We're all good here!");
}
// createGame();
document.getElementById("newPlayer").addEventListener('click', newPlayer);// Function starts game.
$('#resetButton').click(function() {
location.reload();
});
///////////////////////////////////////////////////////////////////
functi... | true |
897c575fb4366602b03ac3c2e4d868b1e79cef69 | JavaScript | wingzero0/query_expansion | /userStudy/submit.js | UTF-8 | 1,285 | 2.78125 | 3 | [] | no_license | function rate(form, formId){
var element = document.getElementById(formId); // the whole div block
//console.log(element);
var postValue = {};
var i;
postValue["nonRelevant"] = 0;
postValue["neutral"] = 0;
postValue["Relevant"] = 0;
for (i = 0;i<form.elements.length;i++){
//console.log(form.elements[i].name... | true |
cd07c9caee31f608e577545a5de57a3b65226f80 | JavaScript | arcoyk/basic_webrtc | /index.js | UTF-8 | 2,175 | 2.796875 | 3 | [] | no_license | 'use strict';
var os = require('os');
var nodeStatic = require('node-static');
var https = require('https');
var socketIO = require('socket.io');
var fs = require('fs');
var ssl_server_key = 'server_key.pem';
var ssl_server_crt = 'server_crt.pem';
var port = 8082;
var options = {
key: fs.readFileSync(ssl_server_key),
... | true |
d8f3cf3c391f233d5c2ee648db0f01680014b298 | JavaScript | giobauermeister/rpi-gpio-nodejs-examples | /ledcontrol_simple.js | UTF-8 | 544 | 2.953125 | 3 | [] | no_license | var rpio = require('rpio');
BTN = 32
LED = 29
rpio.open(BTN, rpio.INPUT, rpio.PULL_UP);
rpio.open(LED, rpio.OUTPUT, rpio.LOW);
var btnState = 0;
var ledState = 1;
var btnLock = 0;
setInterval(function() {
btnState = rpio.read(BTN)
if(btnState == 0 && btnLock == 0) {
ledState = !ledState;
le... | true |
3deffa4ed85b644557946f5aabaaa72694b4c29b | JavaScript | kwayzi/think-mind-map-web-app | /think_web_app/static/js/ajs/utils/canvas.js | UTF-8 | 1,138 | 3.328125 | 3 | [
"MIT"
] | permissive | /**
* @fileoverview A collection of utility functions for the Canvas element.
*/
goog.provide('ajs.utils.canvas');
/**
* Computes the pixel length of the text with the given context.
*
* @param {CanvasRenderingContext2D} context the canvas context.
* @param {string} text the text to measure.
* @param {s... | true |
1d0521f140cef4efe7b7dfd742ce73f4da21b840 | JavaScript | amejiarosario/dsa.js-data-structures-algorithms-javascript | /lab/exercises/10-mixed/integer-to-words.js | UTF-8 | 1,671 | 3.453125 | 3 | [
"MIT"
] | permissive | // nodemon lab/exercises/10-mixed/integer-to-words.spec-assert.js
// npx jest lab/exercises/10-mixed/integer-to-words.spec.js --watch
const UPTO20 = ["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eig... | true |
9e4b82f8d01da2c8e12f7fd19fc2e9300e12bd41 | JavaScript | coorhair/keen-core.js | /lib/utils/base64.js | UTF-8 | 2,017 | 2.640625 | 3 | [
"MIT"
] | permissive | module.exports = {
map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
encode: function (n) {
"use strict";
var o = "", i = 0, m = this.map, i1, i2, i3, e1, e2, e3, e4;
n = this.utf8.encode(n);
while (i < n.length) {
i1 = n.charCodeAt(i++); i2 = n.charCodeAt(i++); i3 = n.... | true |
32392fc40a10424e42a6cc44d9785778563dfd07 | JavaScript | future4code/Pedro-Vitor | /semana3/blackjack/nossoJogo.js | UTF-8 | 1,413 | 4.15625 | 4 | [] | no_license | /**
* EXEMPLO DE UTILIZAÇÃO DA 'comprarCarta'
*
*
const carta = comprarCarta(); // Sorteia uma carta. Por exemplo, o rei de ouros
console.log(carta.texto) // imprime o texto da carta. Exemplo: "K♦️" (indica "K" de ouros)
console.log(carta.valor) // imprime o valor da carta (um número). Exemplo: 10 (dado que "K" ... | true |
9289c9bfc9464d54aea936c9156205b929ebff09 | JavaScript | andydlindsay/apr26-2021 | /w01d03/02_data-structures.js | UTF-8 | 911 | 3.875 | 4 | [] | no_license | // const student = 'Alice';
const cohort = 'APR26';
const avgGrade = 90;
const studentOne = ['Alice', 'APR26', 90];
// console.log(studentOne[300]);
// const student = 'Bob';
const student = {
names: ['Alice', 'Tom'],
cohort: 'APR26',
avgGrade: 90,
friend: {
name: 'Dean',
scores: [10, 15, 7]
},
m... | true |
79758c1544f24d7efc614d570567a9a3bc27655e | JavaScript | imonmahamud/TG | /test.js | UTF-8 | 1,417 | 4.59375 | 5 | [] | no_license | //array traverse and sum the array value by recursive function in javascript
var arr=[1,2,3,4,5,6,7,8]
function arrayTraverseSum(arr,lastIndex){
if(lastIndex<0){
return 0
}
return arr[lastIndex]+arrayTraverseSum(arr,lastIndex-1)
}
console.log(arrayTraverseSum(arr,arr.length-1))
//this is for array t... | true |
5ba8a0f3a936b55f976338a7fd3508f4bbdf64b8 | JavaScript | DhRiTiD/Supply-Mission-2 | /sketch.js | UTF-8 | 3,129 | 3.40625 | 3 | [] | no_license | //Name Spaces
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
//Variables
var helicopterIMG, helicopterSprite, packageSprite, packageIMG;
var packageBody,ground;
var box1sprite, box1body, box2sprite, box2body, box3sprite, box3body;
function preload()
{... | true |
69ed271a44cd3755efbd9d0d38e1b76b5cea76da | JavaScript | belindalei/jsdom-task-lister-lite-nyc-web-080519 | /src/index.js | UTF-8 | 703 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | document.addEventListener("DOMContentLoaded", () => {
const newForm = document.querySelector("#create-task-form");
const textBox = document.querySelector("#new-task-description");
const tasks = document.querySelector("#tasks");
newForm.addEventListener("submit", e => {
e.preventDefault();
const input = ... | true |
61f2f0d5a9d80ffe38e89d36a7111a65d6c6abc4 | JavaScript | coopacqorilazo/pagina-web-qorilazo | /public/js/main.js | UTF-8 | 5,617 | 2.53125 | 3 | [
"MIT"
] | permissive | const btnDepartamentos = document.getElementById('btn-departamentos'),
btnCerrarMenu = document.getElementById('btn-menu-cerrar'),
subMenu = document.getElementById('subMenu'),
enlaceNav = document.getElementById("enlacesNav"),
link = document.getElementById('linkMenu'),
btnLinks = document.getElementById('btnLink... | true |
183c4ee80fbe640568ecc4b45f7146ae7e5f6e3b | JavaScript | lauMv/micro-User | /src/app/services/userService.js | UTF-8 | 1,681 | 2.546875 | 3 | [] | no_license | const { User } = require("../models/user");
const UserService = {
createUser: async (request, response) => {
try {
const user = request.body;
let resultado = "";
await User.count({
where: { name: user.name }
}).then(async count => {
if (count != 0) {
resultado = aw... | true |
a4e59109c085f41275dbd8d95f09951813758965 | JavaScript | yassaminakouadrihabbaze/frontend-pfe | /src/Components/AddProduct.js | UTF-8 | 2,255 | 2.515625 | 3 | [] | no_license | import React, { Component, useEffect,useState } from 'react';
import CategoryService from './../services/category';
import ProductService from './../services/products';
import styled from'styled-components'
function AddProduct() {
const [Name, setName] = useState("");
const [categories, setCategorieList] = us... | true |
f64e222985b6d47c008a841fc85c4dc1e2c26c81 | JavaScript | vatt2001/trainer | /src/main/public/js/controllers.js | UTF-8 | 7,491 | 2.671875 | 3 | [] | no_license | 'use strict';
/**
* This controller manages home page
*/
trainerApp.controller('HomeController', ['$scope', '$location', 'Server', 'notify',
function($scope, $location, Server, notify) {
$scope.isWorking = true;
$scope.stats = null;
Server.getTrainingStats().then(
function(r... | true |
4cd0671f2493b7d7cdb1931a1ce243b07315b4f7 | JavaScript | braccitelli/magic-backend | /util.js | UTF-8 | 720 | 3.21875 | 3 | [] | no_license | "use strict"
const https = require("https")
/**
* Faz o download do html do endereço passado como parâmetro.
* OBS: O código assume que o endereço é HTTPS
* @param {*} endereco
*/
function downloadHTML(endereco)
{
var allData = ""
return new Promise(function(resolve, reject)
{
https.get(end... | true |