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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6b8bc0ce0a81c3380e0efa02db00f864d47f5583 | JavaScript | sanchit0496/50days50projects | /ripple-effect/script.js | UTF-8 | 644 | 3.203125 | 3 | [] | no_license | let buttons = document.querySelectorAll('.ripple');
buttons.forEach(button => {
button.addEventListener('click', function(e){
let x = e.clientX;
let y = e.clientY;
let a = e.target.offsetTop;
let b = e.target.offsetLeft;
let insideLeft = x-b;
let insideTop = y-a;
... | true |
3d6b6438a5cdbf7ea0e5877451427cd421d44649 | JavaScript | ajiprasetyo/dicoding_final_dev | /component/standings.js | UTF-8 | 2,363 | 2.796875 | 3 | [] | no_license | function standings(data) {
var tableHTML = "";
data.standings.forEach(function (standing) {
//console.log(standing)
var dataTableHTML = "";
standing.table.forEach(function (club) {
club = JSON.parse(JSON.stringify(club).replace(/http:/g, 'https:'));
//console.log(... | true |
2c59cb758ecbbe3d69464a3ba36fc5af75ee1e91 | JavaScript | shreen479/weather-app | /public/js/app.js | UTF-8 | 1,212 | 3.1875 | 3 | [] | no_license |
console.log('Client side JS file is loaded')
const WeatherForm = document.querySelector('form')
const searchValue= document.querySelector('input')
const msgOne = document.querySelector('#message1')
const msgTwo = document.querySelector('#message2')
WeatherForm.addEventListener('submit', (e) => {
e.preventDefaul... | true |
02040d4f77d251eac96ec60ebca6cf58ee0c4394 | JavaScript | kemitchell/thundercats | /test/setStateUtil.js | UTF-8 | 865 | 2.609375 | 3 | [] | no_license | var chai = require('chai');
chai.should();
var setStateUtil = require('../').setStateUtil;
describe('Set State Util', function() {
var operation;
beforeEach(function() {
operation = setStateUtil({ cool: 'swag' });
});
it('should return an object with the method `transform`', function() {
operation.sho... | true |
f351fa1a5718c65e99bf301a15be4309464e7986 | JavaScript | nickgusd/MusicExchangeReact | /client/src/components/login/SignUp.js | UTF-8 | 6,314 | 3.078125 | 3 | [] | no_license | import React, { Component } from 'react';
import API from "../../utils/API"
class SignUp extends Component {
state = {
firstName: "",
lastName: "",
email: "",
password: "",
firstNameError: "",
lastNameError: "",
emailError: "",
... | true |
e97474bc3412e0817a49864f2b5ffd1e696727ba | JavaScript | detcitty/100DaysOfCode | /js/unfinished/playingWDigits.js | UTF-8 | 164 | 2.84375 | 3 | [] | no_license | //https://www.codewars.com/kata/5552101f47fc5178b1000050/train/javascript
function digPow(n, p){
// ...
// What does this do?
var str_digit = n.toString();
} | true |
1467c3847bdda38f2b90ca15feb96e6022b4960d | JavaScript | MrCorax/274053-cinemaddict-11 | /src/utils/common.js | UTF-8 | 1,646 | 3.21875 | 3 | [] | no_license | import {MONTH_NAMES} from "../consts";
// генератор случайного числа для оценки
export const getRandomNumber = (min, max) => {
return (min + (Math.random() * (max - min))).toFixed(1);
};
// генератор случайного целого числа
export const getRandomIntegerValue = (min, max) => {
return min + Math.floor(Math.random()... | true |
e347bfc1e08338353e4111f37865e372d8036de8 | JavaScript | S3ler/SmartWatering | /src/js/NewMVC/View/MapObjects/MapBackground/MapBackgroundTouch.js | UTF-8 | 7,309 | 2.6875 | 3 | [] | no_license | function MapBackground(svgMap, mapheight, mapwidth, controller) {
this.controller = controller;
this.svgMap = svgMap;
this.mapHeight = mapheight;
this.mapWidth = mapwidth;
this.background = document.createElementNS("http://www.w3.org/2000/svg", 'rect');
this.background.setAttribute("cx", "" + ... | true |
2df9cb8266e3408d203d3397f9cf6f366bdec50b | JavaScript | Blabolka/SudokuSolver | /src/assets/js/utils/solver.js | UTF-8 | 1,782 | 3.265625 | 3 | [] | no_license | import { checkRow, checkColumn, checkBlock } from "./validator.js";
let exitStatus = false
export function solveSudoku(sudoku) {
let currentNumberOfElements = 0
// set position of mutable items (true -> mutable, false -> immutable)
const mutableIndexes = sudoku.map((row) => {
return row.map((rowEl... | true |
66ac16841adbaf129b41cd75e1c722e6b3d863e3 | JavaScript | AxelGuignard/Mobchamp | /script/gameController.js | UTF-8 | 11,639 | 2.703125 | 3 | [] | no_license | let viewport = {width: $(document).width(), height: $(document).height() };
let map = null;
let canvas = document.getElementById("viewport");
let ctx = canvas.getContext("2d");
let civilisations = [];
let colonies = [];
let totalPop = 0;
let actionStack = [];
actionStack["attack"] = [];
actionStack["reinforce"] = []... | true |
f80ae6aa764a48701a6822e42a4f438bc14619a1 | JavaScript | bytabit/bytabit-serverless | /src/main/js/Badge.js | UTF-8 | 3,336 | 2.515625 | 3 | [] | no_license | /*
* Copyright 2019 Bytabit AB
*/
"use strict";
class Badge {
constructor(db) {
this.db = db;
}
put(event, callback) {
const timestamp = new Date().valueOf();
try {
const data = JSON.parse(event.body);
const params = {
TableName: process... | true |
617a1ebc558de4b05e62c7ada12bdc8706022f37 | JavaScript | learn-co-students/seattle-web-100719 | /99-daily-algorithms/25-antipodes-average/solution.js | UTF-8 | 372 | 3.5625 | 4 | [] | no_license | // Matt
function antipodes(arr){
let mid = arr.length%2
if(mid === 0){
mid=arr.length/2
}
}
// rachid's addition
function antipodesAverage(arr) {
const halfArrLength = Math.floor(arr.length/2)
const arr1 = arr.slice(0, halfArrLength)
const arr2 = arr.reverse().slice(0, halfA... | true |
2dccf80f808600a8f787ac1cb909517e23bcbfba | JavaScript | OusmanaTraore/ProjetPerso | /Canvas/mescanvas/main.js | UTF-8 | 1,479 | 3.421875 | 3 | [] | no_license | const canvas = document.querySelector("#myCanvas1");
var cxt = canvas.getContext("2d");
// Dessin de rectangle rouge
cxt.fillStyle = "#FF0000";
cxt.fillRect(0, 0, 200, 100);
//Dessin de ligne oblique
cxt.moveTo(0, 0);
cxt.lineTo(200, 100);
cxt.stroke();
//Dessin de cercle
var ctx = canvas.getContext("2d");
ctx.beginP... | true |
7c767e225603325335d7244ac368de35e38eaac3 | JavaScript | James-61120/full_Project_MEN | /public/js/root.js | UTF-8 | 1,707 | 2.515625 | 3 | [] | no_license | const root=location.protocol+"//"+location.host
$('.addCart').click(function(event){
event.preventDefault()
const href=this.href
console.log(href)
$.ajax({
url:href,
type:'GET',
data:{},
success:function(){
swal("Add successful!", "continute!", "success");
... | true |
496934c71e4e6d460c7ab893f4d32c20555e3f9d | JavaScript | pollen8/Prefab | /public/js/app/lang.js | UTF-8 | 360 | 2.515625 | 3 | [] | no_license | // Simple language string manager
define(function() {
return {
get: function (k) {
if (this.hasOwnProperty(k)) {
return this[k];
} else {
return k;
}
},
set: function (k, v) {
// Cant set reserved strings!
if (k === 'get' || k === 'set') {
return;
}
this[k] = v;
},
'... | true |
4cbef0e88921cba657c7780510b7abc6d1238c5f | JavaScript | mushahiroyuki/ljs3 | /example/ch03/ex03-18-2/main.js | UTF-8 | 199 | 3.078125 | 3 | [] | no_license | const d = new Date(); // 現在の日時
console.log(d); // 2016-08-08T08:45:46.332Z
const ts = d.valueOf(); // UTCの1970年1月1日午前0時からのミリ秒数
console.log(ts); // 1470645946332
| true |
629d9b2c3dc7b4de6ef66c25de18a9f0bf5264c7 | JavaScript | justindelatorre/js_210 | /small_problems/easy_1/9_multiples_of_3_and_5.js | UTF-8 | 548 | 4.1875 | 4 | [] | no_license | ome other number, inclusive, that are multiples of 3 or 5. For
* instance, if the supplied number is 20, the result should be 98 (3 +
* 5 + 6 + 9 + 10 + 12 + 15 + 18 + 20).
*
* You may assume that the number passed in is an integer greater than 1.
*/
function multisum(end) {
let sum = 0;
for (let number = 1... | true |
0dadf8b322f0214e47930ceb8551e93a051da368 | JavaScript | rehee/leetcode-js-solution | /problems/762-prime-number-of-set-bits-in-binary-representation/v1.js | UTF-8 | 401 | 3.3125 | 3 | [] | no_license | var countPrimeSetBits = function(L, R) {
var count = 0;
for(let i = L; i< R+1;i++){
if(isPrime(i)){
count++;
}
}
return count;
};
function isPrime(L){
var l = (L>>>0).toString(2).replace(/0/g,'');
var c= l.length;
for(let i =2;i<c;i++){
if(c%i==0){
return fa... | true |
aa867829563b381282dcc741728b4c1475f0055d | JavaScript | vk0808/js-constructs | /Selection/if-else/leapYear.js | UTF-8 | 339 | 3.359375 | 3 | [] | no_license | readline = require("readline-sync");
let year = parseInt(readline.question("Enter year : "));
let condition1 = year % 4;
let condition2 = year % 100;
let condition3 = year % 400;
if (condition1 == 0 && condition2 != 0 || condition3 == 0) {
console.log(year + " is a leap year");
} else {
console.log(year + " is n... | true |
d117f96f0552f81d0107b8be0026833be84dd222 | JavaScript | Felps03/KnockoutJs_Felipe | /index.js | UTF-8 | 3,108 | 2.765625 | 3 | [] | no_license | var base_url = "http://localhost:3000/";
function Model(nome, nascimento, cpf, peso, altura, descricao, senha) {
this.nome = ko.observable(nome);
this.nascimento = ko.observable(nascimento);
this.cpf = ko.observable(cpf);
this.peso = ko.observable(peso);
this.altura = ko.observable(altura);
thi... | true |
c9770d52790836f6cfc504360bc98abded04c9c8 | JavaScript | marcelocarvalhoqueiroz/jsStudy | /JS/exercicios/exercicio2.js | UTF-8 | 328 | 3.71875 | 4 | [] | no_license | function triangulo(a, b, c){
if(a === b && a === c){
console.log('Equilátero')
} else if(a !== b && a !== c && b !== c){
console.log('Escaleno')
} else if(a === b || a === c || b === c ){
console.log('Isósceles')
}
}
triangulo(2, 2, 2)
triangulo(2, 2, 3)
triangulo(3,... | true |
2b6f9a61d0d365440c561eb645566878dbdcd120 | JavaScript | hasanrana21/react-core-concept_recap | /src/App.js | UTF-8 | 3,489 | 2.984375 | 3 | [] | no_license | import logo from './logo.svg';
import './App.css';
import { useEffect, useState } from 'react';
function App() {
const nayoks = ['Deepjol', 'Ada Sharma', 'Prajekta', 'BB ki Vines'];
const AllFoods = [
{name: 'Orange', age: '15', id: '1'},
{name: 'Mango', age: '18', id: '2'},
{name: 'Apple', age: '12',... | true |
7cce92bd490ed0d1a47094e8750edae0e5084ed0 | JavaScript | zijun2018/bd | /src/utils/time-methods.js | UTF-8 | 4,812 | 3.1875 | 3 | [] | no_license | /**
* @Project: 时间相关的方法
* @Author: Zi_Jun
* @Email: zijun2030@gmail.com
* @Date: 2019/5/5 15:48
* @Note:
*/
/**
* 时间格式化,将给定时间转换为需要的时间格式
* @param date {Object} 时间格式对象
* @param fmt{String} 需要转化的时间格式,比如:‘YYYY-MM-dd HH:mm:ss’
* @return {*} 需要的时间格式
*/
export const dateFormat = (date, fmt)... | true |
905e3c46778d188bc1a846836a5914303e2d2a98 | JavaScript | Bowen7/leetcode | /src/swordToOffer/que-shi-de-shu-zi-lcof.js | UTF-8 | 229 | 3.296875 | 3 | [
"MIT"
] | permissive | var missingNumber = function(nums) {
let n = nums.length + 1;
const _sum = ((n - 1) / 2) * n;
const sum = nums.reduce((pre, item) => {
return pre + item;
}, 0);
return _sum - sum;
};
console.log(missingNumber([0, 1, 3]));
| true |
76db3f5b287996deff79c2a885fdcd81f8a75734 | JavaScript | wlwl0219/algorithms_practice | /programmers/level1/newId.js | UTF-8 | 3,248 | 3.875 | 4 | [] | no_license | // 새로 가입하는 유저들이 카카오 아이디 규칙에 맞지 않는
// 아이디를 입력했을 때, 입력된 아이디와 유사하면서 규칙에 맞는
// 아이디를 추천해주는 프로그램을 개발하는 것입니다.
// 아이디의 길이는 3자 이상 15자 이하여야 합니다.
// 아이디는 알파벳 소문자, 숫자, 빼기(-), 밑줄(_), 마침표(.) 문자만 사용할 수 있습니다.
// 단, 마침표(.)는 처음과 끝에 사용할 수 없으며 또한 연속으로 사용할 수 없습니다.
// 신규 유저가 입력한 아이디가 new_id 라고 한다면,
// 1단계 new_id의 모든 대문자를 대응되는 소문자로 치환합니다.
/... | true |
56d50f6f5c25b50dcfbeea01a1c4238e520eb41e | JavaScript | ckpantelides/algorithms | /3.5 Sort stack.js | UTF-8 | 1,716 | 4.46875 | 4 | [] | no_license | // Write a program to sort a stack such that the smallest items are on the top
// You can use an additional temporary stack, but no other data structure
function sortStack(stack) {
let tempStack = new Stack();
while (!stack.isEmpty()) {
// Pop the top of the stack and hold the data in memory. Push it to the
... | true |
d2c49c7c296540e42ae562a2defba0dc4ab66266 | JavaScript | bgoonz/UsefulResourceRepo2.0 | /MY_REPOS/Lambda-Resource-Static-Assets/2-resources/_External-learning-resources/00-Javascript/JavaScript-and-jQuery/Day_1/Video4_Video_4_Functions/main.js | UTF-8 | 172 | 3 | 3 | [
"MIT"
] | permissive | function sentence1(verb, noun) {
return "I am " + noun;
}
// Try to create a few other functions
function addTwoNumbers(a, b) {
// Write the code to add 'a' and 'b'
}
| true |
acdf9295bf72e2232f5abe0d2e466473cde0de72 | JavaScript | slakeyj/data-structures-and-algorithms | /code-challenges/arrayShift/array-shift.test.js | UTF-8 | 696 | 2.953125 | 3 | [
"MIT"
] | permissive | 'use strict';
const insertShiftArray = require('./array-shift.js')
describe('insertShiftArray', () => {
it('inserts number into middle of an array with even number of values', () => {
expect(insertShiftArray([4, 5, 7, 8], 6)).toEqual([4, 5, 6, 7, 8]);
})
it('inserts number into middle of an array with odd n... | true |
ee99b75f482ba268c6cf63ce339de6693c385edf | JavaScript | jeesunikim/coderbyte | /03-simpleadding.js | UTF-8 | 283 | 3.5 | 4 | [] | no_license | function SimpleAdding(num) {
var sum = 0;
for(var i=0;i<=num;i++){
sum+=i;
}
// code goes here
return sum;
}
// keep this function call here
// to see how to enter arguments in JavaScript scroll down
SimpleAdding(readline());
| true |
e826224dac00908d23642182ab2da234baedd81a | JavaScript | vova-povoroznyuk/chess | /src/logic/getResultMoveArr.js | UTF-8 | 1,304 | 2.65625 | 3 | [] | no_license | import { getType } from './utils';
import { getFigurePosition } from './getFigurePosition';
import { getAttackArr } from './getAttackArr'
import { getResultStatus } from './getResultStatus';
import { getMoveArr } from './getMoveArr';
export function getResultMoveArr(state){
const { player, status, y, x } = state;
... | true |
e0f3d570023532cd52897a4d6c5388568ecc8550 | JavaScript | RiyanRIS/bahagia-bot | /lib/kamus.js | UTF-8 | 2,483 | 2.5625 | 3 | [] | no_license | const axios = require("axios")
const cheerio = require('cheerio')
module.exports.kbbi = async (kata) => {
return new Promise((resolve, reject) => {
if (!kata) {
reject("Kata kosong")
return
}
const q = kata.trim().split(/ +/g)
axios.get(`https://jagokata.com/arti-kata/${q.join('%20')}.ht... | true |
42aa181dd7f80b4b8a873ae821cd8751f70db3a5 | JavaScript | zakapop/retail_analytics | /app_server/controllers/users.js | UTF-8 | 487 | 2.640625 | 3 | [] | no_license | //listUsers function sends list of users to render page
exports.listUsers = function(req, res){
console.log('Attempting to list users...');
var db = req.db;
var collection = db.get('usercollection');
var cLength = collection.length;
if (cLength === 0){console.log('No users found');}
else {console.log(cLengt... | true |
6a8a212dc4d6c063eeb1f6ea2ac8b5d8b081f6aa | JavaScript | guilhermeestrela/classic-arcade | /js/app.js | UTF-8 | 3,457 | 3.390625 | 3 | [] | no_license | const BLOCK_WIDTH = 101;
const BLOCK_HEIGHT = 83;
/**
* Class: Enemy
*
* Enemies we should avoid
*/
class Enemy {
constructor(){
this.sprite = 'images/enemy-bug.png';
this.x = 1;
this.y = (Math.floor(Math.random() * 3) + 1) * BLOCK_HEIGHT;
this.speed = (Math.floor((Math.random()... | true |
520c1ef549b68d1fedfec32baf733a38fa344fdb | JavaScript | deltawebmap/Delta-Web-Map-Frontend-JS | /assets/app/v2/deltawebmap/views/popouts/DeltaPopoutModal.js | UTF-8 | 4,909 | 2.671875 | 3 | [] | no_license | "use strict";
class DeltaPopoutModal {
/* Represents a popout with modules, usually for a dino or structure */
constructor(app, targetPosition, server, serverDatabase, databaseId, modulesCallback) {
this.app = app;
this.targetPosition = targetPosition;
this.modules = [];
this.modulesCallback = modulesCallb... | true |
7227f1771021562b7d500a81cc86c5ccb788f167 | JavaScript | fredrik655/testingPractice | /Caesar.test.js | UTF-8 | 1,060 | 2.75 | 3 | [] | no_license | const { test, expect } = require('@jest/globals');
const caesar = require('./Caesar');
test('shift with index', () => {
expect(caesar('abc',1)).toBe('bcd');
expect(caesar('hello',5)).toBe('mjqqt');
expect(caesar('caesar',3)).toBe('fdhvdu');
})
test('shift with neg index', () => {
expect(caesar('abc',-1)).toB... | true |
2a0d01527ddd9391c53bef2b1b2b9ce7a58418c3 | JavaScript | KomorIksDe/KocchiBot-Discord | /src/usefulBudds.js | UTF-8 | 233 | 2.96875 | 3 | [] | no_license | exports.isServer = function(str) {
var servers = ["eune", "euw", "na", "kr"];
for(var i = 0; i < servers.length; i++) {
if(str.toLowerCase() === servers[i])
return true;
}
return false;
} | true |
2b919ba62ea614cb4328e0aed0b891dcc6057f50 | JavaScript | conversational-interfaces/dms-scratchpad | /js/main.js | UTF-8 | 8,577 | 2.65625 | 3 | [] | no_license |
let worker = null;
let dmsEditor;
const CANVAS_SIZE = 1000
const canvas = document.getElementById('canvas');
const dmplOutputDiv = document.getElementById('dmpl-output');
const messagesDiv = document.getElementById('messages');
const messagesListDiv = document.getElementById('messages-list');
const ctx = canvas.getCon... | true |
7eb30bad97a399a5adf3b0b2f033294365a3e59a | JavaScript | isylhdin/PED_MaisonHote | /MaisonHote/src/main/resources/js/model/prestation.js | UTF-8 | 985 | 2.578125 | 3 | [] | no_license | var Prestation = Backbone.Model.extend({
localStorage: new Backbone.LocalStorage('prestations-backbone'),
defaults: {
id: null,
title: '',
price: '',
number: 0,
comment: ''
},
initialize: function() {
console.log('Prestation créée !');
},
validate: function(attrs) {
var errors = [... | true |
3b2e66fa773f21ed5bdb881f0e6e551cb42e80f9 | JavaScript | bachadam/sketchsite | /docs/assets/js/20210222_abvAssist.js | UTF-8 | 2,789 | 3.328125 | 3 | [] | no_license | 'use strict'
// let currAbvInp = document.getElementById( "currAbvInp");
// let targetAbvInp;
// let transferVolInp;
let currentAbv;
let targetAbv;
let transferVol;
let dilution;
let finalYield;
let waterAddition;
let currentDiv = document.getElementById( "current" );
let targetDiv = document.getElementById( "targe... | true |
dd73bd92bdac328c9cc166a6d21e12260d185e74 | JavaScript | LDHemingway/Beauty-Junkie | /routes/RegionController.js | UTF-8 | 780 | 2.515625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
const { Region } = require('../db/Model')
/* GET home page. */
router.get('/', async(req, res) => {
const regions = await Region.find()
res.send(regions)
})
router.get('/:id', async(req, res) => {
const region = await Region.findById(req.params.id... | true |
14cfea4df272dd419615d6dbcfef5af78be00eb6 | JavaScript | markert/creli.js | /src/annuity.js | UTF-8 | 1,800 | 2.640625 | 3 | [
"MIT"
] | permissive | 'use strict';
var annuity = function (params) {
// loan ammount
var K = params.ammount || 100000;
// interest rate
var i = params.interest || 0.04;
// paybacks per year
var n = params.perAnno || 12;
// years of fixed interest
var T = params.years || 10;
var q = 1 + i / n;
var qnt = Math.pow(q, n *... | true |
4c35c2dd6fd5def0b5df8ada9d23e3330bbd9e8b | JavaScript | khwaniiz/coding-exercise | /fcc-questions/sumPrimes.js | UTF-8 | 666 | 3.875 | 4 | [] | no_license | function sumPrimes(num) {
// function isPrime(num) {
// for(let i = 2; i <= Math.sqrt(num); i++) {
// if(num % i === 0) {
// return false
// }
// }
// return true;
// }
// let sum = 0;
// for(let i = 2; i <= num; i++) {
... | true |
ec520cf1b47fb26ebe3267695c9489d459550008 | JavaScript | thiago-nascimento-ti/next-ssr-with-react-query | /pages/index.js | UTF-8 | 1,743 | 2.53125 | 3 | [] | no_license | import Head from 'next/head'
import { QueryClient, useQuery } from 'react-query'
import { dehydrate } from 'react-query/hydration'
import fetch from 'node-fetch';
export default function Home() {
const {
data: users,
isFetching,
dataUpdatedAt,
isFetchedAfterMount,
refetch
} = useQuery('us... | true |
2c8a4fe119fc3fc55221789a807179f9de8126c6 | JavaScript | chikeichan/Trio | /spec/signal/signal.spec.js | UTF-8 | 4,730 | 2.8125 | 3 | [] | no_license | describe('The Signal Class', function() {
var Signal = scope.Signal;
describe('One Signal', function() {
var instance1 = {},
instance2 = {},
signalOne, signalTwo,
handler = jasmine.createSpy('handler'),
handler2 = jasmine.createSpy('handler2');
b... | true |
ce4ce04e9a9bb14c088e16d393b5a5b10755e182 | JavaScript | potatogopher/koa-response-handler | /index.js | UTF-8 | 2,834 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* Response middleware for koajs
*
* @author Nick Rucci <nick@rucci.io>
* @link https://github.com/potatogopher/koa-response-handler
*/
/**
* Status codes
*
* TODO: add all status codes
*/
const statusCodes = {
// 1xx
CONTINUE: 100,
// 2xx
OK: 200,
CREATED: 201,
ACCEPTED: 202,
NO_CONTENT: 204... | true |
310862e73d41b0b1790ece07c745d69ceffd902a | JavaScript | Packas/windows-mods | /fps.js | UTF-8 | 327 | 3.109375 | 3 | [
"MIT"
] | permissive | var fps = require('fps')
var ticker = fps({
every: 100 // update every 100 frames
})
setInterval(function() {
ticker.tick()
}, 1000 / 60)
var element = document.getElementById('fps')
ticker.on('data', function(framerate) {
document.getElementById("fps").innerHTML = "FPS: " + (framerate).toFixed(... | true |
b2f494dbd83f2880e391c07771f2801d3beaf200 | JavaScript | Zipexpo/ngl | /build/js/src/component/representation-collection.js | UTF-8 | 854 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* @file Component Collection
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @private
*/
import Collection from './collection.js';
class RepresentationCollection extends Collection {
setParameters(params) {
return this.forEach((repr) => repr.setParameters(params));
}
setVisibility(v... | true |
0bfcbf9f285b4c947b565743a0c5095987e2eab1 | JavaScript | szabototo89/create-it | /examples/increment-counter-with-create-it/src/factories/webgl/button.js | UTF-8 | 875 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { createBox, createText, createContainer, destroyObject } from '../../utils/pixiHelpers';
const button = ({ stage }) => class Button extends React.Component {
componentDidMount() {
const content = React.Children.toArray(this.props.children).join("");
const position = { x: 0... | true |
6924d9d4abf35677b4c382d08b18d6284457d544 | JavaScript | kuangzhehuangjian/Browser_Fuzzing | /SampleDistributor/result/js/js-305916.js | UTF-8 | 125 | 2.609375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
<button ng-mouseleave="count = count + 1" ng-init="count=0">
Increment (when mouse leaves)
</button>
count: {{count}}
| true |
ac91bc1120ac380739a112cb971f171ce51d60c6 | JavaScript | manasmitapk/Codekata_Zen | /Looping/Q2.js | UTF-8 | 1,015 | 3.671875 | 4 | [] | no_license | const readline = require('readline');
const inp = readline.createInterface({
input: process.stdin
});
const userInput = [];
inp.on("line", (data) => {
userInput.push(data);
});
inp.on("close", () => {
let num = userInput[0].split(" ");
function getHCF( )
{
// Minimum of the two numbers
let mi... | true |
c389012716bc1d96c9d07f341ddb07f55d8ec355 | JavaScript | alpha2262/datingapp-angular | /js/profiles/welcome.controller.js | UTF-8 | 424 | 2.53125 | 3 | [] | no_license | "use strict";
(function(){
angular
.module( "profiles" )
.controller( "WelcomeController", ["ProfileFactory", WelcomeControllerFunction])
function WelcomeControllerFunction(ProfileFactory){
var vm = this
ProfileFactory.query().$promise.then(function(profiles){
var RandomIndex = Mat... | true |
6a966cca018d1b5c85ae44fa4d3085201da0ba08 | JavaScript | simon-kruik/latlong_viewer | /main.js | UTF-8 | 1,773 | 2.640625 | 3 | [] | no_license | /*
#### LatLong_Viewer developed by Simon Kruik - starting 2021-07-02
#### Architecture based on https://github.com/odoe/leaflet-electron
*/
// Pass through app and browserwindow from Electron
const { app, BrowserWindow, ipcMain } = require('electron')
// Get the path module for joining filepaths
const path = requir... | true |
446f1b4deb4e2f17c70da25dd7ba86292612898b | JavaScript | jotitan/sandbox-go | /poc_angular/js/services/SearchService.js | UTF-8 | 687 | 2.53125 | 3 | [] | no_license | function SearchService($http,HostServ){
this.results = {data:[],headers:[],executionTime:0};
this.GetResults = function(){
return this.results;
}
this.Execute = function(query){
console.log("Execute query : ",query);
var url = HostServ.getBaseUrl() + "search/query?callback=JSON... | true |
1e0e3ac4e4401923c0a1a02db8c18f0098c2c5f5 | JavaScript | skankhunter/typoteka | /src/service/cli/generate.js | UTF-8 | 2,114 | 2.921875 | 3 | [] | no_license | 'use strict';
const {
ExitCode
} = require(`../../constants`);
const {
getRandomInt,
shuffle,
getRandomDate
} = require(`../../utils`);
const fs = require(`fs`).promises;
const chalk = require(`chalk`);
const DEFAULT_COUNT = 1;
const MAX_COUNT = 1000;
const FILE_NAME = `mocks.json`;
const FILE_TITLES_PATH = `... | true |
b91308f13c8cc388d16db85520f3cc1e890d0ea2 | JavaScript | kule2018/JavaScript-test | /src/BinarySearchTreeTest/BinarySearchTreeTest.js | UTF-8 | 1,369 | 3.53125 | 4 | [] | no_license | import BinarySearchTree from "./lib/BinarySearchTree.ts";
const binarySearchTree = new BinarySearchTree();
binarySearchTree.insert(11);
binarySearchTree.insert(7);
binarySearchTree.insert(15);
binarySearchTree.insert(5);
binarySearchTree.insert(3);
binarySearchTree.insert(9);
binarySearchTree.insert(8);
bina... | true |
69310ac75d10c498e450cb6aadc869b673f88c17 | JavaScript | Stephen-dsouza/burger | /public/assets/javascript/burgerindex.js | UTF-8 | 1,097 | 2.796875 | 3 | [] | no_license | $(document).ready(function () {
//On click of sub=mit for burges to be devoured, the id is captured as an object and an ajax call is made .
//This is passed to burger_controller.js
$(".devour-button").on("click", function (event) {
var answer = {
id: $(this).data("newdevour")
}... | true |
353e77edbcb5a78bd8adae06c4ab180f602ebdbb | JavaScript | youjing402/pub_ordering_system | /js/loginscript.js | UTF-8 | 1,635 | 3.078125 | 3 | [
"MIT"
] | permissive | /**
* File: loginScript.js
*
* This file provides functionality for the login form. It opens the modal form when the
* user clicks the login button, provides validation for logging in and allows the user to
* close the form.
*
* Version 1
* Authors: Sarah Murphy
*/
// Get the element
var modal = document.g... | true |
759c9de7cb13e39cb91875de45ac919429b92cf8 | JavaScript | deborasuzuki/Draw-on-Canvas | /script.js | UTF-8 | 1,977 | 3.421875 | 3 | [] | no_license | let currentColor = 'black';
let canDraw = false;
let screen = document.querySelector('#tela'); //selecionar elemento tela
let context = screen.getContext('2d');
let mouseX = 0;
let mouseY = 0;
//escolher cor
document.querySelectorAll('.colorArea .color').forEach((item) => {
item.addEventListener('click', colorClick... | true |
7da10fe65129dc6997c37caf906dfa1c4bd8e804 | JavaScript | aaylward/learnuv | /workshopper/check-file-content.js | UTF-8 | 1,619 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
var path = require('path')
, fs = require('fs')
, diff = require('diff')
function logDiff(d) {
var differs = false;
d.forEach(function (part) {
var color = part.added
? 'green'
: part.removed
? 'red'
: 'grey'
process.stderr.write(part.value[color])
... | true |
593b67574ab1dbb5986bfb83486ccc35231ee2fa | JavaScript | shinigami-git/tic-tac-toe-using-react | /src/App.js | UTF-8 | 3,321 | 2.859375 | 3 | [] | no_license | import React from "react";
import "./App.css";
import GridRow from "./components/GridRow/GridRow";
import Header from "./components/Header/Header";
import Footer from "./components/Footer/Footer";
class App extends React.Component {
constructor() {
super();
this.state = {
gameState: [
["", "", ... | true |
40ff59f77b6632943ea0f72317569dd5195fe4e1 | JavaScript | matsub/sandbox | /javascript/jest/tests/myModule.test.js | UTF-8 | 374 | 2.546875 | 3 | [] | no_license | const mod = require('../src/myModule');
describe('f', () => {
test('f() returns 2', () => {
expect(mod.f()).toBe(2);
});
});
describe('g', () => {
test('g() returns double of f()', () => {
const spy = jest
.spyOn(mod, 'f');
const value = mod.g();
expect(spy).toHaveBeenCalled();
expe... | true |
b43113d8b04d0900c037e25c4ad448f6f6beef60 | JavaScript | zhangguanping021495/xiaomi_project | /js/main部分中的选项卡.js | UTF-8 | 2,653 | 2.78125 | 3 | [] | no_license |
//家电部分
miHome()
function miHome(){
let hot = document.querySelectorAll("#main .mi-home .home-nav .hot");
let homeList = document.querySelector("#main .mi-home .home-list");
for(let i =0; i < hot.length; i++){
hot[i].onmouseenter = function(){
for(let j=0; j<hot.length; j+... | true |
616c57c6c68ac280a19fe462b8808bbe223ac56f | JavaScript | andrey0902/react-quiz | /src/containers/Counter/Counter.js | UTF-8 | 1,932 | 2.5625 | 3 | [] | no_license | import React from 'react';
import { connect } from 'react-redux'
import Counter2 from "./Counter2/Counter2";
import {addNumber, asyncAdd, subNumber} from "../../redux/actions/actions";
class Counter extends React.Component {
style = {
marginTop: 100,
display: 'flex',
justifyContent: 'center',
alignIt... | true |
1c168f84920a44ec2a7ad800e3eaeb9a0389bd67 | JavaScript | chrinsmas/fractastic_webapp | /pwcp_fractals/mandelbrot.js | UTF-8 | 2,431 | 2.765625 | 3 | [] | no_license | class MandelbrotRenderer extends PointwiseCPFractalRenderer
{
constructor(spec) {
spec.escape_radius = 2.0; //all points further than 2 from the origin
//cannot be in the mandelbrot set.
spec.max_iter = spec.max_iter || 100;
let dec = ["#798CFF", "#7... | true |
80a9da7c14dd0c3bb3c9ccf08900ef0b3962c484 | JavaScript | AniketNarayan/react_learning | /src/App.js | UTF-8 | 1,330 | 2.609375 | 3 | [] | no_license | import React from 'react';
import logo from './logo.svg';
import './App.css';
import Forms from "./Components/Forms" ;
import Leaves from "./Components/Leaves";
export default class App extends React.Component{
constructor(){
super();
this.state= {
MyLeaves:[],
ApplyClicked: false,
LeavesC... | true |
bdc2e0df281a2e3434afdaf6da2a4f89ccb6f393 | JavaScript | LstChanceMadrid/digital_crafts_1203 | /redux.js | UTF-8 | 794 | 3.109375 | 3 | [] | no_license | const redux = require('redux')
const initialState = {
counter : 0
}
const createStore = redux.createStore
const rootReducer = (state = initialState, action) => {
if(action.type === 'INC_COUNTER') {
return {
...state,
counter : state.counter + (action.value = 1)
}
... | true |
4e3c2cc1019062d49d59cb3532ad5450b926b2a8 | JavaScript | rybrennan/databases | /server/db/index-old.js | UTF-8 | 944 | 2.59375 | 3 | [] | no_license | var mysql = require('mysql');
// Create a database connection and export it from this file.
// You will need to connect with the user "root", no password,
// and to the database "chat".
dbConnection = mysql.createConnection({
user: 'root',
password: '',
database: 'chat'
});
dbConnection.connect();
// dbConnec... | true |
2bb70d89fa7c91510942acafb597b3d6b7047812 | JavaScript | styczynski/airlines-mgr-sys | /staticfiles/airlines/crews-panel.js | UTF-8 | 14,299 | 2.5625 | 3 | [] | no_license | $(document).ready(function () {
var crewsTableNav = $('nav.pages');
var crewsTable = $('table.crews-table');
var crewsTableBody = crewsTable.find('tbody');
var PAGE_SIZE = 30;
var pageNo = getParameterByName('page');
var pageOffset = '';
if (pageNo) {
pageNo = parseInt(pageNo);
... | true |
4e0aeee4f8d694e7892aa53465f3e83ef250362e | JavaScript | NicolaFerracin/ComputerScience | /From Nand to Tetris/part2/11/JackAnalyzer/VMWriter.js | UTF-8 | 944 | 2.8125 | 3 | [] | no_license | const fs = require('fs');
class VMWriter {
constructor(file) {
this.output = fs.createWriteStream(file);
}
write(line) {
this.output.write(line);
this.output.write('\r\n');
}
writePush(segment, index) {
if (segment) {
this.write(`push ${segment} ${index}`);
} else {
this.wri... | true |
61086acd3645d2cf2e9cfeb01f81893babe5ed21 | JavaScript | georgeOsdDev/jsonkey | /test/test.js | UTF-8 | 18,204 | 2.71875 | 3 | [
"MIT"
] | permissive | // For command line test
if (typeof module !== "undefined" && module.exports) {
/*jshint -W079 */
var chai = require("chai");
var expect = chai.expect;
var chaiAsPromised = require("chai-as-promised");
chai.use(chaiAsPromised);
var JSONKey = require("../index.js");
/*jshint +W079 */
this.JSONKey = JSONK... | true |
800fdd9c2df70b7cc4834afb6e26565b5b848ec9 | JavaScript | JoinColony/etherpass | /examples/express.js | UTF-8 | 2,470 | 2.796875 | 3 | [
"MIT"
] | permissive | /* Creating a JSON Web Token using the user's wallet signature
*
* To test:
* 1) Start the server
* ```
* ts-node express.ts
* ```
*
* 2) Get the wallet:
* ```
* import { Wallet } from 'ethers';
* const wallet = Wallet.createRandom();
* console.log(wallet.address); // Note the address
* ```
*
* 3) Reques... | true |
bafe35dbfaec99290bb0b09868f2f1558d7c936c | JavaScript | hideInbush/LeetCode | /191.js | UTF-8 | 181 | 3.125 | 3 | [] | no_license | /**
* @param {number} n - a positive integer
* @return {number}
*/
var hammingWeight = function(n) {
return n.toString(2).match(/1/g) ? n.toString(2).match(/1/g).length : 0;
}; | true |
64ddd4dacb83e74aa2068a95b79a6cc20e8623d3 | JavaScript | Yullipe/commands | /dungeon.js | UTF-8 | 2,531 | 2.65625 | 3 | [] | no_license | exports.run = (clair, message, args) => {
var dungeons = new Array(18);
dungeons[0] = "Virtua Forest";
dungeons[1] = "Monster Cave";
dungeons[2] = "West Wind Valley";
dungeons[3] = "Thelad Sanctuary";
dungeons[4] = "Avenir Storage No.3";
dungeons[5] = "MS Mountain";
dungeons[6] = "Marubaco Forest";
dungeons[7]... | true |
cb25db68e86e6d3da0a790468dd9866108c3db69 | JavaScript | cnip7389/prep-shopping-cart | /ex1/js/app.js | UTF-8 | 3,462 | 2.984375 | 3 | [] | no_license | window.onload = function(){
var shoppingCart =
[
{ "image": "images/jello.jpg","name": "Luscious Jello Mix", "description": ["Very Elegant", "Trending item", "Come in Purple"], "price": 80.65 },
{ "image": "images/desk.jpg","name": "Tarnished Standing Desk", "description": ["Modular", "Works for both Tall and Loud... | true |
593bf609b1abd8d772a874963e0255527ff4510e | JavaScript | ioslh/aganippe | /src/editor/utils.js | UTF-8 | 11,814 | 2.5625 | 3 | [
"MIT"
] | permissive | import {
emptyElementNames,
paragraphClassName,
blockContainerElementNames
} from './config.js'
import { html2json, json2html } from 'html2json'
/**
* RegExp constants
*/
const CHOP_REG = /^#{1,6}|(\*{1,3})[^*]+\1/g
const CHOP_TEXT_REG = /(\*{1,3})([^*]+)(\1)/g
const HEAD_REG_G = /^(#{1,6})([^#]*)$/g
const HE... | true |
5d645812989567c11b7dee3b26b006872ce9e038 | JavaScript | wangw3/data-structure-algorithms | /leetcode/easy/array/169-majority-element.js | UTF-8 | 760 | 3.71875 | 4 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var majorityElement = function(nums) {
let obj = {};
for (let num of nums) {
if (!obj[num]) {
obj[num] = 1;
}
else {
obj[num]++;
}
}
for (let key in obj) {
if (obj[key] >= nums.length/2)... | true |
c9eaa8a20bd402fc1259bff7321d657cc30146f3 | JavaScript | Kinvey/js-universal-test-runner | /injectables/test-runner/mobileTapReporter.js | UTF-8 | 3,649 | 2.5625 | 3 | [
"BSD-3-Clause",
"MIT",
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-other-permissive"
] | permissive | var platform = require('../platform');
var isReactNative = platform.isReactNative;
var isNodejs = platform.isNodejs;
var isNativeScript = platform.isNativeScript;
var isCordova = platform.isCordova;
var isDesktop = platform.isDesktop;
var os = require('os');
var MobileTapReporter = function(logServerPort) {
//the... | true |
4f27a224f65626e0b1e0673ad069535e5258967f | JavaScript | Bahersaad676/js-oop-change-color | /app2.js | UTF-8 | 714 | 3.03125 | 3 | [] | no_license | /*var css1 = new ChangeCss("#test1", "red","yellow","10px");
css1.change();*/
/*
function ChangeCss(elem,clr,bg, padding) {
this.elem = [...document.querySelectorAll(elem)];
this.padding = padding;
this.clr = clr;
this.bg = bg;
}
//var css2 = new ChangeCss("#test2", "blue","#ddd","15px");
//var css3 =... | true |
7a77275f09c4334155ed88516d10e1f6708ed1df | JavaScript | elsh32/shotter-game-mario | /shutting.js | UTF-8 | 9,277 | 2.75 | 3 | [] | no_license | function BufferLoader(context, urlList, callback) {
this.context = context;
this.urlList = urlList;
this.onload = callback;
this.bufferList = new Array();
this.loadCount = 0;
}
BufferLoader.prototype.loadBuffer = function(url, index) {
// Load buffer asynchronously
var request = new XMLHttpRequ... | true |
d2a80849e80a9aed5ce7797c74db87f25bf9774b | JavaScript | Kizito007/react-tutorial | /src/components/Conditional.js | UTF-8 | 396 | 2.609375 | 3 | [] | no_license | import React from "react";
function Conditional (props) {
return (
<div>
{/* {//condition ? statement is true : statment is false
props.isLoading ? <h1>Wait a Minute </h1> : <h1> This statement {"is " + props.isLoading} </h1>} */}
<h1>Some cool stuff about conditional ... | true |
6a9bd0146cd76ad81ad6ba572327eb80c8b25186 | JavaScript | Aion-Jp/DriverJob_Preview | /js/main.js | UTF-8 | 2,504 | 2.546875 | 3 | [] | no_license | $(function(){
var agent = navigator.userAgent;
var list = $(".mod_nav ul");
function menuslide(){
//メニュー表示非表示
$(".mod_nav p.navtitle").click(function(){
if($(list).css("display")=="none"){
$(list).slideDown("fast");
}else{
$(list).slideUp("fast");
}
});
}
if(agent.search(/iPhone/) != -1){
menuslide();... | true |
1a1edb86b2a37481645d8b9065409d327ab5fa80 | JavaScript | gcazaciuc/tiny-frp | /src/__tests__/tfrpspec.js | UTF-8 | 4,223 | 2.609375 | 3 | [
"MIT"
] | permissive | import { jest } from '@jest/globals';
import { observable, computed, effect } from '../tfrp';
describe("TinyState", () => {
test("Should allow creating observables out of object data", () => {
const o = observable({firstName: 'a', lastName: 'b'});
expect(o.firstName).toBe('a');
expect(o.las... | true |
4e58ac98480ca28cc3f463673092405f0158f069 | JavaScript | callmecavs/string-css | /src/string-css.js | UTF-8 | 2,691 | 3.1875 | 3 | [
"MIT"
] | permissive | import hash from './hash.js'
const css = () => {
const style = {}
// immutably concat strings and values together
const concat = (strings, values) => {
const len = strings.length
let index
let result = ''
for (index = 0; index < len; index++) {
result += strings[index]
// catch on... | true |
d15f9a6613c73df90aac2765234b888db00e89c3 | JavaScript | hanguyenbinh/hometest | /test1.js | UTF-8 | 2,443 | 3.40625 | 3 | [] | no_license | function isCorrectMatrix(matrix) {
if (!matrix) {
return { code: 1, message: "matrix is null" }
}
else if (matrix.length <= 0) {
return { code: 2, message: "matrix row = 0" }
}
else if (!matrix[0] || matrix[0].length <= 0) {
return { code: 3, message: "row 0 is incorrect" }
... | true |
db6e5a41fa83a8510a3e289875ea6e9aeffadcd4 | JavaScript | CohortOne/CapstoneProject1 | /Ram/Calculator/CalLogic.js | UTF-8 | 3,211 | 3.34375 | 3 | [] | no_license | function backspace() {
var goback = document.getElementById('answer').value;
document.getElementById('answer').value = goback.substring(0, goback.length - 1);
}
function clr() {
document.getElementById('answer').value = "";
}
function dis(value) {
document.getElementById("answer").val... | true |
9600988841b06385e095da0354d72abec6ae0ab2 | JavaScript | salus-sage/millistory-prototype | /assets/js/utilities.js | UTF-8 | 1,307 | 3.328125 | 3 | [
"MIT"
] | permissive | (function(window){
U = window.U || {};
U.arrayToObj = function(array, keyValueMap) {
var obj = {};
var len = array.length;
// Your function will be called for each item in the array.
for (var i = 0; i < len; i++) {
var curVal = array[i];
// Just like with [].forEach(), your function will be passed th... | true |
8160d174cff6b1c45f05346a7f1aef1fd0e6c7f9 | JavaScript | LuciaMezquida/guess-the-magic-number | /js/main.js | UTF-8 | 1,857 | 4.0625 | 4 | [] | no_license | 'use strict';
//select html elements within variables
const number = document.querySelector('.js-number');
const hint = document.querySelector('.js-hint');
const button2 = document.querySelector('.js-button2');
const button = document.querySelector('.js-button');
const counterValue = document.querySelector('.js-counter... | true |
6039da22ca5441079e501a292d16f926f060122c | JavaScript | fwood/ICD9-GAE-HSLDA | /ICD9-webapp/war/icd9json.js | UTF-8 | 3,145 | 2.984375 | 3 | [] | no_license | var sendReq = getXmlHttpRequestObject();
// Function for initializating the page.
function start() {
// Set the focus to the text entry box.
document.getElementById('icd9_code').focus();
}
// Gets the browser specific XmlHttpRequest Object
function getXmlHttpRequestObject() {
if (window.XML... | true |
50701f5e15df316649d4b262658e0263d1edc419 | JavaScript | kirkportas/raw_js_app_example | /www/js/tasks.js | UTF-8 | 3,138 | 2.890625 | 3 | [] | no_license | if (GFT_APP == undefined) { console.error("Incorrect JS load error"); }
var GFT_APP = window.GFT_APP || {};
GFT_APP.tasks = {
// Include vars. Explicitly define locally used controllers etc.
api: GFT_APP.api,
core: GFT_APP,
require_confirmation: true, // Require confirm on deleteions
// State vars
... | true |
1bfc7419c850f6792be77aa5bbca6056aed1a845 | JavaScript | Aayush-Shukla/speech-recog | /script.js | UTF-8 | 1,435 | 3.171875 | 3 | [] | no_license | var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;
var SpeechGrammarList = SpeechGrammarList || webkitSpeechGrammarList;
var grammar = '#JSGF V1.0;'
var recognition = new SpeechRecognition();
var speechRecognitionList = new SpeechGrammarList();
speechRecognitionList.addFromString(grammar, 1);
recog... | true |
40df04ff40cf27abea93f144f00dd2fa0356b8fe | JavaScript | ahmedessam235/Calculator | /engine.js | UTF-8 | 2,751 | 3.578125 | 4 | [] | no_license | var screen = document.querySelector('.myscreen');
var button = document.querySelector('.firstrow');
var buffer = "0";
var result = 0;
var container = 0;
var addop = 0;
var subop = 0;
var multop = 0;
var divop = 0;
var previousvalue = 0;
let buffer2 = "0";
function putvalueinscreen(){
screen.innerText = buffer2;
}
f... | true |
3eb0c8262e40d232ecbb546d318eb7c02012d8d6 | JavaScript | alsc-sfe/kos-cli | /lib/fs.js | UTF-8 | 3,372 | 3.203125 | 3 | [] | no_license | 'use strict';
const fs = require('fs-extra');
const slice = Array.prototype.slice;
// export fs promisified with bluebird
module.exports = factory(fs, Promise);
/**
* Factory to create promisified version of fs-extra.
* Adds promisified methods for all async methods
* e.g. `fs.readFile(path, cb)` becomes `fs.re... | true |
d590309c2fd5192002fe8b5a95c2085be1a5d4ee | JavaScript | B64283/MUI_Week4 | /BronzeApp/js/json.js | UTF-8 | 8,921 | 2.578125 | 3 | [] | no_license | //Matthew Darke
//VFW 1306
//Project 4 Json
var json = {
"vacation1": {
"group": ["group:", "Vacation"],
"dest": ["Destination:", "Rome"],
"days": ["Days of travel:", "9"],
"clothes": ["checkbox Clothes:", "Clothes" ],
"meds": ["checkbox Medication:", "Medication"],
"toiletries": ["checkbox Toiletries:... | true |
08aa9cb500e36e365ed58329a6f0433a85525770 | JavaScript | esauOp/esau-ortega-com | /src/index.js | UTF-8 | 1,921 | 2.9375 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
// If you want to start measuring performance in yo... | true |
e1c82151dd688b865bfcc7b696b42d134262820b | JavaScript | codingstorytime/js-function-return-function | /index.js | UTF-8 | 3,311 | 3.46875 | 3 | [] | no_license | import './style';
// Setup Jasmine testing
import {jasMineBootstrap} from './src/moya/global-jasmine-setup';
/**
* moyarich (moyarich.com | codingstorytime.com)
* https://www.facebook.com/codingstorytime/
* https://www.facebook.com/moyarich
*
*/
function house(sandwiches){
function dogHouse(){
let dogEat ... | true |
3fa8aaa631497eab5d3a349e81693b2cf92cea3d | JavaScript | anavarreteuk/javascript-objects-bootcamp-prep-000 | /objects.js | UTF-8 | 272 | 2.5625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | var playlist = { beethoven:'symphony', mozart: 'concerto', chopin:'nocturne'}
function updatePlaylist(playlist, singer, song) {
playlist[singer] = song
return playlist
}
function removeFromPlaylist(playlist, singer) {
delete playlist[singer]
return playlist
}
| true |
610e23e848e07fa1f58532a9feb6380a9988e6ae | JavaScript | SlepoRus/test_angular | /src/server.js | UTF-8 | 1,982 | 2.8125 | 3 | [
"MIT"
] | permissive | var express = require('express');
var data = require('./app/data');
var app = express();
app.listen(9090, (err) => {
console.log(err || "all running")
})
app.use(function (req, res, next) {
// Website you wish to allow to connect
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:8080');
/... | true |
987015353c142a64e7597a68bd38b65a0f3b3322 | JavaScript | achouippe/angular-dataValidator | /src/validator.js | UTF-8 | 9,243 | 2.9375 | 3 | [
"MIT"
] | permissive | 'use strict';
angular.module('dataValidator', []).factory('Validator', ['$q', '$parse', function ValidatorFactory($q, $parse) {
var EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
var NUMERI... | true |
6381b85b16d0cf11e11cd9f50d0c766ba663fa31 | JavaScript | josephwhittington/react-dynamic-div-generation | /src/Container.js | UTF-8 | 1,262 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react'
import Box from './Box'
export default class Container extends Component {
constructor() {
super()
this.state = {
count: 0,
reverse: false
}
}
componentDidMount() {
let counter = setInterval(() => {
... | true |
d51593dfe53098806bb220dddfbd5762c6fb3336 | JavaScript | q269384828/svg-slimming | /test/xml-parser.js | UTF-8 | 5,608 | 2.796875 | 3 | [
"MIT"
] | permissive | // const xmlParser = require('../dist/xml-parser.js');
// const xmlParser = require('../dist/xml-parser.min.js');
const svgSlimming = require('../dist/svg-slimming.min.js');
const xmlParser = {
parse: svgSlimming.xmlParser,
NodeType: svgSlimming.NodeType
};
const NodeType = xmlParser.NodeType;
const chai = requ... | true |