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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f32b13e23d399ce4afea590d4cdfa3c30ddb629b | JavaScript | ostapetc/onesignal-device-cleaner | /src/utils/unzip-dump.js | UTF-8 | 755 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | const fs = require('fs');
const zlib = require('zlib');
async function unzipDump(path) {
return new Promise((resolve, reject) => {
const exist = fs.existsSync(path);
if (!exist) {
reject('Dump file does not exist');
return;
}
let gunzip = zlib.cre... | true |
56a9cac34bccea54298bece79277dadf93b2519a | JavaScript | cmanish049/expense-app-react | /src/playground/destructuring.js | UTF-8 | 544 | 3.671875 | 4 | [] | no_license | // const person = {
// name: 'Manish',
// age: 28,
// location: {
// city: 'Dhangadhi',
// temp: 88
// }
// }
// const {name: firstName = 'Susli', age, location} = person;
// console.log(`${firstName} is ${age}`);
// const { temp: temperature, city} = person.location;
// if (city && ... | true |
a3d46b695c991799c6f7bc4580e52c26b33f0110 | JavaScript | olojiang/NodeJsDemo | /test/testErrorHandlingDomain.js | UTF-8 | 2,847 | 2.875 | 3 | [] | no_license | /**
* Created by Hunter on 5/22/2015.
*/
"use strict";
var domain = require('domain');
// Domain basic
var dBasic = domain.create();
// run()
// - it will execute the function body, immediately
dBasic.run(function(){
setTimeout(function(){
throw new Error("domain error.");
}, 200);
});
// Domain ha... | true |
ac13b25e1d445f9d06b29bbb010c255f15bd549b | JavaScript | NicollasFrazao/EletronTech | /mobile/FEI/js/Medidor de BTU - Calculo.js | UTF-8 | 501 | 2.78125 | 3 | [] | no_license | function Calcular()
{
var area = txt_area.value.replace(txt_area.getAttribute('unidade'), "").trim();
var peop = txt_pessoas.value.replace(txt_pessoas.getAttribute('unidade'), "").trim();
var elet = txt_eletronicos.value.replace(txt_eletronicos.getAttribute('unidade'), "").trim();
area = parseInt(area);
areaBTU ... | true |
d36835917d4b008e2c4b7718d169f30882c441a3 | JavaScript | vikylkinnelya/healthy-food | /js/modules/slider.js | UTF-8 | 4,643 | 2.859375 | 3 | [] | no_license | import {getZero} from './timer';
function slider({container, slide, nextArrow, prevArrow, totalCounter, currentCounter, wrapper, field}) {
const slides = document.querySelectorAll(slide),
prevBtn = document.querySelector(prevArrow),
nextBtn = document.querySelector(nextArrow),
totalSliderCou... | true |
91f1dbc8897e7331b9c8dc8984d1bce233c7d064 | JavaScript | gympro159/ExpensesManager | /src/screens/Radio/Radio.js | UTF-8 | 2,833 | 2.8125 | 3 | [] | no_license | import React, { useState } from "react";
export default function Radio() {
const [gender, setGender] = useState("Male");
const [confirm, setConfirm] = useState(true);
const handleRadio = (e) => {
setGender(e.target.value);
};
const handleRadio2 = () => {
setConfirm(!confirm);
};
return (
<... | true |
9e4aeb8f0344b530d7a26b0c9ada4f6e4e1208b3 | JavaScript | clementstone/RT-VIEWER | /src/main/RT_DOSE/ImportPixelData.js | UTF-8 | 1,785 | 2.78125 | 3 | [
"MIT"
] | permissive | import {gridScaling} from "./GridScaling";
let Rows, Columns, Number_of_Frames;
/**
* @function importPixelData
* @param {object} dose_image ->Dose Image
* @param {object} dataSet -> Dose dataset
* @description
* This function deals with
* 1. Import Dose Pixel Data
* 2. Parse the Pixel Data
* 4. Function call... | true |
10977a3d5f91ab58eeaba13d943f5b7f20079bf1 | JavaScript | AJK24/Ch13 | /searchlast.js | UTF-8 | 255 | 3.109375 | 3 | [] | no_license | load('searching.js');
function seqSearch(arr, data) {
//changed so now it starts at the back and comes forward
for (var i = arr.length; i > 0; --i) {
if (arr[i] == data) {
return i;
}
}
return -1;
}
//display the array.
//dispArr(arr);
| true |
99e1bd2054402e0cf37461467b5a9ff873a94601 | JavaScript | shiro-gichohi/FreeCodeCamper | /Basic Algorithm Scripting/longest_word.js | UTF-8 | 758 | 4.40625 | 4 | [] | no_license | /*Question
Return the length of the longest word in the provided sentence.
Your response should be a number.
*/
function findLongestWord(str) {
var arr = str.split(" ");
var longestString = arr.reduce(function(a,b){ return b.length > a ? a = b.length : a; },0);
return longestString;
}
console.log(findLongestWord("... | true |
352983d7657eec811329642b43300bbcb451d421 | JavaScript | relvao/flat-file-store | /src/Store.js | UTF-8 | 9,853 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /*jslint node:true, unparam: true */
'use strict';
/*global setImmediate */
var fs = require('fs-extra'),
path = require('path'),
EventEmitter = require('events').EventEmitter,
util = require('util'),
copyVal,
loadFile,
Obj;
// in js all objects are passed by reference.
// sometimes this fact ... | true |
a6a458d53e41c765017167725a54019310e75422 | JavaScript | AdoniszzZ/iwoFM | /src/main/resources/static/js/explore.js | UTF-8 | 249 | 2.5625 | 3 | [] | no_license | const changeIcon = document.querySelector('.loadmore');
changeIcon.addEventListener('click', function() {
const x = document.querySelectorAll('.channel-img .item');
for (i = 0; i < x.length; i++) {
x[i].setAttribute("class", "item");
}
}); | true |
6f0cc701422f787aa6678f66eb9708680a1de927 | JavaScript | AngusLean/ychart | /src/shape/Bezier.js | UTF-8 | 5,358 | 2.921875 | 3 | [
"MIT"
] | permissive | /**
* 贝塞尔曲线
* @module ychart/shape/Besier
*/
import debugs from "../tool/debug"
import ShapeBuilder from "../core/viewBuilder"
var warn = debugs.warn;
var insiderange = function (val, rg1, rg2) {
return val < rg1 || val > rg2;
};
var sqrt = function (val) {
return Math.sqrt(val);
};
var abs = function (val)... | true |
56567203ef1c80e39dd8c08840e508474ec2bca2 | JavaScript | lio85/srint4 | /src/modules/imagesValidator.js | UTF-8 | 1,025 | 2.765625 | 3 | [] | no_license | module.exports = {
isImage: function (file_path){
let length= file_path.length;
let bmp_gif_jpg_png= length -4;
let jpeg_webp= length -5;
let bmp = file_path.indexOf(".bmp");
let gif= file_path.indexOf(".gif"); // si no lo encuentra -1, si si me tira posicion donde empie... | true |
21fb4317c437bbf7ddc638690f7a5d4242153e42 | JavaScript | LPJLPJ/AHMI | /src/public/general/js/browserCheck.js | UTF-8 | 1,836 | 2.578125 | 3 | [] | no_license | /**
* Created by zzen1ss on 16/7/18.
*/
;(function () {
var browserCheck = document.createElement('div');
browserCheck.innerHTML = '<p>系统检测到您的浏览器版本不兼容,推荐使用Chrome,切勿使用搜狗。</p>';
browserCheck.setAttribute('style',"position:absolute;display:inline-block;width:30%;height:20%;background:#F7F6F2;right:0;bottom:0... | true |
00dbb17c10d7c00be78314f73074c323f075cf43 | JavaScript | Yankovsky/neoclassic | /lib/db/repositories/entries-repo.js | UTF-8 | 1,908 | 2.5625 | 3 | [] | no_license | var db = require('./../db')
exports.create = function(entry, callback) {
db.single({
name: 'create_entry',
text: 'INSERT INTO entries (slug, title, html, short_text, datetime, thumbnail_url, type) VALUES ($1, $2, $3, $4, $5, $6, $7)',
values: [entry.slug, entry.title, entry.html, entry.shortText, entry.d... | true |
741d111a7af4a84c2d82ca5e99a62672ebc6ad96 | JavaScript | LevanceWam/UDSA | /BigONotation/Space Complexity/main.js | UTF-8 | 163 | 3.5 | 4 | [] | no_license | let names = ['q', 's', 'b'];
const vance = {
greet: function (names) {
for (let name of names) console.log(`hi ${name}`);
}
}
vance.greet(names); | true |
70fe4d5f5c2876c04f5334c5f2f7d17ab8b5511c | JavaScript | meganphan/octokitten | /src/components/landingpage.js | UTF-8 | 5,606 | 2.546875 | 3 | [] | no_license | import React, {Component} from 'react'
import {TitleComponent} from './title'
import {Form, Label, Row, Col} from 'reactstrap'
import Main from './main'
import Home from './home'
import Bio from './bio'
import LangChart from './charts/languages';
import ActivityChart from './charts/activity'
class LandingPage extends... | true |
313abdf39c74960898b0161717af94d6147fae11 | JavaScript | marinakomissar/marinakomissar.github.io | /cats/js/main.js | UTF-8 | 1,670 | 2.578125 | 3 | [] | no_license |
$(function(){
$('.cards_favorite').on('click', function(){
$(this).toggleClass('cards_favorite--active');
$('#popup').css('top',$(this).offset().top).show();
e.preventDefault();
});
$("[data-scroll]").on("click", function(event) {
event.preventDefault();
... | true |
4d2b8aa34d0edea679204fb1656bd6f6938baa22 | JavaScript | carrot-e/mate-phones-app | /js/components/gallery.js | UTF-8 | 906 | 2.625 | 3 | [] | no_license | import BaseComponent from './base-component.js';
export default class Gallery extends BaseComponent {
constructor(params) {
super(params);
this._item = params.item;
this._render();
this._addListeners();
}
_render() {
if (this._item === undefined) {
return;
}
this._element.inn... | true |
5b380c507c93562cd9630ec9e8f9c67eece42746 | JavaScript | MilosFe/TradeTask | /app/js/uploads/uploads.service.js | UTF-8 | 1,370 | 2.546875 | 3 | [] | no_license | (function() {
'use strict';
angular.module('TradeCoreApp')
.factory('UploadsService', UploadsService);
UploadsService.$inject = ['$http', '$log'];
function UploadsService($http, $log) {
var service = {
getUploads: getUploads,
postUploads: postUploads,
... | true |
511869fd7b3113587489f59cda79324c98311f9c | JavaScript | optimuspaul/react-bootstrap-typeahead | /src/utils/pluralize.js | UTF-8 | 291 | 2.984375 | 3 | [
"MIT"
] | permissive | /**
* Basic util for pluralizing words. By default, simply adds an 's' to the word.
* Also allows for a custom plural version.
*/
export default function pluralize(text, count, plural) {
const pluralText = plural || `${text}s`;
return `${count} ${count === 1 ? text : pluralText}`;
}
| true |
e2f7df6f92b607b95f0fa3c8f76f52f04a1505a7 | JavaScript | flavioochoa/time-checker | /src/TimeCheckerWebApp/server/controllers/time.js | UTF-8 | 1,781 | 2.578125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var timeRecordServiceClass = require('../services/timeRecordsService');
const { timeRecordsService } = timeRecordServiceClass;
var userActionsServiceClass = require('../services/userActionsService');
const { UserActionsService } = userActionsServiceClass;... | true |
00c3bec54468b99f2894c010732461c809cc3ec5 | JavaScript | voroboy/niobot- | /commands/season.js | UTF-8 | 4,365 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const { Discord } = require("../ApexStats.js");
const config = require("../config.json");
let mysql = require("mysql");
let connection = mysql.createPool({
host: config.SQL.host,
user: config.SQL.username,
password: config.SQL.password,
database: config.SQL.database,
});
var { DateTime } = require("luxon");
... | true |
7f0186966a45385d309653786cae2fdb7fd605ca | JavaScript | NellFotina/Social-net | /src/api/api.js | UTF-8 | 3,689 | 2.734375 | 3 | [] | no_license | //DAL-уровень, который отвечает за формирование url
import axios from "axios";
const instance = axios.create({
withCredentials: true, //благодаря true цепляется наша coockie
headers: {
"API-KEY": "73c522ff-bfdb-4f88-bb6e-58eae3d6e793",
},
baseURL: "https://social-network.samuraijs.com/api/1.0/",
});
expo... | true |
435d4ba208f3b842ef86c78fdd6e33298cf6cfeb | JavaScript | misaacs-winc/moreloops | /scripts.js | UTF-8 | 1,259 | 3.3125 | 3 | [] | no_license | /*const button = document.querySelector('#first-section mybutton')
button.addEventListener('click', function (e) {
//console.log(e.target);
// console.log(e);
alert("Button clicked!");
});
const newButton = document.querySelector('#first-section mybutton2')
newButton.addEventListener('click', fun... | true |
e1826a1e0a3a6287a16757c7f29b8e640ca14e08 | JavaScript | lasthead/polls-list | /store/polls.js | UTF-8 | 2,637 | 2.71875 | 3 | [] | no_license | export const state = () => ({
conditions: [
{
name: 'Условие 1',
id: 0,
selectedOption: 0,
options: {
0: {
name: 'Возраст респондента',
ageFrom: 0,
ageTo: 0
},
1: {
name: 'Тип карты лояльности',
selectTypes: {
... | true |
4081e092b0b4319978a6aaa3510db98515fb9645 | JavaScript | SaifMaknojia/Tip-Calculator | /src/App.js | UTF-8 | 4,044 | 2.703125 | 3 | [] | no_license | import React, { useState } from 'react';
import './App.scss';
import DollarSign from './assets/images/icon-dollar.svg';
import PersonIcon from './assets/images/icon-person.svg';
import TipsFormContainer from './component/TipsFormContainer/TipsFormContainer';
import InputForm from './component/inputForm/InputForm';
impo... | true |
86950bb935eb1d91e53ffdffbfc49862e84ab73b | JavaScript | nikhil-ghate/Covid19-Tracker | /js/app.js | UTF-8 | 2,263 | 3.546875 | 4 | [] | no_license | //SELECT ALL ELEMENTS
const countryNameElement = document.querySelector(".country .name");
const updateDate = document.getElementById("update");
const totalCasesElement = document.querySelector(".total-cases .value");
const newCasesElement = document.querySelector(".total-cases .new-value");
const activeElement = doc... | true |
878403ff6ff5e4079340c018160a591d4a7e49a1 | JavaScript | RenanRodriguesdosSantos/mapcontact | /frontend/scripts/main.js | UTF-8 | 1,590 | 2.75 | 3 | [] | no_license | const brasil = [-51.925282,-14.235004];
const center = ol.proj.fromLonLat(brasil);
const view = new ol.View({
center: center,
zoom: 4,
minZoom: 4
});
var map = new ol.Map({
layers: [new ol.layer.Tile({source: new ol.source.OSM()})],
target: 'map',
view: view
});
map.on('moveend',verificarZoom);
var marke... | true |
9ad238edfef2f747f6d9bfbe0c0a490b5bbf588e | JavaScript | pnp/cli-microsoft365 | /eslint-rules/lib/rules/correct-command-name.js | UTF-8 | 1,669 | 2.53125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | function getConstNameFromFilePath(filePath) {
const pos = filePath.indexOf('/src/m365/');
if (pos < 0) {
// not a command file
return;
}
// /src/m365/ = 10
const relativePath = filePath.substr(pos + 10);
const segments = relativePath.split('/');
segments.splice(segments.indexOf('commands'), 1);
... | true |
4c0cfea9b9e7aab486a45f959e3a07348bf42024 | JavaScript | LaithHanania/Replete | /services/EventService.js | UTF-8 | 510 | 2.953125 | 3 | [] | no_license | class EventService {
constructor(eventCriterias) {
this.eventCriterias = eventCriterias;
}
calculateNetValue() {
if (!this.eventCriterias || this.eventCriterias.length === 0) return 0;
const sum = this.eventCriterias.reduce(function (prev, curr) {
return prev + curr.value;
}, 0);
retu... | true |
aafb4d15895ac4cec9031d693a70107dafc051c0 | JavaScript | amaryana/epidemic-broadcast-trees | /state.js | UTF-8 | 7,257 | 2.859375 | 3 | [
"MIT"
] | permissive | 'use strict'
var u = require('./util')
var isMessage = u.isMessage
var isNote = u.isNote
//okay just pretending to be purely functional
//(but if you have good functional disipline, you can mutate)
function clone (state) { return state }
function isInitRx (state) {
return state.remote.req == null || state.local.req... | true |
1aece6484f56cec8271912faf192309eef725406 | JavaScript | daianemsilva09/javascript-hiring | /exemplos/template-string.js | UTF-8 | 102 | 3 | 3 | [] | no_license | "Dai é"
let role ="trasformadora"
console.log(`Dai é ${role}`)
console.log("Dai é " + "" + role) | true |
8713fff5f6286c843f5d42cfbf3a146f1d365b09 | JavaScript | Yehure/SafeAuth | /backend/models/User.js | UTF-8 | 1,583 | 2.515625 | 3 | [] | no_license | import mongoose from "mongoose";
import bcrypt from "bcryptjs";
import jwt from "jsonwebtoken";
const User = new mongoose.Schema(
{
email: {
type: String,
required: true,
lowercase: true,
},
password: {
type: String,
required: true,
},
fullname: {
type: String,... | true |
dde5cebb15e7b4f8f9af35b60674efc546b1ffd2 | JavaScript | pretendBrave/qiongyou | /js/header.js | UTF-8 | 1,441 | 2.953125 | 3 | [] | no_license | // inpu输入框
selectShow("search","input");
// 二级菜单显示
selectShow("select-show","secondary-menu");
// 三级菜单显示
selectShow("menu-list","level-menu");
// 商城
selectShow("shopping","shopping-menu");
// 酒店
selectShow('hotel','hotel-menu')
// 下拉弹窗
function selectShow(eTitle,eContent){
// 获取鼠标移入显示子元素的父元素
var eTitle=document.get... | true |
b6d901690d2832171b46a2f8dc6f7014206f6556 | JavaScript | future4code/Paula-Vitoria | /semana15/aula41-node/tasks/tasks.js | UTF-8 | 106 | 2.6875 | 3 | [] | no_license | const newTask = process.argv[2];
const tasksList = [];
tasksList.push(newTask);
console.log(tasksList);
| true |
cba38388cdbd8a81feab3cc8c0f222244b5942c2 | JavaScript | ZarckDev/tours_app | /public/js/updateSettings.js | UTF-8 | 2,776 | 2.953125 | 3 | [] | no_license |
const updateInfosForm = document.querySelector('.form-user-data')
const updatePasswordForm = document.querySelector('.form-user-settings')
const btnSavePassword = document.querySelector('.btn--save-password')
const btnSaveSettings = document.querySelector('.btn--save-settings')
const inputProfilePic = document.getElem... | true |
9353f5616f29a59824bf09986dcf1d28982cf01e | JavaScript | LucaSunseri/js-paliedispari | /Pari e Dispari/js/script.js | UTF-8 | 2,495 | 4.65625 | 5 | [] | no_license | /*
**Pari e Dispari**
L’utente sceglie pari o dispari e inserisce un numero da 1 a 5.
Generiamo un numero random (sempre da 1 a 5) per il computer (usando una funzione).
Sommiamo i due numeri
Stabiliamo se la somma dei due numeri è pari o dispari (usando una funzione)
Dichiariamo chi ha vinto.
*/
// Facciamo sceglie... | true |
92570fb31944da70e9a66016144ae9bd37e3e8a9 | JavaScript | OlegBirykov/react-4 | /src/task2/components/WalkAddForm.js | UTF-8 | 2,260 | 2.71875 | 3 | [] | no_license | import React from 'react';
import { useState } from 'react';
import PropTypes from 'prop-types';
import './WalkAddForm.css';
import DateInput from './DateInput';
import DistanceInput from './DistanceInput';
import WalkModel, { initForm } from '../models/WalkModel';
import { dateToText, distanceToText, dateTyping, dista... | true |
326446d61ff537daee325fcb75e9396b1effac08 | JavaScript | louiscklaw/react-playlist | /react-query/react-query-firebase-helloworld-tryout/src/User.js | UTF-8 | 1,993 | 2.65625 | 3 | [] | no_license | import React from 'react';
import firestore from './firestore';
// https://firebase.google.com/docs/firestore/quotas
// https://firebase.google.com/docs/firestore/quickstart
const db = firestore.firestore();
db.settings({
timestampsInSnapshots: true,
});
export default function User() {
const getUser = () => {
... | true |
a99bc3df78979a4663930464d11a32cd10a436b3 | JavaScript | 0118ayush/React-Stocks-london-web-career-040119 | /src/containers/StockContainer.js | UTF-8 | 1,209 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import Stock from '../components/Stock'
class StockContainer extends Component {
sortStocksAlphabetically=(stocks)=>{
const stocksCopy = stocks.slice()
if (this.props.alphabetSort){
stocksCopy.sort((a, b)=>{
if (a.name > b.name) return 1
if (a... | true |
8809ddd3a85951ff092d71f96de77069f00173cd | JavaScript | jlongster/flux-game | /js/core/engine.js | UTF-8 | 4,020 | 2.6875 | 3 | [] | no_license | define(function(require) {
var _ = require('underscore'),
util = require('util'),
loader = require('core/loader'),
KeyboardControls = require('core/keyboardcontrols'),
Player = require('player'),
Tileset = require('core/tileset'),
Tilemap = require('core/tilemap');
... | true |
b6d0863046150187539013e70a9dccfc36e0c973 | JavaScript | nicolaslepallec/ballon-telldus | /telldus/Telldus.js | UTF-8 | 2,065 | 2.578125 | 3 | [] | no_license | var config = require('../telldus/telldusConfig')
var OAuth = require('oauth');
var JSONPath = require('JSONPath');
var URL='http://api.telldus.com';
var REQUEST_URI=URL+'/json';
var STATE_ON=1;
var STATE_OFF=2;
var TURN_ON=1;
var TURN_OFF=2;
var TURN_ON_CALL="/device/turnOn";
var TURN_OFF_CALL="/device/turnOff";
va... | true |
65cc004c128574b86f9a25749ba750059d2192a0 | JavaScript | Oregand/translate | /lib/register/validate.js | UTF-8 | 1,588 | 2.640625 | 3 | [] | no_license | var dbConfig = require('../../config/mysql')
var log = require('../log')
var messages = new Array();
function mandatoryRule(user, response) {
log.out('debug','mandatoryRule '+user)
mandatory("Name", user.name)
mandatory("Email", user.email)
mandatory("Password", user.password)
}
function mandatory(nam... | true |
ff42aa414d5e8ad0d0cfe78c9c53ccd79c1dc027 | JavaScript | ghewadesumit/Javascript | /weather app/forecast.js | UTF-8 | 1,487 | 3.25 | 3 | [] | no_license | class Forecast{
constructor(){
this.key = '4XwbjtLDzsq9YbIS4FfTCU67d6I0nYnI';
this.weatherURI = "http://dataservice.accuweather.com/currentconditions/v1/";
this.cityURI = "http://dataservice.accuweather.com/locations/v1/cities/search";
}
async updateCity(city){
console.log('... | true |
0c4c1a55771e9e44a66f9ac60aab5bd222b3ec8d | JavaScript | reyesreg/node-addressbook | /public/js/main.js | UTF-8 | 1,113 | 2.8125 | 3 | [] | no_license | var counter = 0;
var x = document.getElementsByClassName('btnEdit');
for (var i = 0; i < x.length; i++) {
x[i].onclick = function () { editBtnClick(this.id); };
}
document.getElementById('closeEditButton').onclick = function () { editCloseBtnClick(); };
//document.getElementsByClassName('btnEdit')[0].onclick = f... | true |
7f9ca60ae6ca6995c6f99e0a54ea06c6d0af051b | JavaScript | harryby1149/Word-Guess-Game | /assets/javascript/game.js | UTF-8 | 3,134 | 3.4375 | 3 | [] | no_license | //Setting variables and arrays//
//Going with a dog theme//
function newGame() {
var breeds = ["AKITA", "MALAMUTE", "BASSETHOUND", "BEAGLE", "CHIHUAHUA", "TERRIER", "DALMATION", "DOBERMANPINSCHER", "GERMANSHEPHERD", "POINTER", "JINDO", "SAINTBERNARD", "MASTIFF", "IRISHWOLFHOUND", "GREYHOUND", "AUSTRALIANSHEPHE... | true |
c00cf09ec5f7fed06e6d40367672a2a43d91b276 | JavaScript | mturzynskanj/AngularFactoryVsServices | /app/app.js | UTF-8 | 960 | 2.875 | 3 | [] | no_license | /**
* Created by mariaturzynska on 12/3/14.
*/
var app=angular.module('app',[]);
app.service('helloWorldService',function(){
var name='maria '
this.hello=function(){
return "Hello World" + name;
}
});
/* factory returning object */
app.factory('helloWorldFactory',function(){
var name='turzys... | true |
c13f0663e4a9e23cf73469e729f73531a93c0a51 | JavaScript | xiaoerwen/leetcode-train | /medium/#341/solution.js | UTF-8 | 1,951 | 3.765625 | 4 | [] | no_license | /**
* @file 扁平化嵌套列表迭代器
* @author xiaoerwen
*/
/**
* // This is the interface that allows for creating nested lists.
* // You should not implement it, or speculate about its implementation
* function NestedInteger() {
*
* Return true if this NestedInteger holds a single integer, rather than a nested list.
... | true |
949112c868c17a0eed7373b1ff43e645f718ee8a | JavaScript | Aamsegal/WhatsToEat | /src/SavedRecipes/savedRecipes.js | UTF-8 | 6,290 | 2.71875 | 3 | [] | no_license | import React, { Component } from 'react';
import Cookies from 'universal-cookie';
import './savedRecipes.css'
const cookies = new Cookies();
class SavedRecipes extends Component {
state = {
userRecipes: []
}
// Checks for props and waits to see response as the page could (before timeout) lo... | true |
d436f7ab8b485f757343bdd0042e21cdcec7f099 | JavaScript | eprincev-egor/tiles | /js/App.js | UTF-8 | 8,031 | 2.875 | 3 | [] | no_license | "use strict";
class App {
constructor() {
this.initElems();
window.addEventListener("resize", this.onResize.bind(this));
this.onResize();
this.winner = false;
this.gameIndex = 0;
this.games = [
{n: 2, m: 2},
{n: 3, m: 2},
... | true |
016aafcc7127d3c725cf68425b4648e0f1777292 | JavaScript | kemaron/oop | /js/script.js | UTF-8 | 1,172 | 3.390625 | 3 | [] | no_license | "use strict";
/* ----- tworzenie klasy i prototypowanie ----- */
function Phone(brand, price, color, screen, battery) {
this.brand = brand;
this.price = price;
this.color = color;
this.screen = screen;
this.battery = battery;
}
Phone.prototype.printInfo = function() {
console.log("The phone brand is " + this.b... | true |
874c87438b15cecbc8240367e3b33df603f22bda | JavaScript | ZIJ/BFVM | /js/bfvm.js | UTF-8 | 6,767 | 3.125 | 3 | [] | no_license | /**
* Created by JetBrains WebStorm.
* User: ZIJ
* Date: 20.12.11
* Time: 19:39
* To change this template use File | Settings | File Templates.
*/
/**
* Creates a Command instance
* @param id Command identifier
* @param name Command name
* @param paramsCount Amount of optional parameters
* @param func Callba... | true |
c79308e0ae92ff74957743cae35b4857647ade30 | JavaScript | Rotariu-Stefan/Current | /LeetCode/H-index.js | UTF-8 | 1,114 | 3.359375 | 3 | [] | no_license | //https://leetcode.com/explore/challenge/card/august-leetcoding-challenge/550/week-2-august-8th-august-14th/3420/
/** O(n) sO(n) n=nr papers(citations length)
* @param {number[]} citations
* @return {number}
*/
var hIndex = function(citations) {
const citeCount=[];
citeCount.length=citations.length;
for... | true |
fe8f47811f1fd2e27e0c4f290e1ea68d31af8857 | JavaScript | haodayitoutou/Algorithms | /LC150/lc107.js | UTF-8 | 613 | 3.0625 | 3 | [] | no_license | function traversal(root) {
if (root === null) {
return [];
}
var res = [],
queue = [root],
values,
node,
levelNum;
while (queue.length > 0) {
values = [];
levelNum = queue.length;
for (var i = 0; i < levelNum; i++) {
node = queu... | true |
67825c1d9e7e5cc36af82dc9a7007a1659c8ddcd | JavaScript | the1076/OtherDave | /lib/respect.js | UTF-8 | 2,775 | 2.75 | 3 | [
"MIT"
] | permissive | "use strict";
// Based off of kylestetz Sentencer project: https://github.com/kylestetz/Sentencer/
// Words and patterns pulled from toykeeper.net MadLib generator:
// http://toykeeper.net/programs/mad/index
var articles = require("articles/lib/Articles.js");
var randy = require("randy");
var _ = require("lodash");
... | true |
4335892811b365fcab7833cf5c5908d1823b8f2d | JavaScript | jamiebuilds/documentation | /test/fixture/simple.input.js | UTF-8 | 146 | 2.671875 | 3 | [
"MIT",
"ISC"
] | permissive | /**
* This function returns the number one.
* @returns {number} numberone
*/
module.exports = function () {
// this returns 1
return 1;
};
| true |
7649f0c50bcfbe85afb5c0b28615dccd971045e1 | JavaScript | ABBDVD/coinfabrik | /test/testTokenLogic.js | UTF-8 | 2,605 | 2.515625 | 3 | [] | no_license | var TokenLogic = artifacts.require("./TokenLogic.sol");
var TokenData = artifacts.require("./TokenData.sol");
contract('TokenLogic', function (accounts) {
it("has a TokenData contract for which it is the owner", () => {
let td = undefined;
return TokenLogic.deployed()
.then(instance =>... | true |
154fbca205c1aad5dd41913aaa1f199177a40c65 | JavaScript | stonefishy/react-training | /events/App.jsx | UTF-8 | 426 | 2.703125 | 3 | [] | no_license | import React from 'react';
class App extends React.Component {
constructor () {
super();
this.state = {
data: "init state..."
}
this.updateState = this.updateState.bind(this);
}
updateState() {
this.setState({data: "update state"});
}
render() {
return (
<div>
<button onClick={this.updat... | true |
cdca01a736f9eb02fc8b853e66cb840694430a1b | JavaScript | susemeee/SCloud | /_js/file_floater.js | UTF-8 | 2,030 | 2.53125 | 3 | [] | no_license |
$(document).ready(function(){
make_floatable_all(true);
});
function make_floatable_all(first){
var files = $('file');
files.each(function(){
make_floatable($(this), first);
});
}
function unmake_floatable_all(){
var files = $('file');
files.each(function(){
$(this).unbind('click');
});
}
function make_f... | true |
895d2ce31950cd5f170273babdfaf4925837ba01 | JavaScript | BMeeNA57/JavaScript-Projects | /Basic JavaScript Projects/JS/Basic_JavaScript_2.js | UTF-8 | 308 | 3.84375 | 4 | [] | no_license | var x = multiply(10, 5);
document.getElementById("multiply").innerHTML = x;
function multiply(a, b) {
return a * b;
}
function myFunction() {
var sentence="I am learning";
sentence += " to add a concatenate string.";
document.getElementById("Concatenate").innerHTML = sentence;
} | true |
25da11e4fc7bc889a2eff5c3f5c584492f5d3242 | JavaScript | jwebking/nodeNoteList | /app.js | UTF-8 | 1,393 | 3.34375 | 3 | [] | no_license | //modules
const fs = require('fs');
const _ = require('lodash');
const yargs = require('yargs');//parses the arguments
//files
const notes = require('./notes.js');
const argv = yargs.argv;//
var command = argv._[0];
//adding a note
if (command === "add") {
var addnote = notes.addNote(argv.title, argv.body);
... | true |
f0853764431d08e7375c0a9f67cb849153a4d19a | JavaScript | Tushar-Tilwani/stuff | /ad-hoc/lc/isRectangleOverlap.js | UTF-8 | 373 | 2.953125 | 3 | [] | no_license | /**
* @param {number[]} rec1
* @param {number[]} rec2
* @return {boolean}
*/
var isRectangleOverlap = function (rec1, rec2) {
const [r1x1, r1y1, r1x2, r1y2] = rec1;
const [r2x1, r2y1, r2x2, r2y2] = rec2;
return (
(r2x1 > r1x1 && r2x1 < r1x2) ||
(r2y1 > r1y1 && r2y1 < r1y2) ||
(r1x1 > r2x1 && r1x1... | true |
e84ca1933b1e106e476ca52571a35aeab1594646 | JavaScript | haddenJacob/project | /face/js/fetch/fetch.js | UTF-8 | 689 | 2.5625 | 3 | [
"MIT"
] | permissive | function fetch(
url,
param = {},
type = 'GET',
async = false,
header = 'application/json;charset:utf-8',
datatype = 'json',
processData,
contentType){
return new Promise((resolve,reject) => {
// console.log(param)
$.ajax({
method:type,
url:url,
data:param,
async:async,
header:header,
dataT... | true |
8270d33f2c183d0ba23c90924946aacf49143f17 | JavaScript | sdsautter/dart-scorer | /app/components/x01/views/ShotHistory.js | UTF-8 | 2,177 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
export default class ShotHistory extends Component {
constructor() {
super();
this.renderShotHistory = this.renderShotHistory.bind(this);
this.shotRowLoop = this.shotRowLoop.bind(this);
this.shotRowClassName = this.shotRowClassName.bind(thi... | true |
a230d718a7160b7c206ba1ba464fe3295f4c8c74 | JavaScript | wivn/timetracker | /src/util/shortTimeFormatting.js | UTF-8 | 401 | 3.078125 | 3 | [
"MIT"
] | permissive | function shortTimeFormatting(time) {
// time is given in seconds
const seconds = 's'
const minutes = 'm'
const hours = 'h'
if (time <= 60) {
return time + seconds
} else if (time < 3600) {
return Math.round((time / 60) * 10) / 10 + minutes
} else if (time >= 3600) {
return Math.round((time / ... | true |
d5cb59b5f67bdbec90aaa192e9ff01dd11449934 | JavaScript | asarudick/chat-service | /src/prompts/login.js | UTF-8 | 821 | 2.640625 | 3 | [] | no_license | import Prompt from './base';
import userManager from '../managers/user';
import winston from 'winston';
import PromptError from '../errors/prompt';
export default class LoginPrompt extends Prompt {
constructor () {
super();
var that = this;
this.addStep( Prompt.createStep( {
start: (state) => {
// No... | true |
b96ecf5e102d53c138f7ae0360d3f59ab6d9ec16 | JavaScript | OGonzalezNYC/building-forms-lab-online-web-sp-000 | /src/containers/BandsContainer.js | UTF-8 | 1,598 | 2.890625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React, { Component } from 'react';
import Bands from '../components/Bands';
import BandInput from '../components/BandInput';
import { connect } from 'react-redux';
//1.define as an action creator: type and data. Creates an action based on data, and returns it.
const addBandActionCreator = (bandObject) => {
c... | true |
0409f75e8a3a779f6e4d09df68a0248498472eb4 | JavaScript | olegpisklov/leetcode | /leetcode/medium/All Paths From Source to Target/index.js | UTF-8 | 469 | 3.046875 | 3 | [] | no_license | /**
* @param {number[][]} graph
* @return {number[][]}
*/
var allPathsSourceTarget = function(graph) {
const res = [];
helper(graph, 0, res, []);
return res;
};
const helper = (graph, i, res, path) => {
path.push(i);
if (i === graph.length - 1) {
res.push([...path]);
r... | true |
8aed31761ce578718df73b1e6fe0327b1961e230 | JavaScript | y1jay/Server | /node_test/connect_test.js | UTF-8 | 1,129 | 2.9375 | 3 | [] | no_license | // (require)== mysql라이브러리를 사용할 것이다 해당 파일 안에서만
//변수로 항상 저장을 시켜야 한다
// 이름도 꼭 통일 시켜야한다 (mysql)
let mysql = require('mysql')
let connection = mysql.createConnection(
{
host : 'database-1.ckd17nv1s0bt.ap-northeast-2.rds.amazonaws.com',
user : 'node_user',
database : 'my_test',
password :... | true |
fa4f9bf5d3c21cd1c9fd2a697af372f052cbdecb | JavaScript | StevenX911/leetcode-training | /src/9.js | UTF-8 | 617 | 3.578125 | 4 | [] | no_license | /**
* @param {number} x
* @return {boolean}
*/
var isPalindrome = function (x) {
if (x < 0) {
return false;
}
if (x < 10) {
return true;
}
// 获取x的数量级
let n = 10 ** Math.floor(Math.log10(x));
// 利用数量级求出首位整数 和 对数字求余获得位数,若数字为回文,则两数应相等
while (n > 1 && x > 0) {
if (... | true |
9441d8af6466198324781f1a0b88d786c753a33c | JavaScript | ajurik3/spotify | /public/artistdisplay.js | UTF-8 | 8,836 | 2.625 | 3 | [] | no_license | /*
Requests artist info, albums, and top tracks to display the artist's page.
@param {string} id - artist id
@param {string} name - artist name
*/
function getArtistPage(id, name){
let artistAlbums = {artistID : id, artist : name, albums : []};
let artist = new Promise(function(resolve, reject){
$.get({
... | true |
66ee1544cf8e76c2b91e9baedd1c19062bfba28d | JavaScript | vonPiernik/pong | /src/modules/scene.js | UTF-8 | 1,180 | 3.15625 | 3 | [] | no_license | export class Scene {
constructor() {
this.elements = [];
this.canvas = null;
this.canvasCircleRadius = 350;
this.canvasCircleCenterX = 350;
this.canvasCircleCenterY = 350;
}
addElement(element) {
this.elements.push(element);
}
rerender() {
t... | true |
aa9bcdd013d818c48a1e6fd6a991bcacd45ac9f3 | JavaScript | doublepair/chat-app | /controllers/signInController.js | UTF-8 | 1,161 | 2.6875 | 3 | [] | no_license | const mongoose = require("mongoose");
const User = mongoose.model("User");
const sha256 = require("js-sha256");
exports.signin = async (req, res) => {
const {username, email, password} = req.body;
//Email Validation Test
const emailVerifyRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(... | true |
22a48f5d58c64632f06ad3d11b4f6fe5fd818b0d | JavaScript | TylerSheffels/pokerengine | /packages/poker-engine/poker-engine-tests.js | UTF-8 | 2,059 | 3.3125 | 3 | [] | no_license | Tinytest.add('Cards - creating with name and number', function (test) {
errored = false
try {
var card = PokerEngine.Card('two', 'spades');
} catch (error) {
errored = true
test.equal(error.name, 'InstanceError');
}
test.isTrue(errored, 'Instantiation should fail w/o new');
}... | true |
605d55e78bd24ad402e66db79f5301c3cf1284bd | JavaScript | lucyjulian/liri-node-app | /liri.js | UTF-8 | 3,676 | 3 | 3 | [] | no_license | require("dotenv").config();
var fs = require("fs");
var request = require('request');
var keys = require("./keys.js");
var Spotify = require('node-spotify-api');
var Twitter = require('twitter');
var spotify = new Spotify(keys.spotify);
var client = new Twitter(keys.twitter);
var omdb = require('omdb');
var search... | true |
8fc241e13575063d11530234f2399710bd701067 | JavaScript | Abantech/abantech.github.io | /Experiments/CharetNode/Scripts/HandController.js | UTF-8 | 839 | 3.359375 | 3 | [] | no_license | var handController = new HandController();
function HandController() {
var handActions = []
this.RegisterAction = function (name, handAction)
{
handActions.push(new HandAction(name, handAction));
}
this.UnregisterAction = function (name) {
for(var i = 0; i< handActions.length; i++... | true |
5a978fa45c0f3887a3f6c71c649ab57eec8e2c7b | JavaScript | SangNguyen186/Baozi | /Components/Test.js | UTF-8 | 978 | 2.65625 | 3 | [] | no_license | var ProgressBar = require('ProgressBarAndroid');
import React, { Component } from 'react';
var TimerMixin = require('react-timer-mixin');
import View from 'react-native'
var MovingBar = React.createClass({
mixins: [TimerMixin],
getInitialState: function() {
return {
progress: 0
};
},
componentDi... | true |
bd0c16c4dbf24615a4ec171bacd48d6deb2e988f | JavaScript | Supporter09/PrvCvCV19.github.io | /js/quiz3.js | UTF-8 | 6,861 | 3.3125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | (function(){
// Functions
function buildQuiz(){
// variable to store the HTML output
const output = [];
// for each question...
myQuestions.forEach(
(currentQuestion, questionNumber) => {
// variable to store the list of possible answers
const answers = ... | true |
1ed192fbd29c07c3fae28415ab1131122a92f9ab | JavaScript | jdbbaugh/kennelReactApp | /src/components/animal/AnimalList.js | UTF-8 | 1,052 | 2.84375 | 3 | [] | no_license | import React, { Component } from 'react'
export default class AnimalList extends Component {
render() {
const theOwners = this.props.owners;
const theAnimals = this.props.animals;
let ownerAnimalArray = []
theOwners.forEach(owner => {
theAnimals.forEach(animal => {
if (owner.id === anim... | true |
6b1c3ab7b137af8c2b42c9f2a2eece2512c79ad3 | JavaScript | ApexPredeator23/Devsnest_THA | /Day6/day.js | UTF-8 | 1,126 | 3.921875 | 4 | [] | no_license | //First Question
// var is_array = function(input) {
// if (toString.call(input) === "[object Array]")
// return true;
// return false;
// };
//Second Question
// var array_Clone = function(arra1) {
// return arra1.slice(0);
// };
// Third Question
// var first = function(array... | true |
96447d540b5b324d7eb56a90206d72b1266d3735 | JavaScript | ielgov/PsapApp | /WebContent/js/error500_main.js | UTF-8 | 2,281 | 2.765625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | var scene, camera, renderer, projector;
var WIDTH = window.innerWidth;
var HEIGHT = window.innerHeight;
var SPEED = 0.003;
function init() {
scene = new THREE.Scene();
initCube();
initCamera();
initRenderer();
document.body.appendChild(renderer.domElement);
}
function initCamera() {
camer... | true |
9f7b27ce46e318c327137a3c59b040874d6248f2 | JavaScript | sayantabonny/React_Tutorial | /src/App.js | UTF-8 | 2,401 | 3.328125 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import './App.css';
import Person from './Person/Person'
import {Person_Props} from './Person/Person'
class App extends Component{
constructor(props) {
super(props);
this.state = {
persons: [{
name:'Max', age: 28
},
{
n... | true |
3211a7bb68436dc033b5a6cd0a690f4d054ce551 | JavaScript | dio/yugabyte-db | /managed/ui/src/components/alerts/AlertConfiguration/AlertUtils.js | UTF-8 | 480 | 2.65625 | 3 | [
"OpenSSL",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | export const createErrorMessage = (payload) => {
const structuredError = payload?.response?.data?.error;
if (structuredError) {
if (typeof structuredError == 'string') {
return structuredError;
}
const message = Object.keys(structuredError)
.map((fieldName) => {
const messages = stru... | true |
4cb259f61a61b3a81b55b918b665e897b37a6201 | JavaScript | 99Krish/JQueryFbProject | /fbPersonalDataJS.js | UTF-8 | 1,288 | 2.828125 | 3 | [] | no_license | $(document).ready(function(){
var myFacebookToken = 'EAACEdEose0cBAPJeT9SLnYBYXAFH9UuT5XJcAr2nRZAIIoiZCoqxPTKKOOqaFEtZA580nJV7Lw3YhiBZBKZACIPJFz9VcnwNOvZB3TXw8124Vp91eUvMLyaBaTEwY2LssyZBxZCiepdVUKSftNCfzneWJVIqMdPgF15VDQCBAnNop4C2dxFTVq9pJ0spY6fhvXwZD';
function getFacebookInfo()
{
$("#myEducation").htm... | true |
98c43a66847c791ee8217e133665377e024fda4b | JavaScript | Ilyatorero/module5_homework | /js/index8.js | UTF-8 | 191 | 3.0625 | 3 | [] | no_license | let fruits = new Map([
["apple", "green"],
["strawberry", "red"],
["blueberry", "blue"]
]);
for (let elem of fruits) {
console.log(elem);
} | true |
a7555380835fec2af7923ae2da31652b4caa8a26 | JavaScript | fredyyanto/blockchain | /src/Price/PriceChecking.js | UTF-8 | 1,074 | 2.890625 | 3 | [] | no_license | import React, { Component } from 'react';
class PriceChecking extends Component {
state = {
userBTC: 0,
userUSD: 0
}
handleChange = (e) => {
this.setState({ userBTC: e.target.value })
}
convertBtcToUsd = () => {
console.log(this.state.userBTC)
if(!isNaN(thi... | true |
0fc2fc1d18aa7c1e271f7afa1d1bb157c44d1672 | JavaScript | branjsmo1983/unity | /Esempi_Libro/Chapter 15/Scripts15/DialogueManager.js | UTF-8 | 17,994 | 2.796875 | 3 | [] | no_license | #pragma strict
// Player conversation topics with npc_1
var topics_1 = new String[10];
internal var audioOffset: int; // offset for random & sequential replies
//audio variables
var clipSource : DialogueAudioClips; // the script with the audio clip arrays
internal var currentTopicAudio = new AudioClip[2]; // array ... | true |
030a5f906a4dae30f422c0253b9b0b37a9781dd8 | JavaScript | demonCoder95/freecodecamp | /proj-palindrome.js | UTF-8 | 510 | 4.125 | 4 | [] | no_license | /**
* Given a string, determine if it's a palindrome
* Filter off all non-alphanum chars and convert to lowercase
* @param {string} str string to check for palindrome
*/
function palindrome(str) {
// preprocess the string
let str_filtered = str.replace(/[^a-zA-Z0-9]/g,"").toLowerCase();
// check for palindrom... | true |
05801634f20bacff0cdae8e2d778ca499c9bcd61 | JavaScript | ArnaudBuchholz/training-nodejs-playground | /handbook/es6/spread array.js | UTF-8 | 95 | 3.015625 | 3 | [
"MIT"
] | permissive | const fibonacci = [1, 2, 3, 5, 8]
console.log([0, ...fibonacci, 13]) // [0, 1, 2, 3, 5, 8, 13]
| true |
779248e1a8ac2e9a1a7f73d0ac403f39c9edfeb8 | JavaScript | fssroxx/table | /table.js | UTF-8 | 723 | 3.65625 | 4 | [] | no_license | let a = prompt("Количество строк таблицы", "");
let b = prompt("Количество столбцов таблицы", "");
class Table {
constructor(cells, quantity) {
this.quantity = quantity;
this.cells = cells;
}
formColumns() {
for (let m = 0; m < this.cells; m++) {
let $el = document.createElement("tr");
$e... | true |
011c1fe51cae4051bad817de550518a76e966d6a | JavaScript | kealanocallaghan2000/Year3ProjectKealan-Dean | /server.js | UTF-8 | 2,181 | 2.625 | 3 | [] | no_license | const express = require("express");
const mongoose = require("mongoose");
const bodyParser = require("body-parser");
const app = express();
const passport = require("passport");
const cors = require('cors');
app.use(cors());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.he... | true |
0c05992a34f14456b9ec33a54a0ceb907eb58d4e | JavaScript | percussion/percussioncms | /system/cms/content/applications/sys_resources/ApplicationFiles/trinidad/adf/jsLibsDebug/Locale.js | UTF-8 | 22,521 | 3.046875 | 3 | [
"LicenseRef-scancode-dco-1.1",
"Apache-2.0",
"OFL-1.1",
"LGPL-2.0-or-later",
"LicenseRef-scancode-generic-cla"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License")... | true |
4a059574a67bf472ee8e8e87ad66c01cd0d3752e | JavaScript | jakerobs/group-12 | /assets/js/landingpagescript.js | UTF-8 | 762 | 2.96875 | 3 | [] | no_license | var startButtonEl = document.querySelector("#start-btn");
var leaderBoardButtonEl = document.querySelector("#leaderboard-btn");
var startNewGame = function () {
//remove the old categories to refresh the page with new ones.
localStorage.removeItem("categoryIds","categoryTitles");
localStorage.removeItem("... | true |
cc5cd61c43827b10aa7f35be544ea0dd9dee25ad | JavaScript | christsop/node-koa-exc | /01-event-loop-tests/00-02-events.js | UTF-8 | 893 | 3.5625 | 4 | [] | no_license | //
// What exactly will be logged on the console aster the
// execution of the following code?
//
const { EventEmitter } = require('events');
const watcher = new EventEmitter();
watcher.on('bird', (...birdKind) => {
console.log(`Watcher: I just noticed birds of kinds: ${birdKind}`);
});
setTimeout(() => {
watche... | true |
c14c9c367dfc9831a07d4c19d18c8bbad10d0a22 | JavaScript | Jzyhc/react-style | /src/page/performance/Memo/index.js | UTF-8 | 1,416 | 2.578125 | 3 | [] | no_license | /*
* @Author : jincheng
* @Date : 2021-04-25 11:27:32
* @LastEditTime : 2021-06-07 11:00:23
* @LastEditors : jincheng
* @FilePath : /react-style/src/page/performance/Memo/index.js
*/
import React,{useState} from 'react'
import { Button } from 'antd'
import Child from './Child'
import ChildMemo... | true |
1a824987ea786e0b5b9afa1de8e2cb92b623ffec | JavaScript | theasaurus/exam-timer | /src/InputFields.js | UTF-8 | 2,924 | 2.90625 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
/**
* Create the input fields for perusal/planning, exam and a message
* Goes inside the TimerForm
* @param {*} props
*/
const classes = (c) => c.filter(Boolean).join(" ");
const InputFields = (props) => {
const [perusalInput, setPerusalInput] = useState(prop... | true |
3ee8b45ebcd4f84c615ea77c4bf096dd05f18317 | JavaScript | anglee/howdy-web | /lib/Heap.js | UTF-8 | 2,094 | 3.46875 | 3 | [] | no_license | // assume base is 1
const getLeftI = i => 2 * i;
const getRightI = i => 2 * i + 1;
const getParentI = i => Math.floor(i / 2);
const getLastParentI = size => Math.pow(2, Math.floor(Math.log2(size))) - 1;
class Heap {
constructor(array = [], compareFunc = (a, b) => a - b /* MaxHeap */) {
this.A = [0, ...array]; //... | true |
34a368c8271876e34fedb2104f695ba14eff6971 | JavaScript | rasmusoh/ohldRewrite | /src/js/core/entities.spec.js | UTF-8 | 1,450 | 3.078125 | 3 | [] | no_license | describe("Entity", function() {
it("should instatiate correctly", function() {
var ent = new Entity();
expect( ent.hasOwnProperty("c")).toBeTruthy();
});
it("should increment counter on creation", function() {
Entity.prototype.count = 0;
var entity1 = new Entity();
... | true |
2130e9fe8eb845c4c0d7ffc92562a1ec15cf628e | JavaScript | dalcymar/projeto-javascript-user | /scripts/controller/calcController.js | UTF-8 | 2,468 | 3.28125 | 3 | [] | no_license | class CalcController {
constructor(){
this._locale = 'pt-BR';
this._displayCalcEl = document.querySelector("#display");
this._dateEl = document.querySelector("#data");
this._timeEl = document.querySelector("#hora");
this._currentDate;
this.initialize();
this.... | true |