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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
91044c49f96e33b64244a909d1d5a5820606c42b | JavaScript | AndroX7/fancy-todo-server | /fancy-todo-server/middlewares/authentication.js | UTF-8 | 559 | 2.609375 | 3 | [] | no_license | const jwt = require('jsonwebtoken')
function authentication(req,res,next){
if(!req.headers.token){
console.log('header1')
console.log(req.headers.token)
res.status(401).json({
message:'Auth Fail'
})
}
else{
try{
const payload = jwt.verify(req.headers.token,process.env.SECRET_KEY)
... | true |
0d3d165b104295ad09e893dac236062c8fae189f | JavaScript | Congb19/leetcode_solutions | /js/234yh.js | UTF-8 | 789 | 3.765625 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} head
* @return {boolean}
*/
var isPalindrome = function (head) {
//1 暴力 过
// let a = [...Array()];
// let p = head;
// while (p != null) {
// a.push(p.val)... | true |
0a929c375fece5705f8be35c915fc07297b4c623 | JavaScript | CS3345-Team-1/Vroom | /react-ui/src/models/group.js | UTF-8 | 396 | 2.796875 | 3 | [] | no_license | export class Group {
// constructor(id, name, members) {
// this.id = id
// this.name = name
// this.members = members
// }
parseDetail = (obj) => {
this.id = obj.groupID
this.name = obj.groupName
if (obj.members)
this.members = JSON.parse(obj.mem... | true |
96fb6a895f685f6d13a740470a80127a55e12690 | JavaScript | danny128373/Practice-with-APIs | /scripts/main.js | UTF-8 | 214 | 2.640625 | 3 | [] | no_license | fetch("https://reqres.in/api/users?page=2")
.then(users => users.json())
.then(users => {
debugger;
for (let i = 0; i < users.data.length; i++) {
console.log(users.data[i].first_name)
}
})
| true |
82f0dc94be810b66eae56aea3e0636964a729185 | JavaScript | x634725355/Learn-Diary | /面试题/Strikingly/ChallengeB.js | UTF-8 | 1,140 | 3.515625 | 4 | [] | no_license |
// 确保SimplePaller通过以下测试用例:
// 在第一次调用queryFn之前,simplePoller应该等待1秒
// 等待间隔是前一次的1.5倍,但第一次(1秒)除外
// 应该允许并发调用simplePoller,并且函数的调用不会相互干扰
// 注意:您不必在解决方案中实现queryFn和callback。你可以假设他们是被给予的。但是,simplePoller的实现应该能够毫无问题地采用queryFn和callback的不同实现,
// 并且为了实现这一点,我们鼓励您实现几个版本的queryFn和callback以进行测试。
const query = () => {
let time =... | true |
818b39dafdb126a80c53665dce28a585a34b1ec9 | JavaScript | Harshita2605/ColorGame | /index.js | UTF-8 | 16,708 | 3.296875 | 3 | [] | no_license | var newgame = document.getElementById("new");
var t1 = document.getElementById("t1");
var t2 = document.getElementById("t2");
var t3 = document.getElementById("t3");
var t4 = document.getElementById("t4");
var t5 = document.getElementById("t5");
var t6 = document.getElementById("t6");
var t7 = document.getElem... | true |
b93cca65ed9e904384f82ecc4c1b70f8d508ae6e | JavaScript | jounpk/LaZafra_ControlSucursales | /assets/scripts/cadenas.js | UTF-8 | 1,421 | 3.71875 | 4 | [] | no_license | function getCadenaLimpia(cadena){
// Definimos los caracteres que queremos eliminar
var specialChars = "\'!\"¬@#$^&*()[]\/{}|:<>?¿¡";
// Los eliminamos todos
for (var i = 0; i < specialChars.length; i++) {
cadena = cadena.replace(new RegExp("\\" + specialChars[i], 'gi'), '');
cadena = cadena.... | true |
e24d6db040a9d0efb5bde9f544c54faa39b40317 | JavaScript | falonlanders/arcade | /Project_07/Arcade/connect_4/app.js | UTF-8 | 1,513 | 3.28125 | 3 | [] | no_license | const noPlayer = 0; //no player
let currentPlayer = 1; //default player
const numRows = 7; //rows
const numCols = numRows; //columns
const board = Array.from(Array(numCols), (column) => Array(numRows).fill(0)); //board array
function playerChange() {
//player change function
currentPlayer = -currentPlayer;
}
con... | true |
9dd5847f4c709f692af8c4693484d22bc6cf16ed | JavaScript | martin2018git/real_estate_blockchain | /src/Donors.js | UTF-8 | 1,943 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Donor from './Donor';
class Donors extends Component {
/* state = {
donors: [
{
name: "Martin",
addr: "0x7e168622b974cbd63a95523c5ea047e6a22a1098",
balance: "100.000000000"
},
{
... | true |
96470fc48fa2afabb45cd2b0131bf6dbd6632556 | JavaScript | ChrisCooper0/JavaScript-Practice | /!!.js | UTF-8 | 363 | 4 | 4 | [] | no_license | // Double not (!!) coerces the value on the right side into a boolean
console.log(!!null); // false
console.log(!!undefined); // false
console.log(!!""); // false
console.log(!!0); // false
console.log(!!NaN); // false
console.log(!!" "); // true
console.log(!!{}); // true
console.log(!![]); // true
console.log(!!1); ... | true |
92b8ca3026e058274c5da3c010efed41d67c772c | JavaScript | maneko00/javascript-basic | /src/ArrayMethods/filter.js | UTF-8 | 284 | 3.390625 | 3 | [] | no_license | const objectArray = [
{ id: "hoge", text: "fuga" },
{ id: "foo", text: "bar" },
{ id: "fiz", text: "buzz" }
];
const result = objectArray.filter(object => {
return object.id === 'hoge'
})
console.log(result)
// expected output Array [{ id: "hoge", text: "fuga" }] | true |
bb66e39997e2902192bcafbeedd4fa564a5f13fd | JavaScript | yinhaiying/reading-notes | /src/pages/chapter-eight-排序/notes/4.计数排序.js | UTF-8 | 777 | 3.703125 | 4 | [] | no_license |
function countSort(arr) {
let min = arr[0];
let max = arr[0]; // 计数排序必须知道最大值
let obj = {};
let result = [];
// 第一步:取值 n次操作
for (let i = 0; i < arr.length; i++) {
if (min > arr[i]) {
min = arr[i];
}
if (max < arr[i]) {
max = arr[i];
}
if (!obj[arr[i]]) {
obj[arr[i]]... | true |
ab849e622cf32d60ec321b7f076e783e03c286cd | JavaScript | jaswinder06/Assignment | /src/components/Login.js | UTF-8 | 2,929 | 2.609375 | 3 | [] | no_license | import React from 'react';
import '../login.css'
import { withRouter } from 'react-router-dom';
import data from '../data/member.json'
import * as Userdata from '../Userdata.json';
class Login extends React.Component
{
constructor(props) {
super(props);
this.state = {
username: "",
password: "",
... | true |
c36f0df3444e0677eda1a2b5452388a412cb048a | JavaScript | tssk8/teste | /views/scripts/bovespa.js | UTF-8 | 2,919 | 2.578125 | 3 | [] | no_license | /*cria um module e direciona para um controlador */
angular.module('bovespaApp', ['angularUtils.directives.dirPagination']).controller('bovespaListController', ['$http', '$scope', function($http, $scope){
/* Declaração do socketio no cliente */
var socket = io();
$scope.dataHeader = [];
$scope.dataCotacao =... | true |
43bd4b2bbed86c07d649f2cf07df555d8686f9bf | JavaScript | Koofii/advancedJS | /Vecka 2/nodejs/express-sample/src/server/store/mockSource.js | UTF-8 | 2,033 | 3.234375 | 3 | [] | no_license | // FEJKPRODUKTER
const products = [
{
id: 1,
type: "Enkel",
name: 'js 101'
},
{
id: 2,
type: ["JavaScript", "Avancerad"],
name: 'Advanced js'
},
{
id: 3,
type: ["JavaScript", "For the luls"],
name: 'LUL'
},
{
id:... | true |
37f267bf0b716a97901f00bdaf5169843ce48e98 | JavaScript | ansonlouis/usual | /package/model.js | UTF-8 | 5,173 | 2.84375 | 3 | [
"MIT"
] | permissive | // base-class.js
const utils = require('./utils');
const mergeAndDiff = require('./merge-and-diff');
const EventEmitter2 = require('eventemitter2');
class Model{
constructor(...modelAttrs /* attrObj1...cfgN, baseAttrs */){
// used for internal implementation purposes for tracking models
this._internalId =... | true |
59323a94616dcb103529b381438d2925e307dfb4 | JavaScript | aeolusheath/FrontExersize | /data-structure-algorithm/1013-Partition_Array_Into_Three_Parts_With_Equal_Sum.js | UTF-8 | 1,787 | 3.890625 | 4 | [] | no_license | /**
*
*
Given an array A of integers, return true if and only if we can partition the array into three non-empty parts with equal sums.
Formally, we can partition the array if we can find indexes i+1 < j with (A[0] + A[1] + ... + A[i] == A[i+1] + A[i+2] + ... + A[j-1] == A[j] + A[j-1] + ... + A[A.length - 1])
... | true |
12df5c4035305c1ca9826b223bf44d1201eb58f5 | JavaScript | Nitrevino/phase-0-tracks-master | /js/data_structures.js | UTF-8 | 890 | 3.65625 | 4 | [] | no_license | I did this by myself, because I am behind and trying to catch up.
var colors = ["Pink", "Princess Power Pink", "Less Pretty Pink", "yam Yellow",];
colors.push("Mr. Whiskers");
console.log(colors)
var names = ["ed", "ned", "ted", "bed",];
names.push("Mr. Whiskers");
console.log(names)
var pretty_ponies = {}
for (va... | true |
d287968936c6714194fecd04ae32d90cb5885b7c | JavaScript | pablopenna/express_app | /Esqueleto/controllers/test.js | UTF-8 | 811 | 2.921875 | 3 | [] | no_license | /* TEST.JS */
/*Hay qu declarar así las funciones de forma que sean accesibles
desde router.js de la forma controllers_web.<nombre_archivo_js>.<nombre_funcion_exportada>.
Por ejemplo: controllers_web.test.testFunc.
Si se declaran de la forma tradicional 'function <nombre_funcion> () no
será accesible desde router.js'... | true |
b5bf2e8545ce1e278836a7ff592fe5f83c9b3ec6 | JavaScript | bilgeryahov/Heart_Rate_Tracker | /public/JS/SmartWatch.js | UTF-8 | 6,114 | 2.984375 | 3 | [] | no_license | /**
* @file SmartWatch.js
*
* Handles the actions going on the smart watch interface.
*
*
* @author Bilger Yahov <bayahov1@gmail.com>
* @version 1.0.0
*/
var SmartWatch = {
// The thumbs that you see on the page.
_thumbUp: {},
_thumbDown: {},
// Everything is fine text.
_everythingFine: {},
// Second ... | true |
ab20023af666f82f1cc03711748501c2a84dc7e4 | JavaScript | teofilp/p5js | /p5js/projects/snake/sketch.js | UTF-8 | 1,138 | 3.234375 | 3 | [] | no_license | let game;
let board;
let gameWidth, gameHeight;
let snake;
let x = 0;
let y = 0;
let prize;
function setup() {
(function(){
frameRate(5);
gameWidth = 600;
gameHeight = 600;
game = new Game();
board = new Board(30, 30);
snake = new Snake(board);
})();
createCanvas(board.cols*boar... | true |
1cecfec15542e98a959c4cdb716f4f82c50b7175 | JavaScript | vishalgautamm/rxjs-playground | /src-server/example_12_operators_7.js | UTF-8 | 1,417 | 2.96875 | 3 | [] | no_license | import Rx from 'rxjs/Rx';
import {createSubscriber} from './lib/util';
// Zip, WithLatest, CombineLatest
// function arrayZip(array1, array2, selector) {
// const count = Math.min(array1.length, array2.length)
// const results = []
// for (let i = 0; i < count; i++) {
// const combined = selector... | true |
dfef68dfee17f963b88227d9ffc13933d1e75172 | JavaScript | RafaelChianca/meau-app | /src/store/reducers/pet.js | UTF-8 | 2,561 | 2.515625 | 3 | [] | no_license | import { petTypes } from "../actionTypes"
const INITIAL_STATE = {
error: false,
loading: false,
petList: [],
refresh: false,
}
function pet (state = INITIAL_STATE, action) {
switch(action.type){
case petTypes.REGISTER_REQUESTED:
return {...state, loading: true }
case ... | true |
e03efe0a7e03e97ae1d84311f826e50e263872ff | JavaScript | yangxlei/GCanvas | /node/examples/image-exception.js | UTF-8 | 579 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | const { createCanvas, Image } = require('../export');
const canvas = createCanvas(400, 400);
const ctx = canvas.getContext('2d');
const img = new Image()
const img2 = new Image()
const path = require('path')
img.onerror = err => {
console.log(err)
}
img.onload = () => {
}
img.src = 'https://192.168.1.1:80/test.pn... | true |
24800630b283d1451a646d5cd8c74f0ee6e6e70e | JavaScript | DmitrySoshnikov/regexp-tree | /src/optimizer/index.js | UTF-8 | 2,547 | 2.859375 | 3 | [
"MIT"
] | permissive | /**
* The MIT License (MIT)
* Copyright (c) 2017-present Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
'use strict';
const clone = require('../utils/clone');
const parser = require('../parser');
const transform = require('../transform');
const optimizationTransforms = require('./transforms');
module.exports = ... | true |
ec6270d115174c26b4ae9e9d4912cd76a9cbf353 | JavaScript | BetsyRowley/weekend_challenge1 | /server/public/scripts/client.js | UTF-8 | 2,003 | 3.171875 | 3 | [] | no_license | var index = 0;
var numStudents = peopleArray.length;
var profileDivArray = [];
var setTimer = setInterval(forwardInterval, 10000);
$(document).ready(function() {
createGallery();
$(".navigators").on("click", "#next", forwardInterval);
$(".navigators").on("click", "#next", stopTimer);
$(".navigators").on("click", "... | true |
f3e394f922a2d4a879814029f75444c6573c02fb | JavaScript | fernandosev/tictac-toe-frontend-mobile | /src/store/modules/game/reducer.js | UTF-8 | 1,715 | 2.703125 | 3 | [] | no_license | import produce from "immer";
const INITIAL_STATE = {
board: [null, null, null, null, null, null, null, null, null],
status: "opened",
next: "X",
count: 0,
winner: null,
loading: false,
moveLoading: false,
};
export default function auth(state = INITIAL_STATE, action) {
return produce(state, (draft) =>... | true |
2cc15246d598070270f1afabd20ecdb75efd859c | JavaScript | robertlewan/Rock-Paper-Scissors | /rock paper scisscor.js | UTF-8 | 1,665 | 4.25 | 4 | [] | no_license | // Get user choice
const getUserChoice = userInput => {
userInput = userInput.toLowerCase();
if (userInput === 'rock' || userInput === 'paper' || userInput === 'scissors' || userInput === 'bomb') {
return userInput;
} else {
console.log('Invalid input');
}
}
// Get random computer choice
const getCompC... | true |
4b6084b8dace71794c3373bda0270c593a5b92fa | JavaScript | todorstefanov/CardGenerator | /functions.js | UTF-8 | 9,450 | 2.828125 | 3 | [] | no_license | var counter = 1;
function addSpaces(nStr) {
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{4})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ' ' + '$2');
}
return x1 + x2;
};
function expMonthexpYear() {
... | true |
d0888afddafb16e651a07ed7d69677295f8a66e3 | JavaScript | sdayube/trybe-exercises | /7. JavaScript_ ES6/7.1. Let, Const, Arrow Functions and Template Literals/exercise-4.js | UTF-8 | 247 | 4.03125 | 4 | [] | no_license | // Crie uma função que receba uma frase e retorne qual a maior palavra.
const longestWord = (str) => str.split(' ').sort((a, b) => (b.length - a.length))[0];
console.log(longestWord('Antônio foi no banheiro e não sabemos o que aconteceu'));
| true |
e52e306435818a3c7b411fe7120d877304cfe159 | JavaScript | OnlyWane/letao | /public/m/js/register.js | UTF-8 | 2,610 | 2.625 | 3 | [] | no_license | $(function(){
var vCode = '';
// var check;
$('.btn-register').on('tap',function(){
var phone = $('.phone-number').val().trim(); // 手机号
var userName = $('.user-name').val().trim(); // 手机号
var password = $('.password').val().trim(); // 密码
var pwdCheck = $('.password-check').v... | true |
73f49fd3172fd21c008780377417ae7875064725 | JavaScript | mauricelam/ScrollMaps | /src/prefreader.js | UTF-8 | 1,471 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Uses message passing mechanism to read preference values from the context of the extension. This
* class has a cache of its own to provide all required preference values instantly.
*/
const PrefReader = {
options: {},
listeners: [],
setOption(key, value) {
this.options[key] = value;
... | true |
96426448885de866a4841136e5d22467dcb88a30 | JavaScript | ethyl2/vue-3-experiments | /Intro-to-Vue-3-With-Components/components/ProductDisplay.js | UTF-8 | 5,743 | 2.53125 | 3 | [] | no_license | app.component('product-display', {
props: {
premium: {
type: Boolean,
default: false
}
},
template:
/*html*/
`
<div class="product-display">
<div class="product-container">
<div class="product-image product-img">
<a :href="ur... | true |
bde7ed07ef0745aa5369c361596a36628779a110 | JavaScript | jeanToru/Node.js-Practices | /TrabajoClase8/http_v3/moduls.js | UTF-8 | 139 | 2.921875 | 3 | [] | no_license | exports.operation = function (num1, num2) {
let numero1 = Number(num1);
let numero2 = Number(num2)
return numero1 + numero2;
} | true |
26325df56a01dd42fa3367f67f617a62c872fbd7 | JavaScript | jayanzaman/web_development_notes | /web_development_learning/u2/d06/morning/script.js | UTF-8 | 2,314 | 2.734375 | 3 | [] | no_license | $(document).ready(function() {
console.log("loaded");
var $body = $('body');
// getResults function goes here
var getResults = function(input) {
$('.item').remove();
var query = input;
var makeCall = $.ajax({
... | true |
23bef4584bb99e86603f24515a7e71d11a12c99d | JavaScript | attrbute/baogemall | /pages/pay/index.js | UTF-8 | 3,285 | 2.578125 | 3 | [] | no_license | /*
1 页面加载的时候
1 从缓存中获取购物车数据 渲染到页面中
2 这些数据 checked=true
2 微信支付
1 哪些人 哪些账号 可以实现微信支付
1 企业账号
2 企业账号的小程序后台中 必须给开发者 添加上白名单
1 一个appid 可以同时绑定多个开发者
2 这些开发者就可以共用这个appid 和 它的开发权限
3 支付按钮
1 先判断缓存中有没有token
2 没有 跳转到授权页面 进行获取token
3 有token
4 创建订单
5 已经完成了微信支付
6 手动删除缓存中 已经被选中的商品
7 删除后的购物车数据 填充回缓存
... | true |
1b72e6c948a3ef09df71e7dbc72bf2447b79b53e | JavaScript | edinvnode/Academy-387 | /counting_async.js | UTF-8 | 351 | 2.890625 | 3 | [] | no_license | //CALLBACK FUNCTION. CALLBACK FUNCKCIJA JE FUNKCIJA KOJA CEKA DA SE NESTO ZAVRSI
var fs = require('fs');
//PRIMJER CALLBACK FUNKCIJE. CALLBACK FUNKCIJA JE DRUGI PARAMETAR GLAVNE FUNKCIJE.
fs.readFile(process.argv[2], 'utf8', function name(err, data) {
if(err) throw err;
console.log(data.split("\n").length - 1);
})
... | true |
15d3249564c1ca728d3fc8891ca64f33be59f1ae | JavaScript | thiago-franco/registrodecomprasembarcado | /js/registroembarcado.carrinhos.js | UTF-8 | 5,845 | 2.546875 | 3 | [] | no_license | function carrinho() {
//Configuração do dataTable
var requisicao = 'php/invoker.php?_c=CarrinhoControladora&_m=carrinhos&_raw=a';
var colunas = [ { "mData": "id" }, { "mData": "numeroSerie" }, { "mData": "nome" }, { "mData": "ir" } ];
var tabela = carregarDataTable( '#tabela-carrinhos', requisicao, colunas );
t... | true |
36285e8e6fbf28dfaac44d98ab1c499f42cd7810 | JavaScript | beratx/poeditor | /lib/stack.js | UTF-8 | 9,067 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
/*
Copyright [2014] [Diagramo]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | true |
da6abb79a0efe22dc8261c9288347a02062d8518 | JavaScript | wodewone/WechatStat | /plugin/prefix.js | UTF-8 | 2,408 | 2.53125 | 3 | [] | no_license | const moment = require('moment');
const {parseQuery} = require('plugin/utils');
try {
if (process) {
process.datetime = (format = 'YYYY-MM-DD HH:mm:ss') => {
return moment().format(format)
};
/**
* 计算运行时间
* 第一次调用开始记录,第二次获取
* @param timeId 传入ID开始... | true |
9b619bffbef6b408edc9ebedcb990665fd12ad90 | JavaScript | ayaz6789/web-personal | /My-projects/ayazjs-task-1-clock-var/main.js | UTF-8 | 340 | 3.28125 | 3 | [] | no_license | let clocks = document.getElementsByClassName("clock");
let timer1 = clocks[0];
let timer2 = clocks[1];
let timer3 = clocks[2];
function clock1 (){
var date = new Date();
let timer1 = clocks[0];
timer1.innerHTML = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
}
let Interval = setInte... | true |
7cfd071e78deb315933c14ff0e8ae35ecde530c1 | JavaScript | edsonbastos2/AulasJavaScript | /funcao/exercicio.js | UTF-8 | 229 | 3.25 | 3 | [] | no_license | const fabricantes = ['Mecedes', 'Audio', 'BMW']
//const imprimir = (nome,indice) => console.log(`${indice + 1}. ${nome}`)
//fabricantes.forEach(imprimir)
fabricantes.forEach((nome,indice) => console.log(`${indice +1}.${nome}`)) | true |
6caa28efa840a86dcf9ddb31fcba1bd73b2dc51c | JavaScript | Kaylotura/dark-companion | /src/App.js | UTF-8 | 1,744 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react'
import SearchBar from './SearchBar'
import StockTable from './StockTable'
import JSONInventory from './JSONInventory'
class App extends Component {
constructor () {
super()
this.state = {
filterStocked: false,
searchString: '',
inCart: [],
pric... | true |
1e15f93901520ea75e4d6a970c0b94627cb9374e | JavaScript | Ikimoo/Product-Project | /front-end/assets/js/app.js | UTF-8 | 4,118 | 3.15625 | 3 | [] | no_license | const app = {
// Etape à suivre pour ce profjet trop cool qui n'est pas une bataille navale
// Vérification des champs entrées
// - référence
// On défini les regex + les input + le bouton
referenceRegex: new RegExp('([0-9]){3}-([a-zA-Z]){3}'), // autorise 3 lettres maj et min et 3 chiffre entre ... | true |
b38001be26ded29c213c9bd55633bd0622c785b1 | JavaScript | Borisich/particles | /src/scripts/particle.js | UTF-8 | 3,835 | 3.265625 | 3 | [] | no_license | export default class Particle {
constructor(initialX, initialY) {
this.speed = Particle.getRandomNumber(50, 100)
this.currentDX = 0
this.currentDY = 0
this.el = document.createElement('div')
this.el.style.position = 'absolute'
//Изменим тип анимации на более просто... | true |
59fe94d91527ca15ff68f43888846a816e1df9cd | JavaScript | Rademenes16/JS-perlin-noise-map | /src/lib/NoiseGenerator.js | UTF-8 | 1,814 | 3.125 | 3 | [] | no_license | class NoiseGenerator {
constructor(seed){
this.seed = seed
this.configs = {
octaves: 9,
amplitude: 80,
persistance: 0.51,
smoothness: 250
}
}
setConfigs(configs){
this.configs = configs
}
noise(x, z){
const inte... | true |
c251af744313c63e30cca3500424b881a70de1f7 | JavaScript | comiluv/p5js-repo | /cc86cubewave/sketch.js | UTF-8 | 1,117 | 2.75 | 3 | [] | no_license | let angle = 0;
const w = 36;
const magicAngle = Math.atan(1 / Math.sqrt(2));
let maxD;
function setup() {
createCanvas(600, 600, WEBGL);
maxD = dist(0, 0, width * 0.5, height * 0.5);
}
function draw() {
background(201);
/* https://en.wikipedia.org/wiki/Isometric_projection */
ortho(-width, width, ... | true |
cf2fbdc747bb50cf2404b1da55fa2cd1425d73eb | JavaScript | SoftwareAG/c8y_hw_mqtt | /Nodejs/app.js | UTF-8 | 1,904 | 2.5625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | // MQTT dependency https://github.com/mqttjs/MQTT.js
const mqtt = require("mqtt");
// client, user and device details
const serverUrl = "tcp://mqtt.cumulocity.com";
const clientId = "my_mqtt_nodejs_client";
const device_name = "My Node.js MQTT device";
const tenant = "<<tenant_ID>>";
const username = "<<u... | true |
cf7003a1784d0fdd55d57f85bdae9e549406d176 | JavaScript | konradbukanski/todo | /src/components/TaskList.js | UTF-8 | 940 | 2.546875 | 3 | [] | no_license | import React from "react";
import Task from "./Task";
const TaskList = props => {
const todoTask = props.tasks.filter(task => (task.active ? task : null));
const doneTask = props.tasks.filter(task => (!task.active ? task : null));
const todoTasks = todoTask.map(task => (
<Task
key={task.id}
task... | true |
20c6bc10239727879ad5f02bc28700a0cfbddbab | JavaScript | benralexander/baget | /web-app/js/baget/boxWhiskerPlot.js | UTF-8 | 34,799 | 2.546875 | 3 | [
"MIT"
] | permissive | var baget = baget || {};
(function () {
"use strict";
baget.boxWhiskerPlot = function () {
/***
* Publicly accessible data goes here
*/
var instance = {}, // null object around which we will build the boxWhiskerPlot iinstance
boxWhiskerData, // All ... | true |
273960e75ed2f297cc0cb383a5f0c68d1f253216 | JavaScript | billcoding/wz_scripts | /npc/1022000.js | GB18030 | 3,974 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | /* Dances with Balrog
Warrior Job Advancement
Victoria Road : Warriors' Sanctuary (102000003)
Custom Quest 100003, 100005
*/
var status = 0;
var jobId;
var jobName;
function start() {
status = -1;
action(1, 0, 0);
}
function action(mode, type, selection) {
if (mode == 0 && status == 2) {
... | true |
b4636818a87f47aff9253def05d464b1779dd5a4 | JavaScript | epodreczniki/epodreczniki-portal | /portal/static/3rdparty/processingjs/processingjs_script.js | UTF-8 | 1,192 | 2.6875 | 3 | [] | no_license | function stripHost(domain) {
var pos = domain.indexOf('.');
if (pos == -1) {
return domain;
} else {
return domain.substr(pos + 1);
}
}
if (navigator.userAgent.indexOf("MSIE") == -1 && document.domain != '') {
try {
document.domain = stripHost(document.domain);
} catch (... | true |
ff9977652df4a81bfdc8e7e08acd1ad7cd46f808 | JavaScript | emerginginsights/dashboard | /js/MaleToFemale.js | UTF-8 | 1,618 | 2.546875 | 3 | [
"MIT"
] | permissive | countryStatsPromise.then(function (stats) {
male = last_no_zero(stats.indicator_values['2190'])
year = stats.years[male[0]]
female = stats.indicator_values['2210'][male[0]]
$('#maletofemale_year').text(year)
var ctx = document.getElementById('male-to-female__chart').getContext("2d");
var maleT... | true |
fbc4df0c45bf029c81bc1372150e539af03e0aa1 | JavaScript | castonhilcher/user-giphy | /user-giphy-client/src/reducers/favorite-gifs-reducer.js | UTF-8 | 1,353 | 2.875 | 3 | [] | no_license | import {
FAVORITE_GIF_SAVE_SUCCESS,
FAVORITE_GIF_LIST_SUCCESS,
DELETE_GIF_SUCCESS,
GET_GIPHY_GIFS_LIST_SUCCESS
} from '../constants/action-types';
export default function(state = [], action) {
//Each one creates a new object so we don't mutate state
switch (action.type) {
case FAVORITE_GIF_LIST_SUCCESS... | true |
e8f81d11a1d9d2bd1e3f5fb81999b67c7a5d2cd3 | JavaScript | aliszonandrade/estudoNodeJS | /express/index.js | UTF-8 | 670 | 3.09375 | 3 | [] | no_license | const express = require('express') // Importando
const app = express() // Iniciando express
app.get('/', function(req,res){
res.send("Teste")
})
app.get('/canal/', (req, res) => {
var valor = req.query["teste"]
res.send(` ${valor == null ? 'Não há valor' : 'O valor passado foi ' + valor }`)
})
app.get(... | true |
ab7da7dc1904144ab892ab2482ebeeeeb3caa6f1 | JavaScript | rpoole/discordbetting | /eth/test/discord_betting_sol.js | UTF-8 | 8,626 | 2.53125 | 3 | [] | no_license | /*
* Can really clean these up when
* https://github.com/ethereum/solidity/issues/1686 is finished
* For now, preconditions to ensure other reverts are not firing should be
* included in the test
*/
let assertRevert = require('./helpers/assert_revert');
let structs = require('./helpers/structs');
let DiscordBettin... | true |
bdb5280f6ee4f48337aa35d1a1a98a6746b57642 | JavaScript | dansdom/plugins-countdown-timer | /code/countdowntimer1.0.js | UTF-8 | 23,011 | 2.703125 | 3 | [] | no_license | /*
jQuery Countdown Timer Plugin v1.0
Copyright © 2011 Daniel Thomson
Licensed under the MIT license:
http://www.opensource.org/licenses/mit-license.php
*/
// TO DO:
// process the date and turn it into something I can use using the date format option
// be able to use am/pm in the plugin
// work out ... | true |
ce0dc5e216153d5a25df27c2b46bb084270d5b45 | JavaScript | dkel3/high5 | /js/gimme5.js | UTF-8 | 636 | 2.875 | 3 | [
"MIT"
] | permissive | // gimme5.js
$( function() {
$('#step1_next').click( function(event) {
var name = $("#name").val();
localStorage.setItem("gimme5_name", name);
});
$('#step2_next').click( function(event) {
var reason = $("#reason").val();
localStorage.setItem("gimme5_reason", reason);
}... | true |
029fde1ebe2afc66b177541f01c25c1e630b7008 | JavaScript | kreativan/js-reference | /Basics/4-Operators.js | UTF-8 | 1,251 | 4.125 | 4 | [] | no_license | /*-------------------------------------------------------------
# Comparison
-------------------------------------------------------------*/
1 === 1
//-> true
1 !== 1
//-> false
1 < 2
//-> true
1 > 2
//-> false
/*-------------------------------------------------------------
# Operators
--------------------------------... | true |
e636ca60081f11f5381908da1b946051f00e8b8e | JavaScript | eznix86/eenobotsApp | /platforms/android/assets/www/saves/www/js/index.js | UTF-8 | 1,376 | 2.578125 | 3 | [
"MIT"
] | permissive |
$(document).ready(function(){
$("ons-progress-bar").hide();
$("#push-button").click(function(){
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;
$.post("192.168.43.149/www/fetch.php",
{
username: email,
... | true |
98165026a81622b2a3e02f114f1764d4dc7f2734 | JavaScript | kacpergumieniuk/PingComingSoonPage | /app.js | UTF-8 | 667 | 3.078125 | 3 | [] | no_license |
function validateEmail(email) {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
function SubmitEmail(){
let x = document.getElementById("tex... | true |
1dbcdaa9bc3054451a5841869dc7c6000e16bb3f | JavaScript | Silver0401/ExpressTest | /src/App.js | UTF-8 | 711 | 2.59375 | 3 | [] | no_license | import React, {useEffect,useState} from 'react';
import logo from './logo.svg';
import './App.css';
import axios from "axios"
function App() {
const [list,changeList] = useState("fetching users")
const [counter, changeCounter] = useState(0)
useEffect(() => {
axios.get("/users-info").then((request) => {
... | true |
19ded4e9c7384a2143d22ac03e3151660d5b3ce1 | JavaScript | asduong/LeetCode | /709-ToLowerCase.js | UTF-8 | 405 | 3.9375 | 4 | [] | no_license | /**
* @param {string} str
* @return {string}
*/
var toLowerCase = function(str) {
let text = "";
let unicode = 0;
for (let i = 0; i < str.length; i++) {
unicode = str[i].charCodeAt();
if (unicode >= 65 && unicode <= 90) {
text += String.fromCharCode(unicode + 32);
} else {
text += str[i... | true |
d65abb64b4085eed0c4688088da2b5025debffbb | JavaScript | KokoKrumov/react-app-nav-from-scratch | /src/components/Link.js | UTF-8 | 832 | 2.59375 | 3 | [] | no_license | import React from "react";
const Link = ({className, href, children}) => {
const onClick = (e) => {
if(e.metaKey || e.ctrlKey){
return;
}
e.preventDefault();
window.history.pushState({}, '', href);
//това комуникира около компонентите, когато url-a се променя
... | true |
f4b24667fae638c09b75b6d8d3651ee702bf2404 | JavaScript | phpsmarter/Pocketer-CRA | /crawal-server/scrape1.js | UTF-8 | 6,603 | 2.515625 | 3 | [] | no_license |
'use strict'
//TODO Runkit服务器配置
//NOTE 文件头
/**
* Filename: /Users/apple/Public/Git_Bank/graphql-mongodb-example/src/jb51scraper1.js
* Path: /Users/apple/Public/Git_Bank/graphql-mongodb-example
* Created Date: Wednesday, 24th December 2018, 6:32:08 pm
* Author: apple
* item1 :抓取pocket网站内容
* item 2:函数式重构获取方法... | true |
31c206141f7fd9064f9201f54c135d243eff2c45 | JavaScript | B3R307/3 | /ex-05-sumDigits.js | UTF-8 | 2,201 | 4.46875 | 4 | [] | no_license | /**
* sumDigits()
*
* Write a function called `sumDigits` that accepts a number
* and returns a sum total of the value of the digits
*
*
* Examples:
* sumDigits(12) => 3
* sumDigits(1112) => 5
* sumDigits(406) => 10
**/
// ++ YOUR CODE below
function sumDigits(someNum){
// console.... | true |
cdaee2231e88018f98e949e07486a42a7c5bdeb5 | JavaScript | chenbingquan123/learn | /JS基础/day09/07_error.js | UTF-8 | 670 | 3.78125 | 4 | [] | no_license | // console.log(1)
// // var a=1; //语法错误
// var b=2;
// // console.log(b1) //引用错误
// var arr=['a','b','c'];
// // console.log(arr.revers());//类型错误
// // var laptop=new Array(-3);//范围错误
// // console.log(laptop);
var age=19;
// if(age<18 || age>60){
// //自定义错误
// throw'请提供一个合法的年龄'
// }
try{
//尝试执行,放... | true |
0b4abd460cabc2024bb64c72dfac2fad2bd6b1ae | JavaScript | rainyLeo/Vue-tetris | /src/store/mutations.js | UTF-8 | 2,041 | 2.671875 | 3 | [] | no_license | import Block from '../util/block.js'
import { emptyGrid } from '../util/const'
import {
putBottom,
isBottomAvailable,
isLeftAvailable,
isRightAvailable,
hasSolidLine
} from '../util/check'
export const state = {
current: {
type: null,
timeStamp: null,
shape: null,
x: null,
y: null,
},... | true |
7630a6eeeb5c18a360d6472a0e59748421cf5061 | JavaScript | NLSteveO/AdventOfCode | /2022/day07/puzzle2.js | UTF-8 | 3,194 | 3.03125 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
const FILESYSTEM_CAPACITY = 70000000;
const SPACE_NEEDED = 30000000;
const isCDCommand = (line) => line.startsWith('cd', 2);
const isLSCommand = (line) => line.startsWith('ls', 2);
const isDir = (line) => line.startsWith('dir');
const isFile = (line) => !line.st... | true |
fb17f44739a1234adfa3bfd902d677a13ec95b5d | JavaScript | Swolebrain/star-castle | /js/main.js | UTF-8 | 1,483 | 2.78125 | 3 | [] | no_license | import {Shield} from './Entities';
import {ShieldSection} from './Entities';
import {Projectile} from './Entities';
import preloader from './Preloader';
import Ship from './Ship/Ship.js';
var images;
preloader().then(img=>{
images=img;
game();
});
let radius1 = Math.round(Math.min(window.innerWidth, window.innerHe... | true |
d1d81b680e8f3a2fac275b78ce257f74ea2c1fbe | JavaScript | HansenK/Tetris | /tetris2.js | UTF-8 | 8,539 | 2.765625 | 3 | [] | no_license | //VARIÁVEIS
var cores = new Array ("red", "blue", "green", "yellow", "purple", "brown", "orange");
var posicoes = new Array("0px","30px","60px","90px");
var quantb = 0, quantt=0;
var tamy,tamx, initx=0, tamtot=0, score=0;
var timer,teste=0, cont=0, flag1=true, flag2=true;
var posy = [];
var posx = [];
var posy2... | true |
b812481b6991a33354258b80a66ddea5c17505e3 | JavaScript | RenatalinaViski/ExamReact | /front/src/store/actions/user.js | UTF-8 | 1,011 | 2.609375 | 3 | [] | no_license | import { FETCH_USER_START, FETCH_USER_SUCCESS, FETCH_USER_ERROR, FETCH_PERSON_START,FETCH_PERSON_SUCCESS, FETCH_PERSON_ERROR } from "./actionTypes"
function getUser() {
let tokenUser= localStorage.getItem("authToken")
return tokenUser !=null ? localStorage.getItem("name") : "Login"
}
export function fetchUserSt... | true |
26dd89b550a978ae68e5f09f4b3d09d19a7ef87c | JavaScript | chujian1/collection-calculate-camp | /practices/superposition_operation/own_elements_operation/one_add_next_multiply_three.js | UTF-8 | 314 | 2.84375 | 3 | [] | no_license | 'use strict';
function one_add_next_multiply_three(collection){
var arr = [];
collection.forEach(item =>{
var index = collection.indexOf(item);
if(index<(collection.length-1))
arr.push(Math.round((item+collection[index+1])*3));
});
return arr;
}
module.exports = one_add_next_multiply_three;
| true |
f0fa41e9747f57fbba1e7f2c1c2a4cc5ab8dd389 | JavaScript | ihorvasilets/IgniteProject | /script.js | UTF-8 | 951 | 2.765625 | 3 | [] | no_license | //-----------------------------------------------------------------------------
//----- RESPONSIVE-MENU --------------------------------------------------------
window.onload = function () {
var menuButton = document.querySelectorAll('.header-bg button')[0];
var respMenu = document.querySelectorAll('.header-b... | true |
194a027843573b9f6173fda16c546460cc448200 | JavaScript | loikein/my-1Writer-scripts | /Footnote.js | UTF-8 | 1,018 | 2.6875 | 3 | [] | no_license | // source: http://1writerapp.com/actiondir/action/0e854
// ref: http://1writerapp.com/actiondir/action/e2db4
var allText = editor.getText();
var range = editor.getSelectedRange();
ui.input('Footnote Name', '', 'Enter Footnote Name', enterFootnote);
function cursorToEnd() {
var content = editor.getText();
editor.... | true |
510432aff2e8ecd48351d757a7245dc37c3a8491 | JavaScript | Tush1999/CustomEvents | /src/Component/Form/index.js | UTF-8 | 2,930 | 2.65625 | 3 | [] | no_license | import React, { Component } from "react";
import "./style.css";
const { v4: uuid_v4 } = require("uuid");
export default class Form extends Component {
constructor(props) {
super(props);
this.state = {
firstName: "",
lastName: "",
email: "",
id: "",
firstNameError:"",
lastN... | true |
2093f3ab0ccf86be684ffdbf57bd4196037001d5 | JavaScript | HoloLen/tsgz_admin | /src/utils/configZtree.js | UTF-8 | 4,713 | 2.921875 | 3 | [] | no_license | export function moveTreeNode(zTree1, zTree2){
var nodes = zTree1.getCheckedNodes(); //获取选中需要移动的数据
for(var i=0;i<nodes.length;i++){ //把选中的数据从根开始一条一条往右添加
var node = nodes[i];
var strs={}; //新建一个JSON 格式数据,表示为一个节点,可以是根也可以是叶
strs.id =node.id;
strs.name=node.name;
strs.pId... | true |
623a83a0cbcf8b281156111d8db9dd60e71be4ea | JavaScript | quando2299/TMDT | /controllers/contactCtrl.js | UTF-8 | 1,317 | 2.53125 | 3 | [] | no_license | const Contact = require('../models/contactModel');
const contactCtrl = {
getContacts: async (req, res) => {
try {
const contacts = await Contact.find();
res.json(contacts);
} catch (error) {
return res.status(500).json({ message: error.message });
}
},
createContact: async (req, res... | true |
c4a7ffdf18821238c49d9c421d229d5453024c8b | JavaScript | lcbasu/habitlab | /src/libs_backend/ajax_utils.js | UTF-8 | 697 | 2.640625 | 3 | [] | no_license | /*
$.ajax {
type: 'POST'
url: 'https://habitlab.herokuapp.com/add_install'
dataType: 'json'
contentType: 'application/json'
data: JSON.stringify(install_data)
}
*/
function post_json(url, data) {
return new Promise(function(resolve, reject) {
let xhr = new XMLHttpRequest()
xhr.open('POST', url)
... | true |
ec476edac9e2cc05a6db680a6d89b8b42866370e | JavaScript | Kimbangg/TIL | /Algorithm/BoostCamp/Covenant_Normal/약점체크/14719 빗물.js | UTF-8 | 840 | 3.578125 | 4 | [] | no_license | function solution(height) {
let answer = 0;
let left = 0;
let right = height.length - 1;
let maxLeft = 0;
let maxRight = 0;
while (left < right) {
if (height[left] < height[right]) {
if (height[left] >= maxLeft) {
maxLeft = height[left];
} else {
answer += maxLeft - height[l... | true |
a1474ef50a84a953cd43168ca2be60d7c1c8343a | JavaScript | alastairrobertson/Learn-Spanish-Web-App | /js/game.js | UTF-8 | 7,801 | 3.5625 | 4 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | //gameEngine is a global namespace object for organisation of code
window.gameEngine = {};
//level is a global variable that tracks the current level the user is playing at
window.level = 1;
//correctCount is a global variable that tracks when a new level should be incremented
window.correctCount = 0;
/*
This functio... | true |
1c7668c41ce736774dafd91a23cfa6a71777139d | JavaScript | ChristianEverett/AutomationSystem | /AutomationController/src/main/resources/static/js/onDeviceChange.js | UTF-8 | 1,230 | 2.75 | 3 | [
"MIT"
] | permissive |
function setRGBSlider(rgbValues, slider)
{
var color = {r: rgbValues[0], g: rgbValues[1], b: rgbValues[2]};
slider.spectrum("set", color);
}
function setLockImg(setLock, unlockButton, lockButton, unlockImg, lockImg)
{
lockButton.css("background-color", "rgba(114, 114, 114, 1)");
unlockButton.css("ba... | true |
b34ca14b7f3a9a73353b2e0a13b925cbfb7d5b33 | JavaScript | HristoSpasov/JS-Fundamentals---January-2018---SoftUni | /08. Strings and RegExp - LAB/06.RestarauntBill.js | UTF-8 | 548 | 3.6875 | 4 | [] | no_license | // We have an array of products
// On even indices we have the product name
// On odd is the corresponding product price
function calculateBull(orders) {
let products = orders.filter((pr, i) => i % 2 === 0);
let prices = orders.filter((pr, i) => i % 2 !== 0).map(Number);
return `You purchased ${products.jo... | true |
394c0d2a52aaf284a88599ad49d2b6f0f2cb6815 | JavaScript | hangjob/input-tips | /input-tips.js | UTF-8 | 7,082 | 2.6875 | 3 | [] | no_license | ;(function($){
//构造私有方法
var privateFun = function(){
};
var inputTips = (function(){
//构造inputTips 函数
var inputTips = function(element,options){
//this 对象
this.element = element;
//合并参数
this.options = $.extend(true,$.fn.inputTips.default,... | true |
2d1ce26b4ed838b9700c9f4f5f382373119498a0 | JavaScript | MuneebFarid07/Assignment9 | /Chapter1-20/project-master/chapter 12-13/Questions/app.js | UTF-8 | 2,255 | 4.03125 | 4 | [] | no_license | document.write("<h3>Question1</h3>");
var character = prompt('Enter a character or Number: ');
if(character.charCodeAt() >= 65 && character.charCodeAt() <= 90){
document.write( character + ' is a Uppercase Character');
}
else if(character.charCodeAt() >= 97 && character.charCodeAt() <= 122){
document.write( cha... | true |
57a49cf807e197033619536229f8945a878b66e0 | JavaScript | jonathan-annett/pirple2 | /lib/helpers/validate.js | UTF-8 | 25,347 | 2.890625 | 3 | [] | no_license | /*
File: helpers/validate.js
Project: Asignment 2 https://github.com/jonathan-annett/pirple2
Synopsis: helper validation functions
Used By:
*/
/*
Copyright 2018 Jonathan Annett
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t... | true |
056e17259e250bf128a6fa2943e0017a57ac346d | JavaScript | natendaben/FWD | /projects/midtermProject/safety.js | UTF-8 | 516 | 2.671875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | function toggleTips(){ //function for displaying tips
$(this).next('.tips').slideToggle(600); //slide the tips up or down depending on current status with speed of 600 milliseconds
$(this).toggleClass('closeTopic'); //toggle class of "closeTopic" which changes our background arrow icon
}
$(function(){
$('.... | true |
6bc5fc0487213c357435777078906b6309654d07 | JavaScript | heatherstock/kata | /primesToMax.js | UTF-8 | 1,291 | 3.796875 | 4 | [] | no_license | const assert = require('assert');
const { describe, it } = require('./test.js');
function primeFactorsTo(max) {
const store = [];
const primes = [];
for (var i = 2; i <= max; ++i)
{
if (!store [i])
{
primes.push(i);
for (var j = i*2; j <= max; j += i) // bit... | true |
a9270e71af27063e615d5fd978f0aab3feec8e2f | JavaScript | vedantb/Interview-Questions | /AlgoExpert Strings/pattern-matcher.js | UTF-8 | 1,815 | 3.515625 | 4 | [] | no_license | function patternMatcher(pattern, string) {
let didSwitchPattern = false;
let newPattern = getNewPattern(pattern);
if (newPattern[0] !== pattern[0]) didSwitchPattern = true;
let { firstYPosition, xyCounts } = getCountsAndFirstYPosition(newPattern);
if (xyCounts["y"] !== 0) {
for (let lenOfX = 1; lenOfX < ... | true |
fc576cb9c8e106fded0699450eec90966560f8bc | JavaScript | Iryoda/Site | /js/index.js | UTF-8 | 6,214 | 2.84375 | 3 | [] | no_license | var nPost = document.querySelector("#NewPost");
var NewPost = document.querySelector("#newpost");
var modalBg = document.querySelector(".modal-bg");
var modalClose = document.querySelector(".modal-close");
var logoBox = document.querySelector("#logo-box");
var comentario = document.querySelector(".comment... | true |
68aafbabd5fb82e90e42476e52890d1c2629d4db | JavaScript | WorkshopDudes/ecmascript-workshop | /tests/04-template-strings/02-multiline-strings-test.js | UTF-8 | 405 | 2.53125 | 3 | [] | no_license | import getLyrics from '../../src/04-template-strings/02-multiline-strings';
describe('04-template-strings - multiline strings', () => {
it('multiline string works', () => {
expect(getLyrics()).to.equal(`Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make... | true |
a3df5fb4bab4eb5491ad72483f7b57a90090f81e | JavaScript | leetcode-xu/conch_music | /static/js/PopDrag.js | UTF-8 | 17,073 | 2.5625 | 3 | [] | no_license | if (!Function.prototype.bind) {
Function.prototype.bind = function (o, args) {
var _self = this;
return function () {
return _self.apply(o, [].concat(args));
};
};
}
var EventUtil = {
_$: function (id) {
return typeof id === 'string' ? document.getElemen... | true |
601faf6c06d53df1d06e8e6d82d734ede940d03f | JavaScript | lim2481284/webPlugin | /Design/Full Page/Forum/Dynamic search forum/assets/js/main.js | UTF-8 | 331 | 2.828125 | 3 | [] | no_license | $('#searchInput').keyup(function(){
var page = $('#all_text');
var pageText = page.text().replace("<span>","").replace("</span>");
var searchedText = $('#searchInput').val();
var theRegEx = new RegExp("("+searchedText+")", "igm");
var newHtml = pageText.replace(theRegEx ,"<span>$1</span>");
page.html(ne... | true |
7f9636d8700a7b3bfb510ff73fc1555c523436ed | JavaScript | pertrai1/study_hard_parts_oop | /3.scope_and_this/scope-this-class.js | UTF-8 | 1,062 | 4.03125 | 4 | [] | no_license | /*
* Create an object creator function with two parameters
*/
function UserCreator(name, score) {
this.name = name;
this.score = score;
}
/*
* Attatch the three functions to the prototype property
* Use different this permutations in the methods on prototype
*/
UserCreator.prototype.returnThisOne = fun... | true |
d0db0c036f756220b10743843c9fec5c9a732282 | JavaScript | yoosername/streaming-middleware | /test/lib/GetFunctionArguments.spec.js | UTF-8 | 1,930 | 3.03125 | 3 | [
"MIT"
] | permissive | 'use strict';
const expect = require('chai').expect;
const GetFunctionArguments = require('../../lib/GetFunctionArguments.js');
describe('GetFunctionArguments', function() {
it('should exist', function() {
expect(GetFunctionArguments).to.not.be.undefined;
});
it('should be a function', function() {
... | true |
1a3d686eee006344420e3510c99e47be33d017cc | JavaScript | siphu1997/project_manage_karaoke | /fe/src/action/manageMenuAction.js | UTF-8 | 1,445 | 2.515625 | 3 | [] | no_license | import api from "../common/apiService";
const name = "MANAGE_MENU_CONSTANT_";
export const MANAGE_MENU_CONSTANT = {
FETCH_BEGIN: name + "FETCH_BEGIN",
FETCH_SUCCESS: name + "FETCH_SUCCESS",
FETCH_FAIL: name + "FETCH_FAIL",
ADD_NEW_DATA: name + "ADD_NEW_DATA",
UPDATE_DATA: name + "UPDATE_DATA",
DELETE_DATA: ... | true |
6d95a9210633f59f3f8596ab8667f515356f3b9b | JavaScript | Tokihery-hery/tJquery | /js/construteur.js | UTF-8 | 965 | 3.703125 | 4 | [] | no_license | class Dog {
constructor(name, lastname, annee) {
this.anarana = name
this.fanampiny = lastname
this.taonany = annee
this.fullName = (newYear) => {
return new Dog('Lahatra', "fetra", newYear).calcAge(this.taonany)
}
this.calcAge = (yearNow) => {
... | true |
c3dcfecc0338d5e017490b53c2de1146e2842855 | JavaScript | onesunandtwosun/gitskills | /showanimation.js | UTF-8 | 431 | 2.921875 | 3 | [] | no_license | function showNumberWithAnimation(i, j, randNumber) {
var numberCell = $('#number-cell-' + i + "-" + j);
numberCell.css('background-color', getNumberBackgroundColor( randNumber ));
numberCell.css('color', getNumberColor( randNumber ));
numberCell.text( randNumber );
numberCell.animate({
wi... | true |
54911a68b30a68a8ab7e412560df096a9d975d50 | JavaScript | treejames/GitHub-Trending | /libs/github.js | UTF-8 | 6,427 | 2.53125 | 3 | [
"MIT"
] | permissive | var cheerio = require('cheerio'),
request = require('request'),
async = require('async'),
_ = require('underscore');
function GitHubClient(token) {
if (!token) throw new Error('You must provide a GitHub token!');
this.token = token;
};
GitHubClient.prototype.getRepository = function(user, ... | true |
b217b2366a66565551577cae0f70a0304275b8fb | JavaScript | Murilo-Sanches/js-array-performance | /src/benchmarks.js | UTF-8 | 2,564 | 3.09375 | 3 | [
"MIT"
] | permissive | const Benchmark = require("benchmark");
function buildForEachSuite(array) {
return new Benchmark.Suite("forEach")
.add("Array.forEach", function () {
array.forEach((x) => {
x.r = x.a + x.b;
});
})
.add("for of", function () {
for (const obj of array) {
obj.r = obj.a + ob... | true |