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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
048d2a2f3b8e123af27ed087624d2d136cd99b5e | JavaScript | maestrokd/JL-IP3-15_WebServices-Client-Hateos | /src/main/webapp/resources/static/js/createevent.js | UTF-8 | 6,447 | 2.84375 | 3 | [] | no_license |
function geSselectedPhoneNumber() {
return document.getElementById("selected-phone-number").textContent;
}
$(document).ready(function () {
var selectedPhoneNumber = geSselectedPhoneNumber();
$("#sms").click(function () {
doCreateEvent(selectedPhoneNumber, "sms");
});
$("#mms").click(fun... | true |
3e456f8da61172712145f4801f7866c0eb7a84a1 | JavaScript | SKhan1211/OpenStable | /server/models/Stable.js | UTF-8 | 1,874 | 2.625 | 3 | [] | no_license | const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const getGeoData = require("../../util/geo-decoder");
const StableSchema = new Schema({
name: {
type: String,
required: true,
unique: true
},
description: {
type: String,
},
address: {
typ... | true |
45d47ff292e248a7961af150ceed135f4b0adcf1 | JavaScript | tomsjer/nodeschool | /functional/recursion.js | UTF-8 | 509 | 2.984375 | 3 | [] | no_license | // MIA
// function reduce(arr,fn,init){
// if(!arr.length) return init;
// var current = arr[0];
// return reduce(arr.slice(1),fn,fn(init,current));
// }
// OFICIAL
function reduce(arr,fn,initial){
return (function reduceOne(index,value){
if(index>arr.length-1) return value; // Earlyy return
... | true |
f9522e5395e022278a3afc9c0d9c35c9f0bfbeca | JavaScript | LWu93/Leslies-Algo-Practice | /Leetcode/#1207-uniqueNumOfOccurances.js | UTF-8 | 351 | 2.96875 | 3 | [] | no_license | var uniqueOccurrences = function(arr) {
if (!arr.length) return true;
let hash = {};
let dups = {};
for (ele of arr) {
hash.hasOwnProperty(ele) ? hash[ele] += 1 : hash[ele] = 1
}
for (key in hash) {
if (dups.hasOwnProperty(hash[key])) return false
else dups[hash[key]] =... | true |
84acb5d8637b33fbbd082f35adf07f26d1e1b16a | JavaScript | YomiCasual/fullStack_node_vue_memories | /client/src/store/modules/posts/index.js | UTF-8 | 1,322 | 2.578125 | 3 | [] | no_license | import Axios from 'axios'
const BASE_URL = "http://localhost:5000"
const state = () => {
return {
posts: [ ]
}
}
const actions = {
async createPost ({commit, dispatch}, payload) {
try {
const request = await Axios.post(`${BASE_URL}/posts`, payload)
dispatch('getPos... | true |
1d1e39ecd25707130272408add519511782e84af | JavaScript | ellamac/portfolio | /src/Main.js | UTF-8 | 1,539 | 2.546875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import Papa from "papaparse";
import { chunkDatas, sortDatas } from "./helpers/DataHelpers";
import ScrollToTop from "./helpers/scrollToTop";
import NavbarTop from "./components/NavbarTop";
import NavbarBottom from "./components/NavbarBottom";
import Content from "./... | true |
e507b29df479a6f26693f15522aa584fd03c7c2e | JavaScript | William-McGonagle/caramocha | /templates/GET_CHILD.js | UTF-8 | 1,790 | 2.71875 | 3 | [
"ISC"
] | permissive | const readline = require('readline');
const readlineInterface = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function ask(questionText) {
return new Promise((resolve, reject) => {
readlineInterface.question(questionText, (input) => resolve(input) );
});
}
// return finished... | true |
db5b05cde5d6353d80b45ebd59bb4b5466ec4ec3 | JavaScript | cjustice10/EaselJS-Tutorial-Review | /js/video.js | UTF-8 | 4,258 | 3.609375 | 4 | [] | no_license | // This was the version used for the video
"use strict";
// ===== Variables =====
var canvas;
var stage;
var ball;
var paddleLeft;
var paddleRight;
var message;
var leftScore;
var rightScore;
var init = function() {
//!!! Initialize DisplayObject elements here !!!
canvas = document.getElementById("gameCanvas");... | true |
8576c7ef25888165780d05378adecae4e91e779b | JavaScript | 2joom/2joom | /b_example/c_normal/js/src/jquery/rwd_page.js | UTF-8 | 1,877 | 3.296875 | 3 | [] | no_license | // rwd_page.js
(function($){
var winW = $(window).width();
var size = $('.size');
// step1 =================================
/* var ViewSize = function(e){
e.preventDefault();
var nowW = $(window).width();
if(winW !== nowW){
location.reload();
}
size.text(nowW);
};
$(window).on('resi... | true |
54f3c63138c6c8e248e511532cd48746e9ebde4e | JavaScript | cosmoglint/stuff_with_p5 | /3_key_filler/static/block.js | UTF-8 | 905 | 2.75 | 3 | [] | no_license | function block(x,y,txt){
this.x_pos = x;
this.y_pos = y;
this.txt = txt;
this.width = textWidth(this.txt);
this.height = block_size;
this.totwidth = this.width+padding;
}
block.prototype.show = function(){
fill('white');
rect(this.x_pos,this.y_pos,this.totwidth,this.height);
fill(0);
text(this.txt,... | true |
67181e7f52ad77638cda802de5365a835f519e65 | JavaScript | rongyunsuo/zte | /src/main/java/com/leetcode/js/LeetCodeACByJS-master/Solutions/Q201-Q300/Q212.js | UTF-8 | 1,194 | 3.296875 | 3 | [] | no_license | let hasWord = false
var findWords = function (board, words) {
var ans = []
for (let word of words) {
for (let j = 0; j < board.length; j++) {
for (let i = 0; i < board[0].length; i++) {
if (board[j][i] == word[0]) {
hasWord = false
DFS... | true |
305c4757a41456b7b2771811192dc2f6dff9a342 | JavaScript | timothymugayi/polly | /news_headline_reader.js | UTF-8 | 2,553 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const AWS = require('aws-sdk');
const Stream = require('stream');
const Speaker = require('speaker');
const axios = require('axios');
const moment = require('moment');
const NEWS_API_KEY = process.env.NEWS_API_KEY || undefined;
// // Create an Polly client
const Polly = new AWS.Polly({
signatureVersion: 'v4',
... | true |
0dc2833841cf743b7d7aef5e4db40fc8f94b3e5b | JavaScript | AntouanK/wall-street-docs | /src/routes/upload-multi.js | UTF-8 | 2,684 | 2.53125 | 3 | [] | no_license | const Handlebars = require("handlebars");
const pageScript = function() {
$(document).ready(function(e) {
// reset messages
$("#error-container").toggle(false);
$("#success-container").toggle(false);
$("#uploading-container").toggle(false);
$("#form-upload-multiple").on("submit", function(e) {
... | true |
c69d2ed051fe4f8352ee3806c1d4a0ced07581f9 | JavaScript | homiiiiii/homiiiiii | /js/index.js | UTF-8 | 11,499 | 2.609375 | 3 | [] | no_license | document.getElementById('showHideContainer').onclick = function() {
divTest = document.getElementById('linkContainer2');
if (divTest.style.display === "none") {
divTest.style.display = 'block';
}
else {
divTest.style.display = "none";
}
}
var __boxBlack = new THREE.MeshBasicMateria... | true |
46761768a72f34321cb338cd03a739956ba0ca38 | JavaScript | BBAD-Furniture/BBAD-furniture | /client/components/starGenerator.js | UTF-8 | 743 | 2.78125 | 3 | [
"MIT"
] | permissive | import React from 'react';
const generateStars = num => {
let starsHtml = [];
let isDecimal = num % 1 !== 0 ? true : false;
let newNum = Math.ceil(num);
if (isNaN(newNum)) return ['No Reviews'];
for (let i = 0; i <= newNum; i++) {
if (i < newNum - 1) {
starsHtml.push(
<i key={i} className="f... | true |
623af08e02b0270e0d2c635bfd1280d1e712f306 | JavaScript | dylanbest15/Note-Taker | /server.js | UTF-8 | 1,782 | 2.8125 | 3 | [
"MIT"
] | permissive | // Requirements
var express = require("express");
var path = require("path");
var fs = require("fs");
const { v4: uuidv4 } = require('uuid');
// Sets up the Express App
var app = express();
var PORT = process.env.PORT || 3000;
// Sets up the Express app to handle data parsing
app.use(express.urlencoded({ extended: tr... | true |
c65b081e05cb1c7a24ede1b0921a73597af2b4b9 | JavaScript | akudemy/learn | /reference.js | UTF-8 | 2,400 | 3.53125 | 4 | [] | no_license | /**
* Challenge Reference Sheet
*
* A lot of challenges follow similar patterns and deal with similar problems.
* Sometimes these assume terminology and formulae that participants might not
* be familiar with.
*
* This sheet tries to mitigate that by providing searchable definitions.
*
* To aid searchability, ... | true |
69fd3d9d70ee714872f0f12380c80164bb302d2d | JavaScript | jriall/codewars-kata-solutions | /7kyu/valdiate-the-hash.js | UTF-8 | 972 | 3.890625 | 4 | [] | no_license | // https://www.codewars.com/kata/validate-the-hash/train/javascript
// A file's hash value is essentially a string of numbers and letters of fixed length, that functions as a cryptographic fingerprint for that file.
// File hashes are commonly used in cyber security to identify different strains of malware, with a un... | true |
c987f72d7b0cde8d8daadde5787e0d44f18ac5a7 | JavaScript | Cappi-s/PMD-grupo4 | /store/bannedwords.js | UTF-8 | 1,488 | 2.9375 | 3 | [] | no_license | const axios = require('axios').default;
const URL = 'http://www.bannedwordlist.com/lists/swearWords.txt'
class BannedWordsStore {
constructor(){}
FilterMovies(...jsonMovies) {
return new Promise((resolve, reject) => {
axios.get(URL).then(res => {
console.log("Filtering m... | true |
14f5544ab5e6323b8ef3734ecc41750cb969506a | JavaScript | wuzhuzhu/webpack-demo | /src/index.js | UTF-8 | 1,045 | 2.703125 | 3 | [] | no_license | import './style.css'
import Coin from './coin.png'
import { cube } from './math.js';
import _ from 'lodash'
function component() {
const element = document.createElement('div');
const btn = document.createElement('button');
element.innerHTML = _.join([
'Hello webpack!',
'5 cubed is equal to ' + cube(5)
... | true |
b2355c91b874da5b9b4bc3a0ac55cfe5c7eb0971 | JavaScript | Mschweda/javascript-workbook | /03week/towersOfHanoi/towersOfHanoi.js | UTF-8 | 2,238 | 3.796875 | 4 | [] | no_license | 'use strict';
const assert = require('assert');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let stacks = {
a: [4, 3, 2, 1],
b: [],
c: []
};
// print the stacks
function printStacks() {
console.log("a: " + stacks.a);
consol... | true |
5e8d3d82a95c6ff796878a33164d54d3740d3623 | JavaScript | rhavill/js | /examples/closure-loop-fix.js | UTF-8 | 373 | 3.765625 | 4 | [] | no_license | // This was copied from http://blog.jhades.org/really-understanding-javascript-closures/
function asyncOperation(counter) {
setTimeout(function() {
console.log('counter value is ' + counter);
}, 1000);
}
function otherClosureExample() {
var i = 0;
for (i = 0; i < 3 ;i++) {
a... | true |
12084df8960dfc5ed4e884f4dd3129661dd77a55 | JavaScript | KMONISH/learning-challenge-season-3 | /arr_fun/pop().js | UTF-8 | 206 | 3.4375 | 3 | [
"MIT"
] | permissive | <script>
// pop() function
function func() {
var arr = [34, 234, 567, 4];
var popped = arr.pop();
document.write(popped);
document.write("<br>");
document.write(arr);
}
func();
</script>
| true |
773225242e8ef642bb229102614fb345a4c3c694 | JavaScript | acegautam/ds-algo | /src/ds/linkedlist.js | UTF-8 | 3,479 | 3.9375 | 4 | [] | no_license | function CreateNode(value, next = null) {
return {
value,
next
};
}
function CreateLL() {
return {
head: null,
tail: null,
length: 0,
// unshift
prepend(item) {
const node = CreateNode(item);
if (!this.head) {
this.head = node;
this.tail = node;
thi... | true |
bfe4c22140abfb68fcbc07a84e3801b5c3f3708d | JavaScript | hmataveda/JS_Solutions_InterviewBit_javascript | /Stacks And Queues/Simplify Directory Path.js | UTF-8 | 696 | 3.5 | 4 | [] | no_license | // Problem link https://www.interviewbit.com/problems/simplify-directory-path/
const { Queue } = require("../utils/queue");
class Solution {
simplifyPath = function (A) {
let queue = new Queue();
let res = "";
A = A.split("/");
for (let i = 0; i < A.length; i++) {
if (A[i] == "." || A[i] == ""... | true |
7c7d6288db93a94dba10d8638437cdd312b329ab | JavaScript | Hiroaki-Satoh/PracticeJavaScript | /Lesson03/app.js | UTF-8 | 335 | 3.921875 | 4 | [] | no_license | // Lesson3-1
// ใกใคใณ้จๅ
var alertString;
alertString = addString("WebCamp");
// ไฝๆใใ้ขๆฐใๅผใณๅบใ
alert(alertString);
// ไฝๆใใ้ขๆฐ
function addString(strA){
var addStr = "Hello " + strA;
return addStr;
}
// function ้ขๆฐๅ(ๅผๆฐ){
// ๅฆ็
// return ๆปใๅค;
// }
| true |
cd21837a14ab0cb9e02802497966e6f73ef90580 | JavaScript | rishikeshm/customerFormValidation | /app/services/rest.js | UTF-8 | 952 | 2.546875 | 3 | [] | no_license | angular.module('MyApp')
.factory('restApi', ['$http', '$q', function($http, $q){
var execute = function() {
return $http({
method: 'GET',
url: '/data/customers.json'
});
};
return {
getCustomers: function() {
var q = $q.defer();
/*
var successCallback, errorCallback;
var re... | true |
ea2ce8e1322af6f02cb45afd36a21a228d90b4aa | JavaScript | CodeNextEngineersG1/g1-search-orlandom37 | /script.js | UTF-8 | 5,810 | 3.109375 | 3 | [] | no_license | //var database = [
// {
// Name: "Oakland Athletics",
// Picture: "img/Oakland.png",
// Ballpark: "OaklandโAlameda County Coliseum ",
// Established: "1901",
// Owner: "John J. Fisher",
// WorldSeries: "9"
// },{
// Name: "San Francisco Giants",
// Picture: "img/SF.png",
// Ballp... | true |
1c3250a2d007762a44a4a4ef844714bf883f7a46 | JavaScript | cokert/atom-find-tab | /lib/find-tab-view.js | UTF-8 | 3,084 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use babel';
import { Disposable } from 'atom';
import SelectListView from 'atom-select-list'
export default class FindTabView {
constructor(serializedState, callbacks) {
this.callbacks = callbacks;
this.element = document.createElement('div');
this.element.classList.add('find-tab');
this.creat... | true |
eb34bfa4845e93c9812fbd5cd35be41b2154aca2 | JavaScript | raphaelstary/pongypaddle-jam-edition | /www/js/myscenes/model/PlayerController.js | UTF-8 | 820 | 2.78125 | 3 | [] | no_license | var PlayerController = (function (Math, Entity, Vectors) {
"use strict";
function PlayerController(worldBuilder) {
this.worldBuilder = worldBuilder;
}
var forceX = 15;
var forceY = 20;
PlayerController.prototype.jumpLeft = function (player) {
if (player.forceX > -forceX)
... | true |
e932b8c6fbe26697fd533e52af9393acb735c3ee | JavaScript | leetaylor5455/How-Chilli | /src/fetchData.js | UTF-8 | 995 | 2.953125 | 3 | [] | no_license | export default function fetchData() {
return new Promise(async (resolve) => {
const apiKey = '3c0ee22f10b958b6f5cffbe850d69a12';
const colchester = 'lat=51.8959&lon=0.8919';
const fetchWeatherData = new Promise((resolve, reject) => {
fetch(`https://api.openweathermap.org/data/2.... | true |
88832695a7fe06bb07493a0829a9edce57bdda9c | JavaScript | Charley-Hsu/CyanMapleDesign | /src/maple/component/list/index.js | UTF-8 | 2,658 | 2.5625 | 3 | [
"MIT"
] | permissive | import listVue from './list.vue';
import listItemVue from './list-item.vue';
import listList from './listList';
import Sortable from './Sortable.js';
Vue.component('cmui-list',listVue);
Vue.component('cmui-list-item',listItemVue);
function getItemClassByCol(col){
if(_.isNumber(col)){
switch(col){
case 2:
... | true |
a77fba171ec9a49fa1ea33a5a902e8dbf2ed04b1 | JavaScript | silaspsadia/silas-torrent | /src/torrent-parser.js | UTF-8 | 618 | 2.671875 | 3 | [] | no_license | const bencode = require('bencode');
const crypto = require('crypto');
const bignum = require('bignum');
module.exports.parse = torrent => {
torrent.infoHash = calculateInfoHash(torrent);
torrent.size = calculateSize(torrent);
return torrent;
};
function calculateInfoHash(torrent) {
const encodedInfo = bencode.... | true |
089e639d856910817d6052077ce2d485f7084a40 | JavaScript | zabka14/InSPDL | /static/perso.js | UTF-8 | 401 | 2.65625 | 3 | [
"MIT"
] | permissive | $(document).ready(function()
{
console.log( "ready!" );
$("#optAvc").hide();
$('#chkBox').click(function()
{
var $this = $(this);
// $this will contain a reference to the checkbox
if ($this.is(':checked')) {
console.log( "visible!" );
$("#optAvc").show();
} else {
... | true |
2fd5d7f7e8ba4c0b342a65a5ba739995514437b7 | JavaScript | wasd11203/graduation_design | /src/main/webapp/public/static/javascript/auth/auth.js | UTF-8 | 846 | 2.734375 | 3 | [] | no_license | function make_basic_auth(user, password) {
var token = user + ':' + password;
var hash = btoa(token);
// var hash = $.base64.encode(token);
return "Basic " + hash;
}
function $_ajaxAuth(url,username,password){
var auth = make_basic_auth(username,password);
var $defer = jQuery.Deferred();
// jQuery
$.ajax(... | true |
d07f2ace77c8c2981a47930c18bc5e0cf412c554 | JavaScript | Vladyslav120604/frontend | /task_8/task_2/regexp.js | UTF-8 | 1,179 | 3.171875 | 3 | [] | no_license | function selection() {
var pattern = document.getElementById('pattern').value;
var flags = document.getElementById('flags').value;
var text = document.getElementById('text').value;
checkingInformationIromInputFields(pattern, flags, text);
var regExp = new RegExp(pattern, flags);
var selectedText = selectionOfSui... | true |
8b4be8eddbeb596e2aaa8adeccf0bf1fd7932e82 | JavaScript | brownplt/ZZZ-captain-teach | /web/app/assets/javascripts/editor.js | UTF-8 | 1,723 | 2.53125 | 3 | [] | no_license | function makeEditor(container, options) {
var initial = "";
if (options.hasOwnProperty("initial")) {
initial = options.initial;
}
var runButton = drawRunButton();
if (options.run && !options.simpleEditor) {
container.append(runButton);
container.append(drawClearFix());
}
var textarea = jQuer... | true |
2dd3a32e353e1abfc978e7eaa0150cf393df4496 | JavaScript | hanssens/PowerBI-JavaScript | /demo/v2-demo/scripts/utils.js | UTF-8 | 2,499 | 2.75 | 3 | [
"MIT"
] | permissive | function ValidateEmbedUrl(embedUrl) {
var embedUrl = $('#txtReportEmbed').val();
if (!embedUrl)
{
alert("You must specify an embed url.");
return false;
}
var id = null;
var parts = embedUrl.split("reportId=");
if (parts && parts.length > 0)
{
var guidParts =... | true |
2d461e9031cb7edf807574b744a400e20f480b3d | JavaScript | MatMaul/remove-promoted-tweets-chrome-extension | /remove_promoted_tweets.js | UTF-8 | 1,557 | 2.875 | 3 | [
"MIT"
] | permissive | var PROMOTED_LITTERALS = new Set([
"Promoted",
"Sponsorisรฉ",
"Promocionado",
"Patrocinat",
"Sponsorizzato",
"Promovido",
"Gesponsert",
"Uitgelicht",
"Promoveret",
"Promotert",
"Promowane",
"Sponzorira",
"Ajรกnlott",
]);
var RemovePromotedTweets = RemovePromotedTweets || {
init: function () ... | true |
bbd0cf745fec9edfe5c6ce7355cce8d10d4aa06e | JavaScript | xwadh/GameChickServer | /test/functionManager.js | UTF-8 | 15,861 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /**
* ๆ่ฝ็ฑปๅ
*/
const SkillEnum = {
Duration:0, //ๅ
้จไฝฟ็จ๏ผๆ็ปญๆๆ่ฎก็ฎ
//region ๅธฆๆฅ้ๆๅ ๆ็่ขซๅจๆ่ฝ
Defense:1, //่ขซๅจๆๅ้ฒๅพกๅ5%
Life:2, //่ขซๅจๆๅ็ๅฝ5%
Fare:3, //่ขซๅจๆๅ่ฟๆฐ5%
Protect:4, //่ขซๅจๆๅๅ
ไผค็5%
Lucky:5, //่ขซๅจๆๅๅนธ่ฟ็5%
Score:6, //ๅ
ณๅก็ป็ฎ็งฏๅๆถ๏ผๅจๆ็ป็ป็ฎ็ๅบ็กไธx1.5
Money:7, /... | true |
d6343b979d7eb192c96988a610f338f00dc37a4e | JavaScript | mdehsanul/advanced-javascript | /break-continue.js | UTF-8 | 439 | 3.8125 | 4 | [] | no_license | // break
const num1 = [1, 2, 3, 4, 5, 6, 7, 8, 9];
for (let i = 0; i < num1 .length; i++) {
// console.log(nums [i]);
if(num1[i] > 6){
break;
}
console.log(num1 [i]);
}
console.log("by the way, who are you?");
// continue
const num2 = [1, -2, 3, 4, 5, -6, -7, 8, 9];
for (let i = 0; i < num2 .l... | true |
9979aeec75f6968404d5ed40e7400c1c0345d9c5 | JavaScript | VarunOfficialAcc/agarr | /sketch.js | UTF-8 | 699 | 3.0625 | 3 | [] | no_license | var blob;
var blobs = [];
var num_blobs = 100;
var zoom = 1;
function setup() {
createCanvas(400, 400);
blob = new Blob(0,0, 32);
for (var i = 0; i<100; i++){
blobs[i] = new Blob(random(-width, 2*width), random(-height, 2*height), 16);
}
}
function draw() {
background(220);
// translate (width/2-blob.... | true |
66403db598695301c6e6017a25abb7bed5f4aa86 | JavaScript | qpakzk/media-art-gallery | /exercise3/exercise3.js | UTF-8 | 681 | 3.3125 | 3 | [] | no_license | var count = 0;
function setup() {
createCanvas(window.innerWidth, window.innerHeight);
background(0, 0, 0);
stroke(255, 50);
}
function draw() {
if(count % 10 == 0) {
background(random(0, 255), random(0, 255), random(255));
count = 0;
}
count++;
line(random(0, width), random(0, height), random(0, ... | true |
d24651d98a34efae0105d7019cfb5de975a0e4df | JavaScript | jbrackin1/pluto | /u1-becoming-a-developer/d03-javascript/student/logic/ex3.js | UTF-8 | 306 | 3.109375 | 3 | [] | no_license | var absence;
if (parseInt(prompt("Enter your grade.")) < 70 || (absence = parseInt(prompt("How many absences do you have?"))) > 4) {
alert("You are failing!");
} else if (absence > 2|| prompt("Enter your tardies") > 4 ) {
alert("Chronically late!")
} else {
alert("Woohoo you are passing!");
}
| true |
b29ce429bc0bb0085f96afe9e2af0bf94cf7f1f4 | JavaScript | gcdhg/taskDel | /helpers/generateMatrix.js | UTF-8 | 660 | 3.21875 | 3 | [] | no_license | /**
* generates random integer number betwen min and max values
*
* @param {Number} min
* @param {Number} max
*/
const generateMatrix = (NQuery, MQuery) => {
const randomise = (min, max) =>
min + Math.floor(Math.random() * Math.floor(max));
/**
* get query params
*/
const N = parseInt(NQuery, 10);... | true |
844b9e30f6dff5456261e72b42c9bd682587b788 | JavaScript | gimmelpark/vue-puzzle | /src/store/puzzle/numsGetters.js | UTF-8 | 2,446 | 2.734375 | 3 | [] | no_license |
import numsF from './modules/numsFunction.js'
export default {
getRows: (state) => state.numRows,
getCols: (state) => state.numCols,
getLine: (S, getters) => (dir) => {
return dir ? getters.getRows : getters.getCols
},
// ะผะฐะบัะธะผะฐะปัะฝะพะต ะบะพะปะปะธัะตััะฒะพ ะฑะปะพะบะพะฒ
getMaxLength: (state) => (dir) => {
return dir ?
... | true |
b578a34644a97f84dad8ce243599841e5b491a07 | JavaScript | jonrcarey/okiba-ui | /packages/event-manager/lib/handlers/RAFHandler/index.js | UTF-8 | 934 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* @module RAFHandler
* @extends AbstractHandler
* @package event-manager
* @description An handler class aimed to centralize a requestAnimationFrame
*/
import AbstractHandler from '../AbstractHandler'
export default class RAFHandler extends AbstractHandler {
/**
* Recursively requires animation frame
... | true |
1febad99d374ce8b9108bdae5fb5ae1f1e29fb21 | JavaScript | rundexter/gis-zipcode-to-coordinates | /index.js | UTF-8 | 1,046 | 2.6875 | 3 | [] | no_license | //https://github.com/dryan/static-zipcode-api
module.exports = {
/**
* The main entry point for the Dexter module
*
* @param {AppStep} step Accessor for the configuration for the step using this module. Use step.input('{key}') to retrieve input data.
* @param {AppData} dexter Container for all ... | true |
3a6d779b04e614d42360255e040f12dc56740685 | JavaScript | farid64/GrabGifs | /assets/javascript/app.js | UTF-8 | 2,067 | 3.09375 | 3 | [] | no_license |
var arrTerms = ["frog" , "falcon" , "hamster" , "cat" , "dog" , "bulldog" , "pug" , "mouse" , "orangutan" , "Honey badger"];
arrTerms.forEach( function(animals){
var newBtn = $("<button>");
newBtn.addClass("btn");
newBtn.attr("data-value" , animals);
newBtn.text(animals);
$(".buttons").append(newBtn);
}... | true |
d110bfeff529e758a2c95ce6cd493707bee1422a | JavaScript | zryyyyy/project | /่ตไบง็ฎก็/js/repair/my_task.js | UTF-8 | 304 | 2.546875 | 3 | [
"MIT"
] | permissive | $(".sorting_asc[type='checkbox']").is(':checked');
$(".sorting_asc input").click(function() {
if (this.checked == true) {
$(".sorting_1 input").each(function() {
this.checked = true;
});
} else {
$(".sorting_1 input").each(function() {
this.checked = false;
});
}
});
| true |
0139e9963c89d989c4030252001071dd9086fe8c | JavaScript | PDCbc/queries | /test/functions/test_validDate.js | UTF-8 | 1,067 | 2.734375 | 3 | [] | no_license | function setUpTest()
{
return null;
}
module.exports = {
testNull : function()
{
var d = setUpTest();
var result = validDate(d);
var expected = false;
if(result === expected)
{
return {result : true, message : "test passed!"};
}
else
{
return {result : false, mes... | true |
ea6bfabcbd3212d8cd7c01ef0fd4aa7a003982a2 | JavaScript | SHEMPEL133/JS | /object/task_2.js | UTF-8 | 502 | 3.640625 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @return {ListNode}
*/
var middleNode = function (head) {
var temp = head;
var count = 1;
while (temp.next != null) {
count++;
temp ... | true |
435bfaf54d01fad90b23132907f50255cd7f9c99 | JavaScript | dark-swordsman/kac | /capture.js | UTF-8 | 784 | 2.5625 | 3 | [] | no_license | const hook = require('iohook');
const net = require('net');
const buffer = [];
const server = net.createServer((socket) => {
socket.on('data', (data) => {
console.log(data.toString());
});
socket.write('SERVER: Server started.');
hook.on('keydown', e => {
if (buffer.length < 20) {
... | true |
a8374d81a51e30f6337147bd12839cc54005c0eb | JavaScript | ErikSandvikSEA/algorithm-practice | /Nov 2020/restoreString.js | UTF-8 | 182 | 3.171875 | 3 | [] | no_license | var restoreString = function(s, indices) {
let arr = new Array(s.length);
for(let i=0; i<s.length; i++) {
arr[indices[i]] = s[i];
}
return arr.join('');
}; | true |
8bd9918b2c011a510e0bfac5d75861238c7c3d7a | JavaScript | stanley-c-so/leetcode-may-2020-challenge | /day03.js | UTF-8 | 3,072 | 3.765625 | 4 | [] | no_license | // --- Day 3: Ransom Note ---
// Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will return false.
// Each letter in the magazine string can only be ... | true |
66e500f7efcc7506f23cbfcbaa373a1c27487a21 | JavaScript | heqiao1017/Fabflix | /project2/WebContent/search.js | UTF-8 | 14,629 | 2.84375 | 3 | [] | no_license | var movieTableBodyElement = jQuery("#movie_table_body");
var movieTableHeadElement = jQuery("#movie_head");
var totalJsonSize, curItemsPerPage, curPage = 0;;
var titleOrderAsc = 0, yearOrderAsc = 0;
var resultDataString;
function splitListItems(listItems) {
console.log(listItems)
var array = listItems.split(',');
r... | true |
13a5c1505d64621bced0162f6f50c120214ade6f | JavaScript | Prakashthakur0021/QUIZ-W3villa | /src/App.js | UTF-8 | 3,494 | 3.03125 | 3 | [] | no_license | import React, { useState } from 'react';
import './App.css';
import CountDown from './components/Timer'
import {easyQuestions} from "./Questions/EasyQuestions"
import {mediumQuestions} from "./Questions/MediumQuestions"
import {hardQuestions} from "./Questions/HardQuestions"
const App = () => {
const [currentQues... | true |
f706a17ac134a4c37722a0b0baf7e876fc269f5d | JavaScript | rainbowui666/api | /src/api/service/date.js | UTF-8 | 806 | 2.625 | 3 | [] | no_license |
module.exports = class extends think.Service {
convertWebDateToSubmitDateTime(dateString) {
const d = dateString ? new Date(dateString) : new Date();
const month = d.getMonth() + 1;
return d.getFullYear() + '-' + (month > 9 ? month : '0' + month) + '-' + (d.getDate() > 9 ? d.getDate() : '0' + d.getDate()... | true |
58c51daca1a13112344670c23f08ea6c3e73d6f7 | JavaScript | kimd21/javascript-exercises | /calculator/calculator.js | UTF-8 | 476 | 3.3125 | 3 | [] | no_license | function add (a, b) {
return a + b;
}
function subtract (a, b) {
return a - b;
}
function sum (arr) {
if (!arr || !arr.length) {return 0;}
return arr.reduce((accum, val) => accum + val);
}
function multiply (arr) {
return arr.reduce((accum, val) => accum * val);
}
function power(a, b) {
return a ** b;
}
func... | true |
0c4b3592078581999b578ad069de47763f12f591 | JavaScript | seanaleid/Sprint-Challenge-Advanced-React | /client/src/components/Navigation.js | UTF-8 | 1,634 | 2.625 | 3 | [] | no_license | import React from 'react';
import {useDarkMode} from "../hooks/useDarkMode";
//try example from guided project --> come back to --> needs SASS --> dependencies and SASS watch compile
//version 2 - use material ui toggle --> this way doesn't work
// import CheckIcon from '@material-ui/icons/Check';
// import ToggleBut... | true |
a9d994985ad88a3b5135d7c9360ad033b9e6994f | JavaScript | LyleCharlesScott/JS-Code-challenges | /ecmascript/simple-cipher/simple-cipher.js | UTF-8 | 2,259 | 3.296875 | 3 | [] | no_license | const lowercaseOffset = 97;
const alphabetLength = 26;
const alphabetUpperEdge = lowercaseOffset + alphabetLength;
const generateKey = () => {
let key = '';
const keyLength = Math.floor((Math.random() * 100) + 100);
for (let i = 0; i < keyLength; i += 1) {
const randomLetter = Math.floor(Math.random() * 26);... | true |
b60f3cd8d4af33a03c70212fdc3444765a45c15c | JavaScript | IvonReD/trello | /js/app.js | UTF-8 | 698 | 3.015625 | 3 | [] | no_license | window.addEventListener("load", begin);
var container = document.getElementById("content-list")
var list = document.getElementById("addList");
var boxForm = document.getElementById("form");
var text = document.getElementById("list");
var boton = document.getElementById("btn");
function begin(){
/*Versiรณn 0.0.1:Se m... | true |
5a4dd4b0741740cb9a11940ea8976783a8457c69 | JavaScript | starfall-9000/freaking-math-html5 | /js/Logic/logics.js | UTF-8 | 3,975 | 3.046875 | 3 | [] | no_license | // need to setup enviroment
function initGame() {
resetScore()
randNum()
}
function playGame(type) {
const game = Game.currentGame()
game.setConfig({ gameMode: type, gameStatus: 'PLAYED' })
initGame()
countDown()
}
function syncGamePlay(gameMode) {
const game = Game.currentGame()
game.setConfig({ gam... | true |
b0aa7558d3b5ae03fdb12c19b224f7eebd3415d3 | JavaScript | Andrea-Boyd/univerCITY | /routes/html-routes.js | UTF-8 | 1,359 | 2.59375 | 3 | [] | no_license |
var path = require("path");
var db = require("../models");
// Routes
// =============================================================
module.exports = function (app) {
// Each of the below routes just handles the HTML page that the user gets sent to.
// index route loads view.html
app.get("/", function ... | true |
66af0f24459c7e2f98959a13c2c4dedfaab21914 | JavaScript | drholix/MC1-ORM | /index.js | UTF-8 | 1,572 | 2.640625 | 3 | [] | no_license | const express = require('express');
const app = express();
const port = 3000;
const { User } = require('./models');
app.use(express.json());
app.get('/users', (req, res) => {
User.findAll().then((users) => {
res.status(200).json(users);
});
});
app.get('/users/:id', (req, res) => {
User.findOne({
wher... | true |
26306c2d93e30181fad4882c47288059c622e26c | JavaScript | fanwuyue/Software-Engineering | /html/static/js/user/sortengineer.js | UTF-8 | 4,284 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
function getMyDate(str) {
ย ย ย ย var oDate = new Date(str),
ย ย ย ย oYear = oDate.getFullYear(),
ย ย ย ย oMonth = oDate.getMonth()+1,
ย ย ย ย oDay = oDate.getDate(),
ย ย
ย ย ย ย oTime = oYear +'-'+ addZero(oMonth) +'-'+ addZero(oDay) ;
ย ย ย ย return oTime;
}
function addZero(num){
if... | true |
7f8b08b0f723abd3540868bfed1ee1b3678da292 | JavaScript | rvanooyen/readme-generator | /utils/generateMarkdown.js | UTF-8 | 3,461 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | // TODO: Create a function that returns a license badge based on which license is passed in
// If there is no license, return an empty string
const renderLicenseBadge = (license) => {
let licenseBadge = '';
switch (license) {
case 'Apache':
licenseBadge = ';
// console.log(bill.innerHTML);
// const billAmount=bill.value;
// console.log(billAmount);
const btnCheck = document.querySelector("#check-button");
const cashGiven = document.querySelector("#ca... | true |
d85c34b8db0304ea6d2df289cdc6dae9bfbdfc72 | JavaScript | huongw/Lotide | /test/eqArraysTest.js | UTF-8 | 480 | 2.6875 | 3 | [] | no_license | const eqArrays = require("../eqArrays");
const { assert } = require("chai");
describe("#eqArrays", () => {
it("will return true if arrays are equal", () => {
const expected = true;
const actual = eqArrays([1, 2, 3], [1, 2, 3]);
assert.deepEqual(actual, expected);
});
it("will return false if arr... | true |
43e661e1eaad0b589020d5e944ecbdc33c9ffc65 | JavaScript | mariannas-web/front-end | /src/components/news/newsCards.js | UTF-8 | 1,334 | 2.640625 | 3 | [
"MIT"
] | permissive | import React from 'react'
import NewsCard from './newsCard'
import './newsCards.css'
import axios from 'axios'
export default class NewsCards extends React.Component{
constructor(props){
super(props);
this.state = {
newsCards: []
}
}
componentDidMount(){
this... | true |
482386a1743383aaf2274c27b7602fe56e08fdf2 | JavaScript | fearlessfreap24/pogofindcounters | /js/findCounters.js | UTF-8 | 3,020 | 2.75 | 3 | [] | no_license | function capitalize(str){
return str.charAt(0).toUpperCase() + str.slice(1);
};
function findCounter() {
let selected1 = document.getElementById('typeForCounter1').value.toLowerCase();
let selected2 = document.getElementById('typeForCounter2').value.toLowerCase();
var counters = new Set();
... | true |
7c3afb56de60f72966255084b1013a66e771d784 | JavaScript | Ritu-Agrawal/Angular4 | /angularfundamentals/02-promise.js | UTF-8 | 359 | 3.625 | 4 | [] | no_license | var addNumbers = function (a, b) {
var result;
return new Promise(function (resolve, reject) {
setTimeout(function () {
result = a + b;
resolve(result);
}, 1000);
});
}
addNumbers(5,6).then(function(result){
console.log('Result:'+result);
},function(err... | true |
dccb08d21a9a8e0d7a4112fac862be6eb4496bdf | JavaScript | joo7875/redux-thunk-blog | /src/actions/index.js | UTF-8 | 2,710 | 3.296875 | 3 | [] | no_license | import jsonPlaceholder from '../apis/jsonPlaceholder';
import _ from 'lodash';
export const fetchPostsAndUsers = () => async (dispatch, getState) => {
console.log('About to fetch posts');
await dispatch(fetchPosts()); // made delay
// call Action Creator fetchPosts() and run this inner function
// reac... | true |
eef21c89f5208cf9bc724ca8d3377999630c9ca9 | JavaScript | Siphesihle1/Beta-Website | /Beta Website/Javascript/ShoppingCart.js | UTF-8 | 2,858 | 3.4375 | 3 | [] | no_license | //Shopping cart class
function ShoppingCart() {
//Declaring and initialialising variables
this.storedCartItems = [];
this.counter = document.getElementById("itemCount");
this.getCartItems = function(items) {
var cartItems = localStorage.getItem("cartItems");
//Checking if the ar... | true |
72ee840438cdf9ca1adb10da198576236fdc2cfe | JavaScript | efalayi/rpn-generator | /client/api/api.spec.js | UTF-8 | 1,596 | 2.578125 | 3 | [
"MIT"
] | permissive | import api from './api'
describe('#api', () => {
describe('#getPhoneNumbers', () => {
it('should get generated phone numbers from server', async () => {
const sampleData = ['0123456789']
fetch.mockResolvedValueOnce({
json: jest.fn(() => ({
phoneNumbers: sampleData
}))
... | true |
fdcaa93575ea092bf663300a15b7d6fb12eeaf3d | JavaScript | shunwuyu/lesson_md | /interview/2023/es6+/1.js | UTF-8 | 189 | 2.859375 | 3 | [] | no_license | var obj = {
name: '่ฎกๆถ',
email: 'jitao@163.com'
}
// console.log(Object.keys(obj).map((key) => obj[key]));
// console.log(Object.values(obj));
console.log(Object.entries(obj)); | true |
9ca6c18b1b6c35adb60ad9041fb040fa45c72600 | JavaScript | google-microsoft/hygen-smartcompany | /_templates/hygen-smartcompany/fuzzy/index.js | UTF-8 | 2,600 | 2.5625 | 3 | [] | no_license | const path = require("path");
const dtoJson = require('./main/resources/dto.json')
module.exports = {
params: function ({args}) {
if (!args.name) {
args.name = "exmaple";
}
let dtoCode = this.createDtoCode(dtoJson);
let dtoYml = this.createDtoYml(dtoJson);
return... | true |
b44caf419ccd61cf9bb3f270f29ce66b3ff25459 | JavaScript | 19Ahmed83/-problemSolving- | /useRecursionToCreateARangeOfNumbers.js | UTF-8 | 264 | 3.609375 | 4 | [] | no_license | function rangeOfNumbers(startNum, endNum) {
if (startNum === endNum) {
return [startNum]
} else {
const number = rangeOfNumbers(startNum, endNum - 1);
number.push(endNum)
}
return number;
}
console.log(rangeOfNumbers(1, 7)) | true |
f1cba6a297ad387e9983098e5c0292c7f0a42581 | JavaScript | ardragan/react-experiments | /src/reducers/PostsReducer.js | UTF-8 | 581 | 2.609375 | 3 | [] | no_license | import { v4 as uuidv4 } from 'uuid';
export default function PostsReducer(state = [], action) {
switch (action.type) {
case 'FETCH_POSTS':
return action.posts
case 'ADD_POST':
const newPost = {
id: uuidv4(),
title: action.title,
... | true |
35cce92b54dbc727a5d01ad18b99aa81cd21887e | JavaScript | deaundrep/new-dinosaurs-yay-question-mark | /main.js | UTF-8 | 1,119 | 2.890625 | 3 | [] | no_license | const makeDino = function(species, period, carnivore, extinct = false) {
const dino = {
species: species,
period: period,
carnivore: carnivore,
extinct: extinct,
}
return dino
}
const makeSingular = function(dino) {
const newDino = {
species: dino.species,
period: dino.period,
carnivore: dino.carnivore... | true |
85eebfa8f067f98fbed6097b3ec2f97c9d8b67a5 | JavaScript | MHAN001/HZHW | /FinalProject/Index/js/login.js | UTF-8 | 1,769 | 2.84375 | 3 | [] | no_license | function loginaction() {
var username = document.getElementById("username").value
var password = document.getElementById("password").value
var loginurl = "http://127.0.0.1:8000/login/"+ username +"/password/" + password
$.ajax({
type: "GET",
url: loginurl,
dataType: 'text json',
... | true |
86ec13505b51aa475becc5654f2b196df1878401 | JavaScript | praveen-me/math-department | /src/js/faculty.js | UTF-8 | 3,448 | 3.109375 | 3 | [] | no_license | (function () {
// Array of Faculty
const faculty = [
{
name : "Sundarjeet Kaur Bhatia",
qualification : "M.Phil.",
post : "Associate Professor",
id : 0,
email : "skbhatiadu@gmail.com"
},
{
name : "Dalje... | true |
63e42bc8bf51ea10d9070fbc28bd804627481989 | JavaScript | KipodAfterFree/KAF-2019-VeriPieo | /src/challenge/apps/notes/app.js | UTF-8 | 851 | 2.6875 | 3 | [
"MIT"
] | permissive | get("new").onclick = () => {
app_read("notes", (result) => {
if (result === null) result = [];
result.push("New note");
app_write("notes", result, () => {
device_app("apps/notes");
});
});
};
app_read("notes", (result) => {
if (result === null) result = [];
f... | true |
320f59f27e7ddd4fbeb1e2f6c5b9155b76f3bda2 | JavaScript | aphid/fdmsequence | /sequencer.js | UTF-8 | 2,811 | 3.21875 | 3 | [] | no_license | /*
sequencer.js 0.00002
abram stern, aphid@ucsc.edu
This code is public domain.
notes: requires popcornjs and jquery
include this file and 'sequence.js' with your sequence in it.
for now sequence will always start with the first element in the file.
reads "groupdata" object from manifest.js (loaded in the html). fol... | true |
898755d9781d6e2d4181196d68c078c608e4c2e0 | JavaScript | Dunwoody-CWEB-Final-Project-Repository/final-project-repository-FlameDiffusion | /routes/login.js | UTF-8 | 2,027 | 2.515625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
const db = require('../db/index');
const { check, validationResult } = require('express-validator');
const bcrypt = require('bcrypt')
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('login');
});
router.post('/',
[
chec... | true |
779a25303673eeedf4dc85cf28d2774ad0038605 | JavaScript | jgrindall/babylontest | /public/diy3d/game/src/HUD.js | UTF-8 | 3,661 | 2.875 | 3 | [] | no_license | define([], function(){
"use strict";
var BLOCK_SIZE = 14;
var BLOCK_SIZE2 = BLOCK_SIZE/2;
var SIZE = 250;
var SIZE2 = SIZE/2;
var PI2 = 2*Math.PI;
var HUD = function(selector){
var $selector = $(selector);
this.canvas = document.createElement("canvas");
this.canvas.width = $selector.width(... | true |
c1ff0d89f449026e19e4317ad5691eb3e85af0c9 | JavaScript | Arjun819/Shipo | /sketch.js | UTF-8 | 538 | 2.84375 | 3 | [] | no_license | var ship, ship_moving
var sea, sea_moving
function preload(){
ship_moving = loadAnimation("ship-3.png","ship-4.png")
sea_moving = loadImage("sea.png")
}
function setup(){
createCanvas(1500,700);
coast = createSprite(750,350,background.width,background.height)
coast.addImage("sea",sea_moving)
boat = createSpr... | true |
a812d2c55f36074ef78bc1f79d5aa04af099a485 | JavaScript | daniloamsilva/jobscalc-maratona-discover | /src/models/Profile.js | UTF-8 | 936 | 2.5625 | 3 | [] | no_license | const Database = require('../db/config');
module.exports = {
async get() {
const db = await Database();
const data = await db.get(`SELECT * FROM profile`);
await db.close();
return {
name: data.name,
avatar: data.avatar,
monthlyBudget: data.monthly_budget,
daysPerWeek: data... | true |
a46c72e59f969e586be5c0245a287cb408fe1221 | JavaScript | shivasaicharan/practise | /30-01-2019/Falling factorial and random back ground color/falling.js | UTF-8 | 731 | 3.546875 | 4 | [
"MIT"
] | permissive | function factor(){
var x=document.getElementById("num1").value;
var y=document.getElementById("num2").value;
var i=(x-y)+1, r=1;
if(x<0){
document.getElementById("result").innerHTML="Enter the valid number";
}
else if(Number(y)>Number(x)){
console.log(Number(y)>Number(x));
... | true |
2b41d850966a36c77311eb558a994e60381f4297 | JavaScript | npmcomponent/jamesarosen-progressbars | /index.js | UTF-8 | 3,034 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | // Ember-Progressbars.js version 1.0.0
// (c) 2012 James A. Rosen, Zendesk Inc.
// Timecop.js is freely distributable under the Apache v2 License
// For all details, documentation, and bug reports, see
// http://github.com/jamesarosen/ember-progressbars
(function(){
(function() {var get = typeof(Ember) !== 'undefi... | true |
a058d8be9966a188ece79b560fa3e3fa3eb164f7 | JavaScript | spacebar1/spacebar1 | /tact/BattleLogR.js | UTF-8 | 1,688 | 2.8125 | 3 | [
"MIT"
] | permissive | /*
* Renders any input text. For things like confirmation buttons.
* Takes a single key as response, and sends it back to the callback.
*/
(function() {
SBar.BattleLogR = function(title, messageLogs) {
this._initBattleLogR(title, messageLogs);
};
SBar.BattleLogR.prototype = {
title: null,
messageL... | true |
1735828c5ed95d73704aa00a8fa44a388f23062f | JavaScript | Marv-jo/GameWeek | /js/state/levelState.js | UTF-8 | 3,761 | 2.59375 | 3 | [] | no_license | var LevelState = function(game) {};
LevelState.prototype =
{
preload: function(game)
{
game.load.tilemap('map', 'config/maps.json', null, Phaser.Tilemap.TILED_JSON);
game.load.image('background', 'assets/digital.jpg');
for (var i = 0 ; i < list.assets.length ; i++){
game.load.image(list.asset... | true |
0e01162aed9f2e8e637f527698235c69878b27b1 | JavaScript | speckworks/GCnumber2a | /index.js | UTF-8 | 537 | 3.5 | 4 | [] | no_license |
const commonYears = rangesArr => {
// [[1910, 1950], [1900, 1951], [1945, 2000]]
let births = [], deaths = []
rangesArr.forEach(range => {
births.push(range[0])
deaths.push(range[1])
})
let latestBirth = births.sort().pop()
let earliestDeath = deaths.sort().shift()
let numberOfYears = earlie... | true |
b982b914753c8c7c92a74fb67a21262d0a5c22c2 | JavaScript | ObsessiveOrange/RHCareerFairLayout | /web/website/WebContent/lib/PersistentStorage.js | UTF-8 | 1,496 | 2.640625 | 3 | [] | no_license | //
// Set strict mode on.
"use strict";
(function(window) {
function define_PersistentStorage() {
var PersistentStorage = {};
PersistentStorage.storeObject = function(key, object) {
this.storeString(key, JSON.stringify(object));
}
PersistentStorage.storeString = ... | true |
84a30c19d9b20b0d70e1e15679ece6a71b06b1dc | JavaScript | tayaracaires/squad-sport | /src/components/button.js | UTF-8 | 479 | 2.703125 | 3 | [] | no_license | function Button(props) {
const template = `
<button
data-id="${props.dataId}"
id="${props.id}"
class="${props.class} primary-button"
onclick="button.handleClick(event, ${props.onClick})" >${props.title}
<i class="${props.icone}"></i>
</button>
`;
return template;
};
window.button = {... | true |
1c9d3e7ebfd2b53b706dac722cecaf836d2e8989 | JavaScript | leoherrick/domino-mofo-js | /spec/SpinnerSpec.js | UTF-8 | 859 | 2.6875 | 3 | [] | no_license | describe("Spinner", function() {
beforeEach(function() {
four_four = new Spinner(4);
});
it("should have four ends", function(){
expect(four_four.ends.length).toEqual(4)
})
describe("#score", function(){
it("should score all pips if 0 or 1 ends are connected", function(){
expect(four_four... | true |
2110da161c11ec50e45d17fb42eef853405bdedd | JavaScript | juliangruber/hyperspace | /lib/key_of.js | UTF-8 | 300 | 2.53125 | 3 | [
"MIT"
] | permissive | module.exports = function (key) {
if (key === true) {
return function () { return true };
}
else if (typeof key === 'string') {
return function (row) { return row && row[key] }
}
else if (typeof key === 'function') {
return key;
}
return false;
};
| true |
ad66c22c31ca4559fff095143d942ddf5857a07c | JavaScript | Albertove951/db200-mongodb-server | /examples.js | UTF-8 | 3,158 | 2.75 | 3 | [] | no_license | const { MongoClient } = require('mongodb');
const url = 'mongodb://localhost:27017/native-example';
MongoClient.connect(url, function(err, db) {
db.collection('cars')
.insertOne({
make: 'Ford',
model: 'Focus',
year: 2017
})
.then(response => {
... | true |
ed480ba94b213ccd3f7d1c9fab94e6c54702d876 | JavaScript | emlyemly/emlyemly.github.io | /magic8.js | UTF-8 | 3,148 | 3.328125 | 3 | [] | no_license | const input = document.querySelector('.input');
const submit = document.querySelector('.submit-btn');
const loader = document.querySelector('.loader');
let question = '';
let inputErrorAdded = false;
let submitErrorAdded = false;
// hide loader
loader.style.display = 'none';
// add class to submit btn for styling
subm... | true |
213cca0e33ce601cba8faa98dc74fc0c99e14299 | JavaScript | jianqi-liu0874/sharing_zuche | /utils/util.js | UTF-8 | 1,485 | 2.8125 | 3 | [] | no_license | const app = getApp();
/**
* ่ฟๆปค็ฉบๅญ็ฌฆไธฒ, null, undefined
*/
function filterEmpty(data) {
data = data || {};
let obj = {};
Object.keys(data).forEach(key => {
let item = data[key];
if (item !== '' && item !== undefined && item !== null) {
obj[key] = item;
}
});
return obj;
}
// ๅ้urlๅ
function params2Query(p... | true |