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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
00bd8ad07a32692e40485fcbfb2162cd636526e0 | JavaScript | rcarton/lipstr.com | /lipstr/lists/static/js/list.js | UTF-8 | 24,054 | 2.546875 | 3 | [] | no_license |
/**
* list.js
* author: Remi Carton
* http://troebr.net
*
*
* appCache storage:
* <APPLICATION_NAME>:
* {
* list: [list of <tasklist>],
* actions: []
* }
*
* tasklist:
* {
* id: <id>,
* title: <title>,
* items: [list of <task>],
* [tmp_id_replacement: <tmp id to replac... | true |
306ea0135e412587cd33522e8b87ddce865a12b0 | JavaScript | MateSeco/threejs-tank | /js/objects/tank/trajectory.js | UTF-8 | 732 | 2.65625 | 3 | [] | no_license | import {
SplineCurve,
LineBasicMaterial,
BufferGeometry,
Vector2,
Line,
} from "three";
export default function createTrajectory() {
const curve = new SplineCurve([
new Vector2(0, 0),
new Vector2(50, 50),
new Vector2(0, 100),
new Vector2(-50, 50),
new Vector2(0, 0),
new Vector2(50, ... | true |
5b0bb04a2af7692f178ae2a3bfa560aa1f498e2f | JavaScript | rcoutelo/viajecomdarcy-web | /static/js/default/custom.js | UTF-8 | 221 | 2.984375 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | $('.input-number').keyup(function() {
var num = $(this)
number = num.val() - parseFloat( num.val() ) >= 0
if(number !== true){
num.val(" ")
}
if(num.val() == ""){
num.val(" ")
}
});
| true |
fe5e33441a9fcb06914ffc0ccc03c36fde9c2587 | JavaScript | agungdp150/my-hacktiv8-course-projects | /phase-0/week-4/senin/coderbyte-simple-symbol.js | UTF-8 | 338 | 3.0625 | 3 | [
"MIT"
] | permissive | function SimpleSymbols(str) {
var arr = str.split('');
for (var i = 0; i < arr.length; i++) {
if (arr[i].match(/[a-z]/i)) {
if ((arr[i-1] == '+' && arr[i+1] == '+') || (arr[i-1] == '=' && arr[i+1] == '=')) {
return true;
} else {
return false;
}
}
}
}
console.log(SimpleS... | true |
e082432d155b63ec2904336fb7b169a6320b17a5 | JavaScript | nguyentrungduc08/asyncJS_demo | /promises.js | UTF-8 | 1,670 | 3.859375 | 4 | [] | no_license | const posts = [
{title:'post one', body:'This is the post one'},
{title:'post two', body:'This is the post two'},
{title:'post three', body:'This is the post three'},
]
function getPosts() {
setTimeout(() => {
let output = '';
posts.forEach((post, index) => {
output += `<li>... | true |
94b3b9b0e987c22121d277c0293daf9f40746904 | JavaScript | gtf1119/testgit | /springMybatis/.svn/pristine/37/37c6b7e7fe4aed462e6c7000ca6953ad988db332.svn-base | UTF-8 | 1,243 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | var userList = {
init:function(args){
userList.getDataSource(args);
},getDataSource : function(args){
if(typeof args.dataSource == "string"){
$.ajax({
url:args.dataSource,
type:"POST",
dataType : "text",
success : function(json){
var obj = eval("("+json+")");
args.dataSource = obj;
... | true |
e254c58ff684349ca48aca5bf0870e5a3d434cd3 | JavaScript | Hetoreno/NAV-burger-practice | /Styles/main.js | UTF-8 | 992 | 2.515625 | 3 | [] | no_license | const burger = document.querySelector(".burger");
/* const links = document.querySelectorAll(".links"); */
const links = document.querySelector(".mobile");
const navLinks = document.querySelectorAll("a");
const background = document.querySelector("html");
/* burger.addEventListener("click", ()=>{
links.forEach(foc... | true |
48582e1543b3ec6b41185dcfb98fcc2b704edaad | JavaScript | samyakbambole/who-wants-to-be-a-megabit | /src/questions/JamesQQuick.js | UTF-8 | 4,604 | 2.921875 | 3 | [] | no_license | export default [
// #region Easy
{
questionText: "What does React use to make DOM diffing and manipulation efficient?",
correctAnswer: "Virtual DOM",
incorrectAnswers: [
"Shadow DOM",
"React DOM",
"Fast DOM"
]
},
{
questionText: "Which company was React created by?",
co... | true |
6597d6ffa8b051edfe3b809036bf6dc612c23abe | JavaScript | mvanzijl/js_eindopdracht | /script.js | UTF-8 | 2,708 | 3.421875 | 3 | [] | no_license | // javascript //
//functie laat menu zien of haal deze weg
let toggleNav = function () {
let getSidebar = document.querySelector(".nav-sidebar");
let getSidebarUl = document.querySelector(".nav-sidebar ul");
let getSidebarSpan = document.querySelectorAll(".nav-sidebar Span");
// laat menu zien
... | true |
cd70224ed9b12fb7ce4084e8ef39aae0844d0936 | JavaScript | jackaitken/JS_101 | /lesson_3/easy_1/problem_2.js | UTF-8 | 575 | 4.71875 | 5 | [] | no_license | // How can you determine whether a given string
// ends with an exclamation mark (!)?
/*
Since every character in a string has an index, we could just
check whether the last index === '!'.
*/
let endsWith1 = str => str[str.length - 1] === '!';
let str1 = "Come over here!";
let str2 = "What's up, Doc?";
endsWith1(st... | true |
02d4497567b8be0a96c94bd91738f262e923c407 | JavaScript | osgirl/alice | /test/at.js | UTF-8 | 2,375 | 2.859375 | 3 | [
"MIT"
] | permissive | /*globals it describe alice */
(function( alice ) {
"use strict";
if (!alice) {
throw "Alice is missing!";
}
function waitAndDo( cb ) {
setTimeout(cb, 60);
}
// Test at -------------------------------------------
describe("Alice", function() {
describe("#at()", function() {
it("shou... | true |
f6f6ac20730c04654ad92e38877109002d334a50 | JavaScript | MariaEduardaGS/VIDEOS | /questao3.js | UTF-8 | 117 | 3.140625 | 3 | [] | no_license | var result;
result=" ";
for(i=300;i<=400;i++){
if(i%8===0){
result=result+i+" ";
}
}
alert(result);
| true |
3900e2178d6e85b57ff9e5f1632a7617bb92cea0 | JavaScript | rezere/SS_HW | /HW4/Task 1/main.js | UTF-8 | 451 | 3.3125 | 3 | [] | no_license | function findSumIP(first_ip,second_ip)
{
first_ip = first_ip.split( "." );
second_ip = second_ip.split( "." );
let result = 0, numberOne = 0, numberTwo = 0;
for( let i = 0; i < 4; i ++ )
{
numberOne += Number(first_ip[i]) * Math.pow(256, 3-i);
numberTwo += Number(second_ip[i]) * Math.p... | true |
ea591dd1abba00ac3b481fc3fa15f06a3af3c406 | JavaScript | RajuJosephK/jScriptPractice | /removeAlphaChars.js | UTF-8 | 216 | 4.0625 | 4 | [] | no_license | // Remove alpha chars from an array
arr = ["v", "a", "d", "b", 3, "c", 4];
x = 0;
while (x < arr.length) {
if (typeof arr[x] != "number") {
arr.splice(x, 1);
} else {
x = x + 1;
}
}
console.log(arr);
| true |
94d5937ceb12ee8eefccedc79839a0687dcccd7b | JavaScript | KINCH3RO/FCC_American_British_English_Translator | /components/translator.js | UTF-8 | 3,365 | 3.25 | 3 | [] | no_license | const americanOnly = require('./american-only.js');
const americanToBritishSpelling = require('./american-to-british-spelling.js');
const americanToBritishTitles = require("./american-to-british-titles.js")
const britishOnly = require('./british-only.js')
class Translator {
translate(text, locale) {
let a... | true |
c83956c1cf249556c3d5b0d812b0848fe2b18680 | JavaScript | M1KUS3Q/alexa | /app/static/alexa.js | UTF-8 | 489 | 2.75 | 3 | [] | no_license | window.SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
let alexa = new SpeechRecognition();
window.addEventListener('click', function() {
document.body.innerHTML = 'start nasluchiwania'
console.log("dzialam")
return alexa.start();
});
alexa.addEventListener('result', funct... | true |
3bc88ce07d10142f70df6be86e4b321d1fc93ca7 | JavaScript | pilarfernandezz/foodtrack-server | /src/controllers/foodController.js | UTF-8 | 2,780 | 2.625 | 3 | [] | no_license | exports.post = (req, res, next) => {
res.status(201).send('Requisição recebida com sucesso!');
};
exports.put = (req, res, next) => {
let id = req.params.id;
res.status(201).send(`Requisição recebida com sucesso! ${id}`);
};
exports.delete = (req, res, next) => {
let id = req.params.id;
res.status(2... | true |
c8caa0b64affdf552cb90651ecb041fd90b1ab61 | JavaScript | momja/fgmkJsEngine | /src/achievment.js | UTF-8 | 2,109 | 2.546875 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | var achievments = {}
achievments.setup = function(achievmentsjson) {
this.defaultAchievment = function() {
return {
"name": false,
"description": false,
"image": false,
"achieved":false,
"condition":{}
}
}
this.allachievments = achi... | true |
206d19f99761a093081d258339eeedd31d05c7c0 | JavaScript | AberystwythSystemsBiology/DIMEdb | /dimedb/app/static/js/tables/meta/new_publications.js | UTF-8 | 863 | 2.546875 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
$("#autofill_pubmed").click(function () {
var id = $("input[name=pubmed_id]").val();
$.getJSON('http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&id='+id+'&retmode=json', function(summary){
var author_list = "";
for(author in... | true |
1eebe47eb198ab8c38a8afd91cc65a7d017708d7 | JavaScript | DatKevin/Data-Diary | /frontend/src/containers/CreateEntryContainer.js | UTF-8 | 2,336 | 2.6875 | 3 | [] | no_license | import React, { Component } from "react"
import EntryModel from "../models/EntryModel"
import EntryTagsModel from "../models/EntryTagsModel"
import CreateEntryForm from "../components/CreateEntryForm"
import CategoryHolder from "../components/CategoryHolder"
import CategoriesModel from "../models/CategoriesModel"
impor... | true |
e2b654c28c81f4ffcc93576000d0a6dbb15ff84d | JavaScript | LSD237/Portfolio-White-Alexa | /src/portfolio.js | UTF-8 | 2,216 | 3.015625 | 3 | [] | no_license | // //* Переключение li над слайдером и Смена слайдеров (от нажатия на li)
// ulPortfolio.addEventListener('click', function (event) {
// if (event.target.tagName != 'LI') return
// let childrenContainerLi = event.target.parentElement.querySelectorAll('li')
// if (!childrenContainerLi) return // Елси нет детей('l... | true |
abdf13010a6c70aebdc8234e1e6a70a7afdc8c99 | JavaScript | sdockray/scavenge | /plugins/morph.js | UTF-8 | 1,757 | 2.828125 | 3 | [] | no_license | // var sqlite3 = require('sqlite3').verbose()
// /*
// Config options
// file: name of db - defaults to data.sqlite
// refresh: bool - if true drops table if it already exists
// table: name of table - defaults to data
// columns: list of variable names to include as columns in the table
// */
// let db
/... | true |
4f242c03310386cd4d5c2f4120d5d960ef3ae01d | JavaScript | papodaca/node-argon2 | /index.js | UTF-8 | 2,319 | 2.59375 | 3 | [
"MIT"
] | permissive | var bindings = require("bindings")("argon2"),
crypto = require("crypto");
var defaults = exports.defaults = Object.freeze({
timeCost: 3,
memoryCost: 12,
parallelism: 1,
argon2d: false
});
var fail = function (message, callback) {
var error = new Error(message);
if (typeof(callback) === "undefined") {
... | true |
419b771045a7b3c6dd91d29ac19144aa964c7df2 | JavaScript | JakeLoganUK/AusoWorldHR | /js/Employee/employee_validation.js | UTF-8 | 538 | 2.609375 | 3 | [] | no_license | //Required Field
//Current Action = save/1 , update/2
function employeeRequiredFieldHandler(frm_data, action, required_class) {
var response = true;
if (frm_data.designation.length == 0) {
toastr.error('Designation Required!');
response = false;
}
if (action == 1) {
}
$(required_... | true |
47430f4714e7b91b3d3748bc45b3204d1b375b05 | JavaScript | Hamza8479/React-Guidance | /explore/src/App.js | UTF-8 | 3,171 | 3.484375 | 3 | [] | no_license | // import React, { Component } from 'react'
import React, { useState } from 'react'
import './App.css';
import Person from './Persons/Person';
// Class component
// class App extends Component {
// state = {
// people : [
// {name:'Hamza', age:22},
// {name:'Munsif', age:23},
//... | true |
f93f5863d07ce7a17c5595e73188cd5c85c87997 | JavaScript | geina17/FriendFinder | /app/routing/apiRoutes.js | UTF-8 | 747 | 2.671875 | 3 | [] | no_license | var friends = require("../data/friends.js");
var path = require("path");
// Routes
// =============================================================
module.exports = function(app){
// A GET route with the url /api/friends. This will be used to display a JSON of all possible friends.
app.get("/api/friends", func... | true |
d4bac74b750fa1313d59f440184fc9d73c8e8042 | JavaScript | MagnoNeves2/Generation | /node em geral/oop/build/index.js | UTF-8 | 1,128 | 4.09375 | 4 | [] | no_license | "use strict";
class Disciplina {
//Construtor da class Disciplina
constructor(nome) {
this.nome = nome; //(this.) serve para "chamar" o atributo da classe.
}
// Métodos da class Disciplina
calcularAprovacao(nomeAluno, notaAluno) {
if (notaAluno >= Disciplina.media) {
retu... | true |
b630213def46396c4b77bfe0da19ae6a6471d36f | JavaScript | KateTarasowa/comp_grafica | /пример5(картинки)/js5.js | UTF-8 | 637 | 2.8125 | 3 | [] | no_license | function init() {
console.info("initialized");
var canvas = document.getElementById("game");
var ctx = canvas.getContext('2d');
var yandex =
document.getElementById("yandex-logo");
var google =
document.getElementById("google-logo");
var wp= new Image();
wp.src = "wp.jpeg";
ctx.drawImag... | true |
107988e025a81e0f8ad477b722e2880fc312ab82 | JavaScript | pimenteljchristopher/activity1Example | /www/js/services.js | UTF-8 | 2,318 | 2.546875 | 3 | [] | no_license | angular.module('starter.services', [])
.service('thephService', function($http) {
var presidential = [];
this.getPresidential = function(result){
return $http({
method: 'GET',
url: '/data'
}).then(function successCallback(response) {
console.log(response);
return r... | true |
eac8d97c40fc6e57d86628344f7730adc248dc0b | JavaScript | cemalihsan/Atolye15-and-Kodluyoruz-Javascript-Bootcamp | /Atölye15 and Kodluyoruz Javascript Bootcamp/Week 3/events.js | UTF-8 | 1,263 | 3.171875 | 3 | [] | no_license | //Mouse Events
/*
mousedown
mouseup
dbclick
click
mousemove
mouseover/mouseout
*/
window.addEventListener("load", function(){ //dom un oluştuğundan emin olmak için callback yapılıyor, yüklenmesini bekliyor
//const btn = document.querySelector("button")
/*btn.addEventListener("click", function(e){
al... | true |
fe1d8ca55f67800a59d9657f9473a0d5f63df0f1 | JavaScript | nielschristiank/DojoAssignments | /WebFundamentals/Javascript/what_time/what_time2.js | UTF-8 | 2,206 | 3.125 | 3 | [] | no_license | function whatTime(hr, min, am_pm) {
var intro = "";
var outro = "";
if (min < 30) {
if (min < 5) {
intro = "It is almost five past ";
}
if (min === 5) {
intro = "It is five past ";
}
if (15 > min > 5) {
intro = "It is almost quart past ";
}
if (min === 15){
in... | true |
92f6e8021dfaad4a293d4dd060c0242b19566a97 | JavaScript | clarnjan/napreden-veb-dizajn | /lab1/lab1.4.js | UTF-8 | 596 | 3.171875 | 3 | [] | no_license | 'use strict'
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
rl.question('', (p1) => {
rl.question('', (p2) => {
p1 = p1.split(", ")
p2 = p2.split(", ")
console.log(hasSameBread(p1,p2))
... | true |
11e4b2e92c22fc0526a3a3dd67825de621a6ee01 | JavaScript | team14soc/IronCode | /BackEnd/TwoTiers/ApplicationTier/Components/entity.js | UTF-8 | 779 | 2.796875 | 3 | [] | no_license | /*
File: entity.js
Versione: 1.0
Autore: Sharon Della Libera
Registro Modifiche:
Sharon Della Libera, creazione file, 2018-06-25
Sharon Della Libera, creazione classe Entity, 2018-06-25
Sharon Della Libera, versione ufficiale, 2018-06-28
Descrizione: la classe Entity si occupa di creare un oggetto entità
costi... | true |
6f22fc7fb28764f570dbc80a1f7542b03b366338 | JavaScript | HectorSilvaRobles/youtube_clone | /server/models/user.js | UTF-8 | 2,249 | 2.734375 | 3 | [] | no_license | const mongoose = require('mongoose');
const bcrypt = require('bcrypt')
const saltRounds = 10;
const jwt = require('jsonwebtoken')
const userSchema = mongoose.Schema({
name: {
type: String,
maxlength:50
},
email: {
type: String,
trim: true,
unique: 1
},
passwo... | true |
97f4eb445493ea3d7674403272d0dd8723c509ac | JavaScript | adedotunbashorun/designPattern | /DesignPattern/Base/CreationalPattern/constructor_pattern.js | UTF-8 | 423 | 3.34375 | 3 | [] | no_license | class Car1 {
constructor(doors, engine, color){
this.doors = doors;
this.engine = engine;
this.color = color;
}
}
class Suv extends Car1 {
constructor(doors, engine, color , wheels){
super(doors, engine, color);
this.wheels = wheels;
}
}
const civics = new ... | true |
6537ff4ee7c3f96bb8798c0b702471e4e8db6555 | JavaScript | tmzks/practice_ljh | /2020_02_28/lecture_1.js | UTF-8 | 2,768 | 4.09375 | 4 | [] | no_license | //호이스팅 ? 변수나 함수가 선언되기전에 사용되었다면 변수나 함수 선언을
//문서 최상단으로 끌어 올리는 행위
// console.log(x); // x라는 변수를 찾고 있다. undefiend
// var x = 10; //선언은 밑에서 되어있다.
// x; //
//자바스크립트가 위의 코드를 읽는 방법
//1. x라는 변수가 생성이 되어있지 않기 떄문에 x 변수를 최상단에 선언한다
// var x;
// console.log(x);
// x = 10;
// x; //
// 호이스팅이 안되는 변수 타입 let과 const
// foo()... | true |
15297c96cfa4722a397bc96956a31cfa8e10f155 | JavaScript | redDragonLH/ldle | /leetcode/algorithm/1219-path-with-maximum-gold.js | UTF-8 | 2,049 | 3.65625 | 4 | [] | no_license | /**
* 1219. 黄金矿工
*
* 你要开发一座金矿,地质勘测学家已经探明了这座金矿中的资源分布,并用大小为 m * n 的网格 grid 进行了标注。每个单元格中的整数就表示这一单元格中的黄金数量;如果该单元格是空的,那么就是 0。
* 为了使收益最大化,矿工需要按以下规则来开采黄金:
* * 每当矿工进入一个单元,就会收集该单元格中的所有黄金。
* * 矿工每次可以从当前位置向上下左右四个方向走。
* * 每个单元格只能被开采(进入)一次。
* * 不得开采(进入)黄金数目为 0 的单元格。
* * 矿工可以从网格中 任意一个 有黄金的单元格出发或者是停止。
*/
/**
*
* 广度优... | true |
eb08a7628501b72fe4b02af2f17efbf623c5882c | JavaScript | maggiewiseman/hello_REST | /requestHandlerServeForm.js | UTF-8 | 1,414 | 2.796875 | 3 | [] | no_license | var querystring = require("querystring");
var fs = require('fs');
var formidable = require("formidable");
var util = require("util");
function start(request, response, postData) {
console.log("request handler start was called.");
var contents = fs.readFile('testForm.html', 'utf8', function(err,contents){
respons... | true |
25b350c1ce623936a63c62ccedf3dbe1b6866b75 | JavaScript | martins309/hashtag_local | /js/scripts.js | UTF-8 | 8,328 | 2.84375 | 3 | [] | no_license | 'use strict';
$(document).ready(function(){
$("#myModal").modal('show');
});
let geohash;
function getLocation() {
// check to make sure geolocation is possible
if (navigator.geolocation) {
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
... | true |
4463bace67da0e49497e33f9721149c84ced5af3 | JavaScript | PabloPyk/Zaliczenie_JavaScript | /15.DOM-Tworzenie elementów/script.js | UTF-8 | 9,843 | 3.625 | 4 | [] | no_license | //Zadanie 1
const div = document.createElement('div');
div.textContent = 'To jest nowy element';
document.querySelector('#root').appendChild(div);
//Zadanie 2
const ul = document.createElement('ul');
const fruits = ['Pomarańcz', 'Jabłko', 'Gruszka', 'Truskawka', 'Banan', 'Mandarynka'];
for(let i=0; i<6; i++)... | true |
30c38577c1b8fb560a6e373dfe930a005e2b2a6a | JavaScript | jeremyc2/Podcast-Timer | /javascript/broadcast-channel-polyfill.js | UTF-8 | 884 | 2.6875 | 3 | [
"MIT"
] | permissive | if (!window.BroadcastChannel) {
window.BroadcastChannel = class {
constructor(channelName) {
this.channelName = channelName;
}
addEventListener(event, callback) {
if (event === 'message') {
window.addEventListener('storage', (event) => {
... | true |
d598d89cc84493d477aafeb7fc47adb936a302c3 | JavaScript | SCVORAL/project-front | /src/components/SelectInput.js | UTF-8 | 1,611 | 2.828125 | 3 | [] | no_license | import React, { useState, useEffect } from "react"
export const SelectInput = ({list, onChange, name, fandom, isInvalid}) => {
const [tag, setTag] = useState({})
const [searchValue, setSearchValue] = useState(fandom)
const [isOptionsOpen, setOptionsState] = useState(false)
useEffect(() => {
onChange(tag)... | true |
4164ae27c2acf36c5d447aaa12e9f1d2adda9454 | JavaScript | kimbylr/fswd | /week1/day1/4_longest.js | UTF-8 | 889 | 4.375 | 4 | [] | no_license | // Sort and remove duplicated characters
// Take 2 strings s1 and s2 including only letters from a to z.
// Return a new sorted string, the longest possible, containing distinct letters, - each taken only once - coming from s1 or s2.
function longest(s1, s2) {
var myString = s1 + s2;
var stringMaterial = [];
... | true |
61185019aa1f7864bfc2eb434d74daaa36a11fb8 | JavaScript | solgames-fun/solgames-games | /public/stackScene.js | UTF-8 | 13,926 | 2.59375 | 3 | [
"MIT"
] | permissive | "use strict";
var scene, camera, renderer;
var light1, light2; // two lights
var clock; // time
var bricks;
var stackHeight;
var warm = document.getElementById("warm");
var gameState = {
score: 0,
scene: "start",
combo: 0,
maxCombo: 0,
};
var rainBowColors = [
0xd358f7, 0xfa5858, 0xfaac58, 0xfafa58, 0x58fa58... | true |
615b21cabb2bdf91b469cca0cfe9b34af049298b | JavaScript | SitanHuang/AK4 | /core/inventory.js | UTF-8 | 1,826 | 3.1875 | 3 | [] | no_license | RESOURCES = ['salt', 'grain', 'cattles', 'lumber', 'horses', 'iron', 'gold'];
class ResArray {
constructor(init) {
// for domestic, battles, and development
this.salt = init || 0;
this.grain = init || 0;
this.cattles = init || 0;
this.lumber = init || 0;
// for battles only
this.horses =... | true |
6840584b0bbedcd41754ae0e6ba340f51af0dda5 | JavaScript | Krunalkadu97/AstrologerIndia | /screens/Online/FileUpload.js | UTF-8 | 6,177 | 2.53125 | 3 | [] | no_license | //import liraries
import React, { useEffect, useState, createRef } from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, KeyboardAvoidingView, TextInput, Platform, Image } from 'react-native';
import { COLORS } from './../../constants/theme';
import * as ImagePicker from 'expo-image-picker';
impo... | true |
2596440db73ad257c68ca8497be17e8c6d00c85a | JavaScript | Krisndp/Comic | /redux/reducer/changeLightReducer.js | UTF-8 | 415 | 2.609375 | 3 | [] | no_license | import { CHANGE_LIGHT } from '../action/actionType';
const defaultState = { light: true, notification: false };
const changeLightReducer = (state = defaultState, action) => {
switch (action.type) {
case CHANGE_LIGHT:
return {
...state,
light: !state.light,
... | true |
70e7830562e4ad12321ef42ba557a891f8f8a664 | JavaScript | varunvjha/coviddeck | /static/bot.js | UTF-8 | 2,317 | 3.015625 | 3 | [] | no_license | data = []
questions = ["Are you a Senior Citizen (more than 55 years old)?", "What is your gender?", "Do you have fever?",
"Do you currently have a sore throat?", "Do you cough regularly?",
"Are you experiencing shortness of breath or any other problems in breathing?",
"Which of the following is applicable?"
]
an... | true |
92f39a82cb825df0d72c8fd8cea14f3555af681a | JavaScript | jamJamDev/recycle-atx | /src/components/BackToTop.js | UTF-8 | 798 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
class BackToTop extends Component {
constructor(props){
super(props);
}
componentDidMount() {
// Update "Back to Top" button to display when scrolling down
var button = document.getElementById('scroll-top-btn');
window.onscroll = function() {
if (d... | true |
353325e2c7da50d0d615fc174015d7e10661585c | JavaScript | johanein/react-git | /src/Redux/reducers/logoutReducer.js | UTF-8 | 440 | 2.703125 | 3 | [] | no_license | import {
LOGIN_STATE
} from '../constants'
const initialState = {
loginState:false
}
export default function logoutReducer(state = initialState, action) {
switch (action.type) {
case LOGIN_STATE:{
const {loginState} = action
return {
... | true |
6c2e7f48f0ed8948ef2158f0cbdb4dec3a2e48b5 | JavaScript | paul-juang/nodeapp | /atest.js | UTF-8 | 16,955 | 3.046875 | 3 | [] | no_license | let obj = {
"name": "paul",
"1": 100
}
console.log(obj.name)
console.log(obj["1"])
console.log(obj)
let numarr = []
for (let i = 1; i <= 49; i++) {
let num = "";
if (i < 10) {
num = "0" + i;
} else {
num = String(i);
}
numarr.push(num)
}
//console.log(numarr)
let r... | true |
28c8b3d7cbfde6c8e8bf2385c2643267b5f4515a | JavaScript | SteveAlux/Portfolio | /Portfolio.js | UTF-8 | 5,062 | 2.625 | 3 | [] | no_license |
console.log($('#1circle').hasClass('unchecked'));
var width = $(window).width();
$(window).on('resize', function(){
if($(this).width() != width){
width = $(this).width();
if(width<=321){
$("#firstphoto_content").animate({
opacity:1
},100,function(){
console.lo... | true |
fabf6164aee7684149c77095ae08473a84641119 | JavaScript | bbarr/brendanbarr | /public/js/json_enforcer.js | UTF-8 | 5,842 | 3.171875 | 3 | [] | no_license | /**
* Validates JSON with JSON template
*
* @author Brendan Barr brendanbarr.web@gmail.com
*/
var JSONEnforcer = (function() {
var util,
Template,
Stub,
JSON_TYPES = ['string', 'array', 'object', 'number'];
util = {
is_optional: function(prop) {
if (util.is_string(prop))... | true |
8b11fe5f3a0af279027ad415c04a95a831ef6215 | JavaScript | baozihuihui/webpack-learnning | /3-webpack-makeLoader/markdown-loader.js | UTF-8 | 717 | 3.3125 | 3 | [] | no_license | // 每个 Webpack 的 Loader 都需要导出一个函数,这个函数就是我们这个 Loader 对资源的处理过程,
// 它的输入就是加载到的资源文件内容,输出就是我们加工后的结果。
// 我们通过 source 参数接收输入,通过返回值输出。
const marked = require("marked");
module.exports = (source) => {
// 1. 将 markdown 转换为 html 字符串
const html = marked(source);
// html => '<h1>About</h1><p>this is a markdown file.</p>'
//... | true |
eadb7b5122c700066726d7bb2957a2e4979e2acc | JavaScript | zyylyy/zy.blog.github.io | /js/parse.js | UTF-8 | 775 | 4.34375 | 4 | [] | no_license | /*
** 深拷贝
**创建对象副本的最古老方法之一是将对象转换为其JSON字符串表示形式,然后将其解析回对象
*/
// const obj = /* ... */;
// const copy = JSON.parse(JSON.stringify(obj));
const x = {};
const y = { x };
x.y = y; // Cycle: x.y.x.y.x.y.x.y.x...
const copy = JSON.parse(JSON.stringify(x)); // throws!
/*
** 浅拷贝:Object.assign()
**创建对象副本的最古老方法之一是将对象转换为其JSON字符串表... | true |
f4d4d9b8b139d205ef45f29811fd5864d84df94b | JavaScript | tavarestlais/Complete-JS-Course | /Fundamentals01/equalityOperators.js | UTF-8 | 629 | 4.625 | 5 | [] | no_license | const age = 18;
if (age === 18) console.log("You just became an adult 🙂 (strict)");
if (age == 18) console.log("You just became an adult 🙂 (loose)");
const favouriteNumber = Number(prompt("What's your favourite number?")); //number convert the string typed into a number
console.log(favouriteNumber);
console.log(ty... | true |
994e9855ab5984a54b1f7c5910e391fcb19ad588 | JavaScript | caridadrivera/fewpjs-acting-on-events-nyc-web-career-031119 | /index.js | UTF-8 | 811 | 3.46875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | var dodger = document.getElementById("dodger");
dodger.style.backgroundColor = "#FF69B4";
dodger.style.left;
dodger.style.bottom;
dodger.style.bottom = "0px";
// let game = document.getElementById("game");
// let p = document.createElement("p")
// p.color = "#000000"
// p.innerText = "I am here"
// game.appendChild(p)... | true |
845c5f0914571e68703da79855c47fc39a28078e | JavaScript | nemtsov/codewars | /lib/test/runner.js | UTF-8 | 764 | 2.578125 | 3 | [
"MIT"
] | permissive | var childProcess = require('child_process'),
fs = require('fs'),
cwd = process.cwd();
module.exports = Runner;
/**
* Responsible for forking and monitoring
* the runnable, which executes the kata
* test.
*/
function Runner() {
}
Runner.prototype.run = function(isWatchOn, cb) {
function watch() {
clear... | true |
61530a231ee46bd53ec084d8e4819916ec23965c | JavaScript | gericke98/lachu | /pages/index.js | UTF-8 | 1,677 | 2.734375 | 3 | [] | no_license | //Importacion de librerías y variables
import React, {Component} from "react";
import instance from "../ethereum/factory";
import {Card, Button} from "semantic-ui-react";
import Layout from "../components/Layout"
import {Link} from "../routes"
//Creación de componente para publicar pagina de inicio
class CampaignInde... | true |
483dd75c32c5c808e971cc5a155604f5111bbf2b | JavaScript | jun-ice/leetcode | /1365. 有多少小于当前数字的数字/solution.js | UTF-8 | 737 | 3.71875 | 4 | [] | no_license | /**
* @param {number[]} nums
* @return {number[]}
*/
var smallerNumbersThanCurrent = function (nums) {
if (nums.length <= 0) return []
let littleArr = []
let i = 0;
for (const key in nums) {
let arr = [];
nums.filter(ele => {
if (ele < nums[key]) {
arr.push... | true |
27a4bc3d10a01132fa87b9f87d13709a5c7394c7 | JavaScript | wow-such-team/get-swol-with-react | /client/src/components/Navbar/navbar.js | UTF-8 | 2,810 | 2.640625 | 3 | [] | no_license | import React, { Component } from "react";
import { Link } from "react-router-dom";
import API from '../../utils/API';
import Logo from "./Logo.png"
import "./style.css";
// Depending on the current path, this component sets the "active" class on the appropriate navigation link item
class Navbar extends Component {
s... | true |
6e100be4b06aa5ca8250d2d737fb7149dd327808 | JavaScript | YanaSugosha/YanaSugosha.github.io | /js/KumpulanTeam.js | UTF-8 | 954 | 2.5625 | 3 | [] | no_license | function KumpulanTeam(data) {
var timHTML = "";
data.teams.forEach(function (tim) {
timHTML += `
<style>
.card-image {
height: 200px;
padding-top: 25px;
padding-bottom: 25px;
}
</style>
<div class="col s12 m3" >
<div class="card">
<a href="./tim.html... | true |
a27ab5842f1298546fbc34ff4d8d018f8cbb4464 | JavaScript | mmikol/BigMamasKitchen | /src/generator.js | UTF-8 | 4,904 | 3.140625 | 3 | [
"ISC"
] | permissive | // Code Generator Carlos -> JavaScript
//
// Invoke generate(program) with the program node to get back the JavaScript
// translation as a string.
import {
Type,
ElseIfStatement,
ShortElseIfStatement,
Increment,
} from "./ast.js"
export default function generate(program) {
const output = []
// Variable an... | true |
114966267f6eb95d1bbb74b3ec61a1e47efa8424 | JavaScript | siddhanthm/puzzles | /Puzzles_server/server.js | UTF-8 | 4,676 | 2.59375 | 3 | [] | no_license | //File build on top of the starter code for webdev-project for CS 498 class taken in SP 15
// Get the packages we need
var express = require('express');
var mongoose = require('mongoose');
var User = require('./models/user');
var TempUser = require('./models/tempuser');
// For passport protection
var bcrypt = require(... | true |
2eee99cbd144966beb2009c24e47efb645bfea80 | JavaScript | alijany/Algorithm-exc-time-Comparator | /src/algorithms/fibonacci2.js | UTF-8 | 616 | 3 | 3 | [
"MIT"
] | permissive | algorithm = {
initialize: function () {
this.n = 0;
this.numbers = [10000000, 20000000, 30000000, 40000000, 50000000, 60000000, 70000000, 80000000, 90000000, 100000000];
},
update: function () {
this.n++;
},
run: function () {
var a = 0;
var b = 1;
... | true |
e8d9f3143a5dff974db8f380cffff4e94876ab9c | JavaScript | tsachse/gyro | /lib/usonic-fake.js | UTF-8 | 255 | 2.734375 | 3 | [] | no_license | const start_distance = 400.0;
var distance = start_distance;
function sensor() {
distance = distance - 0.1;
if(distance < 0.0) {
distance = start_distance;
}
return distance;
};
module.exports.createSensor = function() {
return sensor;
};
| true |
b05684db5243d5604a6a8a62ce5a7f5d8aeb02eb | JavaScript | AstraySteve/Bamazon | /bamazonCustomer.js | UTF-8 | 2,481 | 3.28125 | 3 | [] | no_license | /*
Steven Tran
UofT SCS, 2018
*/
var db = require('./db');
var inquirer = require('inquirer');
//Set up connection to database
var connection = db.login();
connection.connect(function(err){
if(err){
throw err; //throw exception
}
displayStock(askCustomer);
});
//Functions
displayStock =(ca... | true |
e54dfc8e8cead6984bc33968bc754a556632c4ee | JavaScript | laurierpb/SpaceInvaderIshGame | /public_html/JS/Game/gameOptions.js | UTF-8 | 3,211 | 2.59375 | 3 | [] | no_license | /* global onCanvasClick, onCanvasMove, player, enemy, canvasWidth, canvasHeight, enemeyProjSpeed */
var fps = 48;
var vitesse = 1;
var showPoints = false;
var difficulte = 1;
var vie = 1;
var progressiveDifficulty = true;
var bossSpawnPoint = 1000;
var enemyUpgrade = 250;
var control = 1;
function setOptions(startGame... | true |
7336e591bef2ed43d2e98f36ffdb8c3500d4b723 | JavaScript | Nibkat/sct-assignments | /house/script.js | UTF-8 | 1,908 | 2.96875 | 3 | [] | no_license | var myCanvas = document.getElementById("myCanvas");
var context = myCanvas.getContext("2d");
//context.globalAlpha=0.2;
context.lineWidth = 5;
/*
* Begin of drawing the sky
*/
context.beginPath();
context.strokeStyle="DodgerBlue";
context.fillStyle="#389bfc";
context.moveTo(900,500);
context.lineTo(800,500);
cont... | true |
c60585b77fc1709a55fcec5a67667107d41270d5 | JavaScript | future4code/Camila-Moura | /semana7/potter-api/potterapi/src/App.js | UTF-8 | 3,307 | 2.90625 | 3 | [] | no_license | import React from 'react';
import axios from 'axios';
import styled from 'styled-components';
import './App.css';
const Container = styled.div `
font-family: Verdana, Geneva, Tahoma, sans-serif;
position: absolute;
display:flex;
flex-direction: column;
align-items: center;
left: 20vw;
height: 80vh;
to... | true |
3ac27e76c6fa50fc0692c9e49edda439b474bff5 | JavaScript | purwadhika-school/JS-Fundamental | /function/SampleFour.js | UTF-8 | 2,202 | 4.03125 | 4 | [] | no_license | // Function, Loop, Conditional
// Quiz
const products = [
{
product_name: "Glass",
product_price: "25000",
product_color: "White",
product_category: "Kitchen",
product_location: "Jakarta"
},
{
product_name: "Shirt",
product_price: "45000",
product_color: "Red",
product_categor... | true |
220e5f930afb1fddca7ee65272c2e74dde097c23 | JavaScript | ebony1105/resume | /main.js | UTF-8 | 3,385 | 2.8125 | 3 | [] | no_license | siteWelcome.classList.remove('active')
let specialTag = document.querySelectorAll('[data-x]');
//添加offset类
for(let i = 1;i < specialTag.length;i++){
specialTag[i].classList.add('offset')
}
findcloset();
window.onscroll = function (x) {
if (window.screenY > 0) {
TopNavBar.classList.add('sticky')
... | true |
cb528e9425770b209373dddf9c75fafd97d75e5a | JavaScript | pikachumetal/cursohtml02 | /html5/webworkers/worker.js | UTF-8 | 239 | 2.65625 | 3 | [
"ISC"
] | permissive | self.addEventListener('message', function(e) {
var stringOpt = e.data;
var opt = null;
var listOpt = stringOpt.split('=');
var result = new Function('return ' + listOpt[0]);
self.postMessage(listOpt[0] + ' = ' + result());
});
| true |
f4573d6ced2eaf4bde194d3c3421b118c6d64845 | JavaScript | IsabelGomez87/Covid19-Tracker-frontend-react-redux | /src/utils/common/index.js | UTF-8 | 700 | 2.640625 | 3 | [] | no_license | /* eslint-disable no-param-reassign */
/* eslint-disable no-restricted-syntax */
const getDataForTable = (dataCases, dataVaccines) => {
const cleanObject = (object) => {
for (const property in object) {
if (object[property].country === null || object[property].country === undefined || object[property].count... | true |
42d82978f3f7dbf326b016f5396ac471398c29ae | JavaScript | vanessasuthat03/trello | /trello.js | UTF-8 | 6,991 | 2.71875 | 3 | [] | no_license | const draggables = document.querySelectorAll(".draggable")
const containers = document.querySelectorAll(".container")
const firstTasks = document.querySelectorAll(".firstTask")
draggables.forEach(draggable => {
draggable.addEventListener("dragstart", () => {
// console.log("drad start")
// console.log("statu... | true |
a392012180f4687bb22cec0149bf5aa389201f01 | JavaScript | technologyarts/meep-engine | /engine/graphics/particles/node-based/simulation/GLSLSimulationShader.js | UTF-8 | 12,290 | 2.546875 | 3 | [] | no_license | import { GLSLCodeGenerator } from "../codegen/glsl/GLSLCodeGenerator.js";
import { genAttributeInputName } from "../codegen/glsl/genAttributeInputName.js";
import { genAttributeOutputName } from "../codegen/glsl/genAttributeOutputName.js";
import { getTypeByteSize } from "../codegen/glsl/getTypeByteSize.js";
/**
* Fr... | true |
fc69e4fe0558182a6dead85b1e2ad62faffd0768 | JavaScript | romibernard/ih-crud-deploy | /src/components/FinancialApp/Sidebar.js | UTF-8 | 3,460 | 2.71875 | 3 | [] | no_license | // ./components/FinancialApp/Sidebar.js
// useEffect
// Es un hook que me permite realizar efectos secundarios en el código ("side effects"). Los "side effects" usuales son peticiones de API.
// O necesitan re-renderizar la vista nuevamente, en caso de que haya habido algún cambio en una variable externa, como en useS... | true |
314a3759ef2e1b9cc284899850134a5d32408a77 | JavaScript | ccebinger/clrs-algos | /src/sort/binaryInsertionSort.js | UTF-8 | 712 | 3.46875 | 3 | [] | no_license | // n lg n
function binaryInsertionSort (array, startIdx = 0, endIdx = array.length - 1) {
for (let j = startIdx + 1; j <= endIdx; j++) {
const val = array[j];
for (var searchStartIdx = startIdx, searchEndIdx = j-1; searchEndIdx >= searchStartIdx; ) {
const insertIdx = Math.floor((searchStartIdx + sear... | true |
a0206dcdc0bf7b262ab70e460bff0f022cdaa697 | JavaScript | learn-academy-2020-echo/week-3-assessment-LionSnarl | /react-commenting.js | UTF-8 | 2,464 | 3.515625 | 4 | [] | no_license | // ASSESSMENT 3: React Commenting Challenge
// Add comments to the React Dice Roller Challenge
// Explain the purpose and functionality of the code on the line DIRECTLY below the 10 comment tags
// src/App.js
import React, { Component } from 'react'
// 1) we are importing a child class component from a folder held... | true |
cb1a83f282a11d3d5663afa532a94e679a02fe13 | JavaScript | tinhtinh95/BE | /weather-app/playground/promises2.js | UTF-8 | 810 | 3.109375 | 3 | [] | no_license | const request = require('request');
var temperatureCity = (city) =>{
return new Promise((resolve, reject)=>{
const qEncode = encodeURIComponent(city);
request({
url: `https://samples.openweathermap.org/data/2.5/weather?q=${qEncode}&appid=b6907d289e10d714a6e88b30761fae22`,
j... | true |
88d31cb0994103aab0869de1140c813b40e5bdbf | JavaScript | yujihu/utils-1 | /src/utils/functional.js | UTF-8 | 419 | 3.078125 | 3 | [
"MIT"
] | permissive | /**
* @fileOverview 函数式编程相关函数
* @module Functional
*/
/**
* @description 组合函数
* @param {*}
* @returns
*/
export const compose = (...fns) =>
fns.reduce((f, g) => (...args) => f(g(...args)))
/**
* @description 科里化
* @param {*}
* @returns
*/
export const curry = (fn, arity = fn.length, ...args) =>
arity <... | true |
904587343583343debc7f60c163e87b9b8f3e282 | JavaScript | Motardo/weather | /main.js | UTF-8 | 3,623 | 2.546875 | 3 | [] | no_license | (function () {
'use strict';
var version, pair, type, zone, units, loc;
units = 'us';
loc = {};
version = 'c243';
version += '00b6';
pair = ['e111', '2824'];
type = 'bc';
type = 'afb' + type;
zone = '9735';
zone += 'ce' + 9;
type += '9a' + zone;
zone = version.split('').reverse().join('');
... | true |
5afd8920bd964ce11366c6c07840c78743f66148 | JavaScript | GProSoftware828/JWT_Tokens | /frontend/src/src_todo/ToDoApp.js | UTF-8 | 4,340 | 2.71875 | 3 | [] | no_license | import React from 'react';
import UniqueId from 'react-html-id';
import { ToDo } from './ToDo/ToDo';
import { Completed } from './Completed/Completed';
import './App.css';
import Plus from './assets/graphics/Plus.svg';
export class App extends React.Component {
constructor(props) {
super(props);
UniqueId.ena... | true |
c4291e74e4fb1c6228a0ed6718abdd5c17d756a9 | JavaScript | yonenn/homepage | /nodejs/resources/js/index.js | UTF-8 | 3,721 | 2.5625 | 3 | [] | no_license | import '../sass/index.scss';
// Bootstrapのスタイルシート側の機能を読み込む
import 'bootstrap/dist/css/bootstrap.min.css';
// BootstrapのJavaScript側の機能を読み込む
import 'bootstrap';
var num = 0;
var filter = "new";
var word = null;
var searchtype = 0;
$(function() {
post();
// 送信無効化
//$("#submit").prop("disabled", "true");
// タグがクリ... | true |
49273ca37d7a7898180f6203ed40b73c93f984ed | JavaScript | arews/lab-hello-ironhack | /starter-code/src/index.js | UTF-8 | 1,808 | 2.5625 | 3 | [] | no_license | // importing modules for React
import React from "react";
import ReactDOM from "react-dom";
import "./style.css";
const reactLogo = "../images/react-logo.svg";
const lab = (
<div>
<div id="intro">
<div class="navbar">
<img
src="../images/ironhack-logo.svg"
alt="Ironhack logo"... | true |
ff99247d13734638f612d1ac1fdc40875bad0823 | JavaScript | wenyuzheng/codewars_katas | /Kyu4/test/path_finder_2.test.js | UTF-8 | 931 | 2.78125 | 3 | [] | no_license | import { assert } from "chai";
import { pathFinder } from "../path_finder_2.js";
function testMaze(expected, maze) {
assert.strictEqual(pathFinder(maze), expected, "maze\n" + maze);
}
it("Basic tests", function () {
// testMaze(
// 4,
// `.W.
// .W.
// ...`
// );
// testMaze(
// f... | true |
91ff5ecc206523ec28ee586a6fe3e18270a4cb10 | JavaScript | zakrivi/time-sharing | /src/utils.js | UTF-8 | 5,871 | 2.734375 | 3 | [] | no_license | export const isPC = !/ipad|iphone|midp|rv:1.2.3.4|ucweb|android|windows ce|windows mobile/.test(navigator.userAgent.toLowerCase())
export const dpr = window.devicePixelRatio
// 获取事件名称
export const enumEvents = (() => {
if (!isPC) {
return {
start: 'touchstart',
end: 'touchend',
... | true |
0159daeb4184dc3f6fc54998c4894d8c02e80bf2 | JavaScript | HristinaKrachkova/mobileProject | /mobileProject/assets/js/slide.js | UTF-8 | 1,385 | 3 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function() {
var index = 1;
var slides = document.getElementsByClassName("slides");
var newsList = document.getElementsByClassName("newsList");
Array.prototype.forEach.call(slides, function(s) {
s.style.display = "none";
});
functi... | true |
aa8da7472fc08a1755c24a6268fad690d6052ea4 | JavaScript | jalvareznet/techdegree-project-5 | /js/app - other try.js | UTF-8 | 2,283 | 3.46875 | 3 | [] | no_license | // // THIS ONE IS WORKING
// $(document).ready(function(){
// $.ajax({
// url: 'https://randomuser.me/api/?results=12',
// dataType: 'json',
// success: function(data) {
// console.log(data);
// console.log(data.results);
// console.log(data.results[0].name);
// var employeesHTML = '<ul class="employe... | true |
f05b55442a4127a106d002dd5780eec17ac8adf4 | JavaScript | RZalmon/touch-nums | /js/utils.js | UTF-8 | 1,530 | 3.375 | 3 | [] | no_license | var time = 0;
var status = 0;
function start() {
status = 1;
timer();
//document.getElementById("start").disabled =true;
}
function reset() {
status = 0;
time = 0;
//document.getElementById("start").disabled = false;
document.querySelector('.timer').innerHTML = "00:00:00";
}
function stop... | true |
6d24f58f56b1872cc9becf3c06d26e77ccd9dfc8 | JavaScript | tars0x9752/atcoder | /a/76.js | UTF-8 | 168 | 2.78125 | 3 | [] | no_license | // const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')
const stdin = `4500
0`
const [r, g] = stdin.split('\n').map(Number)
console.log(2 * g - r)
| true |
6358f9a79a41955b71cd4ccacbcd5a4413be3d87 | JavaScript | sudheer316/KanFonts-v-1.0 | /Fonts/Tools/Font Tools/FDK-25-WIN/FDK/Technical Documentation/html_resources/topic_feature_file_syntax_files/urlParser.js | UTF-8 | 2,184 | 2.8125 | 3 | [] | no_license | /*
URLPARSER
$Revision: 1.3 $
@author mok
*/
/*---
Get Information From URL:
adobe.URLParser.workareaName,
adobe.URLParser.locale,
adobe.URLParser.siteLevel,
adobe.URLParser.siteSection,
adobe.URLParser.productName,
adobe.URLParser.siteSubSection,
adobe.URLParser.productSection,
adobe.URLParser.... | true |
dd6dbf572409c34f28ac7df7c2fb4bb201899b25 | JavaScript | kaur2605/Neurons-LoginPage | /src/components/Validate.jsx | UTF-8 | 411 | 2.65625 | 3 | [] | no_license | export default function Validate(data) {
let errors = {};
if (!data.email) {
errors.email = 'Email required';
} else if (!/\S+@\S+\.\S+/.test(data.email)) {
errors.email = 'Email address is invalid';
}
if (!data.password) {
errors.password = 'Password is required';
} else if (data.password.len... | true |
50db870f4a0aac39ba026d73af99659c631558b9 | JavaScript | crllrd/chromerecorder | /working.js | UTF-8 | 2,316 | 2.625 | 3 | [] | no_license | $(document).ready(function () {
var windowScrR = $('.windowsRecord');
var screenR = $('.screenRecord');
var greeting = $('.greeting');
var tabR = $('.tabRecord');
function init(){
windowScrR.on('click', function(){
screenCapture('screen');
stopButton(this);
... | true |
4a437be918d856a1aa724695ac8bd6da415a705e | JavaScript | riyaz4s/react-calculator | /src/components/calculator/Calculator.jsx | UTF-8 | 1,024 | 2.75 | 3 | [] | no_license | import { useState } from 'react';
import Display from './display/Display';
import Keyboard from './keyboard/Keyboard';
import { handleValue } from '../../helpers/index'
import './Calculator.css'
function Calculator() {
const [text, setText] = useState('0');
const [completed, setCompleted] = useState(false);
con... | true |
c0d5066f1a63fca2da95a8c01c8eb0ed58f8e5da | JavaScript | ian-kevin126/JavaScript-Knowledges | /src/4_LeetCode/LeetCode-Algorithms_24/Trie.js | UTF-8 | 1,822 | 4.1875 | 4 | [] | no_license | /**
* Initialize your data structure here.
*/
var TrieNode = function(){
// this.isWord = false;
// this.charArr = [];
this.isWord = false;
this.charArr = [];
}
var Trie = function() {
// this.root = new TrieNode();
// //用于就是字母的索引
// this.initIndex = "a".charCodeAt(0);
this.initIndex ... | true |
fb282ef535c4182e687d91301b201006f7bae06c | JavaScript | imtmh/baarakatta-game | /src/Components/PlayerPortal.js | UTF-8 | 835 | 2.890625 | 3 | [] | no_license | import React, { useState } from "react";
export default function PlayerPortal({ setPlayer1, setPlayer2, player2, player1 }) {
return (
<div className="player-portal">
<h3>PlayerPortal</h3>
<div className="player-box">
<Dice {...{ set: setPlayer1, value: player1 }} />
<Dice {...{ set: ... | true |
1605bf8c1c4e4d6a793acceba922f270df7cd75c | JavaScript | FlysJoint/js_practice_march2020 | /challenges/week9.js | UTF-8 | 5,276 | 4.125 | 4 | [] | no_license | /**
* This function will receive an array of numbers and should return the sum
* of any numbers which are a multiple of 3 or 5
* @param {Array} arr
* @returns {Number}
*/
const sumMultiples = (arr, extraParam) => {
if (arr === undefined) throw new Error("arr is required");
if (extraParam !== undefined) throw n... | true |
ba7f0d96f09685a1640d58ea33fedcfb2cbd4b01 | JavaScript | mchlp/CulminatingTGJ2O | /pages/planning/research/research.js | UTF-8 | 2,200 | 2.859375 | 3 | [] | no_license | var content = [];
//when document is ready
$(document).ready(pageReady);
//page ready
function pageReady() {
$("#planning").addClass("w3-green");
$("#research").addClass("w3-green");
getContent();
}
//get content
function getContent() {
var rawContent = new XMLHttpRequest();
rawContent.open("GET"... | true |
939a2ad66c49f8f9f627b27183243fe485d39abc | JavaScript | rudimk/Gibber | /js/gibberish/lib/external/sink-light.js | UTF-8 | 16,311 | 2.78125 | 3 | [
"MIT"
] | permissive | var Sink = this.Sink = function (global) {
/**
* Creates a Sink according to specified parameters, if possible.
*
* @class
*
* @arg =!readFn
* @arg =!channelCount
* @arg =!bufferSize
* @arg =!sampleRate
*
* @param {Function} readFn A callback to handle the buffer fills.
* @param {Number} channelCount Channe... | true |