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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
373611ff5720a8c2c91c554d04bfc565a7a5a4de | JavaScript | gretaivan/futureproof-stuff | /main.js | UTF-8 | 804 | 3.75 | 4 | [] | no_license | console.log('I dislike trains as a mode of transport');
let alphabet = "abcdefghijklmnopqrstuvwxyz";
console.log(alphabet[4]);
console.log('I love you'.toUpperCase());
//EXERCISE 2.
let num = 1.23456789;
console.log(num.toPrecision(3))
let numString = "45";
// console.log(typeof(numString))
numString = parseInt(numSt... | true |
0ebeb61f316a5e628180822be231538e30e6d008 | JavaScript | ashleymlaing/ashleyawesomebot | /commands/leon.js | UTF-8 | 654 | 2.671875 | 3 | [
"MIT"
] | permissive | var util = require('../util');
module.exports = function (param) {
// param object contains the following keys:
// 1. command - the primary command name
// 2. args - an array of strings, which is user's message posted in the channel, separated by space
// 3. user - Slack client user id
// 4. channe... | true |
d7c756479ea4a491abc50fb0bf30bd79f412acbd | JavaScript | mohsenshafiei/hackerrank-js | /src/mangoes/index.js | UTF-8 | 1,078 | 3.5 | 4 | [] | no_license | const need = (a, k, h) => a + k * h;
const length = (arr) => arr.length;
const computeTotal = (arr, appetite, happiness, index) => {
return arr.reduce((result, item) => {
return result += need(appetite[item], (index + 1), happiness[item]);
}, 0);
}
// greedy algorithm to always choose the minimum person cost
... | true |
8ec138977c35a97689af4206c4981d96cb94a0a2 | JavaScript | alejandropichola/curso-javascript | /07 - funciones nativas para array/main.js | UTF-8 | 430 | 3.03125 | 3 | [] | no_license | const frutas = ['manzana', 'pera', 'melocoton', 'sandia'];
const hasApple = frutas.some(fruta => fruta === 'manzana');
// console.log(hasApple);
const everyApple = frutas.every(fruta => fruta === 'manzana');
// console.log(everyApple);
// console.log(frutas.length);
const find = frutas.find(fruta => fruta === 'manza... | true |
b52e59d515488a6bfbf2473cfe41d6f03464aae8 | JavaScript | feadonai123/docker-OC | /app/pages/api/items.js | UTF-8 | 1,635 | 2.84375 | 3 | [] | no_license | const db = require('../../db');
const jwt = require('jsonwebtoken');
export default async function Items(req, res){
console.log("=================API ITEMS===================")
try{
let response;
if (req.method === 'POST') {
console.log("Pedido para criar item")
const tokenData = jwt.verify(re... | true |
2569efd0e9e1772dda454a88e11ce33872bdc06d | JavaScript | mawie81/meetup-styled-components | /src/how-it-works.js | UTF-8 | 387 | 3.703125 | 4 | [] | no_license | const log = (...args) => console.log(...args);
//log`1`
//const interpolation = "test";
//log`12 ${interpolation}`
//log`test ${(arg) => arg ? true : false}`
// const execFuncArgs = (...args) => args.forEach(arg => {
// if (typeof arg === 'function') {
// arg()
// }
// });
// execFuncArgs("test")
// execFun... | true |
fc5664be535eb2df166580d1efa0617596fc6e1b | JavaScript | caixudong1223/react-redux-learn | /src/store.js | UTF-8 | 221 | 2.515625 | 3 | [] | no_license | function createStore(state, stateChanger){ //专门生产这种 state 和 dispatch 的集合
const getState = () => state
const dispatch = (action) => stateChanger(state, action)
return {getState, dispatch}
} | true |
af1545ac9e655a9277cb3db5a9d6bf1115dca86d | JavaScript | nathanvogel/audio-viz-testbed | /js/FlashingScreen01.js | UTF-8 | 3,502 | 3.15625 | 3 | [] | no_license | var FlashingScreen01 = function (ctx, w, h) {
this.w = w;
this.h = h;
this.ctx = ctx;
this.SPACING = 6;
this.BAR_WIDTH = 5;
this.circles = [];
this.xCount = 6;
this.yCount = 6;
for (let i = 0; i < 100; i++) {
this.circles.push(new FlashingRect01(i, w, h, this.xCount, this.yCount));
}
};
Flashi... | true |
44705858217ce71ad7f9717d2118f4e0bbaf8c44 | JavaScript | HmHmmHm/Gentleman.js | /learnBad.js | UTF-8 | 1,182 | 3.109375 | 3 | [
"MIT"
] | permissive | var fs = require('fs');
var readline = require('readline');
var badWords = require('./dictionary/bad-words.json').badwords;
var badWordMap = {};
for (var index in badWords)
badWordMap[badWords[index]] = true;
console.log('TYPE THE YOU THINK ARE IT MIGHT BE');
console.log('NOT REGISTERED BAD WORDS.');
console.log... | true |
ffd382f364c3cdfb37e00368ac462e21fb8fcee4 | JavaScript | omarliberatto/dm | /public/js/funciones_generales.js | UTF-8 | 4,163 | 2.84375 | 3 | [
"MIT"
] | permissive | // Funcion aplicada a todos los checkbox
$(".boolean-check").ready(function() {
$("input[type='checkbox']").on('change', function(){
$(".hidden-check").val(this.checked ? 1 : 0);
});
});
//Funcion que pregunta si desea eliminar un dato, implementado con BootBoxJS
function eliminar(id, nombre_elemnto) {... | true |
d05b3453dc8eff2126d72abee92e67bf5700a046 | JavaScript | racerx2992/URL-Shortener-Microservice | /server.js | UTF-8 | 3,003 | 2.578125 | 3 | [] | no_license | "use strict";
var express = require("express");
var mongo = require("mongodb");
var mongoose = require("mongoose");
var bodyParser = require("body-parser");
var dns = require("dns");
var btoa = require("btoa");
var atob = require("atob");
var cors = require("cors");
var app = express();
// Basic Configuration
var p... | true |
36155f15a62d8020c94ab402969b95971451d08e | JavaScript | IngJahir/Cursos_JQUERY | /2. CURSO_2/7. OBJETOS/objetos.js | UTF-8 | 1,358 | 4.0625 | 4 | [] | no_license | // Declaracion del arreglo
// -----------------------
var arreglo = ['HTML',15,true];
// Impresion en consola del arreglo
console.log('Impresion arreglo y dato 0');
console.log(arreglo);
console.log(arreglo[0]);
// Creacion de objeto
// ------------------
var objeto =
{
nombre:'HTML',
duracion:15,
estado:true
}... | true |
ebed78bbef471247aac9cc792252766ddde17359 | JavaScript | jintoppy/jest-unit-test-learning | /src/App.js | UTF-8 | 1,051 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import './App.css';
import Post from './components/post/Post';
import Search from './components/search/Search';
class App extends Component {
state = {
posts: []
}
onPostSearch = (query) => {
const filtered = this.originalPosts.filter(p... | true |
a581208a1a8336ac9b45cd5afe95b39b96754852 | JavaScript | mnote/ExtJS6_5-Modern-TimePicker | /packages/local/MX/src/picker/Time.js | UTF-8 | 7,116 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | Ext.define('MX.picker.Time', {
extend: 'Ext.picker.Picker',
xtype: 'timepicker',
alternateClassName: 'Ext.TimePicker',
requires: ['Ext.util.InputBlocker'],
/**
* @event change
* Fired when the value of this picker has changed and the done button is pressed.
* @param {Ext.picker.Date}... | true |
9d69cfe5d140021ce1b36d6925e94349dc012e3b | JavaScript | derwebsait/-1 | /№1/script.js | UTF-8 | 1,620 | 3.109375 | 3 | [] | no_license | let money = prompt("Ваш бюджет на месяц?", "1000"),
time = prompt("Введите дату в формате YYYY-MM-DD", "1990-05-05"),
expenses1 = prompt("Введите обязательную статью расходов в этом месяце", ''),
expenses2 = prompt("Во сколько обойдется?", '');
let appData = {
budget: money,
expenses: {},
optionalExpe... | true |
b9652c0509b11bac6129ae0646a0f0b0fd4d0476 | JavaScript | yaominguo/XiaoChengXu | /SudokuGame/utils/core/sudoku.js | UTF-8 | 490 | 2.875 | 3 | [] | no_license | import Generator from './generator.js';
let sudoku = {
puzzleMatrix: [],
solutionMatrix() {
Generator.generate();
return Generator.matrix;
},
make(level = 5) {
// console.log('sudoku', this.solutionMatrix());
this.puzzleMatrix = this.solutionMatrix().map((row) => {
return row.map((cell) =... | true |
bf48f3c0aed0b23b32fffc6744cfef835dcc8a31 | JavaScript | AB07AB/Newtons-Cradle | /Pendulum.js | UTF-8 | 475 | 2.84375 | 3 | [] | no_license | class Pendulum{
constructor(x, y, color){
var options = {
restitution: 1,
friction: 0,
frictionAir: 0.0,
slop: 1,
inertia: Infinity
};
this.body = Bodies.rectangle(x, y, 40, 40, options);
this.x = x;
this.y = y;
this.color = color;
World.add(world, this.body);
}
display() {
var angle = this.body.angle;... | true |
400001f57f9a0cb49ac813c1def4538a15af1313 | JavaScript | groundberry/js-challenges | /bracket-validator/bracket-validator.js | UTF-8 | 1,186 | 4.375 | 4 | [] | no_license | /*
Bracket Validator
Write a braces/brackets/parentheses validator.
Let's say:
'(', '{', '[' are called "openers."
')', '}', ']' are called "closers."
Write an efficient function that tells us whether or not an input string's
openers and closers are properly nested.
Examples:
"{ [ ] ( ) }" should return true
"{ [ ( ... | true |
b3a101adc650f089d67b715b864e762b1b2beeb6 | JavaScript | adlfc/PAQUETERIA_AJAX | /gestion/aduana/bajaAduana.js | UTF-8 | 1,991 | 2.6875 | 3 | [] | no_license |
$("#btnBajaAduana").click(function()
{
/* ********** MOSTRAR COMBO BAJA EMPLEADO ************************************************************************* */
$.get('gestion/aduana/consultarAduanas.php', null, mostrarAduanas, 'json');
function mostrarAduanas(oAduana, sStatus, oXHR)
{
$("#form... | true |
79ddca31d97f2e3812d827ee5adb53a77801c27c | JavaScript | Narigo/presentations | /src/presentations/linkwork-gulp/js/slide-stream.js | UTF-8 | 856 | 2.8125 | 3 | [] | no_license | var $slide = document.getElementById('slide-streams2');
var $cube = $slide.querySelector('.cube');
$cube.addEventListener('click', function () {
if ($cube.classList.contains('read')) {
$cube.classList.remove("read");
$cube.classList.add("t1");
setTimeout(function () {
$cube.classList.add("circle")... | true |
9d6c334d9c2573e687485e501883328cdd9d0c1e | JavaScript | tymiao1220/Leetcode-Learning | /014 Longest Common Prefix.js | UTF-8 | 665 | 3.9375 | 4 | [] | no_license | /*
Write a function to find the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string "".
Example 1:
Input: ["flower","flow","flight"]
Output: "fl"
Example 2:
Input: ["dog","racecar","car"]
Output: ""
Explanation: There is no common prefix among the input str... | true |
a1427bc24a69d0f6f79de21d503c0645c2428049 | JavaScript | louisantoinem/songcheat-app | /src/Layout.js | UTF-8 | 10,635 | 2.828125 | 3 | [] | no_license | import { List } from 'immutable'
import { Utils } from 'songcheat-core'
class Layout {
/**
Layout API
----------
// create
layout = new Layout(root)
// serialize
str = layout.stringify()
layout = Layout.fromString(str)
// check value equality
bool = layout.equals(layout)
// immutable API: re... | true |
2c781ba54cafa226a5373d20e2f90b6c9ac3dabf | JavaScript | Lotes/voxelify | /lib/exporters/renderers/ThreeExtensions.js | UTF-8 | 2,799 | 2.6875 | 3 | [
"MIT"
] | permissive | 'use strict'
const nodeThree = require('../../shared/node-three/index')
nodeThree.loadInternal('examples/js/renderers/Projector.js')
nodeThree.loadInternal('examples/js/renderers/CanvasRenderer.js')
const THREE = nodeThree.THREE
const Promise = require('bluebird')
const Canvas = require('canvas')
module.exports.THREE ... | true |
6580d48db47bf402fa981004a360a2166fd47834 | JavaScript | iwebexpert/corp-rostelecom-1 | /EvgenyMamontov/Lesson4/lesson4.js | UTF-8 | 2,817 | 3.984375 | 4 | [] | no_license | /**
* Практическое задание
*/
/**
* Написать функцию, преобразующую число в объект. Передавая на вход число от 0 до 999, надо получить на выходе объект,
* в котором в соответствующих свойствах описаны единицы, десятки и сотни. Например, для числа 245 надо получить
* следующий объект: {‘единицы’: 5, ‘десятки’: 4, ... | true |
4a716d03bacf03de69a32617ce2fa7da90505a3c | JavaScript | GrinchenkoD/goit-react-hw-02-feedback | /src/components/App.js | UTF-8 | 1,527 | 2.75 | 3 | [] | no_license | import React, { Component } from "react";
import Section from "./section/Section";
import Statistics from "./statistics/Statistics";
import FeedbackOptions from "./feedbackOptions/FeedbackOptions";
import styles from "./App.module.css";
class App extends Component {
state = {
good: 0,
neutral: 0,... | true |
b8008056ada07a237a7b368db4eabec3501e4e31 | JavaScript | jonginout/JAVA_STUDY_BASIC | /javascript/WebContent/10_node/01_module/test01_module.js | UTF-8 | 599 | 3.5 | 4 | [] | no_license | /*
모듈만들기
재활용 가능한 기능이나 객체를 별도의 파일로 분리시키고 필요한 위치에
재사용가능하게 하기 위해서
분리된 함수나 객체들의 묶음을 모듈(module)이라 부른다.
모듈 파일 정의
test_module.js
모듈 정의시 처리할 일
사용자 정의 모듈은 module.exports 객체에 대입해서 만든다.
모듈 사용
test01.js
require("모듈파일명")
*/
function add (i, j){
return i + j;
}
function sub (i, j){
return i - j;
}
module.exports... | true |
1d76e5cbe4e5c95f253f66cbb67648f8839da4af | JavaScript | SimonHlf/zhuxueModule | /loreRelateManager/js/commonList.js | UTF-8 | 11,220 | 2.65625 | 3 | [] | no_license | //获取科目列表
function getSubjectList(){
$.ajax({
type:"post",
async:false,
dataType:"json",
url:"commonManager.do?action=getSubjectList",
success:function (json){
showSubjectList(json);
}
});
}
//显示角色列表
function showSubjectList(list){
var t='<span>选择科目</span><s... | true |
1662246c68bfd793ee4b1a161e7f243310757160 | JavaScript | dex157/diary | /src/data/Lesson.js | UTF-8 | 2,120 | 2.828125 | 3 | [] | no_license | import PropTypes from 'prop-types'
import Task from './Task'
import moment from 'moment'
export default class Lesson {
static propType = {
title: PropTypes.string.isRequired,
startTime: PropTypes.instanceOf(Date),
endTime: PropTypes.instanceOf(Date),
tasks: PropTypes.arrayOf(PropTypes.shape(Task.prop... | true |
6104b2f040332cd413464a5273d0b465a281a459 | JavaScript | Mirv/ensemble | /ensembletool/main.js | UTF-8 | 1,709 | 2.65625 | 3 | [
"BSD-4-Clause-UC",
"BSD-2-Clause",
"BSD-4-Clause"
] | permissive | // Modules to control application life and create native browser window
const {app, BrowserWindow, dialog, ipcMain} = require("electron");
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
function... | true |
4918ce2f0a4d31b1411ef9b673c11b1d48af1771 | JavaScript | hirvin-faria/uva-aplicacoes-web | /AIA1/questao-02/functions.js | UTF-8 | 1,271 | 3.015625 | 3 | [] | no_license | const inputA1 = document.getElementById('A1');
const inputA2 = document.getElementById('A2');
const inputA3 = document.getElementById('A3');
var mediaNotas;
function getMedia() {
let notas = [
inputA1.value,
inputA2.value,
inputA3.value
];
notas = majorValue(notas);
mediaN... | true |
8481c9c369d0c81c76e1ad66ce1a275b85d9d1b6 | JavaScript | Quant85/js-snack-es6 | /JSnacks-blocco-4-es6/JSnack 2/main.js | UTF-8 | 622 | 3.140625 | 3 | [] | no_license | /*JSnack 2
Creare un array di oggetti: ogni oggetto descriverà una bici
da corsa con le seguenti proprietà: nome e peso.
Stampare a schermo la bici con peso minore.*/
const arrayOggetti = [
modello1= {
nome: "ARC8 Escapee",
taglia: 54,
peso: 810
},
modello2= {
nome: "Basso Diamante SV Disc",
... | true |
6305723fd64c7f4f87932de5dd1298ad0e56eb79 | JavaScript | vtdkhoa/js-projects-challenge | /quiz-app/js/app.js | UTF-8 | 2,191 | 3.203125 | 3 | [] | no_license | const quizData = [
{
question: 'What are the colours of the rainbow ?',
a: '4 colours',
b: '5 colours',
c: '6 colours',
d: '7 colours',
correct: 'd'
},
{
question: 'What is classification in biology the Chicken belong to ?',
a: 'Mammals',
b: 'Birds',
c: 'Amphibians',
d:... | true |
66c1f6001e24458d7fb0274da25c794fcecb2741 | JavaScript | robertram/Dise-o-Web-II | /Taller Semana 7/index.js | UTF-8 | 778 | 3.265625 | 3 | [] | no_license | /*
1. Busque la función anímate, y cree una página que tenga un
div en como un cuadrado y que se mueva de izquierda a derecha,
el cuadrado tanto en colores como en tamaño queda a su creatividad 5 puntos
*/
(function () {
window.lec01 = {
div: {},
text: {},
init: function () {
t... | true |
954ec4aefa33aace2ae18d3460174005b398df70 | JavaScript | stonehouse/brackets-FuncDocr | /hints.js | UTF-8 | 8,506 | 2.640625 | 3 | [] | no_license | // =========================================================================
// Hint Manager
// =========================================================================
define(['text!definitions/default.json',
'text!definitions/js.json',
'text!definitions/php.json'],
function (defaultDef, javascrip... | true |
ed7de7076560653809cce99bb2c13e662d426e7c | JavaScript | Omanshu840/Video-Calling-Platform | /public/script.js | UTF-8 | 4,810 | 2.640625 | 3 | [] | no_license | const socket = io('/')
const videoGrid = document.getElementById('video-grid')
const myPeer = new Peer(undefined, {
path: '/peerjs',
host: '/',
port: '443'
})
let myVideoStream;
const myVideo = document.createElement('video')
myVideo.muted = true;
const peers = {}
navigator.mediaDevices.getUserMedia({
... | true |
3d770d456b1c58603a665d1f1960279bd0f9ed20 | JavaScript | Shridhar-dev/thz | /src/Works.js | UTF-8 | 1,060 | 2.59375 | 3 | [] | no_license | import React from 'react';
import "./Works.css"
class Works extends React.Component{
constructor(){
super()
this.state={
count:0
}
this.incrementer=this.incrementer.bind(this)
}
incrementer(){
setTimeout(() => {
this.setState(prevState=>{return... | true |
b4a44ca928e6496ae9ab3b43df5464a68f0e3cf4 | JavaScript | Lady95/My-Paint | /paint.js | UTF-8 | 6,085 | 2.640625 | 3 | [] | no_license | $(document).ready(function(){
// variables
var canvas = $("#canvas");
var context = canvas[0].getContext("2d");
var brushMouse = false;
var cursorX, cursorY;
var started = false;
var mode = "";
// variable line work
var pointA = true;
var tabCoordinate = [];
... | true |
a34ce3eccba6c207908da5983d49df4b14c7f7d0 | JavaScript | jmp1234/localPick | /app/reducers/userProfileReducers/userProfileInfoReducer.js | UTF-8 | 663 | 2.578125 | 3 | [] | no_license | import types from '../../actions/types';
const DEFAULT_STATE = {
userName: null,
city: null,
firstName: null,
lastName: null,
avatar: null,
coords: null,
}
export default (state = DEFAULT_STATE, action) => {
switch(action.type) {
case types.FETCH_USER_SUCCESS:
return {
...state,
... | true |
0cfad591cff27f943ede1d62b92656e515c6e8fe | JavaScript | 2WheelCoder/js-object-orientation | /2_object.js | UTF-8 | 245 | 2.703125 | 3 | [] | no_license | var rich = {
name: 'Rich Bowen',
course: 'UCD',
teach: function(student, topic) {
return this.name + ' taught ' + student + ' to ' + card sort + '.';
}
};
// rich.name;
// rich['course'];
// rich.teach('Tara', 'card sort');
| true |
c42f1ae7b988e6329cbcdf88fa7c69282bbbf3db | JavaScript | HackManiac/Ruhestein | /src/ruhestein/gamemaster/database/effects/starving-buzzard-101.js | UTF-8 | 1,047 | 2.640625 | 3 | [] | no_license | /**
* @license
* Ruhestein - A Hearthstone game mechanics simulator
*/
'use strict';
// From minion card: (2) 2/2 Starving Buzzard; Whenever you summon a Beast, draw a card.
var StarvingBuzzard101 = {
getDescription: function() {
return this.formatDescription('Whenever you summon a Beast, draw a car... | true |
521715883ee46edbfb18ae3f827300ad8db5560a | JavaScript | dezkareid/ChromeAppDemo | /polywindow.js | UTF-8 | 33,193 | 2.875 | 3 | [] | no_license | Polymer('core-toolbar');;
Polymer('core-selection', {
/**
* If true, multiple selections are allowed.
*
* @attribute multi
* @type boolean
* @default false
*/
multi: false,
ready: function() {
this.clear();
},
clear: function() {
... | true |
355ff99dcb2dc9abc25aeacf4fbb55ead80507fd | JavaScript | SonyaKarkadym/JS | /hw3/task2/table.js | UTF-8 | 1,913 | 2.984375 | 3 | [] | no_license | //- створити розмітці блок з id, class та текстом в середені.
//Зчитати окремо цей текст з селекторів по id , class та тегу
//- змінити цей текст використовуючи селектори id, class, tag
//- змінити висоту та ширину блоку використовуючи селектори id, class, tag
//- за допомоги document.createElement та appendChil... | true |
284514bbfa9fa3e9ebc49538797a91e2675b4cf4 | JavaScript | mahopa/everything-is-a-plugin | /plugin-lessons-plugins/32NMFAfterResolvePlugin.js | UTF-8 | 2,277 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Just some custom plugin utility(s) I wrote.
*/
const path = require("path");
const pluginUtils = require("./plugin-utils");
class AfterResolveNormalModuleFactoryPlugin {
constructor(options) {
this.resourceRegex = options.resourceRegex;
this.newRequestString = options.newRequestString;
... | true |
564cb5e96d19140cb77a1984da7538534fe51451 | JavaScript | asiegrist/tetris-redux-example | /src/reducers/piece.js | UTF-8 | 1,004 | 2.59375 | 3 | [] | no_license | import R from "ramda";
import * as Actions from "../actions";
const rotate = (center, square) => {
const top = square.left - center.left + center.top;
const left = center.top - square.top + center.left;
return { ...square, top, left };
};
const piece = (state = [], action) => {
switch (action.type) ... | true |
4b6e4675ebc0e7856fd164600e1d5921c9baa3be | JavaScript | ryan-aday/adayR | /10_svg/svg02.js | UTF-8 | 1,566 | 3.15625 | 3 | [] | no_license | // Clyde "Thluffy" Sinclair
// SoftDev pd0
// K09 -- basic SVG work
// 2019-03-13w
var pic = document.getElementById("vimage");
var wipe = document.getElementById("but_clear");
//coords of last placed dot
var lastX = 0;
var lastY = 0;
//
var createDot = function(e)
{
console.log("running . . .");
//store click... | true |
b45946645483c2c75a2a6e39a09cc55d8d6483ba | JavaScript | selvaganesh75/interview | /src/store/login/login.reducer.js | UTF-8 | 585 | 2.6875 | 3 | [] | no_license | import loginConstant from "./login.constant";
const initialState = {
loginError: false,
loginSuccess: false,
userData: {},
};
export default function loginReducer(state = initialState, action) {
const newState = { ...state };
if (action.type === loginConstant.LOGIN_FAILURE) {
newState.loginError = acti... | true |
93d249167094396f1d014d229a358f2b5dbb9a2f | JavaScript | ruslanrasulov/GamePool | /GamePool/GamePool.PL.MVC/Scripts/Include/pagination.js | UTF-8 | 678 | 2.546875 | 3 | [
"MIT"
] | permissive | 'use strict';
var CFG = CFG || {};
$(function () {
var $pageLinks = $('.page-link'),
currUrl;
if (CFG && CFG.action) {
currUrl = CFG.action;
} else {
currUrl = window.location.href;
}
$pageLinks.each(function () {
var newUrl,
pageNumber = this.getAttr... | true |
9d34308e52d59c7762277f1c765f6294eb77c5bf | JavaScript | netvarun/Siloseer | /chrome/content/js/algo/auto/heuristics.js | UTF-8 | 5,101 | 3.140625 | 3 | [] | no_license |
function titleH(textNodes)
{
var docTitle = getDocTitle();
docTitle = normalizeString(docTitle);
// alert('title = ' + docTitle);
for(var i in textNodes)
{
var parentNode = textNodes[i].parentNode;
var textContent = parentNode.textContent;
var tagName = parentNode.tagName.t... | true |
fa2c5134e3b90b3a46e65ef802aef5c0e25701c8 | JavaScript | Roger-random/lrwave | /app.js | UTF-8 | 5,156 | 3.109375 | 3 | [
"MIT"
] | permissive | // Tell editor about Web Audio APIs so it does not flag "not defined" error.
/*
global AudioContext
global webkitAudioContext
*/
// Activate MDC JavaScript code on controls
import {MDCRipple} from '@material/ripple/index';
for (const appbutton of document.querySelectorAll(".app-button")) {
new MDCRipple(appbutt... | true |
9b3e1e02a8fdb38f4102f7243ebbdb4f0f889561 | JavaScript | keowu/javascript-vanilla | /aula15 - Variáveis Compostas[ARRAY-VETOR]/vetornatela.js | UTF-8 | 808 | 4.03125 | 4 | [] | no_license | let valores = [8, 1, 7, 4, 2, 9];
console.log(valores);
vetor();
console.log('______________________________________________________');
valores.sort(); //organiza os itens do vetor de forma crescente
console.log('______________________________________________________');
vetor();
console.log('____________________... | true |
6877374817b9c2dab63ad7925c9a041d9417d73d | JavaScript | mhram0208/billing-app | /src/components/navbar/Register.js | UTF-8 | 2,265 | 2.65625 | 3 | [] | no_license | import React, { useState } from 'react'
import { useDispatch } from 'react-redux'
import { startRegister } from '../../actions/userActions'
function Register() {
const dispatch = useDispatch()
const [username, setUsername] = useState('')
const [email, setEmail] = useState('')
const [password, setPassw... | true |
2c9733c1f633add325ea235908d24693f21435b0 | JavaScript | ErosMLima/exercicios-web | /Objeto/heranca1.js | UTF-8 | 501 | 3.421875 | 3 | [] | no_license | const ferrari = {
modelo: 'F40',
velMax: 324
}
const volvo = {
modelo: 'V40',
velMax: 200
}
console.log(ferrari.__proto__) // consegui acessar o object pai -> "SuperObject" protótipo primário.
console.log(ferrari.__proto__ === Object.prototype) // o Object pai.
console.log(volvo.__proto__ === Object.p... | true |
47ded2507b3ed365688eddb7180fdf85c7093089 | JavaScript | tiffanywang3/rps | /tic_tac_toe_hard2.js | UTF-8 | 7,099 | 3.421875 | 3 | [] | no_license | var drawMove = function(square, move){
$(square).removeClass("blank").addClass(move);
};
var computerCheckRow = function(squares){
if($(squares[0]).hasClass("x") &&
$(squares[1]).hasClass("x") &&
$(squares[2]).hasClass("blank")) {
return squares[2]
}
if($(squares[3]).hasClass("x") &&
$(squares[4])... | true |
934fbfedf3c4a85ef5e9763dc42d1e689219e604 | JavaScript | Jekipp/developers_institute | /Week 3/Day 2/Daily Challenge 2/script.js | UTF-8 | 528 | 3.3125 | 3 | [] | no_license | let part1 = 'test test test test ';
let part2 = ' test test test test test ';
let part3 = ' yours truely ';
let btn = document.getElementById("lib-button");
btn.addEventListener("click", create_story);
function create_story(e) {
console.log("test");
let noun = document.getElementById("noun");
let adjective = docum... | true |
6ee536c2a18ec6c6f4c43e2f53c2eec0d1c40716 | JavaScript | James-Thibaudeau/fullstack-project | /client/reducers/LoginReducers.js | UTF-8 | 809 | 2.53125 | 3 | [] | no_license | //login reducers
import { Map } from 'immutable';
import { LOGIN, LOGIN_FAIL, LOGOUT, LOGOUT_FAIL, UPDATE_USER_INFO } from '../actions/LoginActions';
const initialState = {user: {}, isLoggedIn: false, message:''};
export default function (state = initialState, action) {
switch(action.type) {
case LOGIN:
... | true |
55ce9b6bfddf340879cec6273b4eb98c13065193 | JavaScript | cosanlab/rating_wheel | /Final/gui_validation.js | UTF-8 | 53,433 | 2.65625 | 3 | [
"MIT"
] | permissive | // wheel drawing
// form mechanics
var cnt = 0;
function showValue(newValue)
{
document.getElementById("sliderValue").innerHTML=newValue;
}
function showRadioButton(t)
{
if (t.value == "discrete")
{
$("#discreteselected").attr("class","showCSS");
$... | true |
11e6308ea3b887119457d9bb3379afebef1040dd | JavaScript | christiangoni/Curso_NodeJS | /chapter6/form_params.js | UTF-8 | 1,297 | 2.765625 | 3 | [] | no_license | var http = require("http"),
fs = require("fs");
http.createServer(function(req,res){
if(req.url.indexOf("favicon.ico") > 0){ return;}
fs.readFile("./index.html",function(err,html){
var nombre = "";
var array_params = [], params = {};
var html_string = html.toString();
var ... | true |
801e1df4a0226b02e922d29e8ad32530ea73366f | JavaScript | DivyeshKatheGit/wonder | /js/app.js | UTF-8 | 1,368 | 2.5625 | 3 | [] | no_license |
// /* cursor */
// const body = document.querySelector('body');
// console.log(body);
// document.addEventListener('mousemove',(e)=>
// {
// console.log(e.pageX,e.pageY);
// var bubble = document.querySelector('.bubble');
// console.log(bubble);
// var x = e.offsetX;
// var y = e.offsetY;
// b... | true |
ea42035de379c12d9cf11fcaf98e3105a87722cd | JavaScript | mmstarz/NodeJS_theory | /nodeJSworkingDeep.js | UTF-8 | 1,508 | 3.28125 | 3 | [] | no_license | /* Single Thread, Event loop & Blocking code
NodeJS using only one sigle JavaScript thread(a process in operating system).
Evet loop is automatically get started when server starts.
Event loop keeps NodeJS running and hanldes the callbacks.
Event loop only handle(contain) callbacks that contain fast finishing code.
I... | true |
5ac707337dbdaf5668bf2a8535f711533f70b2e8 | JavaScript | alwindeleon/my-page | /app.js | UTF-8 | 1,085 | 2.578125 | 3 | [] | no_license | $(function(){
$('.inspire-button').click(function(){
var url = "http://www.quotesondesign.com/api/3.0/api-3.0.json"
$.ajax({
url: url,
p:"12",
type: 'GET',
crossDomain: true, // enable this
dataType: 'jsonp',
success: function(data) {
showQuote(data);
},
... | true |
3f9960c04bbd2f0d225ba09713ff52703e5d57c9 | JavaScript | muskanmahajan37/lodash-es6 | /modern/objects/merge.js | UTF-8 | 5,063 | 3.34375 | 3 | [
"MIT"
] | permissive | /**
* Lo-Dash 2.4.1 (Custom Build) <http://lodash.com/>
* Build: `lodash modularize modern exports="es6" -o ./modern/`
* Copyright 2012-2014 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.6.0 <http://underscorejs.org/LICENSE>
* Copyright 2009-2014 Jeremy Ashkenas, DocumentCloud and Inv... | true |
09cdefc126d697872f400cd1b426a2ddc8250a99 | JavaScript | gbagiryan/jsoncms | /Models/User.js | UTF-8 | 692 | 2.546875 | 3 | [] | no_license | const mongoose = require('mongoose');
const bcrypt = require('bcrypt');
const CustomError = require('../ErrorHandling/customErrors');
const userSchema = new mongoose.Schema({
username: {
type: String,
require: true,
unique: true
},
password: {
type: String,
require: true,
minlength: 6
}... | true |
a8eefd899c3f2a827d7b3d6cafb5eeceec658408 | JavaScript | helpmonger/CharaSparkAPI | /models/user.js | UTF-8 | 1,392 | 2.578125 | 3 | [] | no_license | var mongoose = require('mongoose'),
bcrypt = require('bcrypt-nodejs'),
cryptoUtil = require('../services/auth/cryptoUtil'),
Schema = mongoose.Schema;
var UserSchema = new Schema({
user_name: {
type: String
},
googleId: String,
facebookId: String,
status: {
type: Strin... | true |
9870b288fcb37d7744e94babb5820fb5dd439bc0 | JavaScript | piwakawaka-2019/code_from_class | /wk_1_bowling/game.js | UTF-8 | 1,928 | 3.4375 | 3 | [] | no_license | // Score 119:
// var frames = [
// [1, 2], [6, 4], [5, 4], [10, 0], [7, 2], [10, 0], [10, 0], [5, 2], [7, 0], [4, 4]
// ]
//
// Score 141:
// var frames = [
// [1, 2], [6, 4], [5, 4], [10, 0], [7, 2], [10, 0], [10, 0], [5, 2], [7, 0], [10, 10, 10]
// ]
//
//Score 300:
// var frames = [
// [10, 0], [10, 0], [10, 0]... | true |
6b6d8b4ae25d8d28b68b757903212a3a18fa15b8 | JavaScript | cedmax/youmightnotneed | /src/content/date-fns/02-second/startOfSecond/vanilla.js | UTF-8 | 237 | 3.171875 | 3 | [] | no_license | const startOfSecond = date => new Date(Math.floor(date / 1000) * 1000)
// The start of a second for 1 December 2014 22:15:45.400:
module.exports = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))
// => Mon Dec 01 2014 22:15:45.000
| true |
ceb22971037099b44781af639251a56ca24df09c | JavaScript | Esmer-byte/stock-market-API | /src/Components/Chart.js | UTF-8 | 1,243 | 2.515625 | 3 | [] | no_license | import { Bar } from "react-chartjs-2";
import { useState } from "react/cjs/react.development";
function Chart(props) {
const [prices, setPrices] = useState();
function onClickHandler() {
if (props.data == "") {
alert("Please submit the stock you want to display the prices for!");
} else {
setPr... | true |
2cdfe041e2eb3d18575e885129ecc290526c2f3d | JavaScript | Koyfin/react-virtualized | /dist/es/Collection/TestData.js | UTF-8 | 830 | 2.8125 | 3 | [
"MIT"
] | permissive | /*
0 1 2 3 4 5
┏━━━┯━━━┯━━━┓
0┃0 0┊1 3┊6 6┃
1┃0 0┊2 3┊6 6┃
┠┈┈┈┼┈┈┈┼┈┈┈┨
2┃4 4┊4 3┊7 8┃
3┃4 4┊4 5┊9 9┃
┗━━━┷━━━┷━━━┛
Sections to Cells map:
0.0 [0]
1.0 [1, 2, 3]
2.0 [6]
0.1 [4]
1.1 [3, 4, 5]
2.1 [7, 8, 9]
*/
export var CELLS = [{
x: 0,
y: 0,
width: 2,
height: 2
}, {
x: 2,
y: 0,
width: 1,
he... | true |
24b7a62649ce0d9ea92271b5439ed88870ba912c | JavaScript | eos-sns/backend | /_helpers/email.js | UTF-8 | 2,445 | 2.53125 | 3 | [] | no_license | const config = require('../config.json');
const nodemailer = require('nodemailer');
const util = require('util');
module.exports = {
sendEmail,
getMessageOnResetPassword,
getMessageOnAccountActivation,
getMessageOnAccountActivationRequest
};
function _getTransporter() {
return nodemailer.createTransport({
... | true |
9321b362ac6b26539b2092ce26d415b32dcad5a5 | JavaScript | ildar-shaimordanov/jsxt | /js/win32/VBScript.js | UTF-8 | 9,742 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// JavaScript unit
// Wrapper for VBScript features in JScript
//
// Copyright (c) 2009 by Ildar Shaimordanov
//
// VERY IMPORTANT!
// InputBox/MsgBox/vbXXX and their descriptions are parts of the CHM-file named as
// "Windows Script Technologies " and all of them are properties of Microsoft
// accordingl... | true |
783ad1d1fb19e9f7c9a40f0e2968801fed7d9329 | JavaScript | 0xboz/javascript_exercises | /answers/Q7.js | UTF-8 | 951 | 3.359375 | 3 | [
"MIT"
] | permissive | // Q7 JavaScript
const q7_isSunday = () => {
const yearFrom = document.querySelector('#q7_year_from').value;
const yearTo = document.querySelector('#q7_year_to').value;
const warning = document.querySelector('#q7_warning');
const result = document.querySelector('#q7_result');
if (isNaN(yearFrom) || ... | true |
4b69c54655beff6cc4adfdfd1e7f83e8acfbd4d5 | JavaScript | binaraD98/ITP-test | /src/components/edit-leave.component.js | UTF-8 | 4,159 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import DatePicker from 'react-datepicker';
import "react-datepicker/dist/react-datepicker.css";
import { CardContent } from '@material-ui/core';
import { Card } from '@material-ui/core';
import '../css/home.css'
export default class EditLeave extend... | true |
7c236a032564386b48d511f08a5a241481d5ffcb | JavaScript | dmcquay/advent-of-code-2017 | /5a.immutable-slow.js | UTF-8 | 1,106 | 2.859375 | 3 | [] | no_license | 'use strict'
function jump(state) {
if (state.isIndexInRange === false) {
return {
...state,
error: 'Out of range before jump not allowed'
}
}
const offsets = [...state.offsets]
offsets[state.idx]++
const idx = state.idx + state.offsets[state.idx]
return... | true |
056b40fbbf5e9c65967c543072f9a96c24f914c7 | JavaScript | belens/soatest | /tools/converter-2.0.js | UTF-8 | 4,456 | 2.859375 | 3 | [] | no_license | import moment from "moment";
import fs from "fs";
var organisationsText = fs
.readFileSync("./tools/soatest-data-2.0-draft-organisations.tsv")
.toString("utf-8");
var timeslotsText = fs
.readFileSync("./tools/soatest-data-2.0-draft-timeslots.tsv")
.toString("utf-8");
const defaultOpenPeriods = {
0: [],
1: ... | true |
42a512f43bd92b35a8f719820303c7654f39562c | JavaScript | ZanestIO/zanest-desktop | /models/Class/Class.js | UTF-8 | 2,812 | 2.65625 | 3 | [] | no_license | const {DataTypes, Model} = require('sequelize')
// ==================================================================================
// Class Course WITH METHODS
// ==================================================================================
exports.Class = class Class extends Model {
/**
* add object... | true |
f4f01d60d01d54cd30779841427877ca93190ba5 | JavaScript | umsanmaru/helpoPrototype | /src/form/SecForm.js | UTF-8 | 1,525 | 2.609375 | 3 | [] | no_license | import EkoPlayer from '../gitsrc/EkoPlayer.js';
import React, { Component } from 'react';
import utils from '../gitsrc/lib/utils';
import '../App.scss'
import { MathComponent } from 'mathjax-react'
function getCheckboxValue() {
// 선택된 목록 가져오기
const query = 'input[name="Section"]:checked';
const selectedEls =
... | true |
c916749484f24fc159e0be89390c1c0c69023172 | JavaScript | dl2293/App_LED | /App_LED/www/scripts/index.js | UTF-8 | 477 | 2.671875 | 3 | [] | no_license | (function () {
"use strict";
document.addEventListener( 'deviceready', onDeviceReady.bind( this ), false );
document.addEventListener("offline", onOffline, false);
document.addEventListener("online", onOnline, false);
function onDeviceReady() {
};
function onOffline()
{
... | true |
08864200fd07a4ca1d61f9a4e917c84d86cafd90 | JavaScript | JonFinley211/Bamazon | /bamazon.js | UTF-8 | 2,609 | 3.03125 | 3 | [] | no_license |
var mysql = require('mysql');
var inquirer = require('inquirer')
var connection = mysql.createConnection({
host: '127.0.0.1',
port: 3306,
user: "Jon",
password: "12345",
database: "bamazon_db",
});
connection.connect(function(error) {
if(error) {
... | true |
7901dce401eee92a08175ac0d3de84578814afe2 | JavaScript | brucevsked/vskeddemolist | /vskeddemos/projects/jslibdemo/WebRoot/js/dojo193/gridx/modules/Focus.js | UTF-8 | 12,268 | 2.53125 | 3 | [
"MIT",
"BSD-3-Clause",
"AFL-2.1"
] | permissive | define([
"dojo/_base/declare",
"dojo/_base/array",
"dojo/_base/connect",
"dojo/_base/lang",
"dojo/_base/sniff",
"dojo/_base/window",
"dojo/_base/event",
"dojo/keys",
"../core/_Module"
], function(declare, array, connect, lang, has, win, event, keys, _Module){
/*=====
var Focus = declare(_Module, {
// summa... | true |
7f923806411d1d32647b4df9e7f23784708a5d91 | JavaScript | Issactoto/tokyoletes | /client/src/Screens/SearchScreen.js | UTF-8 | 3,239 | 2.53125 | 3 | [] | no_license | // Deconstructed
import React, { Component, Fragment, useState, useEffect } from 'react';
import {useQuery} from "@apollo/client";
import Button from '@material-ui/core/Button';
import {withRouter} from "react-router-dom";
import Select from 'react-select';
import {getNoc, getDiscipline} from'../Components/GraphQL/Q... | true |
a733d1cdae79b9bb114c8307788a3b75bfa021fe | JavaScript | roccomuso/sequelize-express-boilerplate | /lib/env-mapping.js | UTF-8 | 265 | 2.5625 | 3 | [] | no_license | /* Map environment's shortnames */
module.exports = function(){
var mapping = {
stg : 'staging',
prod : 'production',
dev : 'development'
};
var env = process.env.NODE_ENV;
if (env && mapping[env])
process.env.NODE_ENV = mapping[env];
};
| true |
745a8bad55bda9e4041d252dbbaa01521ad6fcd3 | JavaScript | mattmurph9/kingpong | /utils.js | UTF-8 | 1,036 | 3.046875 | 3 | [
"MIT"
] | permissive | module.exports = {
convertMentionToId: mentionString => {
// Remove first two characters '<' and '@'
return mentionString.substring(2, mentionString.length - 1);
},
shuffle: arr => {
const copy = [...arr];
let currentIndex = copy.length;
let temporaryValue;
let randomIndex;
// While t... | true |
4077bc46861e4795cc5b60a53edbcdd3294e5b61 | JavaScript | mhaf4krr/CSEiApp | /controllers/localDataController.js | UTF-8 | 334 | 2.609375 | 3 | [] | no_license | const fs = require('fs');
function UpdateLocalData(data) {
fs.writeFileSync('./locale/data.txt',JSON.stringify(data),'utf8');
}
function ReadLocalData()
{
let data = fs.readFileSync('./locale/data.txt','utf8');
return data;
}
module.exports = {
UpdateLocalData :UpdateLocalData,
ReadLocalData : Re... | true |
c769d2a3a1d7dd6a884366f022f966545f236a71 | JavaScript | thinkful-ei25/DSA-Recursion-logan-alex | /binary-rep.js | UTF-8 | 496 | 4 | 4 | [] | no_license | 'use strict';
//recursive
function binary(num) {
//base case
if (num === 0) {
return '';
}
//general case
const remainder = Math.floor(num % 2);
return binary(Math.floor(num / 2)) + remainder;
}
// console.log(binary(25));
//iterative
function binaryIt(num) {
// return num.toString(2);
let binary... | true |
3ed21141ff32391e1ac47130cf57caca9ba4d052 | JavaScript | lortmorris/curso.arquitectura.eduit | /mycluster/start.js | UTF-8 | 882 | 2.84375 | 3 | [] | no_license | const os = require('os');
const cpuInfo = os.cpus();
const spawn = require('child_process').spawn;
let startPORT = 7000;
const FORKS = {};
const fork =(cpu, index)=>{
console.log(`starting fork ${index}`);
FORKS[index] = {
spawn: spawn('node', ['app.js', '--port='+(startPORT++)]),
cpu: cpu
};
addListe... | true |
e40b4996de9c8e8006f397e125b353b01b3d498f | JavaScript | jartigag/tlmWebs | /js/clap.js | UTF-8 | 459 | 3.203125 | 3 | [] | no_license | var clap = document.getElementsByClassName('clap');
var clapCount = document.getElementsByClassName('clap--count');
var numberOfClaps = [];
for (var i = 0; i<clap.length; i++) numberOfClaps[i] = 0;
for (var i = 0; i<clap.length; i++) clap[i].addEventListener('click', updateNumberOfClaps(i));
function updateNumberOfCl... | true |
5d9805566922b42c2d401138faf9b037cbe51eb2 | JavaScript | Suko-dev/app-masters | /dist/util/findMatch.js | UTF-8 | 437 | 2.515625 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (function (item, param) {
return Object.keys(item).some(function (key) {
if (item[key] instanceof Array) {
return item[key].some(function (value) { return value === param; });
}
if (!it... | true |
83364f5ad717907956c9f94ec2a683e1bd7dbeb4 | JavaScript | danieldamianov/TelerikGameDevelopmentCourse | /Animations Homework/app.js | UTF-8 | 627 | 2.796875 | 3 | [
"MIT"
] | permissive | 'use strict'
const game = new Phaser.Game(
800,800,Phaser.AUTO,"",{preload,create,update}
)
function preload()
{
game.load.spritesheet('pic','pictures\\pic.png',1024/4,768/4);
}
var pic;
function create()
{
pic = game.add.sprite(0,0,'pic');
var walk = pic.animations.add('walk');
// And this start... | true |
34a2b3f9ffba0f16862bc1e67241c335ea18444c | JavaScript | ADayn/TetrAIs | /web/src/runtime.js | UTF-8 | 2,473 | 2.625 | 3 | [] | no_license | require("utils");
require("matrix");
require("colors");
require("shape");
require("block");
require("game_type");
require("game");
require("tetris");
let game = null;
let timer = null;
function new_game() {
game = new Game(tetris);
}
function clear_timer() {
if (timer) {
clearInterval(timer);
}
}
function rese... | true |
0b4f12510ea3aba57a50c94d18fe506928674c0b | JavaScript | stefanovualto/dojo-funk-me | /1-curry/2-refactor.js | UTF-8 | 632 | 3.890625 | 4 | [] | no_license | "use strict"
// Declarations
function addCurry(x) {
let numbers = [x];
return function add(y) {
if (!y) {
return numbers.reduce((x, y) => { return x + y; }, 0);
}
numbers.push(y);
return add;
}
}
const addCurryBis = (x) => {
let numbers = [x];
const add... | true |
ce92085c058650c4d19ff0e26829191cc47966fb | JavaScript | webstartsev/timeclicker | /src/services/db.js | UTF-8 | 1,958 | 2.65625 | 3 | [] | no_license | import firebase from 'firebase/app';
import 'firebase/database';
const API_KEY = process.env.REACT_APP_FIREBASE_API_KEY;
const DATABASE_URL = process.env.REACT_APP_FIREBASE_DATABASE_URL;
const AUTH_DOMAIN = process.env.REACT_APP_FIREBASE_AUTH_DOMAIN;
class DB {
constructor() {
firebase.initializeApp({
api... | true |
bd5baa7447f8f90815ac6d8934cb7580db115bb5 | JavaScript | Ioane5/ms_thesis | /code/client/dataController/Security.js | UTF-8 | 4,271 | 2.953125 | 3 | [] | no_license | import forge from 'node-forge'
export default class Security {
constructor(publicKey, privateKey) {
this.userPublicKeyString = publicKey;
this.userPublicKey = this.stringToPublicKey(publicKey);
this.userPrivateKey = this.stringToPrivateKey(privateKey);
}
encrypt(dataString, access... | true |
e7cf2bd5d09ba3abccc3956a76207fd3659d9210 | JavaScript | cindyrise/drageResize | /ds.js | UTF-8 | 2,440 | 2.515625 | 3 | [] | no_license | (function(win, doc) {
var storage = window.localStorage,
targetDom = doc.body,
tempEle = null,
mouseX = 0,//鼠标页面坐标
mouseY = 0,//
marginL = 0,//当前元素left ,top 距离
marginT = 0,
beforeW = 0,//当前元素宽,高
beforeH = 0;
targetDom.addEventListener("mousedown", _resize.bind(this));
//改变div大小
... | true |
6b692c7bd8fffab8353acb02f98cf7a2ebaee591 | JavaScript | dpcairns/gemget | /src/Game/GameBox.js | UTF-8 | 3,449 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import KeyHandler, { KEYPRESS } from 'react-key-handler';
import Hero from './Hero';
import Gem from './Gem';
import './game.css';
class GameBox extends Component {
constructor() {
super();
this.state = {
heroPos: {
x: 50,
y: 50
},
n... | true |
2cb9acbba88e7259dcb3fa43acb096cf47fe1ea9 | JavaScript | arnav017/UptimeMonitoringApi | /config.js | UTF-8 | 668 | 2.609375 | 3 | [] | no_license | let util = require('./util');
var environment = {}
environment.staging = {
httpPort:"3001",
httpsPort:"3002",
name:"staging"
}
environment.production = {
httpPort:"3003",
httpsPort:"3004",
name:"production"
}
let node_env = typeof(process.env.NODE_ENV)=='string' ? process.env.NODE_ENV.toLowerCase() : ''... | true |
e293b371c924ae8f47d09adef997f8322b72f51c | JavaScript | kodola/Recyfood | /RECYFOOD_beta/js/partials/Generator.js | UTF-8 | 2,061 | 2.703125 | 3 | [] | no_license | import React, {useState} from "react";
import data from "../data/database";
import {HashRouter, Link, NavLink, Route, Switch} from "react-router-dom";
const Generator = ({products, setProducts}) => {
const chosenRecipe = [];
data.forEach(obj => {
let counter = 0;
obj.items.forEach(p => {
... | true |
a16b15f04ded2d8cba88d9b0113cd532a6e4719a | JavaScript | DingkeXue/DesignPattern | /Proxy/ES602.js | UTF-8 | 655 | 3.1875 | 3 | [] | no_license | ;(function () {
class User {
constructor(balance) {
this.balance = balance;
}
}
class Bike {
go(destination) {
console.log('正在前往' + destination);
}
}
class BikeManager {
send(user, destination) {
if (user.balance < 2) {
... | true |
e93bc033032223932172118231862ab0130f2a78 | JavaScript | ParkDongJo/software_language | /functional_javascript/basic/src/2_each.js | UTF-8 | 190 | 2.84375 | 3 | [] | no_license |
// common/function 디렉토리로 코드를 옮겼음
// let _each = (list, iter) => {
// for (let i=0; i<list.length; i++) {
// iter(list[i])
// }
// return list
// } | true |
2d302bcc7de6d75ba3e422f2103604aabb5cab13 | JavaScript | BlueStoneQ/BBQ | /war2022/jsWriteByHand/data-handle/20-lodash.get.js | UTF-8 | 582 | 3.375 | 3 | [] | no_license | /**
* 手写lodash.get()
* 2023-3-29
* 参考: https://juejin.cn/post/6844903966992498696
*/
const myGet = (source, path, defaultValue = undefined) => {
// 格式化path: a[3].b -> a.3.b -> [a,3,b]
const keyList = path.replace(/\[(\d+)\]/g, '.$1').split('.')
let res = source
for (const key of keyList) {
res = res ... | true |
cdb07018baac1c8abe5d721f1ff63fca1f85a473 | JavaScript | J0hn5mith/ggj18 | /js/hud.js | UTF-8 | 4,676 | 2.71875 | 3 | [] | no_license | function HUD() {
this.tutorialMode = 1;
this.tutorialText = new Text({
size : 24,
font : "geometria",
color : "#fff",
appearCharPerSec : 40,
lineHeight: 40,
letterSpacing : 2
});
this.hudText = new Text({
size : 24,
font : "geometria",
... | true |
0f012a7154d1c4e8a3e10f37dcb3f420d13ecfe1 | JavaScript | tgerring/mist | /mistAPI.js | UTF-8 | 2,757 | 2.625 | 3 | [] | no_license | var remote = require('remote');
var ipc = require('ipc');
var web3 = require('web3'); //./node_modules/web3/dist/web3.min.js
var BigNumber = require('bignumber.js');
var prefix = 'entry_';
// set web3 providor
web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545"));
// filterId the id to only con... | true |