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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4b2d5b4a16de62b80c9380ad46c574199e4565f1 | JavaScript | lojjic/ScriptSheets | /ImageShadow.js | UTF-8 | 2,935 | 2.640625 | 3 | [] | no_license | /*
** ImageShadow script by Jason Johnston (jj@lojjic.net)
** Created August 2003. Use freely, but give me credit.
**
** This script adds a configurable, alpha-transparent
** drop shadow to an image. For usage and details see
** ImageShadow-doc.html.
*/
/*
TODO:
* Make bottom-right positioned image's shadow mo... | true |
dcda2221ecd2b72bff1ca5d1ec63400fda659bac | JavaScript | AnkitaKhurana/Employee_portal_node | /app/controllers/job.js | UTF-8 | 2,550 | 2.546875 | 3 | [] | no_license | const { logger } = require('../middlewares/logging');
const jobService = require('../services/job');
const functions = {
getJobs: async (req, res) => {
let jobs = await jobService.findAllJobs();
if (jobs)
res.status(200).send(jobs);
else
res.status(404).send('No jobs... | true |
09fe70e7b53fbe83a4a59364050e76ec6e5508c2 | JavaScript | kiransterling/language_translation_1 | /app_no_module.js | UTF-8 | 943 | 2.515625 | 3 | [] | no_license | const http = require('http');
var LanguageTranslatorV3 = require('watson-developer-cloud/language-translator/v3');
var languageTranslator = new LanguageTranslatorV3({version: '2018-05-01', iam_apikey: 'lkbssbEumwyAnPMtOhBDiIZCkk0si2LKKwOpEunemOA9', url: 'https://gateway-syd.watsonplatform.net/language-translator/api'})... | true |
ae0240953be13337e25684b25ca8ba914d4acd99 | JavaScript | akaorignal/giphy | /assets/javascript/app.js | UTF-8 | 2,226 | 3.015625 | 3 | [] | no_license | $( document ).ready(function() {
var gifs = ["Ciara", "2 Chainz", "Lil Boosie", "Curren$y", "Andre 3000"];
function buttons() {
$("#button").html("<div></div>");
$.each(gifs, function(index, topic) {
var btn = $("<button>");
btn.append(topic);
btn.addClass("gif-click");
btn.attr("gif-name", topi... | true |
bf2c00c4c24e4c855310a54057e8def766259289 | JavaScript | d-ost/eth-berlin-lswap | /src/components/RecoverWallet/index.js | UTF-8 | 4,497 | 2.59375 | 3 | [] | no_license | import React, {Component} from 'react';
import PinInput from "react-pin-input";
class RecoverWallet extends Component {
constructor(props) {
super(props);
this.state = {
username : null,
pin: '',
confrimPin : '',
publicAddress: null,
usernameError: false ,
... | true |
47fb2793ec0d7fbc670b9100640633841a94fff6 | JavaScript | tehviking/sprinkler | /app/assets/javascripts/components/fs-gif-url-input.js | UTF-8 | 769 | 2.640625 | 3 | [] | no_license | App.FsGifUrlInputComponent = Ember.Component.extend({
layoutName: "components/fs-gif-url-input",
gifUrl: null,
urlIsValid: function(){
if(!!this.get("gifUrl")) {
return this.get("gifUrl").match(/^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/);
}
}.property("gifUrl"... | true |
87a193eb04f125932a0edc4bb52ec680694fc32a | JavaScript | devantonio/node-2-todo-api | /server/server.js | UTF-8 | 7,625 | 2.8125 | 3 | [] | no_license |
//this file is only responsable for our routes
require('./config/config')
const _ = require('lodash');
const express = require('express');
const bodyParser = require('body-parser');
const {ObjectID} = require('mongodb');
var {mongoose} = require('./db/mongoose');
var {Todo} = require('./models/todo');
var {User} = ... | true |
60097421104ccca32e76f81d50da403250a67980 | JavaScript | sohyunpark95/aa6279 | /sketch.js | UTF-8 | 610 | 3 | 3 | [] | no_license | let canvas;
let canvasWidth = 600;
let canvasHeight = 400;
let squid;
let x, y;
function setup() {
background(0,0,0);
canvas = createCanvas(canvasWidth, canvasHeight);
canvas.position(windowWidth/2 - canvasWidth/2, 20);
x = 280;
y = 0;
// noCursor();
// resetGame();
}
function draw() {
// rect(mouseX, m... | true |
26d9e2bdb7bb610e5d3e443d78e9a95ba6390ae6 | JavaScript | larissolb/jsTasks | /pixi-game/catch_cat.js | UTF-8 | 5,874 | 3.03125 | 3 | [] | no_license | //import * as PIXI from 'pixi.js'
'use strict';
let width = window.innerWidth; //ширина экрана
let height = window.innerHeight; // высота экрана
let field; //поле для игры
let cat;
let gravity = 2; //чтобы коты двигались вниз
let catAmount = 0; //счетчик созданных котов
let cats = []; //массив хранящий котов
let count... | true |
5b506125f03c1754e849d4081e44a11f0ab6f4e2 | JavaScript | josiahaubin/js-tests-basics | /app/strings.js | UTF-8 | 954 | 4.9375 | 5 | [] | no_license | // Write a function that returns the character from a string at a given position
function letterAtPosition(str, position) {
let string = str;
let index = position;
let character = string.charAt(index);
console.log(character);
return character;
}
// Write a function that will join two strings with ... | true |
21d10eb21251b24fdae6b6e49c74bdb182e618a3 | JavaScript | LuskaYu/vscode-chelper | /ideComm.js | UTF-8 | 1,738 | 2.5625 | 3 | [] | no_license |
function openNewDocAndFill(vscode, uri, context) {
var nPos = new vscode.Position(1, 1);
vscode.workspace.openTextDocument(uri).then(doc => {
vscode.window.showTextDocument(doc, 0, true).then (editor =>
editor.edit(function (eb)
{
eb.... | true |
e0ce28fe10483adc94226ff1f42b7b182b17913e | JavaScript | ctghadiri/coding-drills | /03Javascript/11-proj-js-event-listener-2/javascript.js | UTF-8 | 401 | 3.375 | 3 | [] | no_license | var keyHit;
var alphabet= 'abcdefghijklmnopqrstuvwxyz';
var keyHitArray = [];
document.onkeyup = function (input) {
keyHit = input.key.toLowerCase();
if (alphabet.includes(keyHit)){
document.getElementById("document").textContent = keyHit;
keyHitArray.push(keyHit);
document.getElementBy... | true |
bde323abd5d3f38f6e6ce7b9e80e33aa54e0f0c2 | JavaScript | Taumah/webgl | /projet_cantina/js_files/lasers.js | UTF-8 | 962 | 2.78125 | 3 | [] | no_license | import * as THREE from './Dependencies/three.module.js';
export function CreateLasers(){
let origin_light = new THREE.PointLight( 0xff0040, 10, 60 );
let sphere = new THREE.SphereBufferGeometry( 5, 16, 8 );
sphere.castShadow = true;
for(let i = 0 ; i < 5 ; i++){
lasers.push(origin_light.clone());
lasers[i].ad... | true |
383068b46cc9e651b8cc5cef4f8a19611a2c73d0 | JavaScript | ImEkO/Black-Conquest | /Doublon.js | UTF-8 | 579 | 3.546875 | 4 | [] | no_license | /*Filter retourne un nouveau tableau conteant le tableau d'origine sans les
* occurances demander dans la callback via le tableau(a).indexOf
* qui compare la première position d'un élément dans le tableau et sa
* position actuelle. Pour les doublons les positions seront differentes.
*/
function ArrayDoublon(a){
... | true |
70c3201f51ca4b7ef96566b568fa6493b92c2ec9 | JavaScript | fatkulnurk/dht-okecrawl | /test/testBuks.js | UTF-8 | 1,996 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | var utils = require("../utils");
var node = require("../dht_node");
var bukkit = require("../bukkit");
var lineReader = require('line-reader');
var me; // 自我节点
var buks = []; // Kad桶
var bukCount = 0; // Kad桶个数
function init() {
me = node.createNode(utils.genId(), utils.ip2buf('127.0.0.1'), utils.port2buf(23333))... | true |
b44bf4e02ad811ccde81d4aca589ba38d80aa377 | JavaScript | webautotester/wat | /scenario/test/ScenarioTest.js | UTF-8 | 2,787 | 2.515625 | 3 | [
"MIT"
] | permissive | /*Copyright (c) 2017-2018 Xavier Blanc <blancxav@gmail.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, merge... | true |
454b3fd565d32e1e0093849e2c0e9b369ea9d58b | JavaScript | ConstantinHacks/Oregon-Trail | /changePace.js | UTF-8 | 440 | 2.6875 | 3 | [] | no_license | game = JSON.parse(localStorage.getItem('currentGame'));
$(document).ready(function() {
$(document).keypress(function(key) {
if(key.which == 13) {
var userInput = document.getElementById("userInput").value;
game.pace = (Number(userInput))
redirect("status.html", game);
}
});
});
function redire... | true |
7bbe55c9ba97cececc1b1c798f1447341a1a9f32 | JavaScript | emyarod/discorcabot | /src/modules/youtube/youtube.js | UTF-8 | 4,845 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | import keys from '../../cfg/opendoors';
import google from 'googleapis';
import moment from 'moment';
const googleAPIKey = keys.googleAPIKey;
const urlshortener = google.urlshortener('v1');
const youtube = google.youtube('v3');
/**
* getHours() converts number of seconds to hours
* because moment.js cannot convert f... | true |
92ce0f488dae0e3a7b65d792a1b2f61803f9925d | JavaScript | luigivivian/crudNode | /src/controllers/product-controller.js | UTF-8 | 2,545 | 2.671875 | 3 | [] | no_license | 'use strict';
const mongoose = require('mongoose');
const Product = mongoose.model('Product');
const ValidationContract = require('../validators/base-validator');
const repository = require('../repositories/product-repository');
exports.get = async(req, res, next) => {
try {
var data = await repository.ge... | true |
2ea8a1f7bb3dad295d8ab3f59141dbf145f0a848 | JavaScript | mstaniuk/Javascript-RPG | /js/heap.js | UTF-8 | 2,508 | 3.296875 | 3 | [] | no_license | (function() {
"use strict";
function Heap() {
this.heap = new Array(0);
};
Heap.prototype.get = function() {
return this.heap[0];
}
Heap.prototype.getLength = function() {
return this.heap.length;
}
Heap.prototype.isEmpty = function() {
if(this.getLength() <= 0) return true;
retur... | true |
4d7e9a78c1d519cf912920d808239809a68f6e0a | JavaScript | GideonBabu/Data-Structures-and-Algorithms-in-JavaScript | /Algorithms/MergeIntervals.js | UTF-8 | 570 | 3.390625 | 3 | [] | no_license | /**
* @param {number[][]} intervals
* @return {number[][]}
* time O(nlogn) where n is the no. of intervals
* space O(n)
*/
var merge = function(intervals) {
intervals.sort((a, b) => a[0] - b[0]);
let merged = new Array();
for (const interval of intervals) {
if (merged.length === ... | true |
c2bc4933b91b9e9f0cb8da7cee15bede849a7f40 | JavaScript | EshwarAnad/aerinkayne.github.io | /scripts_CSS_ind/seasons/gameClass_p5.js | UTF-8 | 10,562 | 2.671875 | 3 | [] | no_license | class Game{
constructor() {
this.tileSize = 40; //tile size
this.player; //created in setupMap
this.playerSpawnP; //defined in setupMap
this.gameScreen; //created in setupMap
this.levelW; //defined in setupMap
this.levelH;
this.mapTiles = [];
this.onScreenTiles = [];
this.enemy... | true |
1b2b8bb61c12d2223ceb8ef6c60982e982d236bf | JavaScript | WolfieJava/GuideBot | /bot.js | UTF-8 | 543 | 3.109375 | 3 | [] | no_license | const Discord = require('discord.js');
const bot = new Discord.Client();
// All things with Client or client will not work! Must be bot.
bot.on('ready', () => {
console.log(`Logged in as ${bot.user.username}`)
// If name is client.user.username, it will throw an error as client is not defined
});
bot.on('mess... | true |
743c77f8ce849c4bdff05e546313651fa82eab77 | JavaScript | sauevi/vidly | /schemas/customer.js | UTF-8 | 1,219 | 2.59375 | 3 | [] | no_license | const mongoose = require('mongoose');
const Joi = require('joi');
const Customer = mongoose.model(
'customer',
new mongoose.Schema({
name: {
type: String,
required: true,
minlength: 5,
maxlength: 50
},
phone: {
type: String,
required: true,
match: /^\d+$/
}... | true |
ec8b0ed451f6e0bafd1db17cb2597d229b00d6e9 | JavaScript | EnesKorukcu/Nodejs-Basecamp-Api-Wrapper | /utilities.js | UTF-8 | 7,680 | 2.53125 | 3 | [] | no_license |
var https = require('https');
module.exports = function() {
var obc = {
'requests': {
'get_request': function(options, callback) {
var req = https.request(options, function(res) {
var data = '';
var response_object = {
... | true |
7e57e262fb12675bb05ae075e38aec90c7fb4609 | JavaScript | urakey/gulp-my-project | /assets/scripts/components/Validator.js | UTF-8 | 700 | 2.703125 | 3 | [] | no_license | /**
* @class Validator
*/
function Validator() {
};
Validator.prototype = {
isEmpty: function(val) {
return !Boolean(val);
},
isNaturalNumber: function(num) {
return num.toString().match(/^\d+$/) ? true : false ;
},
isEmail: function(num) {
return email.match(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]... | true |
fb4c0665ec6b9290caac9445ac0fe6d02c3540f6 | JavaScript | LiderShino1008/READYY-backend | /routes/archivos-router.js | UTF-8 | 4,040 | 2.53125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
const archivo = require('../models/archivo');
const usuario = require('../models/usuario');
// Guardar un archivo
router.post('/', function(req, res) {
let ar = new archivo(
{
nombre: req.body.ar_txtNombre,
ruta: req.b... | true |
9d861814beb532055f747557c346c83c893f26a1 | JavaScript | shreyas-paranjape/MedicalTravel | /Gmt/public/js/pro.js | UTF-8 | 1,108 | 2.546875 | 3 | [] | no_license | $("#Edit").click(function() {
$("#blank").replaceWith(function() {
return "<input type=\"text\" value=\"" + $(this).html() + "\" />";
});
});
$("#Edits").click(function() {
$("#blanks").replaceWith(function() {
return "<input type=\"text\" value=\"" + $(this).html() + "\" />";
});
});
$("#Editss").click(functi... | true |
8b50749e15b2501753d85187b9d2ef20a5f62584 | JavaScript | Code-Institute-Submissions/tgc07-project04 | /static/js/subscription-select.js | UTF-8 | 692 | 3 | 3 | [] | no_license | const serviceElement1 = document.getElementById('service-1');
const serviceElement2 = document.getElementById('service-2');
const serviceContainer1 = document.getElementById('service-1-container');
const serviceContainer2 = document.getElementById('service-2-container');
serviceContainer1.addEventListener('click', () ... | true |
701f727d86c9c972adff986de3382533730d0ba7 | JavaScript | ajfrierson/React-Todo | /src/App.js | UTF-8 | 5,011 | 3.5 | 4 | [] | no_license | import React from 'react';
import './App.css';
import TodoList from './components/TodoComponents/TodoList'
import TodoForm from './components/TodoComponents/TodoForm';
class App extends React.Component {
constructor() {
super();
this.state = {
todos: [
{
task: 'Give the dog a bath'... | true |
632edd835bbba78849b7b819837f60a2360a752e | JavaScript | nrodr1/tiles-collector-game | /assets/javascript/game.js | UTF-8 | 2,563 | 3.609375 | 4 | [] | no_license | $(document).ready(function(){
var Random=Math.floor(Math.random()*101+19)
// Select a random number at the start of the game
$('#randomNumber').text(Random);
// Appending random number to the randomNumber id in the html doc
var num1= Math.floor(Math.random()*11+1)
var num2= Math.floor(Math.random()*11+1)
... | true |
92ab0a9993f7c91c3a6a54f70d030c930602af58 | JavaScript | egrosclaude/IC | /src/bingame.js | UTF-8 | 5,904 | 2.578125 | 3 | [] | no_license | var svg;
var TABLEAU;
var attrs = {
text: {
fontSize: '7',
fontFamily: 'Helvetica',
textAnchor: 'middle',
dominantBaseline: 'middle',
alignmentBaseline: 'middle',
},
box: {
fill: '#fff',
stroke: '#000',
strokeWidth: '0.5',
},
bkg: {
fill: '#ccf'
},
null: {
fill: '#fff',
stroke: '#fff'... | true |
01d5d600d8b6591e6ab1952cb65fd0bc73dcaa4b | JavaScript | odiesusanto/h8-p0-w3 | /exercise-4builtinfunction.js | UTF-8 | 1,295 | 3.46875 | 3 | [] | no_license | var input = ["0001", "Roman Alamsyah", "Bandar Lampung", "21/05/1989", "Membaca"];
function dataHandling2(array) {
array.splice(1, 2, "Roman Alamsyah Elsharawy", "Provinsi Bandar Lampung");
array.splice(4, 1, "Pria", "SMA Internasional Metro");
console.log(array);
}
(dataHandling2(input));
var tanggal = "21/05/1989"... | true |
70973ffb2114a5a3b4617b79eaf84bfc4dcae780 | JavaScript | thethet/homesweethome | /assets/js/scroll_bar.js | UTF-8 | 373 | 3.0625 | 3 | [
"MIT"
] | permissive | function get_scrollbar(){
// Create the measurement node
var scrollDiv = document.createElement("div");
scrollDiv.className = "scrollbar-measure";
document.body.appendChild(scrollDiv);
// Get the scrollbar width
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
// Delete the DIV
document.bo... | true |
a74b78a1f04dfc1ade3cb8dae71e286e0a63ca01 | JavaScript | DavidMarioLC/WebApplication-Instantanea | /js/modal.js | UTF-8 | 564 | 2.75 | 3 | [] | no_license | import "./modalSearch.js"
const modal = document.querySelector('.modal');
const photos = document.querySelectorAll('.tabs-photos img')
const modalImage = document.querySelector('.modal__image');
function mostrarModal(e){
e.stopPropagation();
modalImage.src = e.target.src;
modal.showModal();
}
function hiddeM... | true |
d155e995e32fe75f0b76a5dd4cc5572393eb105f | JavaScript | imohib168/Bootcamp2020 | /TDD/tdd-tutorial-yt/src/App.js | UTF-8 | 448 | 2.625 | 3 | [] | no_license | import React, { useState } from 'react';
const App = () => {
const [counter, setCounter] = useState(0);
return (
<div>
<h1>Counter App</h1>
<div id="counter-value">{counter}</div>
<button onClick={() => setCounter(counter + 1)} id="increment-button">Increment</button>
<button disabled={... | true |
4bfac5d01a02ae831ed40006f2765e4976f4639b | JavaScript | leomchan/code2014 | /js/add-geopoint-to-country-info.js | UTF-8 | 1,221 | 2.53125 | 3 | [] | no_license | var setup = require('./setup.js');
var config = setup.setup();
var Parse = config.Parse;
var tilde = require('tilde-expansion');
var fs = require('fs');
var csv = require('csv');
var csvPath = process.argv[2];
tilde(csvPath, function (s) {
csvPath = s;
});
csv()
.from.stream(fs.createReadStream(csvPath))
.to.array(... | true |
99172039c2041e9751fb134f537a790a055e0642 | JavaScript | samuel-bowles/hotel-website | /js/hotel.js | UTF-8 | 2,486 | 3.015625 | 3 | [] | no_license | // Create a new hotel and input data
class Hotel {
constructor(hotelInfo) {
this.name = hotelInfo.name;
this.location = hotelInfo.location;
this.numRooms = hotelInfo.numRooms;
this.price = hotelInfo.price;
this.amenities = hotelInfo.amenities;
this.tel = hotelInfo.te... | true |
c6d1d714350d0c0bbb630cfc02d874dd6135181a | JavaScript | florianporada/moovel_testme | /client/app/helper/index.js | UTF-8 | 879 | 2.640625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import dateformat from 'dateformat';
import numberAbbreviate from 'number-abbreviate'
import { Alert } from 'react-native';
const Helper = {
// format date to 'yyyy-mm-dd'
formatDate: function(date) {
return dateformat(date, 'yyyy-mm-dd');
},
// format number to make it shorter 1000 >> 1k
formatNumber: ... | true |
81187dc62f2adfbedbcab51539784da07fb62967 | JavaScript | terapro/rs-school-2018-q1-tasks | /task-12/src/index.js | UTF-8 | 2,209 | 3.390625 | 3 | [
"MIT"
] | permissive | // DO WHATEVER YOU WANT HERE
const createEnumerableProperty = (propName) => propName;
const createNotEnumerableProperty = (name) => {
Object.defineProperty(Object.prototype, name, {
set: (val) => Object.prototype.buffer = val,
get: (val) => Object.prototype.buffer,
});
return name;
};
co... | true |
ff2917fc7669aaa99369d01f986096c6bd8a2333 | JavaScript | AlrightErin27/codeQuestions | /SeptKatas/sept30.js | UTF-8 | 3,722 | 4.15625 | 4 | [] | no_license | //-------------------- 🐬 ---Lonely Frog ---------------//
//--------------------🌊🌊🌊🌊🌊🏄🌊🌊🌊🏖🌴------------------------------//
// You are a lonely frog.
// You live on a coordinate axis.
// The meaning of your life is to jump and jump ..
// The only rule is that each jump is 1 units more than th... | true |
745a9fabbe3d80bf54cdaf0d093b57829423047c | JavaScript | Jyoung-Chen/OnlineRecruitment | /web/js/userLogin.js | UTF-8 | 812 | 2.546875 | 3 | [
"MIT"
] | permissive | $(function(){
var url = "/WebProject/JobsServlet";
$.post(url, {}, function (data, status) {
var list = $.parseJSON(data);
console.log("data = " + data);
console.log("list = " + list);
var tbodyNode=$("#tb");
list.forEach(
function (job) {
tbod... | true |
4afe1aeae2febbf370d88634ad6c114fa9410db2 | JavaScript | CarlesRa/DAW_2020 | /DWEC/javascript01/ejercicio10/scripts/index.js | UTF-8 | 454 | 3.75 | 4 | [] | no_license | var numIntroducido;
var seguirPidiendo = true;
while (seguirPidiendo) {
numIntroducido = prompt('Introduzca un número del 1 al 5' +
'\nSALIR: pulse el número 0');
if (numIntroducido == 0) {
seguirPidiendo = false;
}
else if (numIntroducido >= 1 &&
numIntroducido <= 5 &&
!isNaN(numIntroduc... | true |
90e540cbe12e5c73c1e38eb76cd671787e219136 | JavaScript | abaker93/javascript-exercises | /findTheOldest/findTheOldest.js | UTF-8 | 578 | 3.359375 | 3 | [] | no_license | let findTheOldest = function(arr) {
const currYear = new Date().getFullYear();
let people = [];
arr.forEach(person => {
if (!person.yearOfDeath) person.yearOfDeath = currYear;
let age = person.yearOfDeath - person.yearOfBirth;
let obj = {
"name": person.name,
"yearOfBirth": person.yearOfBirth,
"... | true |
0097c11693280a9d292d551e4c3209970571d1fb | JavaScript | pratikpz18/MERN-LOGIN-SIGNUP-BOILERPLATE | /backend/controllers/usercontroller.js | UTF-8 | 2,821 | 2.515625 | 3 | [] | no_license | const User = require('../models/usermodel')
const bcrypt = require('bcryptjs')
const { check, validationResult} = require("express-validator")
const jwt = require('jsonwebtoken')
const register = async (req,res,next) => {
const errors = validationResult(req);
if (!errors.isEmpty()) {
const err = ... | true |
a9d9877a49d0dd50c74a50d219de6abb2bc7ca81 | JavaScript | renuka-fernando/smart-meter | /smart-meter-web/src/common/data/Utils.js | UTF-8 | 761 | 2.875 | 3 | [
"MIT"
] | permissive | export default class Utils{
static CONST = {
LOGIN_TOKEN_PATH: ''
};
/**
* Round the given time to nearest quarter
* @param hours
* @param minutes
* @returns {string}
*/
static getNearestQuarter(hours, minutes){
let h = minutes > 52 ? (hours === 23 ? 0 : ++hours... | true |
a31316b8cb659927b2192d1bda564abdcc48191e | JavaScript | wandura/PGApi | /system/api.js | UTF-8 | 22,356 | 2.609375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
* ProGade API
* Copyright 2012, Hans-Peter Wandura (ProGade)
* Last changes of this file: Aug 22 2012
*/
/*
@start class
@param extends classPG_ClassBasics
*/
function classPG_Api()
{
// Declarations...
this.axContext = null;
this.axRegister = new Object();
// Construct...
// Methods...
/*... | true |
1c5811221a2648aaab6c862f9c289713ca2f800f | JavaScript | hitosu/duckness | /packages/reactor/__tests__/Reactor.spawn.test.js | UTF-8 | 3,193 | 2.609375 | 3 | [
"MIT"
] | permissive | import 'regenerator-runtime/runtime'
import Reactor, { Reagent } from '@duckness/reactor'
import { takeEvery, take, put, spawn, call } from '../lib/effects'
const pingReagent = Reagent('ping')
const pongReagent = Reagent('pong')
describe('@duckness/reactor Reactor [spawn]', () => {
test('yeild Promise', () =>
n... | true |
49bbaa7a26b49a04d6e0b5972a7a3dd8acabf420 | JavaScript | titounnes/SimpleEditor | /SimpleEditor.js | UTF-8 | 2,580 | 2.671875 | 3 | [] | no_license | var SimpleEditor = {};
/*
menghapus script samapah
*/
SimpleEditor.filterJunk = function(txt){
var str = `<div></div><!-- some comment --><p></p><!-- some comment -->`
txt = txt.replace(/\n/g,'');
txt = txt.replace(/<\!--.*?-->/g, '');
txt = txt.replace(/<style.*?style>/ig,'')
txt = txt.replace(/<o:p.*?o:p>/... | true |
8a4bad2ca994afa9d653f7120d4b45340d68b415 | JavaScript | mixa9269/threejs-bottle | /index.js | UTF-8 | 1,953 | 2.546875 | 3 | [] | no_license | var camera, scene, renderer;
var bottle, cube_geometry, cube_material;
var controls;
var light;
init();
function init() {
scene = new THREE.Scene();
scene.background = new THREE.Color(0x000000);
// renderer
renderer = new THREE.WebGLRenderer({
alpha: true,
});
renderer.setSize(window.innerWidth, win... | true |
0a82d22fce92f4762d6270f301290fa99b4198e3 | JavaScript | davnicwil/okfounder | /src/features/DemoDataAccess.js | UTF-8 | 1,618 | 2.59375 | 3 | [] | no_license | import React from "react"
import {
Text,
FormControl,
Input,
FormLabel,
Button,
Box
} from "@chakra-ui/core"
import db from "../data/database"
import Card from "../ui/Card"
export default class DataAccessDemo extends React.Component {
/*
This is a demo component to show you how to use the loca... | true |
04ed76696b75af201e6af71d62258fa207a0a833 | JavaScript | Jakhar89/calc | /calc/src/components/calc2.js | UTF-8 | 2,567 | 2.984375 | 3 | [] | no_license | //STILL IN PROGRESS
//Please don't include this file
//********************************/
import React, { Component } from 'react';
import Calc from "./calc";
import Buttons from './buttons';
class Calc2 extends Component {
state={
button:[
{id:1,val:'1'},
{id:2,val:'2'},
{id:3,val:'3'},
... | true |
2e3e71ceca67ee186f52dfb07651fdcb412e35f9 | JavaScript | aazcast/donations | /handlers/error/gerror.js | UTF-8 | 1,068 | 2.78125 | 3 | [] | no_license | /**
* Error creator to handle it later
* @param {String} errorcode Error code that i want to assign
* @param {String} errormessage Pretty error message to show to the user
* @param {Number} status Status code to send to the user
* @param {Boolean} operational This error is operational true or not false
... | true |
1217be0d11ca89b7299b09731436954acc1b56d8 | JavaScript | JMVHill/scottcoin-js | /server/prompt.js | UTF-8 | 1,413 | 3 | 3 | [] | no_license | var inquirer = require("inquirer");
console.log("Hi, welcome to ScottCoin");
var questions = [
{
type: "input",
name: "yourName",
message: "Enter your username"
},
{
type: "rawlist",
name: "recipient",
message: "Who do you want to send money to?",
ch... | true |
00bed8c748ba39748cfbc56c15625205d359b6d4 | JavaScript | michiganhackers/michigan-hackers-attendance | /src/Modal.js | UTF-8 | 1,975 | 2.578125 | 3 | [] | no_license | import React, { useState, useEffect, Fragment } from "react";
/** Modal component.
* Displays data grabbed from dataparse.js
* Uses Table component from src/Table.js
* */
function Modal({
name,
header,
content,
modalBackgroundStyle,
modalHeaderStyle,
modalContentStyle,
click,
clicked
... | true |
cc9e45b30f4726eb375be1b1ad8bf524c1545178 | JavaScript | cvjude/Todo_App | /server/helpers/Utilities.js | UTF-8 | 1,739 | 2.84375 | 3 | [] | no_license | /**
* @Module UserController
* @description Controlls all the user based activity
*/
/**
* @static
* @description Returns message based on the status
* @param {Object} res - Response object
* @param {Number} status - Appropraite error status
* @param {String} error - The appropriate error message
* @returns {O... | true |
d82ca26fa244866f444a5793fd9c96a29baab79b | JavaScript | jorge-lba/cursoJavaScript-COD3R | /exercises-js/05_array/12_reduce.js | UTF-8 | 407 | 3.25 | 3 | [] | no_license | Array.prototype.reduce2 = function(callback, initial){
const indexInitial = initial ? 0 : 1;
let accumulator = initial || this[0];
for(let i = indexInitial; i<this.length; i++){
accumulator = callback(accumulator,this[i], i, this)
}
return accumulator;
}
const sum = (total, value) ... | true |
9c8824f09615f56d5fbd3df28a37cf82ff4fa8dd | JavaScript | ThomasSmWatson/address-book-react | /src/App.jsx | UTF-8 | 2,607 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react"
import axios from "axios"
import logo from "./logo.svg"
import "./App.css"
import ContactList from "./components/ContactList.jsx"
import ContactHeader from "./components/ContactHeader.jsx"
import AddContact from "./components/AddContact.jsx"
import ContactInfo from "./component... | true |
5ebdb34ca5c031bb11813990fda4759d9fea15ca | JavaScript | Jill-Ann/js-exercises | /stones-on-the-table.js | UTF-8 | 521 | 4.3125 | 4 | [] | no_license | // There are some stones on Bob's table in a row, and each of them can be red, green or blue, indicated by the characters R, G, and B.
// Help Bob find the minimum number of stones he needs to remove from the table so that the stones in each pair of adjacent stones have different colours.
// "RGBRGBRGGB" => 1
// "R... | true |
d10bd22d481d3c712befda7151d5433154c62d68 | JavaScript | JavedAhmaddev/practise-web | /4-JAVASCRIPT/3.accessingelementsByButtons.js | UTF-8 | 684 | 3.453125 | 3 | [] | no_license |
document.getElementById("mybutton").onclick= function(){
document.getElementById("text").innerHTML="hello javed";
}
document.getElementById("button2").onclick= function(){
document.getElementById("text2").innerHTML="Hello JAVED!! " + document.getElementById("text2").innerHTML + " Awesome";
}
docume... | true |
eaf281e0b932a6d8c376ec6988d6081b174621cf | JavaScript | woksin/JavaScript.Fundamentals | /Source/booting/for_BootProcedures/when_performing_with_two_procedures_where_first_can_not_perform_before_the_second.js | UTF-8 | 1,507 | 2.75 | 3 | [
"MIT"
] | permissive | /*---------------------------------------------------------------------------------------------
* Copyright (c) Dolittle. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------... | true |
1d6d4f5b7c8ad852e80fdb336d2d680ed210e497 | JavaScript | jgkellymit/JS-conference-code | /modern_javascript/addFunc.js | UTF-8 | 131 | 2.9375 | 3 | [] | no_license | function addFunction (argv){
var sum = parseFloat(argv[2]) + parseFloat(argv[3])
console.log(sum)
}
addFunction(process.argv)
| true |
c27a4adda242293d6236365e00a01054079bf7c7 | JavaScript | fullstackzach/refactoring-react | /RenderProps/RenderProp.js | UTF-8 | 1,731 | 2.625 | 3 | [] | no_license | import React from 'react'
import CatIcon from './withCat/cat'
import { Motion, spring } from 'react-motion'
// *** RENDER PROP Solution ***
class Mouse extends React.Component {
state = { x: 0, y: 0 }
handleMouseMove = (event) => {
this.setState({
x: event.clientX,
y: event.clientY
})
}
... | true |
2631b336a2d1df9ad99dbeac2056428e754ee9bb | JavaScript | dsolis421/taylor-pug | /public/javascripts/galleryscript.js | UTF-8 | 1,041 | 2.90625 | 3 | [] | no_license | function setGalleryInput(value) {
$('.gallery-page-input').val(value);
}
function gotoGalleryPage(value) {
window.location.href = "/gallery/" + value;
}
$(document).ready(function() {
var $patharray = window.location.pathname.split( '/' );
var $currentpage = Number($patharray[$patharray.length - 1]);
var $m... | true |
14cb836d0edce243c3a38cc23665585349377225 | JavaScript | IrynaKorolova/To-Do-List | /js/app.js | UTF-8 | 2,164 | 3.5625 | 4 | [] | no_license | const todos = [];
const addFormEl = document.getElementById("addForm");
const todoListEl = document.getElementById("todos");
const totalEl = document.getElementById("total");
//rendering todo list
function renderTodos(todos, todoList) {
totalEl.textContent = todos.length;
todoList.innerHTML = todos.map((todo) => c... | true |
afaec8281dcc5f5b69aec6db1c4dc0a7b8d26f58 | JavaScript | szuwechat-tech/wechat | /src/lib/util.js | UTF-8 | 848 | 3.046875 | 3 | [] | no_license | 'use strict'
const crypto = require('crypto')
/**
* 对 `data` 进行 sha1 加密
*
* @param {any} data 要加密的数据
* @returns {String} 加密后的数据
*/
function sha1 (data) {
return crypto.createHash('sha1').update(data).digest('hex')
}
/**
* 返回当前时间戳
*
* @returns {Number} 当前时间戳
*/
function timestamp () {
return Math.floor(D... | true |
b0452e534e3a361cb170c94f907b56d5e07d68fc | JavaScript | Sindicat/sindicat-jsgame | /FilesJS/mapManager.js | UTF-8 | 8,716 | 3.09375 | 3 | [] | no_license | class MapManager {
constructor() {
this.mapData = null; // Хранение карты
this.tLayer = null; //Хранение ссылки на блоки (необходимо будет разместить весь JSON с типом tilelayer
this.xCount = 0; // кол-во блоков по горизонтали
this.yCount = 0; //кол-во блоков по вертикали
thi... | true |
9f9d7ed4d09af595e7a198a9d8c33e47dd4fb7ab | JavaScript | josephabateman/e-commerce_connect_API | /frontend/js/confirmation.js | UTF-8 | 1,067 | 2.84375 | 3 | [] | no_license | //cart href
const cartButton = document.getElementById('cart-button');
cartButton.href = 'cart.html';
//create elements
const content = document.getElementById('confirmation')
const thankYou = document.createElement('h4')
const div = document.createElement('div')
const totalPrice = document.createElement('p')
... | true |
971fa1b3f4c155680d0a4668ab5cbe57a0271409 | JavaScript | weahwww/myCode | /js/Ban_Space_keyboard.js | UTF-8 | 730 | 2.796875 | 3 | [] | no_license | // 禁止input中输入某些按键
// 这里的两个input分别禁止的是空格(32)和除了数字和删除键(backspace)外的键
// 代码适用React和jquery
onInputKeyUp: function(e) {
if (!e) var e = window.event;
// 48-57和96-105为数字键,8为退格键,190和110为小数点
// 37和39为左右方向键,17为ctrl键,67为C键,86为V键,9为Tab键
// 46为Delete键
if (((e.keyCode >= 48) && (e.keyCode <= 57)) ||
((e.keyCode >= 96) && (e... | true |
bc374e8cd3b548a4ab490607cf5419f2a62fd1af | JavaScript | khoch/quicksand | /saveme.js | UTF-8 | 1,140 | 2.640625 | 3 | [] | no_license | var ij = document.getElementById('injones');
var qs = document.getElementById('quicksand');
var dn = document.getElementById('drowning');
function init(){
qs.style.position = 'absolute';
qs.style.top = '500px';
qs.style.height = '500px';
ij.style.position = 'relative';
ij.style.left = '500px'; ... | true |
e5368ce3b043b6af332ab6bd710e49d533474af6 | JavaScript | Beena-Purushothama/React_Passing_Data_2 | /src/ListMovies.js | UTF-8 | 1,048 | 2.609375 | 3 | [] | no_license | import React, {Component} from 'react';
class ListMovies extends Component{
likedBy = (movieKey) => {
const {users, movies, profiles} = this.props;
const movieProfiles = profiles.filter(profile => (profile.favoriteMovieID === movieKey));
if(movieProfiles && movieProfiles.length > 0){
const listo... | true |
837133234ac406c2e80f17400d08265eddd1c7aa | JavaScript | medoix/medoix.com | /static/js/goodreads.js | UTF-8 | 2,401 | 2.859375 | 3 | [
"MIT"
] | permissive | var open = function () {
var handleReading = function () {
var goodreadsUser = document.getElementById('goodreads-user').value
try {
$.get('https://books.medoix.com/reading/' + goodreadsUser + '/currently-reading/json', function (json) {
var count = 0;
var books = "";
for (var... | true |
c17515b2ea5b17f4c8a7d53eb21fa630f8383847 | JavaScript | harinibodipudi/lab-react-stardom | /prostars/src/components/Stars.jsx | UTF-8 | 2,570 | 2.828125 | 3 | [] | no_license | import React, { Component } from 'react'
import data from './prostars.json'
import './App.css'
export default class Stars extends Component {
constructor() {
super()
this.state = {
dataset: [data[0], data[1], data[2], data[3], data[4]],
count: 5,
}
}
displayst... | true |
20f1ac51f3a7f96e3d2c88344ab4bfa29cc00769 | JavaScript | kwan-kim/mywork | /js/weather.js | UTF-8 | 1,377 | 3.4375 | 3 | [] | no_license | const API_KEY = '5595007db5d1f9a204acca76652ce2fa';
const COORDS = 'coords';
const TEMPERATURE = document.querySelector('.temp')
const CITY = document.querySelector('.city')
function getWeather(latitude, longitude){
fetch(
`https://api.openweathermap.org/data/2.5/weather?lat=${latitude}&lon=${longitude}&appid=${A... | true |
b5a3dcefc0d76a91af1582fadd65bf2243d91050 | JavaScript | Pauldumebi/CAMeasure | /app.js | UTF-8 | 126 | 2.625 | 3 | [] | no_license | function myFunction() {
event.preventDefault();
var element = document.body;
element.classList.toggle('dark-mode')
} | true |
1949a13aad3e36530d2e60395f227fd68d950dae | JavaScript | alexisligon/team-profile-generator | /practice.js | UTF-8 | 1,902 | 3.28125 | 3 | [] | no_license | startQuestions = () => {
inquirer.prompt(questions).then((answer) => {
const employee = new Employee(answer.name, answer.id, answer.email);
employee.getName();
employee.getId();
employee.getEmail();
employee.getRole();
if (answer.role == "Manager") {
inqui... | true |
abc67ca8a9fd43cc672c6d7d299eabd16b66b9c1 | JavaScript | CiprianaM/Doggo | /server/controllers/writeJSON.js | UTF-8 | 578 | 2.578125 | 3 | [
"MIT"
] | permissive | const fs = require ('fs');
// const dataFile = require('../../doggos/src/data.json')
const path = require ('path');
const dataFilePath = __dirname + '/data.json';
const fileContent = "hello";
// console.log(dataFilePath, 'the path');
const writeInFile = async (req, res) => {
console.log(dataFilePath, 'the path');
... | true |
55cae64dae7725e7bf1ad85e307289b62a95227e | JavaScript | aaanderson1/project3 | /src/controllers/imageController.js | UTF-8 | 877 | 2.734375 | 3 | [] | no_license | var express = require("express");
var router = express.Router();
// Import the model (burger.js) to use its database functions.
var image = require("../models/image.js");
// Create all our routes and set up logic within those routes where required.
router.get("/", function(req, res) {
image.all(function(data) {
... | true |
5db23270ce22ab86ea91d939938ce1abd45a7da3 | JavaScript | mymmo74/programmazione-guerrini | /tsslez04_for_array/public_html/js/sampleJs.js | UTF-8 | 939 | 3 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
// mi serve un array per i caricare le valutazioni
var ar_valutazioni = [];
// un metodo per aggiungere le valutazioni all'array
... | true |
889c1f750ffa2b4935a3705a387f6d05d437b795 | JavaScript | yehoudaB/instaPic | /public/app.js | UTF-8 | 3,402 | 2.90625 | 3 | [] | no_license | // il faut faire npm i -g json-server' puis 'json-server db.json --watch' pour commencer
import CardComponent from './component/card-component.js';
const grid = document.querySelector('section');
const modalContent = document.getElementById('titlesPostsLiked')
let likedPosts = [];
let likedPostsTitles =[];
const ... | true |
f327980e0b2ef6e42f488a40c8f954094d7dfa2d | JavaScript | dasd412/responseTimeJS | /response.js | UTF-8 | 1,400 | 3.3125 | 3 | [] | no_license |
const screen=document.querySelector("#screen");
let startTime,endTime,timeOut;//variable gloabalizing
let history=[];
screen.addEventListener('click',function(){
if(screen.classList.contains('waiting')){
screen.classList.remove('waiting');
screen.classList.add('ready');
screen.t... | true |
ef73fd363b9988e7951326a836b5609ab64f3cab | JavaScript | p-vascool/SoftUni | /JS Advanced/2.Arrays/AddAndRemoveElementsFromArray.js | UTF-8 | 499 | 3.640625 | 4 | [] | no_license | function addOrRemoveElements(arr){
let commands = {
counter: 1,
add: (theArray, num)=>[...theArray, num],
remove:(theArray)=>[...theArray.slice(0, theArray.length-1)]
}
let result = arr.reduce((acc, curr)=>{
acc = commands[curr](acc, commands.counter);
commands.counte... | true |
21cc98f01cd01139276d3c974b398684c697ef71 | JavaScript | Astru43/web-development-exercises | /exercise3/src/components/RatingStars.js | UTF-8 | 909 | 2.8125 | 3 | [] | no_license | import React, { Component } from 'react';
import { FaStar, FaRegStar, FaStarHalfAlt } from "react-icons/fa";
export default class RatingStars extends Component {
render() {
return (
<div>
{
this.getStarts(this.props.item)
}
</div>... | true |
ddeb77d5e10bf27ffa7611856c4dfd016f85e342 | JavaScript | walshie4/notebook | /index.js | UTF-8 | 3,991 | 2.734375 | 3 | [] | no_license | const cli = require('commander');
const crypto = require('crypto');
const readline = require('readline');
const fs = require('fs');
const path = require('path');
cli
.version(require('./package').version)
.option('-v, --verbose', 'Verbose logging')
.option('-l --list', 'List notes')
.parse(pro... | true |
493b6fe7f9f94396d3a7a6b4ad8039cbf56af82a | JavaScript | zwaxman/BetterRx | /client/redux/medClasses.js | UTF-8 | 1,377 | 2.59375 | 3 | [] | no_license | import axios from 'axios'
import {sort} from '../../util'
const SET_MED_CLASSES = 'SET_MED_CLASSES'
const ADD_MED_CLASS = 'ADD_MED_CLASS'
const DELETE_MED_CLASS = 'DELETE_MED_CLASS'
const EDIT_MED_CLASS = 'EDIT_MED_CLASS'
export const addMedClass = medClass => ({
type: ADD_MED_CLASS,
medClass
})
export const... | true |
362b7361e47116e76fcbaed622777e4a5179b113 | JavaScript | joaonunesdev/task-manager | /src/helpers/error.js | UTF-8 | 639 | 2.890625 | 3 | [] | no_license | /**
* Error handler central para nossa aplicação Express.
*
* @class ErrorHandler
* @see https://dev.to/nedsoft/central-error-handling-in-express-3aej
*/
class ErrorHandler extends Error {
constructor(statusCode, message) {
super();
this.statusCode = statusCode;
this.message = message;
}
}
/**
*... | true |
055885ed58cb3e9ff18607f494ac9c07020eacb2 | JavaScript | Jinsil-Kelly/algorithm_challenges | /src/07/day_25/blue/1512_numberOfGoodPairs.js | UTF-8 | 350 | 3.234375 | 3 | [] | no_license | // https://leetcode.com/problems/number-of-good-pairs/
const numIdenticalPairs = (nums) => {
nums.sort();
let total = 0;
let currentCount = 1;
for (let i = 1; i < nums.length; i += 1) {
if (nums[i] === nums[i - 1]) {
total += currentCount;
currentCount += 1;
} else {
currentCount = 1;... | true |
ae4bf6c6a93e27513772512f506227ed4062835b | JavaScript | evgmolt/JavaScript | /HW5/js/script3.js | UTF-8 | 1,844 | 3.0625 | 3 | [] | no_license | let imageNamesBlack = ["b-lad.jpg", "b-horse.jpg", "b-elef.jpg", "b-ferz.jpg", "b-king.jpg",
"b-elef.jpg", "b-horse.jpg", "b-lad.jpg", ];
let imageNamesWhite = ["w-lad.jpg", "w-horse.jpg", "w-elef.jpg", "w-ferz.jpg", "w-king.jpg",
"w-elef.jpg", "w-horse.jpg", "w-lad.jpg", ... | true |
50a06317080c7af7d8955d00d01df92a64ac8459 | JavaScript | vipinvkartha/vipinvkartha.github.io | /TypescriptAssignment/Youtube/content.js | UTF-8 | 3,413 | 2.921875 | 3 | [] | no_license | /*This is the class for Youtube Video. It contains member variables,constructor and setter and getter functions*/
var YoutubeVideo = /** @class */ (function () {
function YoutubeVideo(Title, views, likes, dislikes, comments, description, category, quality, age, subtitles) {
var _this = this;
this.ge... | true |
0fd3f089673e89ed53004a561d736db0b68d8046 | JavaScript | ArledgeMike/thebigassetplay | /js/game_menus.js | UTF-8 | 2,473 | 2.96875 | 3 | [
"MIT"
] | permissive |
//MIGHT NEED REFERENCE TO CURRENT LEVEL EVERY TIME A NEXT LEVEL IS CALLED
function Game_Menu(){
this.overlay = "#modal_overlay";
this.game_messages=["<p>That was some top notch asset play! HOWEVER, the client doesn't share your vision.</p> <p>Let's try something with more top of mind bullets.</p>",
... | true |
32a4e33f3b51cfdea6fed8c86b423b3054e618ca | JavaScript | ryanyang1102/vue3_todo_composition_API | /all.js | UTF-8 | 2,765 | 2.90625 | 3 | [] | no_license | import { createApp, ref, onMounted, computed } from 'https://cdnjs.cloudflare.com/ajax/libs/vue/3.2.1/vue.esm-browser.min.js';
const app = createApp({
setup() {
// 建立 todo 資料
const todo = ref([
// {
// id: '323',
// title: '322',
// completed: false,
// }
]);
// to... | true |
5cf494675e46cd05243e52f2f002cece00c430cb | JavaScript | Yurikonoval/goit-js-hw-10-food-service | /src/index.js | UTF-8 | 1,220 | 2.765625 | 3 | [
"MIT"
] | permissive | import menuCardsTpl from './templates/color-card.hbs';
import menu from './menu.json';
import './styles.css';
const Theme = {
LIGHT: 'light-theme',
DARK: 'dark-theme',
};
const STORAGE_KEY = `actual-theme`;
const cardsList = document.querySelector(`.js-menu`);
const toggle = document.querySelector(`.theme... | true |
381eb5bd32613e6ab0ab39854585ca2d0e521992 | JavaScript | franciscop/monday-form | /src/Form.js | UTF-8 | 714 | 2.75 | 3 | [] | no_license | import React from 'react';
// From https://github.com/yoshuawuyts/formdata-to-object
function toObject (data) {
var result = {}
var iterator = data.entries()
var entry = iterator.next()
var value = entry.value
while (true) {
if (Array.isArray(value) && value.length === 2) {
result[value[0]] = value... | true |
6f11fc07f6af3b465a48cd25799324a01cecd76a | JavaScript | Nickolas-Hernandez/c0121-code-solutions | /javascript-constructors/example-constructor.js | UTF-8 | 432 | 3.203125 | 3 | [] | no_license | function ExampleConstructor() {
}
console.log('ExampleConstructor.prototype', ExampleConstructor.prototype);
console.log('typeof ExampleConstructor.prototype', typeof ExampleConstructor.prototype);
var newExampleConstructor = new ExampleConstructor();
console.log('newExampleConstructor', newExampleConstructor);
var... | true |
efe20c70aea8f81cdb2fdbb29dfefd61e4134746 | JavaScript | e-holmes/WordGuessGame | /Assets/Javascript/game.js | UTF-8 | 2,900 | 2.890625 | 3 | [] | no_license | var mgWrds = ["wand", "cauldron", "magic", "wizard", "voldemort", "broomstick", "harry", "hermione", "ron", "peeves", "spells", "quidditch", "gryffindor", "hufflepuff", "slytherin", "ravenclaw", "werewolves", "transfiguration", "potions", "hippogriff" ];
var help = ["Cast's spells.", "You put things in it.", "A life wi... | true |
5bbb8e920c82ebaa5841a97fc9f20ceb967681ec | JavaScript | rdlagdaan/tes | /routes/college_course_crud.js | UTF-8 | 11,199 | 2.546875 | 3 | [] | no_license | const jwt = require('jsonwebtoken'); // Compact, URL-safe means of representing claims to be transferred between two parties.
const bcrypt = require('bcrypt-nodejs'); // A native JS bcrypt library for NodeJS
const url = require('url');
const datetime = require('node-datetime');
module.exports = (router) => {
/* =====... | true |
604e94acf03babb5d76792efebc5de2dabc32f6f | JavaScript | pOw-ER/react_tasks_map_level1_2 | /src/components/Card.js | UTF-8 | 589 | 2.5625 | 3 | [] | no_license | import React from 'react';
const Card = (props) => {
console.log(props.genre.forEach(x => console.log(x)));
return (
<div className="card">
<p>{props.title}</p>
<p>{props.year}</p>
<p>{props.director}</p>
<p>{props.duration}</p>
<p>{props.rate}</p>
<p>{props.genre[0] ? prop... | true |
3fc34960322fec8d00516cf6961dd3f2b6f1ab4a | JavaScript | joetong89/intro_react_redux | /src/components/ViewPlayerPage.js | UTF-8 | 1,202 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from 'react';
class ViewPlayerPage extends React.Component {
constructor(props) {
super(props);
this.state = {
curPlayer: {}
}
}
componentDidMount() {
try {
const playerJSON = localStorage.getItem(this.props.sport+'players');
... | true |
2763fe61eb0faa74696df2879fa28639d3eff5bf | JavaScript | ezhk/python-learning | /javascript-extended/lesson2/project/js/main.js | UTF-8 | 6,861 | 3.484375 | 3 | [] | no_license | class Products {
constructor(container = '.products') {
this.container = container;
this.data = [];
this.allProducts = [];
this.init()
}
init() {
this._fetchGoods();
this._render();
}
_fetchGoods() {
this.data = [
{id: 1, title: 'Notebook', price: 2000},
{id: 2, title... | true |
08c35dab7d19501bf1ea062c2083c20294c2c167 | JavaScript | DenislavVelichkov/JS-Core-January-2020 | /JS-Advanced/5-Arrays/Lab/04-Last-K-Numbers-Sequence.js | UTF-8 | 498 | 3.515625 | 4 | [
"MIT"
] | permissive | function solve(n, k) {
let arr = new Array();
arr.push(1);
for (let i = 0; i < n - 1; i++) {
let numToAdd = 0;
for (let j = 0; j < k; j++) {
let tempValue = 0;
if (arr[i - j] !== undefined) {
tempValue = arr[i - j];
numToAdd += tempVal... | true |