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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0281ffbe90c1d2f196c335aeb4c9d5239ae62ca9 | JavaScript | KevinHardy-Cooper/REngine | /src/Components/Header.jsx | UTF-8 | 361 | 2.546875 | 3 | [] | no_license | /*
December 18, 2017
Created by Kevin Hardy-Cooper
Abstract:
This file contains the title component
*/
// Importing module
import React from 'react';
// This component will contain the title for the page
export default class Header extends React.Component {
render() {
return (
<div>
... | true |
4f2e5900ae578cebad1e9280febfe66561487a29 | JavaScript | 13398199549/ssm | /ssm/src/main/webapp/static/js/jackson.page.js | UTF-8 | 2,939 | 2.765625 | 3 | [] | no_license | $(function(){
//适用于多表联查时,返回不同的字段
$('#btn07').click(function(){
var userName = "小";
$.ajax({
type:"POST",
url:"jsons/seven",
data:{userName:userName},
async:true,
success:function(data){
console.info(data);
}
});
});
//分页条件查询
$('#btn06').click(function(){
va... | true |
15ab347cd01d498da8f2fd239b62540333497e1f | JavaScript | kbase/kbase-ui | /src/client/modules/reactComponents/Title.js | UTF-8 | 1,650 | 2.515625 | 3 | [
"MIT"
] | permissive | define([
'preact',
'htm',
"dompurify",
"lib/utils",
// For effect
'css!./Title.css'
], (
preact,
htm,
DOMPurify,
{domSafeText}
) => {
const {h, Component } = preact;
const html = htm.bind(h);
class Title extends Component {
constructor(props) {
... | true |
4b0fa107ef2f4b1a473e4cf0470a1fdd8deb4de8 | JavaScript | Odonata42/rockpaperscissors | /main.js | UTF-8 | 3,080 | 4.3125 | 4 | [] | no_license | // rock paper scissors game
//get computer answer
//initialise computer answer variable
// random number between 1-3
// if 1, rock, if 2, paper, else- scissers
//let computerSelection= "";
function computerPlay(){
let rand = Math.floor(Math.random()*3);
return (rand==1) ?... | true |
c1f77e98603719965ff4b308769595aa40155a29 | JavaScript | ElNoobProgramando/4IV7-PSW-Cedillo-Lopez-Erick | /js/problema02.js | UTF-8 | 785 | 3.0625 | 3 | [] | no_license | var totali;
function validarn(e){
var teclado = (document.all)?e.keyCode:e.which;
if(teclado == 8) return true;
var patron = /[0-9\d .]/;
var prueba = String.fromCharCode(teclado);
return patron.test(prueba);
}
function comision(){
var valor = document.problema2.cantidad.value;
var... | true |
001ab2668314db2458353c93bbb1d52eec7b31bc | JavaScript | arielsokolsky/programming-website | /website/server/Database.js | UTF-8 | 2,069 | 3 | 3 | [] | no_license | const sqlite = require('sqlite3');
// class manages the database connection.
class Database
{
constructor (filePath)
{
// open and setup database
this.database = new sqlite.Database(filePath,
error =>
{
if (error)
throw error;
... | true |
76abb6e62918118add0c4b2c104c1c62e0e5ba39 | JavaScript | lsamano/js-advanced-first-class-functions-practice-lab-dumbo-web-121018 | /index.js | UTF-8 | 866 | 3.578125 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // Code your solution in this file!
const logDriverNames = drivers => {
drivers.forEach(function(driver){console.log(driver.name);});
}
const logDriversByHometown = (drivers, location) => {
hometownMatch = drivers.filter(function(driver) {return driver["hometown"] === location});
return logDriverNames(hometownMa... | true |
fa3e7170c2995b26787d1b0c77aaef28f919b896 | JavaScript | flysme/webpack | /src/index.js | UTF-8 | 6,445 | 2.96875 | 3 | [] | no_license | /*
* @Description:
* @Author: zhaofeixiang
* @LastEditors: zhaofeixiang
* @Date: 2019-05-08 09:28:01
* @LastEditTime: 2019-05-10 10:23:47
*/
import './css/main.css'
import { greeter } from './greeter'
import './module/demo1/index'
import UTILS from './utils/utils'
console.log(UTILS.getName(),'UTILS')
// d... | true |
e34ecf81dad4fbef728536b0edd35f6964540c73 | JavaScript | wtnabe/honkit | /packages/@honkit/markdown/src/__tests__/page.js | UTF-8 | 4,373 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | const fs = require("fs");
const path = require("path");
const assert = require("assert");
const page = require("../").page;
describe("Page parsing", () => {
let LEXED;
beforeAll(() => {
const CONTENT = fs.readFileSync(path.join(__dirname, "./fixtures/PAGE.md"), "utf8");
LEXED = page(CONTENT);... | true |
507a725eefd65e459b4e801633f0e0b0c13fba9d | JavaScript | jrfferreira/Kernelsys-public | /classes/app.js/js.bo/setMoney.js | UTF-8 | 289 | 2.765625 | 3 | [] | no_license | function setMoney(valor,ob){
valor = String(valor);
valor = valor.replace(',','.');
valor = ((Math.round(parseFloat(valor)*100))/100);
valor = String(valor);
valor = valor.replace('.',',');
if(ob){
ob.value = valor;
}else{
return valor;
}
} | true |
f8f74c9e51c331099c0a0232606197653c193806 | JavaScript | cmarini/Deboggler | /js/deboggler.js | UTF-8 | 15,270 | 2.796875 | 3 | [] | no_license | if (DEBUG) console.log("Running deboggler.js");
var dIndex = {}; // Indexed version of the dictionary
var boardSize;
var charLimit = 15;
var minCharLimit = 4;
var validWords;
var blankDie = '\xa0'; //  
var board;
var boardChanged = true;
var lastBoard = "";
var comboCaps = "";
var letterRegex = "";
class Dic... | true |
3dc873d82cf420946dddd984911659fa07e578ad | JavaScript | Clannis/image-shrink | /renderer.js | UTF-8 | 1,697 | 2.546875 | 3 | [] | no_license | const path = require('path')
const os = require('os')
const { ipcRenderer } = require('electron')
const form = document.getElementById('image-form')
const slider = document.getElementById('slider')
const img = document.getElementById('img')
const status = document.getElementById('submit')
const output = document.getEl... | true |
4cd2cc4d67c83dd028685812f3abf63e97912814 | JavaScript | IsYtotheL/javascript_fullstack | /hanjia/interview/base/modular.js | UTF-8 | 2,356 | 2.96875 | 3 | [] | no_license | // https://blog.csdn.net/qq_38912819/article/details/80597101
//https://www.jianshu.com/p/8573cdcde863
//https://www.cnblogs.com/Yellow-ice/p/10639029.html
//https://www.jianshu.com/p/ae4e566212ff
// 模块化
// 为什么要使用模块化? 都有哪几种方式可以实现模块化,各有什么特色?
// 模块化可以给我们带来好处:
//1.解决命名冲突
//2.提高复用性
//3.提高代码可维护性
//立即执行函数 兼容性好
(function... | true |
cba16b643d24a032c99e6a89532fcc960aec255d | JavaScript | hookover/baoniu-timestamp-ms | /index.js | UTF-8 | 1,157 | 2.625 | 3 | [] | no_license | var express = require('express');
var app = express();
app.set('port', (process.env.PORT || 5000));
app.set( 'view engine', 'html' );
app.engine( '.html', require( 'ejs' ).__express );
app.set('views', require('path').join(__dirname, 'views'));
app.use(express.static(require('path').join(__dirname, 'public')));
ap... | true |
663327be67f9804fbb7d46b7b09b4356a395fc58 | JavaScript | bohdan-shramko/d3js-charts-demo | /pieChart.js | UTF-8 | 3,020 | 2.640625 | 3 | [
"MIT"
] | permissive | var numbers = [
[
{name: 'Drivers License', val: 18, color: '#406080'},
{name: 'Source Code', val: 7, color: '#4DA6FF'},
{name: 'GLBA', val: 23, color: '#7ACC29'},
{name: 'CCN', val: 62, color: '#F2CC0C'},
{name: 'PCI', val: 11, color: '#FF3333'},
{name: 'SSN', val: 5, color: '#B20000'},
],... | true |
092d29a5ac8ab6e26bed69e3a71b0fd601ad18aa | JavaScript | BorisLaporte/lederniermetro | /js-dev/partial/portrait.js | UTF-8 | 769 | 2.921875 | 3 | [
"MIT"
] | permissive | var Portrait = function(){
// DOM
this.id = 'portrait';
this.articleWrapper = $('.article_wrapper');
this.sideContainer = $('.side_container');
this.window = $(window);
// Get div heights
this.articleHeight = this.articleWrapper.height();
this.init();
};
// Init view
Portrait.prototype.init = function() {
... | true |
57dcf5ef6b17d3827b066a01ea7b5c8537ebf936 | JavaScript | daanpeer/sumlifev2 | /src/commands/addQuestion.js | UTF-8 | 1,220 | 2.71875 | 3 | [] | no_license | import { storeCommandState, addQuestionByUser, clearCommandState } from '../queries'
const addQuestion = async (cmd, ctx, next) => {
const message = ctx.message.text
switch (cmd.state.step) {
case 1: {
await storeCommandState(ctx.from.id, 'addQuestion', {
...cmd.state,
step: 2,
qu... | true |
370144c790bf921fd89658de5e3d786d82b2080e | JavaScript | robertobdev/transfer-files | /index.js | UTF-8 | 791 | 2.796875 | 3 | [] | no_license | const fs = require('fs'),
fse = require('fs-extra'),
//rename this path to yours
path = './example';
fs.readdirSync(`${path}`).forEach((fileName) => {
const stats = fs.statSync(`${path}/${fileName}`);
if (!stats.isFile()) {
readContent(fileName);
}
});
function readContent(pa... | true |
18517862f5aed5c00385adb2e36e251d1c24c14e | JavaScript | feliberal/javascriptmasterclass | /examples/ec10.js | UTF-8 | 346 | 3.109375 | 3 | [] | no_license | var frutas = ["morango", "banana", "laranja", "abacaxi", "manga"];
var saladaDeFrutas = {};
for(let i = 0; i < (frutas.length - 1); i++) {
saladaDeFrutas[frutas[i]] = function () {
console.log("Meu nome é " + frutas[i]);
}
}
saladaDeFrutas.morango();
saladaDeFrutas.banana();
saladaDeFrutas.laranja();
... | true |
c3f8043d2d77f5fb2b36fca3bd4d7b9702aece4c | JavaScript | acerbusace/simpletab | /wwwroot/js/site.js | UTF-8 | 1,536 | 3.453125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
// Set the background image every hour
setBackgroundImage();
setInterval(function() {
setBackgroundImage();
}, 1000 * 60 * 60)
// Set the date every second
setDate();
setInterval(function() {
setDate();
}, 1000)
})
// Set the background im... | true |
337abe49f6504ae8383a471c02452064dd3dab52 | JavaScript | khacuy1891/Deliver | /action.js | UTF-8 | 746 | 2.796875 | 3 | [] | no_license | const defaultState = {
isLoading: false,
text: 'Waiting...',
}
export const showLoading = () => ({
type: 'SHOW_LOADING',
isLoading: true,
})
export const hideLoading = () => ({
type: 'HIDE_LOADING',
isLoading: false,
})
export const setLoadingText = (text) => ({
type: 'SET_LOADING_TEXT',
text: text,
... | true |
58187cbc2b6fb73787bceb354d59a8b29913635e | JavaScript | zaproxy/community-scripts | /standalone/alertAndPluginDetails.js | UTF-8 | 1,885 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /* Output sample:
* Alert_Name Source:PluginName WASC CWE
* Cross Site Scripting (DOM Based) ACTIVE:Cross Site Scripting (DOM Based) 8 79
* Non-Storable Content PASSIVE:Content Cacheability 13 524
* It's tab separated so you can simply copy/paste it into Excel (or whatever).
*/
extAlert = control.getE... | true |
8935c41603f0d61f278c39c9751b973161e06c1b | JavaScript | amctammany/amctammany-old | /app/scripts/mc3/services/math/quaternion.js | UTF-8 | 4,132 | 2.828125 | 3 | [] | no_license | 'use strict';
angular.module('mctApp')
.factory('Quaternion', function () {
var Quaternion = function (x, y, z, w) {
this._x = x || 0;
this._y = y || 0;
this._z = z || 0;
this._w = (w !== undefined) ? w : 1;
};
Quaternion.prototype = {
_updateEuler: function () {
if... | true |
ab5b000f43979e9c5b93af7afb9cade1ad7fba0a | JavaScript | shweps13/algoritmos | /js/LeetCode/Easy/933-ES-Number-of-Recent-Calls/queue.js | UTF-8 | 525 | 3.703125 | 4 | [] | no_license |
var RecentCounter = function() {
this.queue = new Queue();
this.counter = 0
};
/**
* @param {number} t
* @return {number}
*/
RecentCounter.prototype.ping = function(t) {
this.queue.enqueue(t);
this.counter++
while (this.queue.front() < t - 3000) {
this.queue.dequeue()
... | true |
b599f1f497e86e10798e9b8eb3a524a46c30b3b6 | JavaScript | Charlie-Dumpit-Jr/Unit5-02 | /script.js | UTF-8 | 158 | 2.609375 | 3 | [] | no_license | document.getElementById('button').addEventListener('click', displayMessage)
function displayMessage () {
alert('Born in the Philippines on May 3, 2005')
}
| true |
1532dfbf3551028158f3da1495f32d03ca5dcc0e | JavaScript | mvolkmann/angularjs-labs | /collectbook/features/share/fs-promise.js | UTF-8 | 2,824 | 3.3125 | 3 | [
"MIT"
] | permissive | 'use strict';
/*jshint esnext: true */
/*global Promise: false */
/**
* This module wraps Node.js fs functions
* in new functions that return ES6 promises.
*/
var fs = require('fs');
var mkdirp = require('mkdirp');
var rimraf = require('rimraf');
/**
* Determines if a given path refers to an existing file or dire... | true |
eed00708343e064eb953ad6e20fd0bb0259fea6e | JavaScript | bkirkby/covid-sim-admin-client | /src/api/index.js | UTF-8 | 2,059 | 2.53125 | 3 | [] | no_license | import axios from 'axios';
export const login = (username, password) => {
return axios.post(`${process.env.REACT_APP_SERVER_API}/login`, { username, password })
.then(res => {
localStorage.setItem('token', res.data.key);
return res;
})
.catch(err => {
if (err.response) {
return ... | true |
851bccc3bd970a69d016ab28db1ed679608ff1b3 | JavaScript | JMejiax/Django-First-Project | /static/home/calculo.js | UTF-8 | 727 | 3.15625 | 3 | [] | no_license | function calculos(){
var iva = 0.14;
var pordia = 50.0;
var pagoMensual = pordia*30.0;
var impuesto = pagoMensual*iva;
var totalMensual = pagoMensual+impuesto;
var pagoAnual = pagoMensual*12.0;
var impuestoA = pagoAnual*iva;
var totalAnual = pagoAnual+impuestoA;
var body = documen... | true |
13608784347e1a5205fda4027b2d548f584bfda6 | JavaScript | pranjalmalkhede/ReactJS-WhatsAppWEB | /src/utils/reducer.js | UTF-8 | 538 | 2.59375 | 3 | [] | no_license | export const initialState = {
mainUser: null,
contacts: [],
};
export const actionTypes = {
SET_MAIN_USER: "SET_MAIN_USER",
REMOVE_MAIN_USER: "REMOVE_MAIN_USER",
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.SET_MAIN_USER:
return {
...state,... | true |
45391f57537bf100e90125b9057c3bb62f88f198 | JavaScript | JMwill/exercise | /leetcode/problem-1-100/problem-9.js | UTF-8 | 835 | 4.1875 | 4 | [
"MIT"
] | permissive | /**
* 回文数
* 判断一个整数是否是回文数,完成题目,同时不需要额外的空间
*
* 思路:将数据逐个位拆出来,向后拼接,得出一个反转数后相比较
*/
/**
* @param {number} x
* @return {boolean}
*/
var assert = console.assert;
var log = console.log;
var isPalindrome = function(x) {
if (x < 0) {return false;}
var revertX = 0, tempX = x;
do {
revertX *= 10;
revertX += tempX %... | true |
b0b41caee333847a47073d92089c8d1008139804 | JavaScript | wonderpl/dolly-ios | /dollyTests/login_tests.js | UTF-8 | 4,220 | 2.640625 | 3 | [] | no_license |
DELAY=5;
var target = UIATarget.localTarget();
function logInWithUser(userName, password) {
var testName = "logInWithUser";
UIALogger.logStart(testName);
UIALogger.logMessage("Tapping user name field");
var userNameTextField = target.frontMostApp().mainWindow().textFields()["Username Field"].textFields()[... | true |
194acd197049a5c04d1eef933e4f9cb904cd4a60 | JavaScript | davidahouse/lincoln-api | /index.js | UTF-8 | 2,587 | 2.53125 | 3 | [
"MIT"
] | permissive | const fs = require('fs')
const homedir = require('os').homedir()
const moment = require('moment')
const path = require('path')
/**
* This class implements an interface to a Lincoln vault, which is the
* top level data structure used in the Lincoln app file system.
*/
class LincolnVault {
/**
* Constructor for the ... | true |
aa5c3257001e6a0b7995119e60ce0b083fed163f | JavaScript | zarc1411/Animu | /models/Pet.js | UTF-8 | 659 | 2.921875 | 3 | [] | no_license | //Dependencies
const { Schema, model } = require('mongoose');
//Schema
const petSchema = new Schema({
memberID: {
type: String,
unique: true,
},
petType: String,
petName: String,
happiness: {
type: Number,
default: 100,
}, //1 - 100, If below 50 for 7 days, pet run aways
lastFedHoursAgo: ... | true |
4bba33786cb4305f174e167d7e814bf3ab69ccbf | JavaScript | matildabrantley/weather-dashboard | /assets/js/script.js | UTF-8 | 7,679 | 3.0625 | 3 | [] | no_license | var resultText = $('#result-text');
var resultContent = $('#result-content');
var searchForm = document.querySelector('#search-form');
var units = "imperial"; //imperial is default, metric is other option
var bgOpacity = 0.3;
var bgOpacity2 = 0;
var bgOpacityDirection = 1;
const apiKey = 'a641bf9af84171a774e42ab0fb8b52... | true |
2b6dc22438643f6888cffd494e44dc3b976aa4fe | JavaScript | hansenjl/react-async-gif-search-lab-online-web-ft-110419 | /src/containers/GifListContainer.js | UTF-8 | 881 | 2.703125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React from 'react'
import GifList from '../components/GifList'
import GifSearch from '../components/GifSearch'
class GifListContainer extends React.Component {
state = {
gifs: [],
}
componentDidMount(){
this.fetchGifs('random')
}
fetchGifs(searchTerm){
let url = '... | true |
27cfb338a2efa5955834b33039e73bc9c5d343f0 | JavaScript | Toti2003/JS | /1_cvic.js | UTF-8 | 1,613 | 2.84375 | 3 | [] | no_license | function cenaF() {
mn = document.form.kg.value;
k = eval(document.form.krmivo.value);
c = k * mn;
document.form.cena.value = c;
}
function celkF() {
krm = eval(document.form.krmivo.value);
mno = document.form.kg.value;
zakKrm = krm * mno;
c111 = 0; c211 = 0; c311 = 0; c411 =... | true |
2a678b60f3ff8abb5eb0ee75e3eff86680432c34 | JavaScript | ONatanFreitas/desafioFinal | /src/database/database.js | UTF-8 | 876 | 2.78125 | 3 | [] | no_license | var axios = require('axios')
const apiKey = process.env.TMDB_API_SECRET
// puxa os dados dos filmes
async function mostrarDadosFilmes (){
try {
const response = (await axios.get(`https://api.themoviedb.org/3/list/7107576?api_key=${apiKey}&language=pt-BR`)).data.items
const dadosFilmes = [... | true |
62c9a863362bf3e37519891827de30029de0bc8f | JavaScript | DerekAlanGilbert/food-reccomendation-engine | /network/prototype.js | UTF-8 | 596 | 2.53125 | 3 | [] | no_license | const boxen = require('boxen')
const brain = require('brain.js')
const log = require('../lib/logger')
const protoTrainingData = require('../data/prototype-data.js')
const network = new brain.NeuralNetwork()
network.train(protoTrainingData)
const result = network.run({
carbs: 70,
sugar: 3,
fiber: 29,
toatlFat: 4,
... | true |
65f83a2bfc6c8724db36d6c337b0bb57f439997b | JavaScript | AJFaraday/nose_poker | /src/models/game.js | UTF-8 | 3,961 | 2.734375 | 3 | [
"MIT"
] | permissive | const CLIENTS = require('../clients.js');
const Controller = require('./controller.js');
const Ogre = require('./ogre.js');
const Utils = require('./../lib/utils.js');
const FS = require('fs');
class Game {
constructor(clients = null) {
this.hand_number = 1;
this.log_text = "";
this.init_clients(clients... | true |
e9b809e2417ba5625580ffc63099cfa18d8737c2 | JavaScript | helderjose/diversos | /code-base/javascript/currencyFormatter.test.js | UTF-8 | 5,990 | 2.9375 | 3 | [] | no_license | console.clear();
const currencyFormatter = require('./currencyFormatter.js')
let testId = 1;
// teste
let param = 1
let expected = '0,01'
console.log(`\nTest ${testId++}: WHEN: "${param}" SHOULD RETURN: "${expected}"`)
let result = currencyFormatter(param)
console.assert(
result === expected,
`WHEN "${param}" SHO... | true |
d208375ae9da6da3cefe18551e56975ad1380fd0 | JavaScript | SzymonRojek/codewars | /7-kyu/count-character.js | UTF-8 | 1,272 | 4.78125 | 5 | [] | no_license |
/*
Description:
The goal of this kata is to write a function that takes two inputs: a string and a character.
The function will count the number of times that character appears in the string.
The count is case insensitive.
For example:
countChar("fizzbuzz","z") => 4
countChar("Fancy fifth fly aloof","f") => 5
Th... | true |
832b56ede9013d413a00437c9d75cb58f4461bd8 | JavaScript | GabrielRebelles/Tramites | /api/auth/auth.js | UTF-8 | 1,015 | 2.765625 | 3 | [] | no_license | const jwt=require('jsonwebtoken')
const { jwtSecreto,adminUser } = require('../../config')
function sign(data){
//evito que se envie la password dentro del token:
delete data.password
//creo la session:
return jwt.sign(data,jwtSecreto,{ expiresIn: 1800 })
}
async function logeado(req){//si hay alg... | true |
f1844c49dfc56c6df6ed497b9668a86a534d1bf5 | JavaScript | michaelmccarty/proj3 | /client/src/Tilemap.js | UTF-8 | 8,630 | 2.515625 | 3 | [] | no_license | import tilemapVS from './shaders/tilemap.vert';
import tilemapFS from './shaders/tilemap.frag';
import { vec2 } from './utils/gl-matrix-min';
import GLUtil from './utils/gl-utils';
// https://github.com/toji/webgl-samples/blob/master/js/webgl-tilemap.js#L217
// A lot of the webgl is from here
// Tilemap is rendered ... | true |
1c30a9620a2fcbcc9cd2c650d8d688991633e019 | JavaScript | Tduncan14/weatherappreact | /weather/src/components/top/weather.jsx | UTF-8 | 704 | 2.515625 | 3 | [] | no_license | import React from 'react'
import sunImg from "../../resources/sun.png";
export default class Weather extends React.Component{
constructor(props){
super(props);
this.state={}
}
render(){
return (<div className="weather-container">
<div className="header">
... | true |
14d2a7221e88b391b64b31335a87604c06d14c49 | JavaScript | karin112358/coderdojo-monsters-game | /server/server.js | UTF-8 | 5,655 | 2.796875 | 3 | [
"MIT"
] | permissive | const { exception } = require('console');
var express = require('express');
var cors = require('cors');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server, {
cors: true
});
const configuration = { width: 1200, height: 1200 };
const port = process.env.PORT || 3000;
... | true |
3cdbc3a7a30cb441bcc8305cf09584a78e3855b9 | JavaScript | AAI-USZ/FixJS | /input/100+/before/2757f4e28a445e01ae209c1f4a405573656d3e6d_0_1.js | UTF-8 | 746 | 2.515625 | 3 | [
"MIT"
] | permissive | function( adUrl, callback ){
var _this = this;
mw.log('AdLoader :: load Ad: ', adUrl);
// See if we should even try to request via xhr:
if ( !('withCredentials' in new XMLHttpRequest()) && !(typeof XDomainRequest !== "undefined")){
_this.loadFromProxy( adUrl, callback );
return ;
}
// First tr... | true |
92f9298e458c730a4d8a910ce4d3a749dce35a9d | JavaScript | mwwilson/vHack | /src/onboarding/onboarding/static/scripts/offer_letter.js | UTF-8 | 554 | 2.53125 | 3 | [] | no_license | function download_offer(){
window.location.href = "http://localhost:6543/offer_letter";
}
function submit_app(){
$.ajax({
url: "../submit/Offer_Letter",
dataType: 'json',
success: function(data){
alert("Successfully submitted!")
window.location.href = ... | true |
4916a958686c7936d330f780db8ea9a42299b714 | JavaScript | cncf/landscapeapp | /src/components/ObsoleteListRenderer.js | UTF-8 | 3,275 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | const _ = require('lodash');
const { h } = require('../utils/format');
const l = function(x) {
return h((x || "").replace("https://", ""));
}
const { formatNumber } = require('../utils/formatNumber');
function highlightLinks(s) {
if (!s) {
return '';
}
// markdown styles
s = s.replace(/\[(.*?)\]\((https?:... | true |
49a3648db58739bcc0215e1d06b55731dc27e300 | JavaScript | Fdavidtr/Dialogflow-WikiBot | /functions/index.js | UTF-8 | 4,276 | 2.515625 | 3 | [] | no_license | 'use strict';
const functions = require('firebase-functions');
const { WebhookClient } = require('dialogflow-fulfillment');
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0;
const axios = require('axios');
const SIGN = "\n\n*justwaps.com*";
... | true |
dc64467e6239c36319682603458590475283e4be | JavaScript | joshfrench/gilded-rose-kata | /js/src/gilded_rose.js | UTF-8 | 4,783 | 3.296875 | 3 | [
"MIT"
] | permissive | /**
* Here's the process I went through:
*
* 1) Wrote specs for existing behaviors.
* 2) Decided to go with a functional approach, which would allow me to build
* and test low-level functions before overhauling `update_quality`.
* 3) With that plumbing in place, swapped out the body of `update_quality`
* a... | true |
13a867f609947c0c47fb710992d6fb03103ea860 | JavaScript | PROTECO/intersemestral-2015-2 | /JavaScript/Clase1/js/main.js | UTF-8 | 913 | 3.515625 | 4 | [] | no_license | function cambiarTexto(){
// alert(document.getElementById("saludo").innerHTML);
// alert(document.getElementsByTagName("div")[0]);
// alert(document.getElementsByClassName("navbar")[0]);
// && AND
// || OR
var correo = document.getElementById("input_name").value;
var pass = document.getElementById("input_pass").value... | true |
9a01dd355b10ef80eab2aedb1ea0991be1ceb67a | JavaScript | JulianaCarvalho/projetotwitter | /Dashboard/Twitter/Dashboard/assets/js/helpers.js | UTF-8 | 2,906 | 2.890625 | 3 | [] | no_license | /*
Parametros:
- componente --- objeto do componente acessado por this dentro dos pontos
de acesso
- cda --- objeto que o resultset encaminha ao componente. acessivel
dentro do postFetch( cda ) - eh passado como argumento
Essa funcao recebe um resultset p... | true |
d46e39fcb6b51cb6665e37d398224bdf6c235dd9 | JavaScript | rbarak2/cardcom | /Cardcom/CardComApi/ClientApp/src/App.js | UTF-8 | 3,631 | 2.6875 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { useAlert } from 'react-alert'
import AddPersonForm from './forms/AddPersonForm'
import EditPersonForm from './forms/EditPersonForm'
import PersonTable from './tables/PersonTable'
import axios from 'axios';
const App = () => {
const alert = useAlert()
... | true |
efed8aaa9a546424d96066b8b599cad320d993bd | JavaScript | KLarina/Homework | /JS_1_2/01_02_js/js/script.js | UTF-8 | 453 | 3.921875 | 4 | [] | no_license | // Заполнить массив циклом //
var arr = [];
for (var i = 0; i < 5; i++) {
arr.push(prompt( "Введите имя", ''));
}
user = prompt('введите свое имя', "");
var variable;
for (var i = 0; i < arr.length; i++) {
if (user == arr[i]) {
alert(user+ ' вы успешно вошли!');
variable=true;
break;
... | true |
a7e14b9a2ddbac06592afdaf7974901f8c8e1f1d | JavaScript | Anuja-More/to-do-list-cxD | /app.js | UTF-8 | 8,069 | 3.015625 | 3 | [] | no_license | const toDoList = document.querySelector(".todo");
const onGoingList = document.querySelector(".ongoing");
const lists = [...document.querySelectorAll(".list")];
const addToDoForm = document.querySelector(".form__todo");
const deleteZone = document.querySelector(".delete");
let id = 1;
let toDos = [];
// example of to... | true |
91422fa0fad83b964232afcfe1edc34f459cf30e | JavaScript | ostegm/hn-sentiment-client | /src/validators.js | UTF-8 | 548 | 2.9375 | 3 | [] | no_license | export const required = value => (
value ? undefined : 'Required');
export const nonEmpty = value => (
value.trim() !== '' ? undefined : 'Cannot be empty');
let webRegex = new RegExp('(https://)');
export const webAddress = value => (
webRegex.test(value) ? undefined : 'Must start with https://');
const hnReg... | true |
08c9edde3813650f87868384dd5f12e131afa912 | JavaScript | IAmAdamTaylor/AdventOfCode2020 | /solutions/day3-part1.js | UTF-8 | 892 | 3.625 | 4 | [
"MIT"
] | permissive | /**
* Advent of Code 2020
* Day 3 - Part 1
*
* Find how many trees (#) are passed when
* moving from the top-left of the input file
* down to the bottom, making steps of
* right 3, down 1 each time
*
* @see https://github.com/IAmAdamTaylor/AdventOfCode2020/wiki/3.1:-Day-3-Part-1
*/
const {readLines} = requ... | true |
4dd358c7c55a052b13ac773b0600f213a4d4f760 | JavaScript | Maxi-Olea/memorandosapi | /controllers/countries.controller.js | UTF-8 | 1,936 | 2.71875 | 3 | [] | no_license | const countryService = require("../services/countriesService")
const getAll = async (req,res) => {
const {idPais, pais} = req.query
console.log("INIT GET paises:"+ JSON.stringify({idPais, pais}))
const countries = await countryService.getAll({idPais, pais});
console.log("response controller "+ JSON.str... | true |
456b1e16224c31215ed4178ce06c640f8da1943f | JavaScript | djones5713/vanillajs-1-afternoon | /Part2/index.js | UTF-8 | 529 | 3.203125 | 3 | [] | no_license | console.log("The house always wins!")
const idInput = document.getElementById("idInput");
const colorInput = document.getElementById("colorInput");
console.log(idInput);
console.log(colorInput);
function setCard(){
const card = document.getElementById(idInput.value);
card.style.color = colorInput.value;
console... | true |
38158ce985050c5c7b1f38e57c2787b1a0ee6302 | JavaScript | nus-cs4344-students/save-her | /classes/character.js | UTF-8 | 19,135 | 2.6875 | 3 | [] | no_license | "use strict";
function Character(){
// statistics
this.maxHP = 100;
this.maxLives = 5;
this.HP = this.maxHP;
this.lives = this.maxLives;
this.characterType;
// private attributes
var that = this;
// this character belongs to this client
var isMine = true;
// sequence number for labellin... | true |
fb13365700ce5f4b909190b17b47c5a11110c7ee | JavaScript | wohuifude123/csReact | /react01/component/calculator/TemperatureInput.Component.jsx | UTF-8 | 2,100 | 3.265625 | 3 | [] | no_license | import React from 'react';
const scaleNames = {
c: 'Celsius',
f: 'Fahrenheit'
};
/*
However, we want these two inputs to be in sync with each other.
When we update the Celsius input,
the Fahrenheit input should reflect the converted temperature, and vice versa.
In React,
sharing state is ... | true |
284cc62849fd2cde2f793e1e0a27092077ff8dfb | JavaScript | kjbrowne28/node-shell | /bash.js | UTF-8 | 590 | 3.015625 | 3 | [] | no_license | const pwd = require("./pwd")
const ls = require("./ls")
process.stdout.write('prompt > ');
// // process.stdin.on('data', (data) => {
// // const cmd = data.toString().trim();
// // process.stdout.write('You typed: ' + cmd)
// // process.stdout.write('\nprompt > ')
// // })
process.stdin.on('data', (dat... | true |
da61afae50af204938753d100a13845b3e6c0d50 | JavaScript | DilanDM/Enigmatica2Expert-Extended | /dev/lib/EvtTechSolarCalc.js | UTF-8 | 4,651 | 2.921875 | 3 | [] | no_license | /*
Computing Environmental Tech solar Arrays
Output table of solar panel Tier and its output
based on solar panels material
Formula: https://ftb.gamepedia.com/Solar_Array_Controller
Example output:
Solar arrays Tiers and output RF by material:
╔══════╤═══════════╤═════════╤═══════════╤═══════════╤═══════════╤══... | true |
1433018645929c48dd88ca410b78fdc4292358c0 | JavaScript | joelalejandro/work-with-me | /commands/toggl/status.js | UTF-8 | 662 | 2.53125 | 3 | [] | no_license | import { getToken, getCurrentTimeEntry } from '../../services/toggl';
export default async ({ chatId, commandData }) => {
const token = getToken(chatId);
const result = await getCurrentTimeEntry(token);
if (result.error) {
return `🛑 Something went wrong: ${result.error}`;
} else {
if ... | true |
76da4bd64e1d9a9490b00bde6d59fe50fc6eb581 | JavaScript | Project-Hud/daylight-map | /public/javascripts/index.js | UTF-8 | 3,458 | 2.53125 | 3 | [] | no_license | /*global d3, topojson, performCalculations, sind, cosd*/
(function () {
var wWidth = $(window).width()
, wHeight = $(window).height()
, mapTarget = $('#mapTarget')
, lightHeight = wWidth / 1.998830409
/*
* Original Map Code (C) 2011 g/christensen (gchristnsn@gmail.com)
* URL: https://github.com/... | true |
750ddc0e10168726f037a21bd3478433bfcf9ae7 | JavaScript | xodiyevlutfulloxonuz/typing-game-project- | /main.js | UTF-8 | 2,860 | 3.25 | 3 | [] | no_license | const word = document.getElementById('word');
const text = document.getElementById('text');
const scoreEl = document.getElementById('score');
const timeEl = document.getElementById('time');
const endgameEl = document.getElementById('end-game-container');
const settingsBtn = document.getElementById('settings-btn');
cons... | true |
3b27f58c8fec00cb074c0f15cc32f512de9addfa | JavaScript | KrzysztofZiemski/shop-backend | /controllers/modelsDB.js | UTF-8 | 2,425 | 2.5625 | 3 | [] | no_license |
class Validate {
constructor() {
this.statuses = ['accepted', 'waiting payment', 'in progress', 'sent', 'closed', 'canceled'];
this.schemaProduct = {
name: undefined,
description: undefined,
tags: [],
price: undefined,
count: undefined,
... | true |
4dc814516a743b8cbea86c08a2abbc6142a383b9 | JavaScript | jmccutcheon16/jmccutcheon16.github.io | /assignments/a11_ReadingServerSideJSON/reading-server-side-json/public/script.js | UTF-8 | 1,533 | 3.34375 | 3 | [] | no_license | async function getBands() {
let response = await fetch("http://localhost:3000/api/bands");
let bandsJSON = await response.json();
let bandsDiv = document.getElementById("bands-list");
for (i in bandsJSON) {
let band = bandsJSON[i];
bandsDiv.append(getBandItem(band));
}
}
function ge... | true |
d7946625382fde39f6fa19afb50c37652f5d2bd6 | JavaScript | charlesmartinreed/modern-javascript-refresher | /Number-Guesser-Project/app.js | UTF-8 | 2,478 | 4.0625 | 4 | [] | no_license | // Game values
let min = 1,
max = 10,
winningNumber = getRandomNumber(min, max),
guessesLeft = 3;
// UI Elements
const gameEl = document.querySelector('#game'),
minNumberEl = document.querySelector('.min-number'),
maxNumberEl = document.querySelector('.max-number'),
guessBtn = document.querySelector('#g... | true |
4030d47d3c1bf05ebe682d70ca8c3d5815874334 | JavaScript | theekshanawj/node-fetch-client | /utils.js | UTF-8 | 522 | 3.03125 | 3 | [] | no_license | /**
* Take a promise and return [error, result] format.
* If promise success -> [null, result]
* If promise fail -> [error, null]
* For a non-promise argument -> [error, null]
* @param promise
* @return {Error[]|Promise<[null, unknown] | [any, null]>}
*/
const to = (promise) => {
if (promise instanceof Promi... | true |
1277a4127f2d3d2ef316e993dbdcf24f636019c4 | JavaScript | organics-for-your-little-sister/organics-for-your-little-sister | /server/db/models/user.spec.js | UTF-8 | 1,465 | 2.546875 | 3 | [] | no_license | /* global describe beforeEach it */
const {expect} = require('chai')
const db = require('../index')
const User = db.model('user')
describe('User model', () => {
beforeEach(() => {
return db.sync({force: true})
})
describe('User Model Name', () => {
let user;
beforeEach(() => {
user = User.build({... | true |
01bc1d708e7066d5a019987e6460fb91c320f4f9 | JavaScript | SnirHazan/Mern_Stack | /server/client/src/components/DeleteEmployee.js | UTF-8 | 3,534 | 2.671875 | 3 | [] | no_license | import React, { Component } from 'react';
import { URLS } from '../consts';
import axios from 'axios';
export default class DeleteEmployee extends Component {
constructor(props) {
super(props);
this.state = {
employeeList: [],
selectedEmployeeId: 'Choose...',
err... | true |
e481883d5ec0508ea2d50568a9a924dbbefc6378 | JavaScript | giancarlo88/bittrex-lamda | /__test__/calculate.spec.js | UTF-8 | 747 | 2.75 | 3 | [] | no_license | const calculate = require('../calculate')
describe('Calculate function', () => {
describe('given objects that all have prices', () => {
it('should be reduced correctly to a single value string', () => {
const data = [
{
available: 2,
price: 2
},
{
avail... | true |
59ff8055088225199a2ade47c1174d804e9bb95e | JavaScript | alisapush/JavaScript.Ninja-basic-2021-1 | /task-compose/src/solution.js | UTF-8 | 440 | 2.6875 | 3 | [] | no_license | function compose(fns) {
// Это неправильное решение! Просто заглушка чтобы
// продемонстрировать что будет на экране
// Не ищите здесь сакрального смысла или "основы" -
// здесь все надо переписать :)
return (...args) => {
fns.reduceRight((argss, fn) => [fn(...argss)], args).pop();
};
}
| true |
8bf47b49d0410aff77c2efc67c4c076409445f67 | JavaScript | imransilvake/current-weather | /src/app/utilities/helpers/Helper.js | UTF-8 | 259 | 2.765625 | 3 | [
"MIT"
] | permissive | /**
* add letter spacing
* @param str
* @param spaces
* @returns {string}
*/
const addLetterSpacing = (str, spaces) => {
const fillSpaces = Array(spaces).fill('\xa0').join('');
return str.split('').join(fillSpaces);
};
export default addLetterSpacing;
| true |
3d4de43019bfaa976092ac8e9041aa25332d5715 | JavaScript | darshanshah1921999/stickey-keys | /index.js | UTF-8 | 767 | 2.96875 | 3 | [] | no_license | let map = [];
let k = 0;
let isSticky = false;
let timeout = 0;
document.addEventListener("keydown", (event) => {
if (event.key === "Shift") {
if (!isSticky) {
map[k] = Date.now();
k++;
checkForStickey();
} else {
setTimeout((fn) => {
isSticky = false;
}, timeout);
}
... | true |
a774d05f217988f36e8aac77374b59b65937b9c5 | JavaScript | Punta-Multimedia/Punta | /js/script.js | UTF-8 | 639 | 2.546875 | 3 | [
"MIT"
] | permissive | const btnToggle = document.querySelector('.toggle-btn');
btnToggle.addEventListener('click', function () {
console.log('clik')
document.getElementById('sidebar').classList.toggle('active');
console.log(document.getElementById('sidebar'))
});
$(document).ready(function(){
"use strict";
$(".icon").on("click",fu... | true |
397b9941f77cc7ad83f3895b97be34d47d1d77d2 | JavaScript | myra-grace/wksp-module-2-js-2-fundamentals | /workshop/10-anything-goes/10-exercise-5.js | UTF-8 | 815 | 4.59375 | 5 | [] | no_license | // Q5
// Write a JavaScript program to find ALL the Armstrong
// numbers between 0 and 999, store them in array an output
// that array to the console.
// Note : An Armstrong number of three digits is an integer
// such that the sum of the cubes of its digits is equal
// to the number itself. For example,
// 371 is... | true |
44eb035a4f20c121bd5fdd2a61643c99c775746e | JavaScript | dorcheng/potate | /reducers/userInfo.js | UTF-8 | 928 | 2.984375 | 3 | [] | no_license | import { database } from '../server/firebase'
// ACTION TYPES
const GET_USER_INFO = 'GET_USER_INFO'
// ACTION CREATORS
export const getUserInfo = info => ({ type: GET_USER_INFO, info })
// THUNKS
function snapshotToObject(snapshot){
const item = snapshot.val()
item.key = snapshot.key
return item
}
export con... | true |
f525547b43aad458c2f38e16451a8b5154020103 | JavaScript | dmijatovic/nodejs-training | /todoApi/api-async.js | UTF-8 | 4,658 | 2.59375 | 3 | [] | no_license | //load configuration
require('./config/config');
//load dependencies
const express = require ('express');
const bodyParser = require('body-parser');
const { ObjectID } = require('mongodb');
const { mongoose } = require ('./mongodb/mongoose');
const { ToDo, User } = require ('./mongodb/models');
const auth = require('.... | true |
2085ff4aa6adf5eca84ba3db2f3e3bf08d28731e | JavaScript | funnykoss/goit-js-hw-10-food-service | /src/js/switchTheme.js | UTF-8 | 1,096 | 3.25 | 3 | [] | no_license | const Theme = {
LIGHT: "light-theme",
DARK: "dark-theme"
};
const toggleTheme = document.querySelector("#theme-switch-toggle");
const bodyRef = document.querySelector("body");
const STORAGE_KEY = "curent-theme";
bodyRef.classList.add(Theme.LIGHT);
toggleTheme.addEventListener('change', onSwitchTheme);
document.... | true |
7643935a616e37474562cfeefabb764909cdb074 | JavaScript | Lau-Ren/conways-game | /createBoard.js | UTF-8 | 178 | 2.9375 | 3 | [] | no_license | function createBoard(size) {
var board = Array(size)
for(var i = 0; i <= size - 1; i++) {
board[i] = new Array(size)
}
return board
}
module.exports = createBoard
| true |
991c98f90b0e5104384f842b86d7381475772ae5 | JavaScript | Aditya-quo/javascript-practise-hackerrank-solution | /Task 4/Pairs.js | UTF-8 | 393 | 3.34375 | 3 | [] | no_license | function pairs(k, arr) {
let map = new Map();
let pairCount = 0;
for( let index in arr){
map.set(arr[index], arr[index]);
}
for( let index in arr){
if( map.has(arr[index] - k) ){
pairCount++;
}
if ( map.has(Number(arr[index]) + Number(k) )){... | true |
6daaf3df35cdb359545ff510266c393195bd946c | JavaScript | green-fox-academy/WenyuD | /week-04/day-01/simple-golden-acorn-app/src/App.js | UTF-8 | 1,035 | 3 | 3 | [] | no_license | import React from 'react';
import './App.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {count: 0};
this.handleBuy = this.handleBuy.bind(this);
this.handleEat = this.handleEat.bind(this);
}
handleBuy() {
this.setState({count: this.state.count + 1});... | true |
0be5a14844780c88c9b0ef955ad49f0a5b548a84 | JavaScript | dylanjshaw/WeatherByRedux | /src/actions/index.js | UTF-8 | 811 | 2.890625 | 3 | [
"MIT"
] | permissive | import axios from 'axios';
//axios is basically jQuery, but just for AJAX
const API_KEY = 'cc3b58a6050360b8c4271b0fd5084ed2';
const ROOT_URL = `http://api.openweathermap.org/data/2.5/forecast?appid=${API_KEY}`;
// api.openweathermap.org/data/2.5/forecast?{city name},{country code}
export const FETCH_WEATHER = 'FETC... | true |
c9fa31a1d568719f640f772acca010a24e40daf4 | JavaScript | br3y1n/JS-Course-udemy | /06-bucle While/While.js | UTF-8 | 133 | 3.390625 | 3 | [] | no_license | var año = 2018;
while(año<2050){
console.log(año);
año++;
//to exit the bucle, write "break" inside the While
} | true |
220f4bf4b3aee0787a18b1383da04b3bc82c8c0d | JavaScript | jordangregson/Flyerstracker | /js/current-score.js | UTF-8 | 3,941 | 3.140625 | 3 | [] | no_license | function gameInProgress(apiDate) {
//turning the date into sportsdata.io format
var today = new Date();
var date = today.getDate();
var numMonth = today.getMonth();
var year = today.getFullYear();
var month;
if (numMonth == "0") {
month = "Jan";
}
if (numMonth == "1") ... | true |
26d815d2c27912e7fcd8d3849b35c54b8ed691d7 | JavaScript | jdunruh/golf-reg-relay | /public/javascript/app1.js | UTF-8 | 1,664 | 2.59375 | 3 | [
"MIT"
] | permissive | var re = /^flights\[([a-fA-F0-9])+\]/; // $1 is the "index" part of the name
var reAttr = /^(flights\[)[a-fA-F0-9]+(\]\[(.+)\])/; // $1 is the "index" part of the name, $2 is the attribute part of the name
// name format is flights[9][time]
$(document).ready(function() {
$('.delete-link').each(function(index, el) ... | true |
dea97744054d1c762675c78e50bbacda9fe0a5ef | JavaScript | RenzoPederzoli/lab-canvas-race-car | /js/obstacle.js | UTF-8 | 311 | 3.34375 | 3 | [] | no_license | class Obstacle {
constructor(x=0,y=0,width=50,height=35,count=10) {
this.x = x
this.y = y
this.width = width
this.height = height
this.count = count
}
setRandomValues() {
this.x = Math.floor(Math.random() * (450))
this.width = Math.floor(Math.random() * (430 - 50)) + 50
}
} | true |
7746ac7b377cfdd430d264e5e6c1cac5e3019d42 | JavaScript | RuKubat/BootcampJS | /chapter_1/homework/js_01/js/main_01.js | UTF-8 | 1,092 | 4.4375 | 4 | [] | no_license | /* Напишите функцию которая принимает массив с названиями стран и
возвращает страну с самым длинным названием
(затем страну с самым коротким названием) */
// let countryList = ['Kyrgyz Republic', 'Australia',
// 'Spain', 'Mali', 'Brazil' ];
// function sortCountries() {
// }
// sortCountries(countryList);
let c... | true |
651304f25c6cde94d36840d766366b70f3486d62 | JavaScript | spencermountain/compromise | /src/3-three/normalize/methods.js | UTF-8 | 3,143 | 2.875 | 3 | [
"MIT"
] | permissive | const termLoop = function (view, cb) {
view.docs.forEach(terms => {
terms.forEach(cb)
})
}
export default {
// remove titlecasing, uppercase
'case': (doc) => {
termLoop(doc, (term) => {
term.text = term.text.toLowerCase()
})
},
// visually romanize/anglicize 'Björk' into 'Bjork'.
'unico... | true |
e8234019b7fe98d2fcab0fc920213ed8978a22e1 | JavaScript | ImDyA/JS-Advanced-Home-Work- | /HomeWork-7/script.js | UTF-8 | 3,889 | 3.4375 | 3 | [] | no_license | const timerStart = document.getElementById("start");
const timerPause = document.getElementById("pause");
let timerNumber = document.getElementById("number");
const timerTest = document.getElementById("timer");
// timerStart.addEventListener('click', function() {
// // let timeMinut = parseInt(timerNumber.value)... | true |
8d428ea3a6e37a805f1fe836162221fc36d0f833 | JavaScript | Paul-Ryan/code-practice | /javascript/binomialCoefficient.js | UTF-8 | 906 | 4.59375 | 5 | [] | no_license | // Write a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). For example, your function should return 6 for n = 4 and k = 2, and it should return 10 for n = 5 and k = 2
// The value of C(n, k) can be recursively calculated using following standard formula for Binomial Co... | true |
b8509ad0117768923aa60229ffe3cc690adcff91 | JavaScript | thoneywill3/unit-4-game | /assets/game.js | UTF-8 | 764 | 3.09375 | 3 | [] | no_license | var randomNumber = getRandomNumber(100);
function getRandomNumber(upper){
var num = Math.floor(Math.random()*upper) + 1;
return num;
}
function crystal1()
{
//add logic to add random points from crystal1 button to player's total scor... | true |
860bf7b59a9620540f0885c042bf96ada235f15f | JavaScript | kangfauz/tinirudoc | /src/helpers/Helpers.js | UTF-8 | 1,676 | 2.59375 | 3 | [] | no_license |
/*
* Tiniru Doc
* Version 0.1, 2019
*
* @website - https://tiniru.com
*
*/
export function toUrl(url) {
return encodeURI(url.replace(/ /g, '-').replace(/[^\w.-]+/g,'').toLowerCase());
}
export function postData(url,data={}){
// Default options are marked with *
return fetch(url, {
meth... | true |
6ccd65438b8886ec2cdf1fe561be3a955ed188c3 | JavaScript | fnknzzz/Wo.js | /src/effect.js | UTF-8 | 1,170 | 2.515625 | 3 | [] | no_license | import {W} from "./w"
import {Wo} from "./wo"
import {} from "./tool"
W.extend({
show(){
log( move.linear(0, 100, 10, 100) );
},
hide(){
},
animate(options, interval, easing, callback){
var elem = this[0];
var entrys = {};
for (var key in options) { //第一次循环取值
entrys[ke... | true |
eb3da3c7eef0039c8b6986b8105aa29709bb44a0 | JavaScript | smunozmo/to_do_list_with_webpack | /src/liststructure.js | UTF-8 | 1,071 | 3 | 3 | [] | no_license | const listContainer = document.getElementById('list-container');
function StoreList(arr) {
localStorage.setItem('LocalList', JSON.stringify(arr));
}
function PopulateList(array) {
listContainer.innerHTML = '';
array.sort((a, b) => a.index - b.index);
for (let index = 0; index < array.length; index += 1) {
... | true |
0b1d70f29f87bac28397945bfa48df9f3d76c2fe | JavaScript | Rickardt/consupedia | /public_html/script.js | UTF-8 | 3,125 | 2.90625 | 3 | [] | no_license |
$( function() {
$( "#sortable1, #sortable2" ).sortable({
update: function( event, ui ) { //change update? uppdaterar vid både recieve och update?
calc();
},
connectWith: ".connectedSortable"
});
});
var values = {env : 0, health : 0, just : 0, price : 0, quality : 0} ;... | true |
147bda711f5d366dff083f249111e5fcadfe3978 | JavaScript | byteshiva/es6-tuts | /functionalprogramming/day80/funcday80/index.js | UTF-8 | 448 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | const R = require('ramda');
const hasName = R.has('name');
const has1 = hasName({name: 'alice'}); //=> true
const has2 = hasName({name: 'bob'}); //=> true
const has3 = hasName({}); //=> false
const point = {x: 0, y: 0};
const pointHas = R.has(R.__, point);
const has4 = pointHas('x'); //=> true
c... | true |
af95e55793f2ab3706872afb25bdbb3abbfba974 | JavaScript | erirore/erirore.github.io | /textanimation.js | UTF-8 | 629 | 2.71875 | 3 | [] | no_license | var wss_i = 0;
var wss_array = [ "WELCOME TO BLESSED ESE",
"FURNITURE AND INTIRIOR DECORATION",
"WE GIVE THE BEST FINICHING ",
"CUSTOMAR IS A KING ",
"WE DELIVER TO YOUR DOOR STEP",
"WE GIVE BEST QUALITY AND PROFECTIONA ITERIOR D... | true |