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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
82a41c0d66a8c6b2a84be3ca5a45a47a89a59178 | JavaScript | HeimdallGames/shotenSamurai | /js/basicConfiguration.js | UTF-8 | 831 | 2.9375 | 3 | [] | no_license | /*exported soundActivated musicActivated idiomaSelected updateSoundActivated updateIdiomaSelected updateMusicActivated */
var soundActivated;
var musicActivated;
var idiomaSelected;
function updateIdiomaSelected() {
let value = localStorage.getItem("idiomaSelected");
if (value == undefined) {
idiomaSele... | true |
96580f820b481d39447af729f301ecea46d60e8a | JavaScript | nylira/phaser-examples | /collision/process-callback/game.js | UTF-8 | 1,437 | 2.921875 | 3 | [] | no_license | // Generated by LiveScript 1.2.0
(function(){
'use strict';
var assets, sprite1, sprite2, gPreload, gCreate, gUpdate, gRender, collisionCallback, processCallback, g;
assets = '../../../phaser/examples/assets/';
gPreload = function(){
g.load.image('atari', assets + 'sprites/atari130xe.png');
g.load.image... | true |
e96f5d07a0ccea2e87bd7d60bfbcd84d282ead29 | JavaScript | RomanovaSophia/Snake | /Snake/www/js/game.js | UTF-8 | 3,247 | 3.421875 | 3 | [] | no_license | const canvas = document.getElementById("game");
const ctx = canvas.getContext("2d");
const ground = new Image();
ground.src = "img/ground.png";
let foodImgLast = new Image();
foodImgLast.src = "img/food.png";
let foodImg = new Image();
foodImg.src = "img/food.png";
let foodImg2 = new Image();
foodImg2.... | true |
24ceb69ff8829e965ee0ea94f4b3987cbcd0f427 | JavaScript | hanxuanliang/iarland | /app/models/art.js | UTF-8 | 956 | 2.828125 | 3 | [] | no_license | // 存放一些含有逻辑的 flow model 返回结果
const { Movie, Sentence, Music } = require('./classic')
class Art {
/**
* 通过 类目(type) id(对应类目的id) 来查询
*/
static async getData(art_id, type, useScope = true) {
let art = null
// 如果在scope中传入null,不会应用scope
const scope = useScope ? 'ex' : null
/**
* MOVIE:100,
... | true |
1507479054c939720851965926c4b8f54113bf97 | JavaScript | 123ryoma12/Bible-React-Native-App | /api_test.js | UTF-8 | 963 | 2.765625 | 3 | [] | no_license | const API_KEY = '50ac0857808920814bbef361f4fc5972bcd66017'
const API_URL = 'https://api.esv.org/v3/passage/text/?'
const request = require('request')
const queryString = require('query-string');
const fetch = require('node-fetch')
const getEsvText = async (passage) => {
const query = {
'q': passage,
... | true |
033d8206ce1c93402a1dd67c62a91d5e94be8a48 | JavaScript | devrawan/reactproject | /src/pages/HomePage/Data.js | UTF-8 | 2,736 | 2.625 | 3 | [] | no_license |
export const homeObjOne = {
primary: true,
lightBg: false,
lightTopLine: true,
lightText: true,
lightTextDesc: true,
topLine: 'Health Information',
headline: 'Take Care of Your Body',
description:
'Being physically healthy enables you to have better overall health, including in y... | true |
f1694d36f864671d722b2ce60a35b86d20944e8c | JavaScript | notkar1m/pie-chart | /static/index.js | UTF-8 | 945 | 3.078125 | 3 | [] | no_license | let lastNum = 0
function addInput(){
let newBr = document.createElement("br")
let newInp = document.createElement("input")
newInp.required = true
newInp.className = "form-control"
newInp.name = lastNum + 1
newInp.placeholder = "Title..."
let newInp2 = document.createElement("input")
... | true |
70d8d3133489f3cacc85a72d9f2aa8458d1d230c | JavaScript | vjpr/babel-plugin-parameter-decorator | /test/index.js | UTF-8 | 963 | 2.984375 | 3 | [] | no_license | import test from 'ava';
import Greeter from './lib';
test('Should the original function work correctly.', t => {
const greeter = new Greeter('Nice to meet you!');
const message = greeter.greet('Warner');
t.is(message, 'Hello Warner, Nice to meet you!');
});
test('Should throw required error when name not passe... | true |
91e7153d8d7933eb541bb836d25393075ee68f9c | JavaScript | Dihsl1986/JS | /Discover/OperadoresDeString/expressAndoperators.js | UTF-8 | 2,086 | 4.75 | 5 | [] | no_license | /* Expresssões e Operadores */
/*
- Expressions
- Operators
Binary
Unary
Ternary
*/
// Foi atribuido o valor 1 para a variável number
//let number = 1 // Expressão É qualquer linha de código que resolve alguma
//coisa no javascrip ex: let number
// ps Sempre use o ponto ... | true |
db1f8e5697e1055f730d4cc67ef7a364da3d0cb1 | JavaScript | seintelligence/Polymorph | /bower_components/alasql/partners/typescript/test.js | UTF-8 | 595 | 2.5625 | 3 | [
"MS-PL",
"MIT"
] | permissive | /// <reference path="alasql.d.ts" />
var alasql = require('../../dist/alasql.js');
var res;
// test 1
alasql('=2*3');
console.log(1);
// test 2
res = alasql('=2*3');
console.log(2, res);
// test 3
alasql.options.errorlog = true;
alasql('SELECT SELECT');
// test 4
console.log(alasql.error instanceof Error);
// test 5
al... | true |
f283770f9ac8490119c7037807e88e45e89c82e2 | JavaScript | gelilaa/document-and-pass | /exercises/1-reverse-string/index.js | UTF-8 | 471 | 3.9375 | 4 | [] | no_license | /**
* reverts a given string
* @param {string} toReverse - text to revert
* @returns {string} a reversed text
*
* @example
* const reverseString ='hello there';
* console.log (reverseString ()); // 'ereth olleh'
*/
const reverseString = (toReverse) => {
let reversed = '';
for (let i = toReverse.length... | true |
c712be123e7818295c8ddc9a204a0cbf39cfe8bd | JavaScript | TouhouFishClub/baibaibot | /ai/ff14/attr.js | UTF-8 | 3,145 | 2.546875 | 3 | [
"MIT"
] | permissive | function calAttr(content,qq,callback){
if(content.startsWith("直击")){
var left = content.substring(2).trim();
var num = parseInt(left);
var rate = Math.floor((num-380)/3300*55*10)/10;
var next = Math.ceil((rate+0.1)*100/100/55*3300+380);
var lastnum = Math.ceil((rate)*100/100/55*3300+380);
var ... | true |
b81651013947773eee8d8dd3a8d9e08e09e0859b | JavaScript | Monse0051/TalenLandReto-back-end | /newsWrapper.js | UTF-8 | 2,340 | 2.859375 | 3 | [] | no_license | const requestPromise = require('request-promise-native');
const firebase = require("firebase");
let firebaseConfig = {
apiKey: "AIzaSyCxz9r4GYfptGIo_-t-Xbr7pe2rJMx6I_8",
authDomain: "talentlandreto.firebaseapp.com",
databaseURL: "https://talentlandreto.firebaseio.com",
projectId: "talentlandreto",
... | true |
fd459f58a785e6aafa0b2e6af709d32057cfa708 | JavaScript | WylderG/week-4-game | /assets/javascript/game.js | UTF-8 | 7,339 | 3.75 | 4 | [] | no_license | function gameClass() {
this.min = 19; //> value is no lower than min
this.max = 121; //> value is less than (but not equal to) max
this.crystal_min = 1;
this.crystal_max = 13;
// Function returns the random numbers generated
this.getRandomNumber = function getRandomNumber... | true |
b3ae0f3aa37ca88d00d3bfdec32dd937c0b5e663 | JavaScript | marquiseJeanMarc/GestionPlus | /js/document.js | UTF-8 | 1,750 | 3.140625 | 3 | [] | no_license | document.getElementById('nom').addEventListener('change', function() {
var recupe=document.getElementById('nom').value;
console.log(recupe);
});
document.getElementById('prenom').addEventListener('change', function() {
var recupe=document.getElementById('prenom').value;
console.log(recupe);
});
//'keyu... | true |
bb0ffe96deb8b608979c1b141773fd89207899d6 | JavaScript | brave/ethereum-remote-client | /ui/app/hooks/useTimeout.js | UTF-8 | 938 | 2.703125 | 3 | [
"MIT",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import { useState, useEffect, useRef, useCallback } from 'react'
/**
* useTimeout
*
* @param {Function} cb - callback function inside setTimeout
* @param {number} delay - delay in ms
* @param {boolean} [immediate] - determines whether the timeout is invoked immediately
*
* @return {Function}
*/
export... | true |
f7c0607875a22ef0fa4521721707860cc10c6362 | JavaScript | cat-haines/ISS-Pebble-Example | /src/js/pebble-js-app.js | UTF-8 | 1,786 | 2.984375 | 3 | [
"MIT"
] | permissive | function httpWrapper(url, verb, callback) {
var xhr = new XMLHttpRequest();
xhr.onload = function () {
callback(this.responseText);
};
xhr.open(verb, url);
xhr.send();
}
function loop() {
navigator.geolocation.getCurrentPosition(function(position) {
var url = "http://api.open-notify.org/iss-pass.js... | true |
bf8627efb00c55b78bf70a5073a111650a619f8f | JavaScript | KhomenkoSerhii/NotFirstOne | /src/store/reducers/getUsersReducer.js | UTF-8 | 338 | 2.515625 | 3 | [] | no_license | import { GET_USERS } from "../constants";
const initStore = {
users: []
}
export default function reducer(store = initStore, action) {
switch (action.type) {
case GET_USERS:
return {
...store,
users: action.users
}
default:
re... | true |
b865df7a3f5dc77699dd820faf9f915ca29af853 | JavaScript | Bogdan-Mireanu/js-algorithms-practice | /087_findMaxLengthOfThreeWords.js | UTF-8 | 478 | 4.65625 | 5 | [] | no_license | /*
Write a function called "findMaxLengthOfThreeWords".
Given 3 words, "findMaxLengthOfThreeWords" returns the length of the longest word.
var output = findMaxLengthOfThreeWords('a', 'be', 'see');
console.log(output); // --> 3
*/
function findMaxLengthOfThreeWords(word1, word2, word3) {
// your code here
con... | true |
c9a86bd10aaecc74961820d0424763445ba1ef45 | JavaScript | danielherken/javascript-book | /Kapitel_3/Loesungen/3.6/Aufgabe_2/operatoren.js | UTF-8 | 99 | 2.625 | 3 | [] | no_license | const vorname = 'Daniel';
const nachname = 'Herken';
console.log(`Hallo ${vorname} ${nachname}`);
| true |
5f196666124f1dfe21ee8c267151bb1ef5f52b42 | JavaScript | psypersky/What-the-Fuck-is-Node.js | /students/axel/ExampleRandomWords/Read.js | UTF-8 | 469 | 3.015625 | 3 | [] | no_license | const Readable = require('stream').Readable;
const util = require('util');
const random = require('random-words');
function MyReadable() {
Readable.call(this);
}
util.inherits(MyReadable, Readable);
MyReadable.prototype._read = function () {
var foo = random();
if (Math.floor(Math.random() * 10 + 1) ===... | true |
c7c2d674fc670738ae7093f24ce48c3e041867a9 | JavaScript | skhanna1011/practice-programs | /wd-june/js/day-4-arrays-objects/word-frequency.js | UTF-8 | 642 | 3.28125 | 3 | [] | no_license | Array.prototype.count = function(n) {
var count = 0
this.forEach(function(num){
if(num == n){
count++;
}
});
return count;
};
Array.prototype.uniq = function() {
var result = [];
this.forEach(function(num){
if(result.find(function(n){ return n == num }) == undefined){
result.push(nu... | true |
b8dd4856ae4b7e31529079089bb469387411702a | JavaScript | PolaricServer/webapp | /XMLOverlay/kaXmlPoint.js | UTF-8 | 8,533 | 2.515625 | 3 | [] | no_license | /******************************************************************************
* kaXmlOverlay - XML server side generated overlay for kaMap.
*
* Based on code by
* Piergiorgio Navone
* Modifications/additions/removals by
* Øyvind Hanssen, LA7ECA
*
************************************************... | true |
931f8daaaafd0109f11e280d09548c3a1b5693a9 | JavaScript | xXHidekaneXx/xXBotkaneXx | /bot.js | UTF-8 | 512 | 2.828125 | 3 | [] | no_license | const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready',() => {
console.log('hi');
});
function coinToss() {
return (Math.floor(Math.random() * 2) === 0);
}
client.on('message', (message) => {
if(message.content.toLowerCase() == 'good morning' || message.content.toLowerCase... | true |
a7bebcdd7ff8742b62304753e96c51001990476e | JavaScript | diafortenberry/summerware-pre-release | /client/js/map.js | UTF-8 | 2,544 | 3.015625 | 3 | [] | no_license | var googleMap;
var googleMapMarkers = [];
var openInfoWindow;
function initialize() {
var mapOptions = {
center: {
lat: 29.9657894,
lng: -90.0993333
},
zoom: 11
};
googleMap = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
g... | true |
077b2611c14d6b5e7201db457e39da348f813ba3 | JavaScript | mark0802-prog/furima_29251 | /app/javascript/preview.js | UTF-8 | 1,987 | 2.96875 | 3 | [] | no_license | const preview = () => {
const itemPreview = document.getElementById("item-preview")
const itemImage = document.getElementById("item-image")
if (itemImage == null) {
return null
}
const createImageHTML = (blob) => {
const imageElement = document.createElement("div")
imageElement.setAttribute("id"... | true |
77fd8f17d71d6ec8e2dd1f92324535ab6c43a11a | JavaScript | rmeyners/ClassWork | /saturday.10.7/rpg.js | UTF-8 | 1,224 | 3.625 | 4 | [] | no_license | function character(name, profession, gender, age, strength, HitPoints, avoidance, IsAlive, Attack, LevelUp) {
this.name = name;
this.profession = profession;
this.gender = gender;
this.age = age;
this.strength = strength;
this.HitPoints = HitPoints;
this.avoidance = avoidance;
this.PrintStats = function... | true |
b69835f346526046fe23cd9f315b17f2ac0dbbfe | JavaScript | gruberchris/simple-todo | /src/App.js | UTF-8 | 1,548 | 2.75 | 3 | [] | no_license | import React from 'react';
import { Container, Row, Col } from 'react-bootstrap';
import NavBar from './components/NavBar';
import ToDoForm from './components/ToDoForm';
import ToDoList from './components/ToDoList';
export default class App extends React.Component {
constructor() {
super();
this.state = {
... | true |
ac8a75a5939b8f29c1a285148216875d63da0574 | JavaScript | ejohnsms/studieren | /src/code_from_Douglas_Crockford_videos/ajax_monad.js | UTF-8 | 627 | 3.40625 | 3 | [] | no_license | // ajax monad
// macroid
function MONAD() {
var prototype = Object.create(null);
function unit(value){
var monad = Object.create(prototype);
monad.bind = function(func,args){
return func.apply(undefined,
[value].concat(Array.prototype.slice.apply(args || [])));
};
return monad;
};
unit.lift = functi... | true |
58893dab1fc852731980e86631f6c1e51d1c543b | JavaScript | HannahConnolly/asciitowers | /src/Game.js | UTF-8 | 5,433 | 2.796875 | 3 | [] | no_license | import React from 'react';
import Container from 'react-bootstrap/Container';
import './App.css';
import Hand from './Hand';
import Turn from './Turn';
import Alert from './Alert';
import Instructions from './Instructions';
class Game extends React.Component {
state = {
board: [
[1, 2, 3, 4, 5],
[':... | true |
0ff495ef614774cac35be11fc2789b6fb675b8e3 | JavaScript | asdacap/agvc | /server/imports/machine/StateCalculator.js | UTF-8 | 8,230 | 2.890625 | 3 | [
"MIT"
] | permissive | import Machines from './Machines';
import Readings from '../reading/Readings';
import LocationLogs from '../location/LocationLogs';
import Map from '../location/Map';
import Point from 'point-at-length';
import moment from 'moment';
import { calculateEstimatedSpeed } from './SpeedCalculator';
// Calculate the last ti... | true |
8f065583d45850bf67f6db49e2bc3be220e10c17 | JavaScript | Nabildexter/ResumePortfolio | /Web-Dev Side Projects/Photo Panels (JS, CSS)/index.js | UTF-8 | 1,584 | 3.328125 | 3 | [] | no_license | const photos = document.querySelectorAll(".photoPanel");
console.log("There are " + photos.length + " photos.");
var currActive = "pic3";
var currActiveNum = 3;
var one = document.querySelector(".circles i:nth-child(1)");
var two = document.querySelector(".circles i:nth-child(2)");
var three = document.querySelecto... | true |
29a18e131f934154abce364cf66a746f0354abc3 | JavaScript | NDark/Ntust2013Unity_GitHub | /DEPENDENCY/2DGameplayTutorialProject/Assets/Scripts/2D/Camera/CameraFocus.js | UTF-8 | 3,088 | 3.0625 | 3 | [] | no_license | // Script that puts a window on-screen where the player can toggle who he controls
// It works by sending SetControllable messages to turn the different characters on and off.
// It also changes who the CameraScrolling scripts looks at.
// An internal reference to the attached CameraScrolling script
private var camera... | true |
9d49f0a4694d2e2d9be25c09f82c7975b8922bac | JavaScript | atomb0mb/covid19-tracker | /src/App.js | UTF-8 | 1,662 | 2.734375 | 3 | [
"MIT"
] | permissive | import React from 'react';
import styles from './App.module.css'; // styles.container to make sure there is no interferace from other css file
//Unique and cleanier way to import
import {Cards, Chart, CountryPicker, Footer } from './components';
// Similar to this
// import Cards from './components/Cards/Cards';
// im... | true |
c9b65d5bdf9626ba1c7453086f2cbf5f7cea1146 | JavaScript | faiz260/JS_CLASS | /CLASS-JS-16/app.js | UTF-8 | 1,012 | 3.109375 | 3 | [] | no_license | // Reading/Getting field values
function checkEmail(fieldId) {
var value = document.getElementById(fieldId).value;
if (value === "") {
alert("Email is required !!");
} else {
alert("Thank you for submitting your response!");
alert("Your response is: " + value);
}
}
// Setting field values
function... | true |
0b8cd2c1d0e60f55fb493ed8964500bfae586ea2 | JavaScript | Kevin-Velasquez/RedLight-webgl-game | /prog/geometries/animated/diamond.js | UTF-8 | 3,647 | 2.890625 | 3 | [] | no_license | /**
* A tilted cube that has a checkerboard texture applied to it. A subclass of
* TiltedCube.
*
* @author "Your Name Here"
* @this {diamond}
*/
class Diamond extends Geometry {
/**
* Constructor for Diamond
*
* @constructor
* @returns {diamond}
*/
constructor(size, centerX, centerY, centerZ, i... | true |
191c6496fba2d9fdde4ef9ee589f382122d6d126 | JavaScript | barryblando/burger-builder | /src/playground/react-hooks-part4/components/Todo.js | UTF-8 | 2,733 | 3.0625 | 3 | [] | no_license | /* eslint-disable no-console */
import React, { Fragment, useEffect, useReducer, useRef } from 'react';
// Using firestore as NoSQL database
import { db } from '../../../config/firebaseConfig';
const todo = () => {
// using internal reference for onChange handler
const todoInputEl = useRef();
// just like redu... | true |
ef797eea4bde52ed565604abb3b5221597e34b3f | JavaScript | girafffene/understandingDataStructureAndAlgorithms_JS | /stacks.js | UTF-8 | 2,638 | 5.15625 | 5 | [] | no_license | // Stacks
//BASIC USAGE OF STACKS WITH AN ARRAY////////////////////////////////////////////////////////////////////////////////////////////
// functions: push(to add), pop(to remove), peek(display top element), length(size - determines how many elements are in the stack)
var letter = [] //this is the stack
var word =... | true |
ced5f9045f9927fbe58859f7e494ae72a0ed9ad9 | JavaScript | doc22940/JSCodeRun | /src/constants/examples.js | UTF-8 | 1,342 | 2.859375 | 3 | [
"MIT"
] | permissive | import helloWorld from './code/hello-world';
import conditional from './code/conditional';
import forLoop from './code/for-loop';
import whileLoop from './code/while-loop';
import fibonacci from './code/fibonacci';
import binaryTreeDfs from './code/binary-tree-dfs';
import binaryTreeBfs from './code/binary-tree-bfs';
... | true |
637304621174033456555624ae95dc116f9f531e | JavaScript | dujunhui/du-Calendar | /js/du-Calendar-course.js | UTF-8 | 3,408 | 3.21875 | 3 | [] | no_license | /*
* 依赖jquery1-1.11.1.js
* 面向过程写法
*/
var year; //年
var month; //月
var date; //日
var weekNum; //1号是星期几
var m_days; //定义一个包含十二个月在内的月份总天数的数组:
var tr_str; //表格所需要行数
$table = $("#du_calendarBox").find("table");
$leftBtn = $("#du_calendarBox").find(".du_left");
$rightBtn = $("#du_calendarBox").find(".du_right"... | true |
f89889af5fe7fce7aae43eeba7456ef4de3d337b | JavaScript | Zhao-changyuan/Frontend-03-Template | /week19/publish-server/server.js | UTF-8 | 3,336 | 2.53125 | 3 | [] | no_license | // 服务端
let http = require('http');
let https = require('https');
let fs = require('fs');
let unzipper = require('unzipper');
let querystring = require('querystring');
/**
* 2. auth路由:接收code, 用code+client_id+client_secret换token
* @param {*} request
* @param {*} response
*/
function auth(request, response) {
l... | true |
7393fef0a922320abcfffbdac9ba4f308eb7dca8 | JavaScript | caleb42david/cxk1506-vxb4825-ams8560 | /NFA.js | UTF-8 | 7,587 | 3.109375 | 3 | [] | no_license | /**
* File: NFA.js
* Authors: Val Booth <vxb4825@rit.edu>, Caleb Kofahl <cxk1506@rit.edu>, Aaron Stadler <ams8560@rit.edu>
*/
// ---------- VARS -----------
var Turing = false;
// List of states
var Qstates = [];
var EPSILON_VAL = '\u03B5';
// Start State
var Qzero = null;
// Accept States
var FStates ... | true |
dbd53cbb60452036c017de90e9ab1c8cae71b20a | JavaScript | SagarPaul007/Countdown-Timer | /js/main.js | UTF-8 | 630 | 3.359375 | 3 | [
"MIT"
] | permissive | let timer = document.querySelector(".timer-text");
let thisYear = new Date().getFullYear();
console.log(thisYear);
const newYear = new Date(`January 1, ${thisYear + 1} 00:00:00`).getTime();
let x = setInterval(() => {
const now = new Date().getTime();
let diff = newYear - now;
let day = Math.floor(diff /... | true |
c361ef55ea0710700dbdd65b22bcb4fd4728a212 | JavaScript | kaschief/google-map-react-examples | /src/components/markers/CircleMarker.js | UTF-8 | 1,382 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
const K_WIDTH = 20;
const K_HEIGHT = 20;
const greatPlaceStyle = {
// initially any map object has left top corner at lat lng coordinates
// it's on you to set object origin to 0,0 coordinates
position: 'absolute',
width: K_WIDTH,
height: K_HEIGHT,
left: -K_WIDTH ... | true |
2ac52c5f8576dcbc1eacec64d20ef3d8199dd4d5 | JavaScript | Jaharim/TIL | /Algorithm/BOJ/Solve problems step by step/Step_07/boj_11720.js | UTF-8 | 369 | 2.921875 | 3 | [] | no_license | const readLine = require("readline");
const rl=readLine.createInterface({
input: process.stdin,
output:process.stdout
});
let input = [];
let arr = [];
rl.on("line", function(line) {
input.push(line);
}).on("close", function() {
arr = input[1].split("").map(el=>parseInt(el)).reduce((prev,curr)=>prev+curr... | true |
6aa4a9d9153f06decc2dada7e061371b69e304f5 | JavaScript | gitter-badger/integrator-match | /src/index.old.js | UTF-8 | 3,241 | 2.625 | 3 | [
"MIT"
] | permissive | import _ from 'lodash';
import VNode from 'virtual-dom/vnode/vnode';
import VText from 'virtual-dom/vnode/vtext';
import createElement from 'virtual-dom/create-element'; // decode - takes "model" returns an element
import toVdom from 'html-to-vdom';
import diffDOM from 'diff-dom';
import utils from './utils';
import r... | true |
19ce08b277fbc6a93fb577df65f79e9acb01f1a5 | JavaScript | BalajiJBcs/Node.Js.Beginner | /sourcecode/chart/app.js | UTF-8 | 1,037 | 2.609375 | 3 | [
"MIT"
] | permissive | const express = require('express');
const app = express();
const server = require('http').createServer(app);
const faker = require('faker');
const port = process.env.PORT || 80;
const User = require('./models/User');
require('./libs/db-connection');
app.set('view engine', 'ejs');
app.get('/', (req, res) => {
let gt... | true |
35645b4c514b784d5240db9184b0fe1f6661da8b | JavaScript | SamStenton/city-clicker | /src/unlock.js | UTF-8 | 827 | 2.828125 | 3 | [] | no_license | class Unlock {
constructor(name, config) {
this.name = name
this.id = config.id
this.goldCost = config.goldCost
this.happinessChange = config.happinessChange
this.initialGps = config.initialGps
this.additionalItemCost = config.additionalItemCost
this.numberTim... | true |
942e90813fa7aaf8002f50eb39ad211c164e49ec | JavaScript | EncipherWizard/MusicWizard | /src/util/uniforms.js | UTF-8 | 1,536 | 2.796875 | 3 | [] | no_license | export function buildUniforms (uni) {
const uniforms = {...uni}
const bools = Object.keys(uniforms).filter(key => uniforms[key].type === 'boolean').map(key => uniforms[key])
bools.forEach(({ name }) => {
uniforms[`${name}Tween`] = { value: false, type: 'boolean', visible: false }
uniforms[`${name}TweenPro... | true |
51ae43b7c32c503ea3ad9514302218339e456ddd | JavaScript | GYQ-LQ/quinn-source-code | /2.实现promise/promise/promise.js | UTF-8 | 2,270 | 3.21875 | 3 | [
"MIT"
] | permissive | /*
* @Author: Quinn
* @Date: 2021-04-19 20:55:59
* @LastEditTime: 2021-04-19 21:43:55
* @LastEditors: quinn
* @Description: 手写实现promise
*/
// 先定义三个常量表示状态
const PENDING = 'pending';
const FULFILLED = 'fulfilled';
const REJECTED = 'rejected';
class Promise {
constructor(executor) {
// 参数校验
if ... | true |
d7cb30e0de4c4d1f0b85cc5078d9e6a49f831b68 | JavaScript | Theag9998/lotide | /letterPositions.js | UTF-8 | 1,236 | 4.09375 | 4 | [] | no_license | const assertArraysEqual = function(array1, array2) {
if (eqArrays(array1, array2)) {
console.log(`🙂Assertion Passed: ${array1} === ${array2}`);
} else {
console.log(`☹️ Assertion Failed: ${array1} !== ${array2}`);
}
};
const eqArrays = function(array1, array2) {
let value = false;
if (array1.lengt... | true |
c4b6c0b8c62db163bbe1d5375be8ab3feead1808 | JavaScript | nicolasgonzalezgonzanlez/Node-bases | /conceptos/callbacks.js | UTF-8 | 411 | 3.609375 | 4 | [] | no_license | function hola (nombre, myCallback) {
console.log('soy async')
setTimeout(function () {
console.log('hola ' + nombre);
myCallback(nombre);
}, 1000)
};
function adios (nombre, otroCallback) {
setTimeout(function () {
console.log('adios ' + nombre)
otroCallback();
}, 1000)
}
hola('nicolas',functi... | true |
061139ad1056a99796671bb7372459165c18c270 | JavaScript | tjr226/kappaschool | /front-end/src/Reducers/cardReducer.js | UTF-8 | 3,658 | 2.828125 | 3 | [] | no_license | import {
GET_CARDS_FOR_LECTURE_STATS_START, GET_CARDS_FOR_LECTURE_STATS_SUCCESS, GET_CARDS_FOR_LECTURE_STATS_FAILURE,
GET_CARDS_FOR_LECTURE_QUIZZES_START, GET_CARDS_FOR_LECTURE_QUIZZES_SUCCESS, GET_CARDS_FOR_LECTURE_QUIZZES_FAILURE,
INCREASE_USER_READING_CARD_TIME_START, INCREASE_USER_READING_CARD_TIME_SUCC... | true |
7b04e9aa3a952fdcb79a5cacce205745470868a0 | JavaScript | Honey-bee-code/belajar-nodejs | /1-test/coba.js | UTF-8 | 808 | 4.125 | 4 | [] | no_license | // 1. Synchronous
// const getUserSync = (id) => {
// // let nama = "";
// // if (id === 1) {
// // nama = "Aulia";
// // } else {
// // nama = "Hanifi";
// // }
// const nama = id === 1 ? "Aulia" : "Hanifi";
// return nama;
// };
// const userSatu = getUserSync(1);
// console.log(userSatu);
// c... | true |
c281c83fc4a8ec466fc45ce846797ea7485bece9 | JavaScript | thechriswalker/translator | /test/translator.spec.js | UTF-8 | 4,931 | 2.78125 | 3 | [] | no_license | "use strict";
var assert = require("assert"),
vows = require("vows"),
Translator = require("../lib/translator");
vows
.describe("Translator")
.addBatch({
"before adding a locale": {
topic: function(){ return new Translator(); },
"setLocale should throw an error": function(T){
assert... | true |
14c8fe14cd57d04778c554ac131dc61503de0052 | JavaScript | tomLadder/react-native-echarts-wrapper | /src/jsBuilder.js | UTF-8 | 4,226 | 2.53125 | 3 | [
"MIT"
] | permissive | import { Platform } from "react-native"
export const convertToPostMessageString = obj => {
return JSON.stringify(obj, (key, val) => {
if (typeof val === "function") {
return new Function("return " + val.toString())
}
return val
})
}
export const toString = obj => {
if (obj === undefined) retur... | true |
b4116ca7cf877aa76c0365dd7ad4a1086a33b791 | JavaScript | Supermobarbie/capstonev1 | /src/components/displayContainers/CurrentCard.js | UTF-8 | 8,456 | 2.984375 | 3 | [] | no_license | import React from 'react'
import { Card, Image } from 'semantic-ui-react'
const CurrentCard = (props) => {
let inputParams = props.inputParams
let currentInfo = props.currentInfo
let currentForecast = props.forecastInfo['0']
const unitDisplay = (unit) => {
// a function to display the correct ... | true |
e1439ef6c8ca1f9cd0b528be0d90e1370161ee11 | JavaScript | mvelyov/Telerik-Academy-Alpha-Javascript-Fundamentals | /Loops/trailing-0s-in-factorial.js | UTF-8 | 341 | 4.15625 | 4 | [] | no_license | /*
Write a program that calculates with how many
zeroes the factorial of a given number N has
at its end.
Your program should work well for very big numbers,
e.g. N = 100000
*/
const line = +'100000';
let number = line;
let sum = 0;
do {
sum += Math.floor(number / 5);
number = number / 5;
} while ((number / 5) > 1 )... | true |
820eb6476f0424199358f80e806fd703df00204b | JavaScript | marvant/phase-0-tracks | /web_dev/client_side_js/script.js | UTF-8 | 273 | 3.234375 | 3 | [] | no_license | var els = document.getElementsByTagName("ul");
var el = els[0];
el.style.backgroundColor = "red";
console.log("The script is running");
function addBackgroundColor(event) {
event.target.style.backgroundColor = "blue";
}
el.addEventListener("click", addBackgroundColor); | true |
ab91a54042ad7c3fe029f575b025755ce3c7878f | JavaScript | kuraini/142107-keksobooking | /js/pin.js | UTF-8 | 1,031 | 2.640625 | 3 | [] | no_license | 'use strict';
(function () {
var PIN_HEIGHT = 44;
var PIN_PSEUDO_HEIGHT = 18;
var PIN_HEIGHT_IN_PROCENT = 100;
var PIN_TRANSITION = Math.floor((PIN_PSEUDO_HEIGHT * 100 / PIN_HEIGHT) + PIN_HEIGHT_IN_PROCENT);
var mapPinTemplate = document.querySelector('template').content.querySelector('.map__pin');
funct... | true |
02f99ebfc1678fcabe75ac1033f792b9b4b4fdab | JavaScript | gray-turtle/robot-gladiators | /assets/js/game.js | UTF-8 | 2,933 | 3.71875 | 4 | [] | no_license | //set up player's stats
var playerName = window.prompt("What is your robot's name?");
var playerHealth = 100;
var playerAttack = 10;
var playerMoney = 10;
//set up enemy stats
var enemyHealth = 50;
var enemyAttack = 12;
var enemyNames = ["Roborto", "Amy Android", "Robo Trumble"];
//Game States
//"WIN" - P;ayer robot... | true |
08baa5d678300d3b33703954f4998bf946c0da02 | JavaScript | SoullessSoldier/gloacademy-js_DeliveryFood_2 | /js/cart.js | UTF-8 | 4,120 | 3.015625 | 3 | [] | no_license | 'use strict';
const cart = () => {
//В случае, если проект не собирается сборщиком, имена переменных будут в глобальной области видимости
//и можно применить инапсуляцию
const renderAmountCart = (elementAmount) => {
let total = 0;
const data = JSON.parse(localStorage.getItem('cart'));
... | true |
1c209abaa9f0d193323b044ee3f4e1735957f21e | JavaScript | Emil-Blomquist/scroll_start | /js/lib/init.js | UTF-8 | 327 | 2.734375 | 3 | [] | no_license | $(window).on('mousewheel', function (event)
{
event.preventDefault();
var deltaY, timeStamp, result;
deltaY = event.deltaY;
timeStamp = event.timeStamp;
// if console log/time here, the script will run slow!
result = gatherData(timeStamp, deltaY);
// if (result)
// {
// console.log(result)
//... | true |
e6c4fa7250a2d2e80efd220eae20e97689bcaff2 | JavaScript | pmusce/stavros_server | /app.js | UTF-8 | 2,655 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var express = require('express');
const fs = require('fs');
var app = express();
const nodemailer = require('nodemailer');
function sendMail(content) {
// create reusable transporter object using the default SMTP trans... | true |
21c3ca1ef2f1d2df83801e081d698dd87e34f5d9 | JavaScript | Esri/terraformer-arcgis-parser | /terraformer-arcgis-parser.js | UTF-8 | 12,172 | 2.9375 | 3 | [
"MIT"
] | permissive | /* globals Terraformer */
(function (root, factory) {
// Node.
if(typeof module === 'object' && typeof module.exports === 'object') {
exports = module.exports = factory(require('terraformer'));
}
// Browser Global.
if(typeof root.navigator === "object") {
if (!root.Terraformer){
throw new Erro... | true |
9159bfcd1ec67833107ac281f62e7e6320827f35 | JavaScript | partykaVik/homework-Partyka-Viktor | /Homework#14/js/script.js | UTF-8 | 1,116 | 3.78125 | 4 | [] | no_license | const nextValueButton = document.getElementById('nextValue');
const increaseFontButton = document.getElementById('increaseFontSize');
const decreaseFontButton = document.getElementById('decreaseFontSize');
const increase = increaseFontGeneration();
const decrease = decreaseFontGeneration();
const infiniteGenerator = c... | true |
e737d81ed2904eda5687e5e04019b273112bc2b2 | JavaScript | wmlepcha/TL-LikedinLogin | /index..js | UTF-8 | 890 | 2.8125 | 3 | [] | no_license | var request = require('request');
var access_token = 'AQUVFUXebxAg1nY-LE3NjZgb5LQGRziLC7sGmaGJUqcQtB7JGuNY5BHS5_B8s3LQFGSZLLfVL8SUJymoCRW2ooB96d9KcZ0tco3qk46UrG1p9sXH6-9ASsSpErGyJaavziJn56RsoyKxg8AXyjz5MGQCo1gKLElmu7Y5SVu3kc9wJztcGrzp4B2hXFcqEstJhvuAzYyl6rMb1Y5dNsZHSc3wvMRrI0NB4O-xT-iD8nVeaUwf-bNFt2NSDKSOUjviH3BiXt-Rv7... | true |
442061c57b8fe951a3fea4b11db22b3fdbdacdba | JavaScript | Alisson-Corrales/SAT-scores-javascript | /new.js | UTF-8 | 4,901 | 3.40625 | 3 | [] | no_license | 'use strict';
const _BOARD = [
['.', '9', '.', '.', '4', '2', '1', '3', '6'],
['.', '.', '.', '9', '6', '.', '4', '8', '5'],
['.', '.', '.', '5', '8', '1', '.', '.', '.'],
['.', '.', '4', '.', '.', '.', '.', '.', '.'],
['5', '1', '7', '2', '.', '.', '9', '.', '.'],
['6', '.', '2', '5', '8', '... | true |
5c649f2bad927a414dfe9f9872f3cc8e90cf1d90 | JavaScript | harsha-iiiv/Mathball | /src/carmichael/index.js | UTF-8 | 592 | 3.34375 | 3 | [
"MIT"
] | permissive | /* Carmichael Number
* Function: isCarmichael()
*/
const validate = require('../validation/positive-integer');
const prime = require('../prime').check;
function squarefree(i){
for(let k = 2; (k <= Math.sqrt(i) && i % k !== 0 && i/k % k !== 0); k++){
return true;
}
}
function isCarmichael(n){
let c = 0;
for(let... | true |
918621e7a975bfce17c9a3dde6f3c1e0316d7dfd | JavaScript | Ammar00Areeda/bus-mall | /js/app.js | UTF-8 | 4,436 | 3.3125 | 3 | [
"MIT"
] | permissive | /* eslint-disable no-undef */
/* eslint-disable new-cap */
/* eslint-disable no-unused-vars */
let attemptEl = document.getElementById('attempts');
let container = document.getElementById('image-container');
let leftImg = document.getElementById('leftImg');
let midImg = document.getElementById('midImg');
let rightImg =... | true |
c0b67153be14af116b5d910ffbbf46bb90707f7c | JavaScript | chaozhangdev/vanilla-js-projects-combo | /memory-game/script.js | UTF-8 | 1,707 | 3.5 | 4 | [] | no_license | const shuffle = () => {
var currentIndex = data.length;
var temporaryValue;
var randomIndex;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
temporaryValue = data[currentIndex];
data[currentIndex] = data[randomIndex];
data[randomIndex] ... | true |
e0086b9e0044bd61700066c59ff82a92afbb427b | JavaScript | triver/demos | /cellautomata/cellularautomata.js | UTF-8 | 3,105 | 2.8125 | 3 | [] | no_license | ;(function(global){
'use strict'
function randomGrid( width, height) {
var grid = []
for (var y = 0; y < height; y++) {
grid[y] = []
for (var x = 0; x < width; x++) {
var on = ( x === 0 || x === width - 1 || y === 0 || y === height - 1 )
grid[y][x] = on ? 1 : Math.random() < 0.5 ? 1 :... | true |
d130479bcb8eccc1a701e21899c77d36e195407a | JavaScript | trungvn222/demo-timline | /src/index.js | UTF-8 | 3,150 | 2.796875 | 3 | [] | no_license | import React from "react";
import ReactDOM from "react-dom";
import { data, totalTrackLength } from "./sampleData";
import "./styles.css";
/**
* @point {object} object of { start: x, end: x }
* @width {string} eg: 10px , 10%
* @height {string} eg: 10px, 10%
* @backgroundColor {string} : eg: #e3e3e3, red
* @textCo... | true |
c1ffa0e71605e58cc9398d89b86214514bac58b1 | JavaScript | 2103-Team-Saturn/VizWiz | /client/store/singleData.js | UTF-8 | 1,188 | 2.65625 | 3 | [
"MIT"
] | permissive | const axios = require("axios");
const SET_SINGLE_DATA = "SET_SINGLE_DATA";
const FORMAT_DATA = "FORMAT_DATA";
const SAVE_DATA_ID = "SAVE_DATA_ID";
const _fetchSingleData = (data) => {
return {
type: SET_SINGLE_DATA,
data,
};
};
export const formatData = (data) => {
return {
type: FORMAT_DATA,
data,
};
};... | true |
86a461c6794a85f23b72e798cc380207a8235d2d | JavaScript | 2700036/WeatherChart | /src/services/GeoYandexApi.js | UTF-8 | 876 | 2.765625 | 3 | [] | no_license |
class GeoYandexApi {
constructor(APIkey) {
this._APIkey = APIkey;
}
getCoords = (searchString) => {
return fetch(
`https://geocode-maps.yandex.ru/1.x/?format=json&apikey=${this._APIkey}&geocode=${searchString}`
)
.then((res) => (res.ok ? res.json() : Promise.reject(`Ошибка: ${re... | true |
50315ba0db5dda277c2768156d44f38f7b5aca53 | JavaScript | igoboj/discogscrawler | /crawler/routes/artistCrawler.js | UTF-8 | 2,086 | 2.546875 | 3 | [] | no_license |
const log = require("./../log");
const crawlArtist = async ({ request, $ }, { requestQueue, baseDomain }, connectionPool) => {
const title = $('title').text();
let artistInfo = {};
let jsonLD = $('script[type="application/ld+json"]');
let jsonLDParsed = JSON.parse(jsonLD[0].children[0].nodeValue)
... | true |
bcc5b18a376e1e4716521344191b240c309878b6 | JavaScript | birametgod/FBM_App | /backend/controllers/competency.js | UTF-8 | 1,151 | 2.59375 | 3 | [] | no_license | import Competency from '../models/competency';
export function getCompetencies(req,res,next) {
let competencies = [];
Competency.find((err, result) => {
if (err) {
return res.status(500).json({
message: err.message
});
}
if (result) {
comp... | true |
857628f25627e20a8e4ca4895a34bbf1c69a35fd | JavaScript | EdwinOrta/test-front | /src/components/Textos.js | UTF-8 | 839 | 2.59375 | 3 | [] | no_license | import React from "react";
import FormatNumber from "../util/Util";
const Textos = ({ data, message, char }) => {
const quantities = data.map(q => q.quantity);
const positionText = -message.length * 8;
const quantitySum = quantities.reduce((total, num) => {
return total + num;
}, 0);
let quant... | true |
cd8c5c97b1888b0bb3aed2c6d07535cce734320b | JavaScript | ianrockefeller/survey-builder | /businessLogic/model.js | UTF-8 | 1,252 | 2.578125 | 3 | [] | no_license | // Create the JSON object that will be the Survey
// import React from 'react';
var ids = {
counter: 0,
make: function() {
this.counter++;
return this.counter;
}
};
export class Question {
constructor(name, type) {
this.id = ids.make();
this.name = name;
this.type = type ? type.toLowerCase() : 'html';
... | true |
39f003d4c67abbbacde359473b8b3f3c05bb587c | JavaScript | j-g-/task-records-helper | /src/trh.js | UTF-8 | 862 | 2.65625 | 3 | [] | no_license | // Sipmple general use functions
export function copyToClipboard(divID) {
var r = document.createRange();
r.selectNode(document.getElementById(divID));
window.getSelection().removeAllRanges();
window.getSelection().addRange(r);
document.execCommand("copy");
window.getSelection().removeAllRanges(... | true |
59a77f8d48f31a4260b7df3ce30df233ddff24d7 | JavaScript | RilDCraft/IC_ForestryPE | /dev/blocks/soil/peat/tile.js | UTF-8 | 1,378 | 2.515625 | 3 | [] | no_license | TileEntity.registerPrototype(BlockID.bog, {
defaultValues: {
CYCLE: 25 * 20,
cyclen: 0,
commmonTime: 0,
counter: 0
},
tick: function () {
if ((World.getBlockID(this.x + 1, this.y, this.z) == 8 || World.getBlockID(this.x + 1, this.y, this.z) == 9) ||
(Wor... | true |
c24e0e139e0272aabe95042dfbbe2736730ccdb6 | JavaScript | zykc123/node-GuideFishing | /routes/course.js | UTF-8 | 6,351 | 2.578125 | 3 | [] | no_license | /**
* Created by yangw on 2016/11/8.
* 带渔课程路由管理
*/
/* 课程模型 */
var Course = require('../models/Course');
/* 读取磁盘图片数据形成地址 */
var ReadCourseImg = require('../models/ReadTypeImg');
/* 获取当前时间和日期 */
var getDate = require('../models/tools/GetDate');
/* 获取根目录 */
var locateFromRoot = require('../models/tools/Loc... | true |
dda3ea00b9dea09e77fcf603967de96e69bd7407 | JavaScript | 02akashpol/MEAN_Stack | /Day_7/src/module1.js | UTF-8 | 1,464 | 2.84375 | 3 | [] | no_license | const fs = require("fs");
let readDemo = () => {
// readFile() for file1
const filePath1 = "D:/CDAC Data/CDAC Modules/MEAN_Stack/NodeJS_Assi_and_Work/day_7/demo01.txt";
fs.readFile(filePath1, {encoding : "utf-8"}, (err, data) => {
// output of file1
console.log(1, data);
// readFile()... | true |
3d7e5ca9ccc3adc31373d9baeecda3c2da503253 | JavaScript | adrianadames/auth-ii | /client/src/users/Users.js | UTF-8 | 1,606 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import '../App.css';
import {Route} from 'react-router-dom';
import axios from 'axios'
class Users extends Component {
state = {
// users: ''
users: []
}
render() {
return (
<div className="Users">
{/* <h1> Users page </h1>
{console.... | true |
a17fd85d5b6e256556b9fd35eb7deebecfc3bbf5 | JavaScript | davidokonji/log-stripper | /bin/stripper.js | UTF-8 | 2,005 | 2.875 | 3 | [
"MIT"
] | permissive | var fs = require('fs');
var totalFiles = 0;
const directorListing = [];
var walk = function (dir, opt ,done) {
const commentInstead = opt.commentInstead
fs.readdir(dir, function (error, list) {
if (error) {
return done(error);
}
var i = 0;
(functio... | true |
8637705fc9b519b32aa17d7baad423d10bac2249 | JavaScript | Namrta13/node-modules | /playgroud/5-es6-objects.js | UTF-8 | 660 | 3.84375 | 4 | [] | no_license | //Object property shorthand
const name = 'Namrta'
const userAge = 24
const user = {
name,
age: userAge,
loaction: 'Lucknow'
}
console.log(user)
//Object destructuring
const product = {
label: 'Notebook',
price: 10,
stock: 200,
salePrice: undefined,
rating: 4.5
}
// const {label: pr... | true |
c8e38ac311317251262401ac5e2d9783ad6800b3 | JavaScript | thinkful-ei-dragonfly/robert-lucas_quiz-app | /src/Quiz.js | UTF-8 | 2,921 | 3.59375 | 4 | [] | no_license | 'use strict';
import Model from './lib/Model'
import Question from './Question';
class Quiz extends Model {
static DEFAULT_QUIZ_LENGTH = 2;
constructor() {
super();
// Array of Question instances
this.unasked = [];
// Array of Question instances
this.asked = [];
this.active = false;
... | true |
5fbf17f6ffcff00d2390525ea1b8e611a52269ab | JavaScript | seiyamiyaoka/webpack_global_func | /src/ColorHandler.js | UTF-8 | 315 | 2.859375 | 3 | [] | no_license | const SetColorHandler = (sourceId) => {
const source = document.getElementById(sourceId);
source.addEventListener('change', ColorHandler);
}
const ColorHandler = (e) => {
const targetElement = document.getElementById("displayArea")
targetElement.style.color = e.target.value
}
export {
SetColorHandler
} | true |
f18325d210872bf0d7d31adfc1c6d2aad25e1e11 | JavaScript | Vir4k/Gyromina | /systemFiles/globalFunctions.js | UTF-8 | 6,585 | 3.203125 | 3 | [
"MIT"
] | permissive | // Require colors and the emoji regex
const color = require('colors');
const emojiRegex = require('emoji-regex');
const regex = emojiRegex();
// UTIL
/**
* Writes to the console with time when it was ran
* @author Laica#4351 (Altenhh)
* @param message
* @param startTime
* @param useLocale
*/
exp... | true |
2c58b5f003283d0b8b84a258eb18686207e01223 | JavaScript | waltomatt/securemail | /class/SMTPConnection.js | UTF-8 | 4,534 | 2.53125 | 3 | [] | no_license | const tls = require("tls"),
fs = require("fs"),
dns = require("dns"),
util = require("./../lib/util.js"),
config = require("./../config.json")
const IncomingEmail = require("./IncomingEmail.js");
const AcceptedCommands = [
"EHLO",
"HELO",
// "STARTTLS",
"MAIL",
"RCPT",
"DATA",
"RSET",
"NOOP",
... | true |
441664a16b8a8cbb9125c43a212a6a5564374057 | JavaScript | dmartincc/ethinkerApp | /app/static/js/graphs/categories.js | UTF-8 | 1,995 | 2.75 | 3 | [] | no_license | function categories(a,b){
var width= a,
height= b,
format = d3.format(",d"),
color = d3.scale.category20c();
var bubble = d3.layout.pack()
.sort(null)
.size([width, height]);
var svg = d3.select(".information").append("svg")
.attr("width", width)
.attr("height", height);
d3.json(... | true |
9a310fd8762587cb1dcee04d9bef86df9aa6cf33 | JavaScript | EricJB77/TwilioQuest | /Javascript/laserPower.js | UTF-8 | 328 | 3.53125 | 4 | [] | no_license |
function calculatePower(freightItems) {
let totalPower = 0;
freightItems.forEach(myfunc)
function myfunc(item, index, array) {
totalPower += item * 2
}
return totalPower;
}
const laserPower = calculatePower([1,3,8]);
console.log("Required laser power is: " + lase... | true |
ad6f698d15853ff65097d4a552af8cd9198405b0 | JavaScript | wyattpaq14/AdvJSFall2016 | /public_html/Week4/Lab4/script.js | UTF-8 | 2,734 | 2.890625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
var objDiv = document.querySelector('#agreeScroll');
//scroll event listener
objDiv.addEventListener('scroll', checkPosition);
//Form... | true |
3841d150acd9aa5fa91c3b9da7e1d4a7c92d7360 | JavaScript | mikkie383/ChihYang | /lesson7/js/lesson7.js | UTF-8 | 1,384 | 2.84375 | 3 | [] | no_license | WebFont.load({google: {families: ["Acme", "Open Sans"]}});
const year = document.querySelector('.year');
const time = document.querySelector('.date');
var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
const date = new Date();
year.textContent = date.getFullYear();
time.innerHTML = `L... | true |
1a91405c8dcc4f6b187bee714eb49aba047e9579 | JavaScript | stanislavt/yamlenv | /tests/test-config.js | UTF-8 | 2,242 | 2.796875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const fs = require('fs')
const t = require('tap')
const sinon = require('sinon')
const yamlenv = require('../lib/main')
const mockParseResponse = {test: 'foo'}
let readFileSyncStub
t.beforeEach(done => {
readFileSyncStub = sinon.stub(fs, 'readFileSync').returns('test: foo')
sinon.stub(yamlenv, 'parse').returns(... | true |
e5d3f25d6270fc3da97bd21a4c1842def18b3b20 | JavaScript | haroldia/Summative | /JS/Core/GraphicsProjection.js | UTF-8 | 1,592 | 3.28125 | 3 | [] | no_license | updateList.push({ f: () => drawAllP()});
var drawListP = [];
function drawAllP() {
drawRectP(0, 0, canvas.width, canvas.height, "black");
//sorts drawList by layers
drawListP.sort(function (a, b) { return b.l - a.l; });
//draws in order of layers (lowest layer are drawn in front)
for (var i = 0; i < drawL... | true |
680c56b05142643944f24ff61c1fe2d5284d45d9 | JavaScript | leiqiang123/algorithm-base-demo | /demo/src/baseFunction/MyArray.js | UTF-8 | 534 | 3.109375 | 3 | [] | no_license | Array.prototype.myReduce = function(cb, initValue) {
if (!Array.isArray(this)) {
throw new TypeError('not a array')
}
if (this.length === 0 && arguments.length < 2) {
throw new TypeError('Reduce of empty array with no initial value')
}
let arr = this
let res = null
//判断是否有初始值,若没有则取数组第一个值
if (arg... | true |
08f471089e7ef7dd42e1f0b699ed78d3e59ff691 | JavaScript | tonyaniu/javascriptStudy | /javascript/js/js17.js | UTF-8 | 265 | 3.015625 | 3 | [] | no_license | var imgs=document.getElementsByTagName("img");
var big=document.getElementById("big")
for(var i=0;i<imgs.length;i++){
imgs[i].onmouseover=function(){
var src=this.getAttribute("src");
var newSrc=src.replace("small","big");
big.setAttribute("src",newSrc)
}
} | true |
f767e764381c1a241df90401d568d03183a4809e | JavaScript | endaniel/AdvWebApp | /app/public/js/controllers/displayStationsLocationCtrl.js | UTF-8 | 2,553 | 2.734375 | 3 | [] | no_license | (function(){
"use strict";
function displayStationsLocationCtrl($scope, stationService){
var self = this;
var mapOptions = {
zoom: 6,
center: new google.maps.LatLng(33,35),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
... | true |
b8f7d2a89ddf7858db071eb958b3a37809b085ac | JavaScript | ZhiJunYin/Focus | /app/components/TaskList.jsx | UTF-8 | 1,770 | 2.578125 | 3 | [] | no_license | 'use strict';
import actions from '../actions/ActionCreator';
class comp extends React.Component {
componentDidMount(){
this.$task = $(React.findDOMNode(this)).find('.task');
}
render(){
var taskClasses = classSet({
'task': true,
'done': this.props.truth.done
});
return(
<li ... | true |