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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ba4716dd76050ae8a0cf44ff19a54cf6a3b11b50 | JavaScript | ashkiani/WebAPIsHomework-CodeQuiz | /assets/scripts/scores.js | UTF-8 | 3,060 | 3.109375 | 3 | [] | no_license | var containerEl = document.querySelector(".container");
var btnEl = document.querySelector("#btn");
var colClass = "col-md-4 text-center border bg-light";
function compare(a, b) {
var result;
console.log("comparing:" + a.score + "," + b.score);
if (a.score > b.score) {
result = 1;
}
else if... | true |
ca070106aa0ee8e951e8907e8f873c63e445b39b | JavaScript | CaoPengflying/expressDemo | /DAO/SeatDAO.js | UTF-8 | 2,037 | 2.515625 | 3 | [] | no_license | var Pool = require('./../util/mysqlUtil');
var pool = Pool.Pool;
/*
* 座位表的增删改查
* */
function SeatDAO(){
this.getSeatType = function(id, callback){
var sql = "select status from seat where id="+id;
pool.getConnection(function (err, connection) {
if(err){
console.log("连接失... | true |
2f059b3ab4f3306227d86bd0568ff387fabfdb65 | JavaScript | jatinchander/Personal-Website | /app.js | UTF-8 | 694 | 2.625 | 3 | [] | no_license | // Require packages/frameworks
const express = require("express");
const fs = require("fs");
const app = express();
// Configure
app.use(express.static(__dirname + "/public"));
app.set("view engine", "ejs");
// Routes
app.get("/", function(req, res){
res.render("index");
});
app.get("/resume", function(req, r... | true |
3ee6f2f8322c7f2720f515bb86e6313d266c77d7 | JavaScript | novakiss/Login_Site_With_ReactRedux_And_Foundation | /src/app/reducers/registerUserReducer.js | UTF-8 | 550 | 2.515625 | 3 | [] | no_license | import {REGISTER} from '../constant'
const initialState = {
user: {},
allUserId: [],
};
const registerUser = (state = initialState, action) => {
switch (action.type) {
case REGISTER:
const {username, password, id} = action.payload;
return {
...state,
... | true |
0f7e7bb124cb4271a4e324801a1136256cbf24b7 | JavaScript | Si3ver/algorithm024 | /Week_07/037solveSudoku.js | UTF-8 | 2,260 | 3.78125 | 4 | [] | no_license | /**
* https://leetcode-cn.com/problems/sudoku-solver/
* 37. 解数独 | hard
*/
// set 交集
function intersection(set1, set2) {
return new Set([...set1].filter(x => set2.has(x)))
}
function solveSudoku(A) {
const init = (n) =>
Array(n).fill(0)
.map(
_ =>
new Set(
Array(n).fill... | true |
e70929eebc6f1efc37419d669b07cdbc69c652e0 | JavaScript | Adelinestack/exercise-javascript--array-basics | /arrayBasics.js | UTF-8 | 1,363 | 3.78125 | 4 | [] | no_license | // Créez un tableau de chaussures nommé shoesList
// Initialisez cette liste de chaussures avec 5 noms de marques qui vous plaisent.
const shoesList = ['Vans', 'Minelli', 'Jonak', 'Nike', 'Adidas'];
// Ajoutez une marque au début de la liste
const newShoesList = shoesList.unshift('Doc Martens');
// Affichez la liste et... | true |
8ab8c4bb97a17551d1e20e8fe620310c513408ec | JavaScript | biblesoapopera/client | /src/screen/audio/audio.js | UTF-8 | 5,990 | 2.5625 | 3 | [] | no_license | $.screen.audio = function(config){
$.screen.slide.call(this, config);
this.content.querySelector('.text').innerHTML = config.text;
this.player = $.player(config.id);
this.action = this.content.querySelector('.btn');
this.action.addEventListener('click', this);
this.track = this.content.querySelector('.tr... | true |
0b60bea4f9037253873a0c64bcecd10463f8c89e | JavaScript | better-automation/iga-open-database-migration | /get-enum.js | UTF-8 | 4,219 | 2.53125 | 3 | [] | no_license | require('./polyfills');
const getValuesFromPropertyMap = require('./get-values-from-property-map');
const inputFilePath = "./data/IGA-2016-v3.json";
const root = require(inputFilePath);
function getEnum(propertyMaps) {
const enumValues = [];
propertyMaps.forEach(propertyMap => {
const values = getVa... | true |
ba4ae0045fd537becaf1ea64a850c982e80ebe16 | JavaScript | maxgherman/notes-source | /producer-consumer-file-processing/producer-consumer.js | UTF-8 | 990 | 2.6875 | 3 | [] | no_license | const ProducerConsumer = (files, progressEvent) => {
const fileQueue = [];
let stop = false;
const produce = () => {
if(files.length) {
fileQueue.push(files.pop());
}
}
const producer = () => {
const interval = setInterval(() => {
if(files.length <... | true |
ffc04f3649343abd8235f585e15bea64abe6b674 | JavaScript | Bcaskey/Lab_19 | /factories.js | UTF-8 | 1,086 | 2.734375 | 3 | [] | no_license | var factories = angular.module('myApp.factories', []);
factories.factory('ContactFactory', [function() {
var contacts = [
{
name: 'Mickey',
email: 'bigm@disney.com',
phone: '1 (800) BIG-EARS'
},
{
name: 'Donald',
email: 'beakman@dis... | true |
704e2500bf6d4d31bcf9d95d2f59962898b99936 | JavaScript | AlexCanCode/Quick-Stats | /tests/specs/contentjs.specs.js | UTF-8 | 3,146 | 3.09375 | 3 | [] | no_license | describe("Content Script", function() {
describe("cleanArray(arr)", () => {
let pageText;
let ret;
beforeEach(function () {
pageText = document.body.innerText.replace(/[^A-Za-z0-9_-]/g, ' ').toLowerCase().split(" ");
ret = cleanArray(pageText);
})
it("should return an array of strings with no fal... | true |
c183ef4d519d4f2884756ddc6f946aebe61e3cb4 | JavaScript | csus190teamtbd/SeniorProject | /src/util/sampling.js | UTF-8 | 1,883 | 3.34375 | 3 | [] | no_license | ---
---
import translation from "{{base}}../util/translate.js";
export function randomInt(from, to) {
return Math.floor((to - from) * Math.random()) + from;
}
/*
* Returns a new array that contains shuffled elements of the original array.
*/
export function shuffle(arr) {
let clone = arr.concat([]);
function s... | true |
db83a9e9b1f8b30cd9252c2c5358bbfaea7fd42d | JavaScript | bobbi-henderson/Coding_Challenges | /LeetCode/easy/findInsertPostion.js | UTF-8 | 918 | 4.0625 | 4 | [] | no_license | // Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
// You must write an algorithm with O(log n) runtime complexity.
// Example 1:
// Input: nums = [1,3,5,6], target = 5
// Output: 2
// E... | true |
87d62569a5a1206f32c601d599d1a55366880f1e | JavaScript | Alan-love/engine | /src/math/mat4.js | UTF-8 | 38,437 | 2.984375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import { math } from './math.js';
import { Vec2 } from './vec2.js';
import { Vec3 } from './vec3.js';
import { Vec4 } from './vec4.js';
const _halfSize = new Vec2();
const x = new Vec3();
const y = new Vec3();
const z = new Vec3();
const scale = new Vec3();
/**
* @class
* @name Mat4
* @classdesc A 4x4 matrix.
* ... | true |
574fe73119e23d4718cf5bdc4a0bb40fe00ff3ed | JavaScript | Lamista/Technologijos | /parduotuve/src/components/CardComponent.jsx | UTF-8 | 1,664 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { Link } from 'react-router-dom';
import apple from '../images/apple.jpg'
import book from '../images/book.jpg'
import mouse from '../images/mouse.jpg'
import pen from '../images/pen.jpg'
import pencil from '../images/pencil.jpg'
import phone from '../images/phone.jpg'
import defaultIm... | true |
9f8faea2a513be20c6c26637ab25fa7b652819af | JavaScript | Automattic/lazy-load | /js/lazy-load.js | UTF-8 | 1,362 | 2.640625 | 3 | [] | no_license | (function($) {
lazy_load_init();
$( 'body' ).bind( 'post-load', lazy_load_init ); // Work with WP.com infinite scroll
function lazy_load_init() {
$( 'img[data-lazy-src]' ).bind( 'scrollin', { distance: 200 }, function() {
lazy_load_image( this );
});
// Force load images with the class 'exclude-lazy-load'... | true |
103ac08420de1419cfecd31e3a123875959e262e | JavaScript | TarantinoMariachi/BlocksJS | /archive/0.5.12/js/container.js | UTF-8 | 4,973 | 2.59375 | 3 | [
"MIT"
] | permissive | /*
Copyright (c) 2013 William Malone (www.williammalone.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg... | true |
f457b5a34e5eb8afd24a5aee53e85c45736f75af | JavaScript | KolosovAO/dota-pick-tester | /server/login_form.js | UTF-8 | 2,842 | 2.859375 | 3 | [] | no_license | module.exports = (message) => `
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="shortcut icon" href="./static/medvebet.ico" type="image/x-icon">
<title>LOGIN</title>
<style>
form {
width: 400px... | true |
5421b67a0a3cb35efa6954c09d8645e0d2fcb49f | JavaScript | Alonamel84/goit-js-hw-10 | /src/fetchCountries.js | UTF-8 | 589 | 2.921875 | 3 | [] | no_license | // // fetchCountries(name);
const urlRoute = 'https://restcountries.com/v2/name/';
const filterName = '?fields=name,capital,population,flags,languages';
export const fetchCountries = countryName =>
new Promise((res, rej) => {
{
return fetch(urlRoute + countryName + filterName)
.then(response => {
... | true |
c655d6aeed0dc41d8bce50b11108acd21c69d757 | JavaScript | atanasna/borchee-web | /js/components/tools/Search.js | UTF-8 | 8,158 | 2.625 | 3 | [] | no_license | class Search extends BasicTool {
constructor(button_id,button_class,placeholder,icon_url){
super(button_id,button_class,placeholder,icon_url)
//this.button = this.addHTMLSearchButton("right-nav-search-tool","right-nav-button")
this.attachSearchButtonListener()
this.generateS... | true |
4138817d9caad12bcdf8f0f97384304cfd8d3ec2 | JavaScript | codylindley/learnjs | /public/javascripts/edition2/Ch05/FunctionDeclarationExample.js | UTF-8 | 237 | 3.265625 | 3 | [] | no_license | //https://github.com/nzakas/professional-javascript/blob/master/edition2/Ch05/FunctionDeclarationExample.htm
//Function Declaration Example
print(sum(10,10)); //20
function sum(num1, num2){
return num1 + num2;
}
| true |
65be954d16b9764f1874f924a9832520d284f892 | JavaScript | nguyenphucthienan/quote-island-api | /services/categoryService.js | UTF-8 | 2,879 | 2.53125 | 3 | [] | no_license | const mongoose = require('mongoose');
const Category = mongoose.model('Category');
const CategoryConstants = require('../constants/CategoryContants');
exports.getCategories = (pageNumber, pageSize, filterObj, sortObj) => (
Category.aggregate([
{ $match: filterObj },
{
$lookup: {
from: 'quotes',... | true |
cc738073348975e39bc554a8c0e9c82dcd66ff10 | JavaScript | NicolasEden/developpement | /bootstrap/Météo/JS/index.js | UTF-8 | 5,905 | 2.90625 | 3 | [] | no_license | var city = null;
var pays = null;
$.ajax({
url: './City/city.json',
type: 'GET',
dataType: 'json',
async: false,
success : function(data) {
city = data;
}, error : function(req, err) {
alert: ("Request:"+ JSON.stringify(req));
}
});
function changeCity(event) {
if(event.c... | true |
12c26b4e00884f0a5a33e03eca28db9673cf212f | JavaScript | fuinelda/law_watch | /law_watch/static/law_watch/js/common.js | UTF-8 | 887 | 2.59375 | 3 | [] | no_license | window.onload = function(){
var tabs = document.getElementsByClassName('insidetab');
for(i in tabs){
if(tabs[i].style){
tabs[i].style.width = (100 / tabs[i].attributes.value.value - 2) + '%';
}
}
}
function toJson(stringtojson){
return stringtojson.replace(/'/g,'"').replace(/\r\n/g,'\<br \/\>');
}
func... | true |
ad830ff840eaf3bfecc355c00f63ed9ee23ae7f0 | JavaScript | errahulgzb/user-registration | /model/taskModel.js | UTF-8 | 392 | 2.546875 | 3 | [] | no_license | var connection = require('./../config/config');
exports.getAllTask=function(result){
var query="SELECT * FROM tasks";
connection.query(query,function(err,res){
if(err){
console.log("Error :",err);
result(null, err);
}else{
console.log("Res... | true |
5d8a28c7639d41d4996bfed51a6209d1a3dc7dd9 | JavaScript | joni-/adventofcode | /2017/puzzle-06a.js | UTF-8 | 1,517 | 3.078125 | 3 | [] | no_license | const test = require('./test');
const maxIndex = (list) => list.reduce(
(acc, current, index) =>
current > acc.val ? { val: current, index: index } : acc,
{ val: Number.MIN_SAFE_INTEGER, index: -1 }
).index;
const redistributeBlock = (memoryBank, blocks, start) => {
let newBank = [...memoryBank];
for (le... | true |
dcb530ea8d8bf13781f55db41e654161b482a4f3 | JavaScript | Gabriel-Rivas/PEI-tennis-app | /tennis-web/src/components/PartidoTablero/PartidoTablero.js | UTF-8 | 1,806 | 2.53125 | 3 | [] | no_license | import React, { useState } from 'react';
import API from '../../services/API';
import { Table, Button } from 'react-bootstrap';
import { Link } from 'react-router-dom'
const PartidoTablero = props => {
const [partido,setPartido] = useState(props.location.state.partido);
const sumarPunto = async(id, modoJugador) ... | true |
b833cf185057fb92aeeb62126555a3c85e8c3df1 | JavaScript | hafsa906/JavaScript-Problem-Solving-Practice | /topic 3/logical and assignment operators/app.js | UTF-8 | 522 | 3.921875 | 4 | [] | no_license | // a program that takes two variables and prints the sum of it.
function cheak(){
let num1=parseInt(document.getElementById("num1").value)
let num2=parseInt(document.getElementById("num2").value)
let sum=num1+num2;
alert(sum);
}
// a program that uses logical and assignment operators.
let isFullAttendence = true;
l... | true |
b333fe20b73133058b8ae484cbd7ec41edaf0fdf | JavaScript | mrpoussin/udemy-master-electron | /renderer/items.js | UTF-8 | 3,510 | 2.921875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0"
] | permissive | // track items with array
exports.toReadItems = JSON.parse(localStorage.getItem('toReadItems')) || []
// Save items to localstorage
exports.saveItems = () => {
localStorage.setItem('toReadItems', JSON.stringify(this.toReadItems))
}
// toggle selected item
exports.selectItem = event => {
$('.read-item').remove... | true |
03af8112996209f770454e6e34e7baf324eb770f | JavaScript | trevithj/motion-design | /src/middleware.js | UTF-8 | 1,000 | 2.546875 | 3 | [] | no_license | export const ASYNC_START = 'ASYNC_START';
export const ASYNC_END = 'ASYNC_END';
const promiseMiddleware = store => next => action => {
if (isPromise(action.payload)) {
store.dispatch({ type: ASYNC_START, subtype: action.type });
action.payload.then(
res => {
console.log('RESULT', res);
... | true |
b123a3cbb2456a38b16b9cd48f7816ad2c8a6e6e | JavaScript | harryho/esx-ds-algo | /src/sort/bubble-sort.js | UTF-8 | 440 | 3.171875 | 3 | [] | no_license | export const BubbleSort ={
sort: (items)=>{
let swapped = false
let temp = null
do
{
swapped = false
for (let i = 1; i < items.length; i++) {
if (Utils.compare(items[i - 1], items[i]) > 0) {
Utils.swap(items, i-1, i )... | true |
60c919932c9935df73fe2af4439ee20e1bfd4d8e | JavaScript | heshamelmasry77/tweeter-storm-hesh | /js/main.js | UTF-8 | 2,071 | 3.109375 | 3 | [
"MIT"
] | permissive | var button = document.querySelector("#make-readable");
button.addEventListener("click", function () {
//to make the screen go top
scroll(0,0);
var mainTweetSource = document.querySelector("#main-tweet-template").innerText;
var mainTweetTemplate = Handlebars.compile(mainTweetSource);
var subTwe... | true |
cffe647ff7f426efe035d2208302d427c7dd1e47 | JavaScript | stuti371/Apollo_Ecomm | /Backend/app/controllers/product.controller.js | UTF-8 | 2,941 | 2.671875 | 3 | [] | no_license | const Product = require("../models/product.model.js");
exports.create = (req, res) => {
if (!req.body) {
res.status(401).send({
message: "Cannot be empty!"
});
}
const product = new Product({
productprice: req.body.productprice,
productpattern: req.body.productpattern,
... | true |
2ea093bfb99675a9cbd6e1feacf78062265c76ed | JavaScript | Ashish142/Cisco-AdvJs-May-2017 | /03-FP/products.js | UTF-8 | 5,952 | 3.140625 | 3 | [] | no_license | var products = [
{id : 4, name : 'Pen', cost : 5, units : 20, category : 'stationary'},
{id : 8, name : 'Pencil', cost : 20, units : 10, category : 'stationary'},
{id : 2, name : 'Mouse', cost : 100, units : 10, category : 'stationary'},
{id : 5, name : 'Len', cost : 70, units : 30, category : 'grocery'},
{id : 6,... | true |
ecd00f451ababd7483e8b7642a11a247a0e8ff50 | JavaScript | cirocosta/react-samples | /react/src/basicsApp/components/HelloWorld.jsx | UTF-8 | 653 | 3.15625 | 3 | [
"MIT"
] | permissive | /**
* @jsx React.DOM
*/
var React = require('react');
// TODO make this data change (it was being
// rendered with setTimeout)
var HelloWorld = React.createClass({
getInitialState: function () {
return {
currentTime: new Date().toTimeString()
};
},
componentDidMount: function () {
setInterv... | true |
05f9c33d25ad84263ba87a4a2e4197ba11068a03 | JavaScript | aemiers/will-andy-pick-me | /index.js | UTF-8 | 1,806 | 3.546875 | 4 | [] | no_license | // ~~~~~~~~~~~~~~~~~ query selectors ~~~~~~~~~~~~~~~~~~~~~~~~
var userQuestion = document.querySelector(".user-question");
var getYourAnswerButton = document.querySelector(".get-your-answer");
var eightBallImage = document.querySelector(".eight-ball");
var askedQuestion = document.querySelector(".entered-question");
v... | true |
04f2c63c198c5d6c0c076e89f8e27897cb617417 | JavaScript | MukulDhiman03/AnalogClock-using-JS | /clock.js | UTF-8 | 405 | 3.078125 | 3 | [] | no_license | setInterval(() => {
let d = new Date();
let hourTime = d.getHours();
let min = d.getMinutes();
let sec = d.getSeconds();
hrotation = 30 * hourTime + min / 2;
mrotation = 6 * min;
srotation = 6 * sec;
hour.style.transform = `rotate(${hrotation}deg)`;
minute.style.transform = `rotate(... | true |
d12dcb3ac912b308244acc7aced8efaf9cd09ab4 | JavaScript | fernandanardoni/fc-space | /scripts/index.js | UTF-8 | 920 | 2.640625 | 3 | [] | no_license | // deixei aqui nesse arquivo as funções pontuais
const schedulesCollection = document.querySelector('#schedules');
const setSchedules = (data) => {
let html = '';
data.forEach(doc => {
const scheduling = doc.data();
const listItem = `
<li>${scheduling.data}
`;
html += l... | true |
0342a4f73be0e2f565e93d86afa281c18470b250 | JavaScript | 9vdd/c-charts | /src/core/ChartItem.js | UTF-8 | 1,786 | 2.8125 | 3 | [] | no_license | import {
select
} from 'd3-selection';
import {
scaleLinear
} from 'd3-scale';
import {
axisBottom,
axisLeft
} from 'd3-axis';
import {
lineHandler
} from './shapes';
class ChartItem {
constructor(chartConfig) {
this.chartDom = chartConfig.chartDom;
this.x = scaleLinear()
.range([50, chartCon... | true |
32f5f48d9156141a444f5d042355259d3ab9ce6d | JavaScript | Suyash2810/Get-Recipe | /Public/Script/load.js | UTF-8 | 2,377 | 3.359375 | 3 | [
"MIT"
] | permissive | window.onload = function () {
var canvas = document.querySelector('canvas');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
var ctx = canvas.getContext('2d');
var mouse = {
x: undefined,
y: undefined
}
window.addEventListener('mousemove', function (ev... | true |
f1c5173651c43d29373712d7ed50aeabb23250ab | JavaScript | LukNasc/GameEngine | /scripts/game_engine/sound_manager.js | UTF-8 | 538 | 2.640625 | 3 | [] | no_license | const soundList = {};
export const SoundManager = {
play(name) {
soundList[name].element.play();
},
load({ name, src }) {
return new Promise((resolve, reject) => {
const audio = new Audio(src);
audio.oncanplaythrough = () => {
soundList[name] = { name... | true |
0ee47587f02d19efe72429cc7ed3054f9f8bf28c | JavaScript | Fawaaz16/RealtimePizzaOrderTrackerApplication | /app/http/controllers/customers/orderController.js | UTF-8 | 1,608 | 2.59375 | 3 | [] | no_license | const Order = require('../../../models/order')
const moment = require('moment')
function orderController () {
return {
store(req, res) {
const { phone, address} = req.body
if(!phone || !address) {
req.flash('error', 'Enter all the fields')
return res... | true |
85e36afa773d3aaf90056be53d9fcf8e19886f27 | JavaScript | tinybull/Functionaljs | /HighOrderFunction.js | UTF-8 | 910 | 2.609375 | 3 | [] | no_license | function hasKeys() {
var KEYS = _.toArray(arguments);
var fun = function (obj) {
return _.every(KEYS, function (key) {
return _.has(obj, k);
});
};
fun.message = cat(['Must have values for keys:'], KEYS).join(' ');
return fun;
}
function checker(/* validators */) {
... | true |
c6b214410b5b804e908188aa70a192bab872e190 | JavaScript | npmcdn-to-unpkg-bot/react-newsreader | /server/app.js | UTF-8 | 3,167 | 2.6875 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const FeedParser = require('feedparser');
const path = require('path');
const htmlparser = require("htmlparser2");
const app = express();
app.set('port', 3000);
app.use('/', express.static(path.join(__d... | true |
64605ee0bd8380e9d612719208b06de4b89ed644 | JavaScript | scott-anderson-wc/cs210pub | /experiments/concentration/solution.js | UTF-8 | 3,153 | 3.734375 | 4 | [] | no_license | //global variables: number of tries and matches are 0 initially, click = 1 to
//indicate the first element in a pair of clicks will start the game,
//firstelt is defined so that it can be used to save the id of the first
//element clicked in a pair of clicks
var tries = 0;
var matches = 0;
var click = 1;
var firstelt;... | true |
6786bca5047f0c6fbe39fed8c9b6ca55956a0444 | JavaScript | Ritzing/Algorithms-2 | /Kadane's/JavaScript/kedane.js | UTF-8 | 526 | 4.03125 | 4 | [
"Apache-2.0"
] | permissive | /**
* Calculates the largest sum of contiguous subarray within a one-dimensional array
* @param {Array} array - One-dimensional array
* @return {Number} currentMax - The largest sum of contiguous subarrays
*/
function kadane(array){
var currentMax = max = 0;
for (var i = 0; i < array.length; i++) {
max ... | true |
d02c04a60e7389d1838ca98a7a37754a7ac2a2d9 | JavaScript | cmastel/decisions | /routes/users.js | UTF-8 | 2,891 | 2.703125 | 3 | [] | no_license | /*
* All routes for Users are defined here
* Since this file is loaded in server.js into api/users,
* these routes are mounted onto /users
* See: https://expressjs.com/en/guide/using-middleware.html#middleware.router
*/
const express = require('express');
const router = express.Router();
const bcrypt = require(... | true |
30f7dcf8d2dda364f43ed44d52884b35fa8dc170 | JavaScript | jymfony/jymfony | /src/Bundle/SecurityBundle/src/Command/UserPasswordEncoderCommand.js | UTF-8 | 7,435 | 2.609375 | 3 | [
"MIT"
] | permissive | import { EOL } from 'os';
import crypto from 'crypto';
import { promisify } from 'util';
const AsCommand = Jymfony.Component.Console.Annotation.AsCommand;
const Command = Jymfony.Component.Console.Command.Command;
const InputArgument = Jymfony.Component.Console.Input.InputArgument;
const InputOption = Jymfony.Componen... | true |
697be940648f821739cf7ada68aa2738630ba072 | JavaScript | dan-j-gibson/Shopping-List | /index.js | UTF-8 | 2,576 | 3.1875 | 3 | [] | no_license |
// function adds a new item to the list
$(function() {
$('#js-shopping-list-form').submit(event => {
event.preventDefault();
const userTextElement = $(event.currentTarget).find('#shopping-list-entry');
$('ul').append(`<li>
<span class="shopping-item">${userTextElement.val()}</span... | true |
20a78704545491c810efd6fd73bab6160125aea7 | JavaScript | Morrism1/todoList | /src/test/addtodo.test.js | UTF-8 | 464 | 2.609375 | 3 | [] | no_license | import AddTask from '../addtodo';
const newTask = new AddTask('Read', 'reading', '24/3/2021', 'high');
test('if title is correct', () => {
expect(newTask.title).toBe('Read');
});
test('if description is set correctly', () => {
expect(newTask.description).toBe('reading');
});
test('if date is set correctly', () =... | true |
e0a8dcd8c61d134f1c72855f2342c5a1e03fad8e | JavaScript | shuiqin/node | /util/inherits.js | UTF-8 | 296 | 3 | 3 | [] | no_license | /**
* Created by shuiqin on 9/26/17.
*/
var util = require('util');
function Vehicle() {
}
Vehicle.prototype = {
accerelate: function () {
console.log('accerelate');
}
}
function Bike() {
}
util.inherits(Bike, Vehicle); //child , parent
var bike = new Bike();
bike.accerelate(); | true |
1220cc3857df3beee43fa8c6d77e0e67c56e2634 | JavaScript | jozsefmorrissey/node-server | /public/js/utils/services/no-activity-runner.js | UTF-8 | 503 | 2.734375 | 3 | [] | no_license |
class NoActivityRunner {
constructor(timelapse, noActivityFunc) {
let pending = false;
let callCount = 0;
const secondCallback = (callId) => () => {
if (callId === callCount) noActivityFunc();
}
const firstCallback = () => {
pending = false;
setTimeout(secondCallback(callCount)... | true |
093d8ca3feb9a0bf97bc2855bbc8a65917281c9d | JavaScript | uridanan/D3Test | /steamExampleData.js | UTF-8 | 386 | 2.734375 | 3 | [] | no_license | /**
* Created by Home on 26/07/2015.
*/
function myFormatData(data){
var format = d3.time.format("%m/%d/%y");
data.forEach(function(d) {
d.date = format.parse(d.date);
d.value = +d.value;
});
//data.toString().replace("NO AGE", "NO AGE, NO AGE, NO AGE");
var nest = d3.nest().ke... | true |
68b4ca427d420aa872652abfd8a58858c3a094eb | JavaScript | overusdev/es | /src/js/modules/es6/consts.js | UTF-8 | 643 | 3.015625 | 3 | [] | no_license | 'use strict';
export const constModule = () => {
const settings = {
a: 10,
b: 15,
c: 20
};
settings.a = 11; // теперь a === 11
// settings = { a: 11 }; // Uncaught TypeError: Assignment to constant variable
/* eslint-disable-next-line */
console.log(settings);
};
/*
... | true |
a90d857138db192353542b89673d47ed456cdd11 | JavaScript | louiswilbrink/pancakes-recipe | /utils/i18n.js | UTF-8 | 3,495 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* Author: Jeff Whelpley
* Date: 3/19/14
*
* This utility handles all translations
*/
module.exports = function (_, translations, context, config) {
// @module({ "client": true })
var untranslated = {};
var lastdumpTimestamp = (new Date()).getTime();
var i18nVarExpr = /(?:\{\{\s*)([^\{\}]*)(?:\... | true |
6540754d269b30c6f2eeefc49c82f6bd228a432d | JavaScript | austintheriot/algorithms-and-data-structures | /src/Algorithms/Numbers & Math/euclideanLCM (Two Digits)/lcm.test.js | UTF-8 | 216 | 2.59375 | 3 | [] | no_license | import lcm from './lcm';
it('Should return the LCM of two nubmers', () => {
expect(lcm(2, 3)).toBe(6);
expect(lcm(17, 13)).toBe(221);
expect(lcm(24, 32)).toBe(96);
expect(lcm(12345, 54321)).toBe(223530915);
});
| true |
192bd6c44d3c73d5a620c3708069a7ae3b79a24d | JavaScript | ceres-pallas/function-approximator | /test/function-approximatorTest.js | UTF-8 | 8,246 | 2.921875 | 3 | [
"MIT"
] | permissive | var expect = require('chai').expect;
var $ = require('../index');
var FunctionApproximator = $.FunctionApproximator;
var ValueFunction = $.ValueFunction;
describe('Function Approximator', function() {
it('should exist', function() {
expect(FunctionApproximator).to.exist;
});
it('should be instanti... | true |
19840c5d5d9642851c30959cd517cc1202daf004 | JavaScript | thorsteinsson/node-harvest | /lib/api/reports.js | UTF-8 | 1,688 | 2.5625 | 3 | [
"MIT"
] | permissive | 'use strict';
const helpers = require('../helpers');
/**
* [Reports description]
* @param {[type]} harvest [description]
*/
function Reports(harvest) {
this.harvest = harvest;
this.harvest.request = harvest.request;
}
Reports.prototype.timeEntriesByProject = function(id, options, cb) {
if (!helpers.has(opti... | true |
a95530c35bd5f6cbf7176ecb8d0f5cb619bf3842 | JavaScript | Gre3nLioN/iot-gdd | /server/models/in-memory-plant.js | UTF-8 | 1,926 | 2.875 | 3 | [] | no_license | /* GET home page. */
module.exports = {
plants:[],
getById: function(id){
for (var i = 0; i < this.plants.length; i++) {
if (this.plants[i].id === id){
return this.plants[i];
}
};
return false;
},
get: function(id, callback, error){
var plant = this.getById(id);
if (!plant){
error(id + ' was... | true |
f28f5639a86a7863677c201098abd51c4c12296e | JavaScript | ervinjames/sqta-villegas-act2 | /15loop.js | UTF-8 | 416 | 2.65625 | 3 | [] | no_license | function loadUsers(userIds, load, done) {
var users = [];
var completed = 0;
userIds.forEach(function (id, index) {
load(id, function (user) { // load will be invoked with user perimeter
users[index] = user; // putting user to the correct position
if (++completed >= userIds.length) {
retu... | true |
60139548f13cd822fa2f5bfa78d2af487d0a74fc | JavaScript | upcs/cs-341-project-sq19-india | /public/javascripts/functions.js | UTF-8 | 3,138 | 3.421875 | 3 | [] | no_license | /*functions.js
Author: Huy Nguyen
Version: 2/12/2019
*/
/*
function: buttonPressed
check to see if coordinate inputs are correct
*/
function checkCoor(firstNum, secondNum) {
console.log('checkong coor');
//Check to see if any of the box is empty, return false if it is
if(firstNum === "" || secondNum === "")... | true |
3f670d4b391f1eaa66930a6d55fb3605861c8856 | JavaScript | aaronbuchanan/flashquiz | /public/app.js | UTF-8 | 2,912 | 2.546875 | 3 | [
"MIT"
] | permissive | var TOTAL_ATTEMPTS = 3;
var app = angular.module('quizApp', ['ngRoute']);
app.config(['$routeProvider', function ($router) {
$router.when('/', {
controller: "EditCtrl",
templateUrl: "/edit"
}).when('/quiz', {
controller: "QuizCtrl",
templateUrl: "/quiz"
}).when('/results', {
controller: "Res... | true |
3febd112887b2b240302057aeaa190d31f7e3ce0 | JavaScript | tnorth93/00-code-wars | /highest-scoring-word/solution.js | UTF-8 | 397 | 3.265625 | 3 | [] | no_license | function high(x){
let scoreArr = [];
let myArr = x.split(' ');
for (let i = 0; i < myArr.length; i++) {
let indiScore = 0;
for (let b = 0; b < myArr[i].length; b++) {
indiScore += (myArr[i].charCodeAt(b) - 96);
}
scoreArr.push(indiScore);
}
let highScore = Math.max(...scoreArr);
let hi... | true |
8568ffe40504d3cc0208b851bdf3dca05d971a6c | JavaScript | ranman/edda | /edda/ui/display/js/arrows.js | UTF-8 | 2,851 | 3.09375 | 3 | [] | no_license | // Copyright 2009-2012 10gen, Inc.
//
// 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... | true |
46bb2fa6e08fe3a26456d1d225b8c67c5e878ca2 | JavaScript | BraianAquije/Examen-Ingreso-Julio-2021 | /2021_DIV_E_TN_Fuentes/uno.js | UTF-8 | 4,572 | 3.359375 | 3 | [] | no_license | /*
Debemos realizar la carga de 5(cinco) participantes de una competencia de Enduro
de cada uno se deben cargar los siguientes datos:
-el nombre del participante,
-la categoría (validar "MX1", "MX2" o "MX3"),
-el tiempo (validar entre 10 y 30),
-la cantidad de vueltas (no puede ser 0 o negativo y no debe superar las 20... | true |
0b4cf232aa9b930996f5e1b95ad6107ed94e0ca8 | JavaScript | entrypointvr/ep-lambda-utils | /lib/router.js | UTF-8 | 1,862 | 2.90625 | 3 | [] | no_license | const UrlPattern = require('url-pattern')
class Router {
constructor() {
this.routes = {
get: [],
post: [],
put: [],
delete: []
}
}
get(route, handler) {
this.routes.get.push({ string: route, pattern: new UrlPattern(route), handler })
}
post(route, handler) {
this.rout... | true |
8c856e491d42a20588523b2e4627f50d453e13f5 | JavaScript | sahilvishnani/javascript-project-one-finding-factor- | /projectrun.js | UTF-8 | 136 | 3.21875 | 3 | [] | no_license | const factors = number => Array
.from(Array(number + 1), (_, i) => i)
.filter(i => number % i === 0)
console.log(factors(100)); | true |
5394621faeba1d0828d02edbe410e58af7552c7b | JavaScript | bdb2381/qpq-frontend | /src/components/RequestCard.js | UTF-8 | 1,611 | 2.53125 | 3 | [] | no_license | import React from "react";
const RequestCard = (props) => {
const requestDetails = props.request;
return (
<div className="card">
<div className="request-card">
Your Service:
<p className="service-name">{requestDetails.requested_service.name}</p>
You Will Receive in Return:{" "}
... | true |
2d1a69dd006064d78214b7a98364adb84f2eb079 | JavaScript | tsandovalr/encriptado_seguridadinf | /encriptado_seguridad/src/server/controller/message.js | UTF-8 | 402 | 2.515625 | 3 | [] | no_license | const rsa = require('../RSA/rsa');
const messageCtrl = {};
messageCtrl.get = async (req, res) => {
res.send('Home get');
console.log('peticion tipo get');
}
messageCtrl.post = async (req, res) => {
const { message } = req.body;
res.send('Home post');
//decrypt
rsa.decryp(message);
... | true |
8fca25d363bdd6d1e23a5cb1c8a6778608610418 | JavaScript | huang-jeff/jeff-bot | /bot.js | UTF-8 | 3,567 | 2.734375 | 3 | [] | no_license | const Commando = require('discord.js-commando');
const { prefix, token, owner } = require('./config.json');
const roleSetupCMD = "<reactrole>";
const rebootCMD = "<reboot>";
const selfAssignRoles = ["Yutzu Farmers", "ABC123", "League of Legends", "Destiny 2", "Warframe", "Fortnite"];
const reactions = ["🍊", "🔤", "😍... | true |
8fa4850c8721cc747f94de144a7621c6f47cfb60 | JavaScript | shigeru-takehara/personal-web-application-sdk | /http-server/SERVER-SCRIPTS/lib/system/Process.js | UTF-8 | 13,954 | 2.515625 | 3 | [
"MIT"
] | permissive | var pwa = pwa || {};
/**
* Manage OS related processing.
*
* @namespace
* @requires JavaType.js
* @requires system/System.js
* @requires system/Command.js
* @requires util/CommandWindow.js
*/
pwa.process = (function () {
var _pub = {}; // public methods holder
/**
* Kill a task by pid. (Win... | true |
1af8522fe6a623ebfb76641ecaa74b1e7c9d5d23 | JavaScript | williammoreschi/semana-react-alura-next-js | /src/components/QuizQuestion/index.js | UTF-8 | 3,292 | 2.609375 | 3 | [] | no_license | import React, { useState } from 'react';
import PropTypes from 'prop-types';
import Widget from '../Widget';
import AlternativesForm from '../AlternativesForm';
import Button from '../Button';
export default function QuizQuestion({
question,
questionIndex,
totalQuestions,
onHandleNextQuestion,
onHandleAddRe... | true |
55245df69647a314a79ab7bcacf99062d6579eb9 | JavaScript | sarasabet/lighthouse-js-fundamentals | /kata15 OrganizingInstructors.js | UTF-8 | 1,087 | 4.25 | 4 | [] | no_license |
// In this exercise, we will be given a list of instructors and we will create a single object to organize them based on their course.
const organizeInstructors = function(instructors) {
let result = {};//variable to stor final objet/eresult
instructors.forEach(element => { // loop through each and every ellement... | true |
268a9f88072159cbbebc742ea6246d325cb61e81 | JavaScript | ffdghs/portfolio | /lab/js/review-carousel/script.js | UTF-8 | 2,336 | 2.609375 | 3 | [] | no_license | let profile1 = document.querySelector('#profile-1');
let profile2 = document.querySelector('#profile-2');
let profile3 = document.querySelector('#profile-3');
let profile4 = document.querySelector('#profile-4');
let profile5 = document.querySelector('#profile-5');
let next = document.querySelectorAll('.next');
... | true |
7598d97244fb9a0e2ee5535a7f881417088c1393 | JavaScript | Lucax64/CursoIngresoJS | /9-Parciales/2018_1Cuatri_Parcial_fuentes/nueve.js | UTF-8 | 3,974 | 4.0625 | 4 | [] | no_license | /*Realizar el algoritmo que permita ingresar la marca del producto, el peso el cual debe ser entre 1 y 100 (validar),
la temperatura de almacenamiento(entre -30 y 30) hasta que el usuario quiera e informar al terminar el ingreso por document.write:
a) La cantidad de temperaturas pares.
b) La marca del producto más pesa... | true |
44554ae9885a9ba9c10d4556da59f46299b3cd19 | JavaScript | tauruskin/goit-js-hw | /practise/proba.js | UTF-8 | 33,321 | 4.1875 | 4 | [] | no_license | // #2
// 1.Создайте массив styles с элементами «Джаз» и «Блюз».
// 2.Добавьте «Рок-н-ролл» в конец.
// 3.Замените значение в середине на «Классика». Ваш код для поиска значения
// в середине должен работать для массивов с любой длиной.
// 4.Удалите первый элемент массива и покажите его.
// 5.Вставьте «Рэп» и «Регги» в... | true |
55eb884eac1e90c10ed3688d13531c3405fc977e | JavaScript | iandersen/shockwave | /shockRipple.js | UTF-8 | 25,798 | 2.53125 | 3 | [] | no_license | var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var grids = [];
var ALL_UNLOCKED = true;
var TYPES = {
empty: 0,
button: 1,
target: 2
};
var SCREENS = {
menu: 0,
levels: 1,
game: 2
};
var hints = {
1: 'Click the square to create a ShockRipple',
2: ... | true |
82687a062227b63410855770a54d1766d5da51af | JavaScript | iamzapata/picolors | /Components/Canvas/index.jsx | UTF-8 | 2,405 | 2.953125 | 3 | [] | no_license | import React, { useEffect, useRef } from "react"
import { number } from "prop-types"
import piDecimals from "utils/piMillionDecimals"
const Canvas = ({ colorMap, width, height }) => {
const canvasRef = useRef()
const drawScreen = () => {
const dpr = window.devicePixelRatio
const canvas = canvasRef.curren... | true |
fa82c91ee2fa52e504ebacb484b6ebfd2eec1bb5 | JavaScript | future4code/Melissa-Tammy | /semana3/blackjack/nossoJogo.js | UTF-8 | 1,520 | 3.578125 | 4 | [] | no_license | /*
let cartausuario = []
let cartacpu = []
let pontosusuario = []
let pontoscpu = []
let totalusuario = 0;
let totalcpu = 0;
console.log("Bem vindo ao jogo de Blackjack!")
if(confirm("Quer iniciar uma nova rodada?")) {
let carta = comprarCarta();
cartausuario.push(carta.texto)
pontosusuario.push(carta.valor)
... | true |
5ccc6abc62f02a160637c4088fa9b15cf0e8f049 | JavaScript | emanuelcastro96/weather-forecast-app | /src/helpers/getWeatherInfo.js | UTF-8 | 1,519 | 2.921875 | 3 | [] | no_license | import { getDate, getTime } from "./getDateTimeFormat";
export const getWeatherInfo = async ({ lat = '51.509865', lon = '-0.118092' }) => {
const apiKey = process.env.REACT_APP_WEATHER_API_KEY;
const url = `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&appid=${apiKey}&units=metric`;
... | true |
8e19b1e44cf9e9c51902a80b22b525c7c4107dad | JavaScript | joha0033/medtronics | /server.js | UTF-8 | 417 | 2.59375 | 3 | [] | no_license | var express = require('express');
var path = require('path');
var app = express();
var port = process.env.PORT || 3000;
// Serve up static files
app.use(express.static(__dirname + '/web'));
// Serve up routes
// app.get('*', function (req, res) {
// res.sendFile(path.join(__dirname + '/web/index.html'));
// });
// ... | true |
efd18f0b72f04dfcdf796a3a46142741922d2337 | JavaScript | Nana4774/portfolio | /js/main.js | UTF-8 | 5,136 | 3.140625 | 3 | [] | no_license | 'use strict';
{
const start = document.getElementById('start');
const card = document.getElementById('card');
const count = document.getElementById('count');
const right = document.getElementById('right');
const explantaion = document.getElementById('explanation');
const answer = document.getElementById('a... | true |
a1397a0e6b878390ec4a8dfa9c7f00cb25b97b71 | JavaScript | tylerjoh/ITM_352_F20_repo | /Lab11/Ex5.js | UTF-8 | 1,758 | 4.125 | 4 | [] | no_license | var values = ["2", "-3", "asdf", "-3.1456", "5"];
function isNonNegInt(stringToCheck, returnErrors = false) {
errors = []; // assume no errors at first
if (Number(stringToCheck) != stringToCheck) errors.push('Not a number!'); // Check if string is a number value
if (stringToCheck < 0) errors.push('Negative... | true |
1bc08a605d7d3bf9789b980082dbaa7bb42d5247 | JavaScript | carloscampo96/agendapp | /src/store/tasks/taskReducer.js | UTF-8 | 783 | 2.59375 | 3 | [] | no_license | import {
FETCH_TASKS_FAILURE,
FETCH_TASKS_SUCESS,
FETCH_TASKS_REQUEST
} from './taskTypes'
const initialState = {
loading: false,
tasks: [],
error: ''
};
const reducer = (state = initialState, action) => {
switch(action.type) {
case FETCH_TASKS_REQUEST:
return {
... | true |
799190fd454f72ac040b3b792fefd9adca573e5f | JavaScript | jpagnan0/trivia_smack | /trivia_smack/src/App.js | UTF-8 | 5,151 | 3.078125 | 3 | [] | no_license | let counter = 0
class App {
constructor() {
this.adapter = new Adapter();
this.handleCategoryClick = this.handleCategoryClick.bind(this);
this.handleClueSubmit = this.handleClueSubmit.bind(this);
this.handleSignIn = this.handleSignIn.bind(this);
this.createUsers = this.createUsers.bind(this);
... | true |
d673c71d533bc76f404a288e874e8be0f15eda6c | JavaScript | vinayp15/my-calculator | /index.js | UTF-8 | 706 | 3.546875 | 4 | [] | no_license |
insert = (val) => {
let ansVal = document.getElementsByClassName('answer')[0].value;
if(val) {
ansVal = ansVal + val;
}
document.getElementsByClassName('answer')[0].value = ansVal;
}
calculate = () => {
let ansVal = document.getElementsByClassName('answer')[0].value;
if(ansVal) {
... | true |
d010a63cb649eb68ef326bb13951c0f2d4f81022 | JavaScript | joangavelan/building-react-projects | /src/Get-Random-Number.js | UTF-8 | 1,845 | 3.140625 | 3 | [] | no_license | import React from 'react'
class RanNumber extends React.Component {
constructor(props) {
super(props);
this.state = {
ranNum: 0,
min: '',
max: ''
}
//binding
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
this.getRando... | true |
93670d23f4c07a499a8af943c381ba43a31b31a2 | JavaScript | Pr0sper0/pagination_bj_app | /src/components/TaskForm.js | UTF-8 | 3,515 | 2.65625 | 3 | [] | no_license | import React from 'react';
export default class TaskForm extends React.Component {
constructor(props) {
super(props);
this.state = {
username: props.task ? props.task.username : '',
text: props.task ? props.task.text : '',
email: props.task ? props.task.email :... | true |
68ac23c2a4e87be361ceaf78f6193e95de82a9fb | JavaScript | devaku/example-stream | /index.js | UTF-8 | 702 | 2.71875 | 3 | [] | no_license | const fs = require('fs');
const ytdl = require('ytdl-core');
const url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
// ytdl('https://www.youtube.com/watch?v=dQw4w9WgXcQ', { filter: format => format.container === 'mp4' }))
// .pipe(fs.createWriteStream('video.mp4'));
ytdl(url, { filter: format => format.contain... | true |
f4400a83ca9d2ff4be2c18add0b4c043da42925a | JavaScript | cafir/alterra-FE | /class/tugas/part-8/part-2/problem-4.js | UTF-8 | 1,508 | 3.171875 | 3 | [] | no_license |
const listBrands = [
{
brand: 'H&M',
processTime: 7000
},
{
brand: 'Zara',
processTime: 4000
},
{
brand: 'Uniqlo',
processTime: 5000
},
{
brand: 'Pedro',
processTime: 9000
},
{
brand: 'The Executive',
processTime: 10000
... | true |
11482c4f17454eca15fd6e094c4268c2d3a4fa07 | JavaScript | sriharilakshmanan/Burger-Builder | /src/store/reducers/burgerBuilder.js | UTF-8 | 2,133 | 2.921875 | 3 | [] | no_license | import * as actionTypes from "../actions/actionTypes";
import { objectAssign } from "../../utils/utility";
const INGREDIENT_PRICE = {
salad: 0.5,
meat: 1.5,
cheese: 0.8,
bacon: 1.2
};
const initialState = {
ingredients: null,
totalPrice: 4,
error: false,
buildingBurger: false
};
const addIngredient = ... | true |
a0a2df6c9323aa0c0970ed5d3e748dd8b4119ad6 | JavaScript | tintheturtle/acebook | /routes/api/users.js | UTF-8 | 9,938 | 2.65625 | 3 | [] | no_license | import express from 'express'
import bcrypt from 'bcryptjs'
import jwt from 'jsonwebtoken'
import validateRegisterInput from '../../utils/validation/register'
import validateLoginInput from '../../utils/validation/login'
import stringComparison from '../../utils/comparisons/StringSimilarity'
import User from '../../... | true |
ff15e55ad211a913fc3dcac07d99af23b25e7dad | JavaScript | ducklord/limejs | /lime/src/animation/spawn.js | UTF-8 | 2,051 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | goog.provide('lime.animation.Spawn');
goog.require('lime.animation.Animation');
goog.require('lime.animation.Delay');
goog.require('lime.animation.Sequence');
/**
* Animations that are run parallel with each other.
* Also accepts more than two animations
* @param {...(lime.animation.Animation|!Array.<lime.animatio... | true |
3204a1353bf6c797383cb24d4945c67ff1a5d90e | JavaScript | Yanpix/react-preview-code | /src/services/fakedata-service.js | UTF-8 | 807 | 3.03125 | 3 | [] | no_license | // use fakeJSON API - https://github.com/typicode/jsonplaceholder
class FakeDataService {
_baseUrl = "https://jsonplaceholder.typicode.com";
getData = async url => {
const res = await fetch(`${this._baseUrl}${url}`);
if (!res.ok) {
throw new Error(res.status);
}
return await res.json();
};... | true |
ecb2f3b4713cca32d1f960045e6f1360114c1b98 | JavaScript | jbfm21/kanbravo | /backend/main/db/plugins/mongoose-validators.js | UTF-8 | 1,717 | 2.625 | 3 | [
"MIT"
] | permissive | 'use strict';
var validator = require('validator');
function createValidator(callback, options)
{
var message = options.message ? options.message : undefined; //eslint-disable-line
return {
validator: callback,
msg: message
};
}
function validatorHandler(method)
{
return ... | true |
61fecc8098d0bc94f119b3627d4badbc88c67067 | JavaScript | SharadJangid/Inventory | /Inventory/Inventory/Scripts/Product.js | UTF-8 | 4,251 | 2.9375 | 3 | [] | no_license | //Load Data in Table when documents is ready
$(document).ready(function () {
loadData();
clearData();
});
//Load Data function
function loadData() {
//create a data object for by default getting active record
var empObj = {
tb_pro_status: 1
};
$.ajax({
url: "api/apiproduct/getpr... | true |
062d7e4a4294d627043b707f4758a1d4451cb1bb | JavaScript | YuanjunS/daxcontrol | /public/javascripts/remote_scripts.js | UTF-8 | 1,038 | 2.59375 | 3 | [] | no_license | /**
* Created by User on 14.02.2017.
*/
var socket = io();
/*$(document).on('click', function(event){
socket.emit('welcome', {message:'welcome',id: event.target});
});*/
$(document).off('click','#pie_reset').on('click','#pie_reset',function(e){
console.log('click');
socket.emit('pie_reset1',{message:'pi... | true |
f6c6759bcd046b1ce0464348969b9a8d505d6a6a | JavaScript | CaliZam/skylab-bootcamp-202004 | /stuff/web-components/main.1.js | UTF-8 | 882 | 3.265625 | 3 | [] | no_license | function Register() {
return `<section class="register">
<h1>Register</h1>
<form>
<input type="text" name="name" placeholder="name">
<input type="text" name="surname" placeholder="surname">
<input type="email" name="email" placeholder="e-mail">
<input type="password" name="pa... | true |
8b7c2c9efc0d6561936964e3d582e252e7dcc7d9 | JavaScript | Lemon-Cannon/Xilef | /src/buttons.js | UTF-8 | 6,698 | 2.78125 | 3 | [] | no_license | const { MessageButton, MessageActionRow, MessageMenuOption, MessageMenu } = require("discord-buttons");
const { RequiredArg, Command } = require("./commands.js")
class Poll {
constructor(message, options, title, time) {
this.message = message
this.options = options
this.users = {}
t... | true |
f218ffbed86d83addc38da6f95ea249e9e0fd127 | JavaScript | dsomel21/CtCI-6th-Edition-JavaScript | /chapter01/1.1 - Is Unique/index.js | UTF-8 | 2,075 | 3.578125 | 4 | [] | no_license | const { test, assert } = require('../../test/TestHelper');
// Write your code here...
function isUnique(str) {
if (str.length < 2) return true;
const sortedCharCodes = mergesort(getCharCodes(str));
console.log('getCharCodes(str)', getCharCodes(str));
console.log('sortedCharCodes', sortedCharCodes);
for (let ... | true |