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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7a0345acf0677cb770bd3d27115282344d4ef4df | JavaScript | themarquisdesheric/svelte-game | /src/utils.js | UTF-8 | 1,709 | 3.75 | 4 | [
"MIT"
] | permissive | const getRandomInt = (max = 2) =>
Math.floor(Math.random() * max);
export const getRandomCoordinate = () =>
getRandomInt() ? 'x' : 'y';
export const getRandomPolarity = (duration) =>
getRandomInt() ? duration : -duration;
const fisherYatesShuffle = (owls) => {
const shuffled = [...owls];
// walk the ar... | true |
8584cb1e46a797d62d9b3c0e53762dca8a018146 | JavaScript | jakobhellermann/bevy-contrib-inspector | /bevy-contrib-inspector-derive/static/script.js | UTF-8 | 837 | 2.5625 | 3 | [
"MIT"
] | permissive | const throttle = (func, limit) => {
if (!limit) return func;
let lastFunc, lastRan;
return function () {
const context = this, args = arguments;
if (!lastRan) {
func.apply(context, args);
lastRan = Date.now();
} else {
clearTimeout(lastFunc);
... | true |
15ea6f5aa909edc58ad50965b7aae9bd4c860d43 | JavaScript | KuwtC/TicTacToe | /src/server/api/api.test.js | UTF-8 | 3,167 | 3.328125 | 3 | [
"ISC"
] | permissive | const request = require('supertest')
const app = require('../../../app')
const TicTacToe = require('../logic/tictactoe')
const game = new TicTacToe()
describe('GET /api/update/:cell', () => {
it('should return an object with a updated game (new move has been made)', async () => {
const cell = '0,0'
const res... | true |
d61dae013b45ddfd23cdf0d374f5ea2dcbdf31da | JavaScript | jacobtyq/simple-form | /assets/js/script.js | UTF-8 | 2,681 | 2.546875 | 3 | [] | no_license | $(document).ready(function(){
//Form validation
$("#contact-details").validate({
rules: {
firstname: "required",
lastname: "required",
contactnumber: "required",
address: "required"
},
messages: {
firstname: "Please enter your f... | true |
fbb3e1db4411d228b8af5769985651cb207b9c80 | JavaScript | swapnilgupta89/PLP | /js/main.js | UTF-8 | 5,962 | 2.8125 | 3 | [] | no_license | window.onload = function(){
var productPromise = factory.getJSONData("http://demo1853299.mockable.io/products"),
filterPromise = factory.getJSONData("http://demo1853299.mockable.io/filters"),
products;
productPromise.then(function(data){
products = factory.getProducts(data);
factory.displayPro... | true |
ef13b9a434ab96b240100c1f5698984869a478c5 | JavaScript | robinma/myblog | /history/v1/lib/util.js | UTF-8 | 426 | 2.578125 | 3 | [] | no_license | /** create unit id
* GUID
* ps.javascript mvc guid page:39
*/
var MD5=require('../node_modules/MD5');
exports.createUnitId=function(){
var unid=guid() + new Date().getTime();
return MD5(unid).subStr(0,16)
};
function guid () {
// body...
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,functio... | true |
fa95349b7eea3280014a786bf5282b965c2dd0c5 | JavaScript | londomloto/tanaga | /cores/bower_components/graph-svg/dist/graph.js | UTF-8 | 669,224 | 3.046875 | 3 | [] | no_license |
(function(){
/**
* Lodash polyfill
*/
_.float = parseFloat;
_.gcd = function(array) {
if (array.length === 2) {
var a = array[0], b = array[1], t;
while (b > 0) {
t = b;
b = a % b;
a = t;
}
... | true |
4d47489902ec4a0044894037da97986a2f0e6cc8 | JavaScript | wilwad/whatsapp-text-to-speech | /source.js | UTF-8 | 4,412 | 2.8125 | 3 | [] | no_license | /* whatsapp web chat list text-to-speech */
/* whatsapp seems to hide the top nodes when u scroll to bottom & vice versa */
var whatsapp_timerId = null;
var whatsapp_iter = function(){
// clear the timer
if (whatsapp_timerId) window.clearInterval(whatsapp_timerId);
var root = document.getElementsByClassNa... | true |
42fb219ac35f5da9357ec4e33d4db46bc8e3901d | JavaScript | youngjay/react-middleware | /store/territory.js | UTF-8 | 1,148 | 2.53125 | 3 | [] | no_license | /**
* Copyright 2014, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
'use strict';
var createStore = require('fluxible/addons').createStore;
var normalize = function(territory) {
if (territory.updateTime) {
territory.updateTime = new Date(ter... | true |
c30b8af9bcf4a6d9fbb1fdf15d0a017b2aad736f | JavaScript | slidvo/vashipirogi | /model/products.js | UTF-8 | 5,190 | 3.078125 | 3 | [] | no_license | function CakesType(i, n, t) {
this.id = i;
this.name = n;
this.tagline = t;
}
let cakesType = [
new CakesType(0, "Сладкие пироги", "Сладкая мечта на блюде"),
new CakesType(1, "Вкусные пироги", "Съешь всё до последней крошки"),
new CakesType(2, "Сытные пироги", "С пылу, с жару")
];
function Cak... | true |
6135af6282d835394841b32af9aa0a9a41840671 | JavaScript | issamBoutissante/Js-Tp-15 | /index.js | UTF-8 | 2,180 | 2.671875 | 3 | [] | no_license | document.getElementById("paypal").addEventListener("click", echanger);
document.getElementById("carteBancaire").addEventListener("click", echanger);
var isPaypal = true;
function echanger(e) {
if (e.target.value == "paypal") {
isPaypal = true;
document
.querySelectorAll(".paypal")
.forEach((elemen... | true |
36285b97af600d9ddbfb43ba644d048c90e84267 | JavaScript | xlan-codes/genesis-cloud-challenge | /solutions/fs1_billing_alert_manager/front/src/api/api.js | UTF-8 | 2,629 | 2.84375 | 3 | [] | no_license |
let requestOption = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: null
};
const responseHandler = async(response) => {
if(response.status === 200 || response.status === 201 || response.status === 204){
return response.json();
} else {
const a ... | true |
0eca2a7648c90e7c466044395629a6290a948096 | JavaScript | wclwksn/canvas-painter | /src/js/common/Select.js | UTF-8 | 4,168 | 2.828125 | 3 | [] | no_license | /**
* @下拉菜单组件
* @author anchen01
*/
define(function (require, exports) {
/**
* 下拉选择组件
* @param {Object} options
* @param {jQuery} options.button select按钮 (必须传)
* @param {jQuery} options.layer select浮层 (必须传)
* @param {string} options.attrValueName 属性名,点击浮层获该取属性值
... | true |
211731ff09ec16099f5b93fac79062bcc29b0365 | JavaScript | KaraPedersen/lab-11-pokemon-catcher | /utils.js | UTF-8 | 433 | 2.84375 | 3 | [] | no_license | import { pokeData } from './pokemon.js';
export function findById(array, id) {
for (let item of array) {
if (item.id === id) {
return item;
}
}
}
// export function randomPoke(array) {
// const pokeNumber = Math.floor(Math.random() * array.length);
// return array[pokeNum... | true |
8627325c936cee495dcd56ab531bb78d2f8c5f2a | JavaScript | cmoten/JavaScript-Data-Structures-Course | /Recursive_Fibonacci.js | UTF-8 | 467 | 4.65625 | 5 | [] | no_license | /*
Write a fucntion called fib which accepts a number and returns the nth number in the Fibonacci sequence. Recall that the
Fibonacci sequence is the sequence of whole numbers 1, 1, 2, 3, 5, 8, ... which starts with 1 and 1, and every number
thereafter is the sum of the previous two numbes.
Examples:
fib(4) // 3
fib... | true |
3ea9e98e7642427b533b6c42fbf9b530b94deb34 | JavaScript | zsazsaspeck/Serratec-2021 | /LogicaDeProgramacao/exercicios4/limiteloja.js | UTF-8 | 498 | 2.671875 | 3 | [] | no_license | //O aplicativo na entrada da loja possui internamente um limite de pessoas que podem estar dentro do estabelecimento ao mesmo tempo. Toda vez que um cliente quiser entrar, o segurança irá preencher a quantidade de pessoas já na loja, e o programa avisará se o cliente pode prosseguir.
var ler = require("prompt-sync")();... | true |
8c9678a2e2ffedb682d19a5d4a2d18860c1d3b1e | JavaScript | corey-mitchell/Firebase-Assignment | /assets/Javascript/firebase.js | UTF-8 | 3,324 | 3.046875 | 3 | [] | no_license | // Document Ready Function
$(document).ready(function() {
// Initialize Firebase
var config = {
apiKey: "AIzaSyAgI2MGgnlwTdpSWs8ZimvYD5NO3U3nV4k",
authDomain: "database-test-6d0e5.firebaseapp.com",
databaseURL: "https://database-test-6d0e5.firebaseio.com",
projectId: "database-te... | true |
2acdd518d379badd399d421ab2e8a56533fc0359 | JavaScript | info340a-au18/lecture-demos | /redux/src/reducers.js | UTF-8 | 1,486 | 2.9375 | 3 | [] | no_license | 'use strict';
import {combinedReducers, combineReducers} from 'redux';
import * as Action from './actions';
// let store = {tasks: []}
// let anAction = {type: ADD_TASK, payload: "Description of the new task"};
// let anAction2 = {type: ADD_TASK, payload: "second task"};
// let anAction3 = {type: TOGGLE_TASK, payou... | true |
e644f4088d5dbf06795f13d7f45d18f75ea5e03a | JavaScript | hotan486/nodejs | /sunday/sunday01ex15_http2.js | UTF-8 | 778 | 2.625 | 3 | [] | no_license | var http = require('http');
var server = http.createServer();
server.listen(3000, function(){
console.log('http://localhost:%d',3000);
});
/*server.on('connection',function(socket){
console.log('connection......');
});*/
server.on('request',function(req, res){
//res.end('<h1>Hello</h1>');
//console... | true |
1d43bf2d5436d0f55f8333090024977cc787628c | JavaScript | vutran1412/SpaceInvader | /src/entity.js | UTF-8 | 582 | 2.734375 | 3 | [] | no_license | const Rectangle = require('./rectangle')
function Entity(position, speed, direction) {
this.position = position
this.speed = speed
this.direction = direction
this.time = 0
this.width = 5
this.height = 5
this.hp = 1
}
Entity.prototype.update = function(deltaT) {
this.time += deltaT
}
E... | true |
9d8f2b9989a483cfc06c02b104d464a3134fe296 | JavaScript | mugglim/react-hooks-study | /src/Page/Page.jsx | UTF-8 | 495 | 2.515625 | 3 | [] | no_license | import React from "react";
import styled, { css } from "styled-components";
const StyeldPage = styled.div`
width: 100%;
height: 100%;
${props => {
const { width } = props;
const backgroundColor = width < 720 ? "red" : "blue";
console.log(width, backgroundColor);
return css`
b... | true |
0b80ec609d1d033b504490b3c001c77768d3e779 | JavaScript | htmlacademy-nodejs/560773-typoteka-3 | /src/service/utils.js | UTF-8 | 541 | 2.78125 | 3 | [] | no_license | 'use strict';
const {
ExitCode
} = require(`./constants`);
const getRandomInt = (min, max) => {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
};
const shuffle = (array) => {
return array.sort(() => Math.random() - 0.5);
};
const error = (message) =>... | true |
7d09bee7940ab8aaf90902c2aae98e42ff57de2f | JavaScript | NedelchoPenev/JS_Core | /02. JS Advanced/08_Modules/exercise/03_Turtles/EvkodianTurtle.js | UTF-8 | 502 | 3.078125 | 3 | [
"MIT"
] | permissive | import {Turtle} from "./Turtle";
export class EvkodianTurtle extends Turtle{
constructor(name, age, gender, evkodiumValue) {
super(name, age, gender);
this.evkodiumValue = evkodiumValue;
}
get evkodium(){
return {
value: this.evkodiumValue,
density: this.g... | true |
e0d5a0fe49e522128449c1ce79740c064c5e58f1 | JavaScript | EfraimKrug/TShirts | /junk/oldJSA.js | UTF-8 | 22,533 | 2.921875 | 3 | [] | no_license | //<!-- shopping cart manipulation -->
function calcShoppingCartTotal(formatFlag){
var shoppingCart = document.getElementById("shoppingCart");
var payTotal = 0.00;
for (var r=1; r < shoppingTable.rows.length; r++){
payTotal += parseInt(shoppingTable.rows[r].cells[4].innerHTML * 100);
}
if(formatFlag) ret... | true |
6e95e12aa6192e9dd4c3d5966df37d54bf925ad8 | JavaScript | vforge/react-ttt | /src/utils/players.js | UTF-8 | 449 | 3.046875 | 3 | [] | no_license | const PLAYERS = {
1: {
name: 'X',
color: '#e69f00',
},
2: {
name: 'O',
color: '#56b4e9',
},
};
export function getPlayerName(player) {
return PLAYERS[player].name;
}
export function getPlayerColor(player) {
return PLAYERS[player].color;
}
export function getNextPlayer(player) {
return p... | true |
291799842309a3cfd3b2e4e787b5f0a425e44346 | JavaScript | AndrewLane/JSCalc | /JavaScript.js | UTF-8 | 4,333 | 3.375 | 3 | [] | no_license | let currentInput = document.getElementById("input")
let operandOne = 0
let operandTwo = 0
let operator = 0
let Num1 = document.getElementById('Num1');
let Num2 = document.getElementById('Num2');
let Num3 = document.getElementById('Num3');
let Num4 = document.getElementById('Num4');
let Num5 = document.getElementById('N... | true |
e661454fe1bf2e9a4c39ab2e16ed20c8b0dd1687 | JavaScript | richardljohn/Assignment-Zero | /14-frequencyCounter/frequencyCounter.js | UTF-8 | 314 | 3.328125 | 3 | [] | no_license | function frequencyCounter(word) {
var w = new Object();
for(var i = 0; i < word.length; i++){
key = word.charAt(i);
if(w[key]){
w[key]++;
} else {
w[key] = 1;
}
}
return w;
}
console.log(frequencyCounter("apple"));
// Do not edit this line;
module.exports = frequencyCounter; | true |
4e036794a14e8c548557c865337f20b431731b6f | JavaScript | mfrance14/Trabalho_Final_JavaScript | /js/resumo.js | UTF-8 | 2,273 | 3.234375 | 3 | [] | no_license | let livros = [];
let dados = [];
function recupera(){
dados = JSON.parse(sessionStorage.getItem('dadosusuario'));
livros = JSON.parse(sessionStorage.getItem('guardalivros'));
console.log(livros);
console.log(dados);
exibirResumo();
}
recupera();
function frete(){
let max = Math.floor(20)... | true |
ee7a3082e75c35027713f2f2c1c1a2043321a4c0 | JavaScript | 03l54rd1n3/WIP_LWR.DSK.MKR.MMS | /OldStuff/WebSockets/js/game.js | UTF-8 | 9,734 | 2.75 | 3 | [
"MIT",
"Apache-2.0"
] | permissive |
//Global vars
var canvas;
var context;
var player;
var character;
var character_crushed;
var background;
var background2;
var background3;
var time = 120;
var frame = 0;
var imgWidth = 32;
var imgheight = 32;
var diamondCount = 0;
var chances = [46, 92, 96, 100];
var gravity = 1;
var drawHandle;
var player = ... | true |
73b9b7bc43ccd4e9b12bfb24fd09141f48279829 | JavaScript | evgenik1/codewars | /7_IsNDivisibleBy.js | UTF-8 | 1,294 | 3.921875 | 4 | [] | no_license |
function isDivisible(args) {
var arr = [];
for (var i = 0; i < arguments.length; i++) {
arr.push(arguments[i]);
}
for (var i = 1; i < arr.length; i++) {
if ((arr[0] % arr[i]) != 0) {
return false;
}
}
return true;
}
console.log(isDivisible([100, 50, 25, 5,... | true |
48727be72244684a22dd69e78070504a3c215110 | JavaScript | DakotaLarson/BoxelScript | /js/world/camera/player_controls/PlayerRotation.js | UTF-8 | 783 | 2.890625 | 3 | [] | no_license | import Component from 'Component';
import EventHandler from 'EventHandler';
export default class PlayerRotation extends Component{
constructor(yawObject, pitchObject){
super();
this.yawObject = yawObject;
this.pitchObject = pitchObject
}
enable = () => {
EventHandler.addE... | true |
416caf8c2f7dfe414d9ef5fa1a732b838dde95c7 | JavaScript | Huma-Sahar/my_assignments | /app.js | UTF-8 | 5,553 | 4.125 | 4 | [] | no_license | //CHAPTER 38--42
//1. Write a custom function power ( a, b ), to calculate the value of a raised to b.
// function power(){
// var a = 2;
// var b = 10;
// var c = Math.pow(b, a);
// alert(c);
// }
// power();
/////////////////////////////////////////////////////////////////////
//2. Any year is entered through th... | true |
9cc4bddb87a611dab0c4be077d7a96226d0d9880 | JavaScript | LiubaLozynska/reen_template | /js/script.js | UTF-8 | 365 | 2.984375 | 3 | [] | no_license | function buttonClick(){
let buttons=$('.main-button');
let len=buttons.length;
for (let i=0; i<len; i++){
buttons.eq(i).on('mousedown', function(){
buttons.eq(i).css('font-weight','500');
})
buttons.eq(i).on('mouseup', function(){
buttons.eq(i).css('font-weigh... | true |
eb9e2e424bd0c458d9a95e925e72ef15a7fbd306 | JavaScript | pekka566/improv-client | /src/modules/login.js | UTF-8 | 2,076 | 2.59375 | 3 | [
"MIT"
] | permissive | import qs from 'qs';
// const API_URL = 'https://improv-api.herokuapp.com';
const API_URL = 'http://localhost:5000';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
export const LOGIN_FAILURE = 'LOGIN_FAILURE';
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
// ------------------------------------
// Action creators
c... | true |
195bc621c8e954aa54bfd7a3bcde794ee6aba6e6 | JavaScript | BackupTheBerlios/sitebe-svn | /trunk/projet-be/admin/Scripts/scripts_admin_matieres.js | ISO-8859-1 | 1,685 | 2.96875 | 3 | [] | no_license | /*
** Fichier : scripts_admin_matieres
** Date de creation : 26/11/2004
** Auteurs : Conde Mickael, Badaoui Kassem, Canaye Kurvin, Guenatri Kamil
** Version : 1.0
** Description : Fichier contenant les fonctions javascript pour verifier les matieres
*/
/*
** fonction : checkMatiere
** entrees : formName : nom du for... | true |
1398ea3faa91f7abd07f4b0df771dc44b19c1ad1 | JavaScript | cakeinpanic/core | /lib/shower/shower.Container.js | UTF-8 | 7,448 | 2.734375 | 3 | [
"MIT"
] | permissive | /**
* @file Container class for shower slides.
*/
shower.modules.define('shower.Container', [
'Emitter',
'util.bound',
'util.extend'
], function (provide, EventEmitter, bound, extend) {
/**
* @typedef {object} HTMLElement
*/
/**
* @class
* @name shower.Container
*
* ... | true |
6bce987e2163974593b0147fced20355161e18a0 | JavaScript | orrmendelson/InteractB2C | /Task.jsx | UTF-8 | 2,228 | 3.0625 | 3 | [] | no_license | // Task component - represents a single todo item
Task = React.createClass({
propTypes: {
task: React.PropTypes.object.isRequired,
showPrivateButton: React.PropTypes.bool.isRequired
},
toggleChecked() {
// Set the checked property to the opposite of its current value
Meteor.call("setChecked", this.... | true |
87e3d0944a6fd380972561ab373f43a6e0ed77d4 | JavaScript | mateuszlewandowicz/last_element_list | /script.js | UTF-8 | 316 | 3.46875 | 3 | [] | no_license | const ulList = document.createElement('ul');
document.body.appendChild(ulList);
let number = 4;
for(let i = 1; i<number; i++){
const liItem = document.createElement('li');
ulList.appendChild(liItem).textContent = i;
}
const lastLi = document.querySelector('li:last-child');
lastLi.innerText ='Ostatni element'; | true |
28b3cfe14677abd0ef87c9e8df32ad48a65523de | JavaScript | Mondal10/Node-JS-Tutorial | /basic part 1/10_usingPipes.js | UTF-8 | 1,000 | 3.359375 | 3 | [] | no_license | /**
* Using pipes
*
* The pipe() function reads data from a readable stream as it becomes available and writes it to a destination writable stream.
*/
const http = require('http');
const fs = require('fs');
const server = http.createServer((req, res) => {
console.log(`URL of the page: ${req.url}`);
/* 200... | true |
2eab79638dbd2f9f5970a009b52414a130ce0ce7 | JavaScript | wonsunil/hangul | /js/index.js | UTF-8 | 5,485 | 2.953125 | 3 | [] | no_license | const choArray = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ',
'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ',
'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'];
const jungArray = ['ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ',
'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ',
'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅣ'];
const jongArray = ['', 'ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ',
'ㄷ', 'ㄹ', 'ㄺ', 'ㄻ', 'ㄼ', 'ㄽ'... | true |
f8f3ce8d93679b34e338aed521b4b31bc9678bd5 | JavaScript | wqzwh/DataStructures-Algorithms | /src/algorithm/quickSort/quickSort3.js | UTF-8 | 1,458 | 3.234375 | 3 | [
"MIT"
] | permissive | /**
*
* 快速排序
* 交换法
* https://segmentfault.com/a/1190000004410119
*
*/
const Helper = require('../../helper/index')
// 1,每次取数组的第一项作为基准值,从第二项开始遍历
// 2,start代表开始时第二项的下标索引,start开始向后移动,当发现对应的值大于等于参考值先停下,继续执行3
// 3,end代表数组结尾的索引,开始向后移动,当发现对应的值小于基准值,则与start对应的值进行交换,然后继续执行2,直到start在end后面一位,将基准值与end交换,执行4
// 4,返回此时的end值,然... | true |
19ea81062cf42f6c8dae70dcd1244c9d884e499a | JavaScript | VuNTruong/Cuckoo-Node.js-API | /controller/cuckooController/cuckooPostCommentPhotoController.js | UTF-8 | 2,739 | 2.640625 | 3 | [] | no_license | // Import the cuckoo post comment photo model
const cuckooPostCommentPhotoModel = require(`${__dirname}/../../model/cuckooModel/cuckooPostCommentPhotoModel`);
// Import the handler factory
const factory = require(`${__dirname}/../handlerFactory`);
// Import the catchAsync
const catchAsync = require(`${__dirname}/../.... | true |
ce526508369fea82bed0345b011fc97d6534723d | JavaScript | leonorfmartins/ExercismSolutions | /ecmascript/hamming/hamming.js | UTF-8 | 361 | 3.1875 | 3 | [] | no_license | export default class Hamming {
compute(source, toCompare) {
if (source.length !== toCompare.length) throw new Error("DNA strands must be of equal length.");
let distance = source.split('').reduce((distance, char, i) => {
if (char != toCompare[i]) {
return distance+1;
}
return distanc... | true |
3d9e2f78f620c7dd2c56c7a2e3fa0737e239b5a9 | JavaScript | leoliveira28/principios-da-programacao-funcional | /funcao_pura2.js | UTF-8 | 302 | 3.625 | 4 | [] | no_license | // FUNÇÃO IMPURA
function geraNumeroAleatorio(min, max) {
const fator = max - min + 1
return parseInt(Math.random() * fator) + min
}
console.log(geraNumeroAleatorio(10, 20))
console.log(geraNumeroAleatorio(5, 6))
console.log(geraNumeroAleatorio(5, 6))
console.log(geraNumeroAleatorio(5, 6)) | true |
3f33fb7f0d6bedf9b3ded8ffc180b5217d3476ea | JavaScript | minhduc2803/School | /HK5/Web/Tuan_02/1712358_1712369_1712379_1712347/4D/script/night.js | UTF-8 | 2,811 | 2.9375 | 3 | [] | no_license | function check() {
var top = document.getElementById("top");
var bg = document.getElementById("bg");
var title = document.getElementById("title");
var home = document.getElementById("home");
var night = document.getElementById("night");
var dl = document.getElementById("dl");
var info = docu... | true |
2fa95f82c6746ed448ed8f466acbf2dbb834f69d | JavaScript | Earth-Turtle/DiscordBot19 | /index.js | UTF-8 | 1,821 | 3.0625 | 3 | [] | no_license | // Grabs the filesystem access of node.js
const fs = require('fs');
//Gets discord's API
const Discord = require("discord.js");
//Gets the settings done in our config file
const { prefix, token } = require("./config.json");
const client = new Discord.Client();
client.commands = new Discord.Collection();
const commandF... | true |
41c459414ef53deec347303a2bfb2cfd849e86a2 | JavaScript | hongdeyuan/javascript_fullstack | /MiaoZ/js/curry/curry.js | UTF-8 | 461 | 3.484375 | 3 | [] | no_license | function sum(a, b, c) {
return a + b + c;
}
const curry = (func) => {
const _curry = function(...args) {
if (args.length === func.length) {
return func(...args);
}
return (...params) => {
let _args = [...args, ...params];
if (_args.length === func.length) {
return func(..._args... | true |
153ed660af828cc56438084cb24e8e9e1d9a5838 | JavaScript | maddenpj/msc-orderbook | /MEOrderScraper.js | UTF-8 | 1,668 | 2.6875 | 3 | [] | no_license | var http = require("http");
var SellOrder = require('./Order.js');
var EventEmitter = require('events').EventEmitter;
function OrderScraper(period, pages) {
this.url = "http://mastercoin-explorer.com";
this.uri = "/api/v1/selling_offers.json?page=";
this.period = period;
this.pages = 10;
}
OrderScraper.prototy... | true |
51f87037b2a94afa836529c914855e3a6ad493d3 | JavaScript | caleeli/pandemia | /src/components/mixins/Actions.js | UTF-8 | 7,197 | 2.640625 | 3 | [] | no_license | import actionFeature from './actionFeature';
const pi = Math.atan(1) * 4;
// COSTS
const canCosts = {
points(points) {
return this.points >= points;
},
none() {
return true;
},
evolve(action) {
action.preLevel = action.preLevel === undefined ? 0 : action.preLevel;
c... | true |
00b0c1c2287d036f11138bb08a528ae2aa24e3d6 | JavaScript | nguyenxuanda0550/Coffee-and-Tea | /models/cart.model.js | UTF-8 | 1,186 | 2.90625 | 3 | [] | no_license | function cart(cart_old) {
this.items = cart_old.items || []
this.priceTotal = cart_old.priceTotal || 0
this.add = function(product, id, imageSrc) {
const index = this.items.findIndex(s => s.id === id)
if (index < 0) {
this.items.push({ id: id, qty: 1, item: product, imageSrc })
... | true |
9101323c5e46b2fcbf6b686407c6b339263ca0b1 | JavaScript | fatcatt316/clase_de_front_end | /homework3/yavascript.js | UTF-8 | 640 | 2.5625 | 3 | [] | no_license | $(function() {
var initializeRequest = function(button) {
$('#resultz').html("<img src='loading_cat.gif'>");
button.prop('disabled', true);
}
$('.ajax-it-up').on('click', function(event) {
initializeRequest($(event.target));
$.get({
url: 'http://thecatapi.com/api/images/get.php?format=htm... | true |
f7516eb1a99042ed7eb6c282d3af9270cc596112 | JavaScript | pleomax13/weather | /src/App.js | UTF-8 | 6,999 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Days from './components/Days';
import Head from './components/Head';
import Degree from './components/Degree';
import rain from './components/images/rain.jpg'
import thunderstorm from './components/images/thunderstorm.jpg'
import fog from './component... | true |
f7f1be4faaedef75b765dfd6d8ea2b506f5d9f64 | JavaScript | KenHoang16CDTH12/FG-YouthUnion | /resources/assets/js/_services/auth.service.js | UTF-8 | 967 | 2.546875 | 3 | [
"MIT"
] | permissive | import { url } from '../_helpers';
import { authHeader } from '../_helpers';
import { contentType } from '../_helpers';
import { handleResponse } from '../_helpers';
export const authService = {
login,
user,
logout
};
function login(email, password, remember_me) {
const requestOptions = {
meth... | true |
94a95578ffb0a563331f7f97c1af4a9c69ef1851 | JavaScript | UtileHomme/Programming_Codes | /Advanced_Javascript/lesson14/test7.js | UTF-8 | 245 | 4.15625 | 4 | [] | no_license | // How to get arguments list using array index
// var x = function()
// {
// //gives the first argument i.e. 1
// console.log(arguments[0]);
// };
//using spread operators
var x = (...args) =>
{
console.log(args[0]);
}
x(1,2,3);
| true |
6c3f9b90357a33473a152de10f9a268c2d47ca9d | JavaScript | rochakg05/rochakg05.github.io | /Js_car_lane_game_with_bullet_implementation/js/item.js | UTF-8 | 707 | 3.015625 | 3 | [] | no_license | class Item {
constructor(pos_x, pos_y, type, img_path) {
this.pos_x = pos_x;
this.pos_y = pos_y;
this.vel_y = 0;
this.type = type;
this.img_path = img_path;
this.image = new Image();
this.image.src = this.img_path;
this.collide_rect = new Rect(p... | true |
d73d954e468f437eefe64660fef7d7ca63066733 | JavaScript | ronglang/qidongmes | /src/main/webapp/core/js/board/insulation2.js | UTF-8 | 6,603 | 2.546875 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$("#showtime").html(showTime);
setInterval(function(){
$("#showtime").html(showTime);
},1000);
//图
// $("#two .left").css("width",winWidth/2+'px');
// $("#two .right").css("width",winWidth/2+'px');
// getCheckSpeed();
// getCheckOD();
taskwebSocket();
//getTackPoint();
});
... | true |
093caa4ae1bad5eaead57b6daa7e97541b2cef47 | JavaScript | svetlanaaleshina2104/JS | /lesson 12/func.js | UTF-8 | 388 | 3.1875 | 3 | [] | no_license | function appleMaster(num) {
console.log('я подошел к корзине ' + num + ' с яблоками');
console.log('я посчитал каждое яблорко в корзине ' + num);
console.log('я записала сколько было в корзине ' + num + ' яблок');
}
for ( let i = 1; i < 4; i++ ) {
appleMaster(i);
}
appleMaster(5);
| true |
3a7ed5f5995fc9207617f49a3dd097c3d62fa9a5 | JavaScript | lovecolor/Openwt-React2021-PhanThanhHoangLong- | /js/ES6(part1)/ex17.js | UTF-8 | 199 | 2.859375 | 3 | [] | no_license | const filterArr = (arr, filter) =>
arr.reduce(
(rs, value, idx) => (rs[filter[idx] ? 0 : 1].push(value), rs),
[[], []]
);
console.log(filterArr([1, 2, 3, 4], [true, true, false, true]));
| true |
06c29a788f44d8ccb951d530b7cb2f6b0e884ce8 | JavaScript | mlundstrom23/algorithm-practice | /searches.js | UTF-8 | 746 | 5.125 | 5 | [] | no_license | /*
Linear Search
We will begin by explaining how to implement linear search in
JavaScript. We will create a function called linearSearch
that accepts a value that is an integer or string and an array
as parameters. The function will search every element in the
array for the value and return the position of the va... | true |
ee8c5921b1d7fd067f228baf6baeee3161f3d154 | JavaScript | knightyueguang/sellapp | /src/api/apis.js | UTF-8 | 764 | 2.734375 | 3 | [] | no_license | // 所有请求封装接口文件(方便项目后期维护,所有请求统一管理)
import axios from 'axios'
// var axios = require('axios')
// axios.defaults.baseURL = 'http://localhost:3000'
// 完全等效
//创建一个请求对象
let req = axios.create({
baseURL: 'http://localhost:3000', // 基本路径
timeout: 10000 //ms 请求10秒,如果10秒还没有请求到,则提示超时!!(8-12秒) 超时限制!
})
//这个... | true |
0d0893379c76d1315a26cda25eee0d46367cd989 | JavaScript | faviofz/contact_form | /js/script.js | UTF-8 | 1,306 | 3.453125 | 3 | [] | no_license | window.onload = function () {
const form = document.getElementById("myform");
const submit = document.getElementById("submit");
form.addEventListener("input", function () {
const nombre = document.getElementById("nombre");
const email = document.getElementById("email");
if (nombre.value != "" && email.value !... | true |
678be1626618d53a8ea5b47a13d00a05dd0854ca | JavaScript | tienthienngt1/project-reactjs1 | /src/contexts/AuthContext.js | UTF-8 | 2,438 | 2.546875 | 3 | [] | no_license | import { createContext, useReducer, useEffect } from "react"
import AuthReducer from "../reducers/AuthReducer";
import { loginCore, sendResAuthCore, registerCore } from "../cores/AuthCore"
import setToken from "../helps/setToken";
import { SET_AUTH } from "../constants/AuthConstant";
import { LOCAL_STORAGE_TOKEN_NAME }... | true |
9927ffe4fd935fb99119358238933bd350133c55 | JavaScript | vaulty-co/js-sdk | /packages/common/src/nodes/__tests__/Node.spec.js | UTF-8 | 1,619 | 2.515625 | 3 | [] | no_license | import { Node } from '../Node';
describe('Node', () => {
let nodeInstance;
beforeEach(() => {
nodeInstance = new Node({
node: document.createElement('div'),
});
});
describe('#appendTo', () => {
});
describe('#addClass', () => {
it('should add class to node, when classes are not defin... | true |
3518679b612438bcd21e2f34013be1ffcabd96af | JavaScript | angelia-yuqi-personal/node-game-physics-engine | /src/actions/WrapInRectangle.js | UTF-8 | 431 | 2.640625 | 3 | [] | no_license | var Wrap = require('../math/Wrap');
var WrapInRectangle = function(items, rect, padding) {
if (padding === undefined) {
padding = 0;
}
for (var i = 0; i < items.length; i++) {
var item = items[i];
item.x = Wrap(item.x, rect.left - padding, rect.right + padding);
item.y = Wrap(item.y,... | true |
253df752e72e3a01bca20d32b8ee9c1987b66762 | JavaScript | hwynn/QuickJournal | /data/DLrules.js | UTF-8 | 4,238 | 2.546875 | 3 | [] | no_license | function hideExtra() {
document.getElementById("showButton").style.display = "block";
document.getElementById("hideButton").style.display = "none";
document.getElementById("AdvancedOptions").style.display = "none";
document.getElementById("OptionBox").style.height = "18px";
};
function showExtra() {
document.ge... | true |
0f7fed8af8a2b146239cf3d15eadf0599892ea3f | JavaScript | robertzanceanu/Colr | /proiect/frontend/rankings/rankings.js | UTF-8 | 3,494 | 2.796875 | 3 | [] | no_license | const artefactTable = document.getElementById('table-artefacts')
const userTable = document.getElementById('table-users')
const getArtefacts = async () => {
try {
const response = await fetch(`http://localhost:8081/api/artefacts/get-artefacts`, {
method: 'get',
headers: {
'Acc... | true |
24497052e054ce27ae18257816c448bfe6d38393 | JavaScript | VNagorniy/module10_homework | /Задание 3 (Модуль 10.6)/script.js | UTF-8 | 4,573 | 3.015625 | 3 | [] | no_license | /* Задание 3
Реализовать чат на основе эхо-сервера wss://echo.websocket.org/
Интерфейс состоит из input, куда вводится текст сообщения, и кнопки «Отправить».
При клике на кнопку «Отправить» сообщение должно появляться в окне переписки.
Добавить в чат механизм отправки гео-локации:
При клике на кнопку «Гео-локаци... | true |
41c2eac884f635ac4cf83080b292f03f3f402e0f | JavaScript | photonstorm/phaser3-docs | /percy/lib/getQueryString.js | UTF-8 | 1,673 | 3.28125 | 3 | [
"MIT"
] | permissive | /**
* Takes a Uniform Resource Identifier (URI) component (previously created by encodeURIComponent or by a similar routine) and
* decodes it, replacing \ with spaces in the return. Used internally by the Net classes.
*
* @method Phaser.Net#decodeURI
* @param {string} value - The URI component to be decoded.
* @return ... | true |
a64beea6728b65a7fa59bf5aa3cb65588ddb554a | JavaScript | Pupix/JSONForms | /index.js | UTF-8 | 5,929 | 2.90625 | 3 | [
"MIT"
] | permissive | 'use strict';
// Tester
function isNumeric(value) {
// Returning
return /^\d+$/.test(value);
}
// Parser
function parsePath(path) {
let steps = [],
memento = path,
first = path.substr(0, path.indexOf('[')),
error = !first.length;
if (!error) {
path = path.subst... | true |
dcfebb5d8b21ab740dd0299ffbf62da7273055fb | JavaScript | reemshai10/express-server | /server.js | UTF-8 | 4,382 | 2.796875 | 3 | [] | no_license | // Modules
const express = require("express");
const fs = require("fs");
const path = require("path");
const bodyParser = require("body-parser");
const { map, parseJSON } = require("jquery");
const port = 3001;
const app = express();
app.use(express.json());
// view engine setup
app.set("views", path.j... | true |
b321e4b8ac10061f8bdc991e7d569b232c0fb196 | JavaScript | EdwinWq/newreact | /react-demo/react-basic/src/App.js | UTF-8 | 1,245 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import Person from './Person/Person'
class App extends Component {
state={
persons:[
{name:'王伟东',cont:'20'},
{name:'佳琪',cont:'20'},
{name:'文明',cont:'20'},
],
other:"anything"
}
swithNameHandler=(newTex,newCont) => {
conso... | true |
3e59f96f53244a03d6b7ebff0701866f66f53e57 | JavaScript | george-g/pm | /components/client/src/main/webapp/js/domain/bounds.js | UTF-8 | 3,885 | 2.9375 | 3 | [] | no_license | "use strict";
function ChartBuilder(qnm) {
var pointsNumber = calcPointsNumber();
this.buildMaxXChart = function () {
var result = chartTempate();
result.title.text = 'Maximum Throughput';
result.subtitle.text = 'X(N)';
result.yAxis.title.text = 'X (tps)';
result.toolt... | true |
3ccacd221b73514560ffa0b5abe5ec3d44519568 | JavaScript | johnmschneider/johnmschneider.github.io | /projects/rpg game 1/pointsOfInterest/settlement.js | UTF-8 | 2,164 | 3 | 3 | [] | no_license | import { PointOfInterest } from
"https://johnmschneider.github.io/projects/rpg%20game%201/pointsOfInterest/pointOfInterest.js";
import { Utils } from
"https://johnmschneider.github.io/projects/rpg%20game%201/utils.js";
class Settlement extends PointOfInterest {
constructor(name, sizeModifier, size, chunk... | true |
5c5aac21b66750a3d21607247aa23c2d9106ef09 | JavaScript | satanas/cards-client | /views/opponent_ground.js | UTF-8 | 871 | 2.578125 | 3 | [] | no_license | var OpponentGround = Backbone.View.extend({
initialize: function() {
this.collection.on('add', this.addCard, this);
this.collection.on('remove', this.removeCard, this);
},
addCard: function(card) {
var cardView = new CardView({model: card, reversed: false, opponent: true});
this.$el.append(cardVie... | true |
b799d064c18857f4bf35318dea3936f846e0cdac | JavaScript | neecholai/jobly | /__tests__/integration/jobsRoutes.test.js | UTF-8 | 8,990 | 2.5625 | 3 | [] | no_license | process.env.NODE_ENV = 'test';
const request = require('supertest');
const db = require('../../db');
const Company = require('../../models/company');
const Job = require('../../models/job');
const User = require('../../models/user');
const app = require('../../app');
const jwt = require('jsonwebtoken');
const {
SECR... | true |
f7dc9ff5c9218aae5dba105b4ac080ca8bbbee06 | JavaScript | Ccallananranken/all-web-dev-coursework | /murach_js_3e/exercises/ch07/slideshow/slideshow.js | UTF-8 | 990 | 2.9375 | 3 | [
"MIT"
] | permissive | "use strict";
var $ = function (id) { return document.getElementById(id); };
var imageCache = [];
var imageCounter = 0;
var timer;
var runSlideShow = function() {
imageCounter = (imageCounter + 1) % imageCache.length;
var image = imageCache[imageCounter];
$("image").src = image.src;
$("caption").first... | true |
abfbcb9fa57480f98bd470f760a4a341aa37e176 | JavaScript | franciscobrs/SistemaPOO3 | /test/index.spec.js | UTF-8 | 2,145 | 2.703125 | 3 | [] | no_license | //var projeto = require('../app/models/projeto');
var chai = require('chai');
var chaiHttp = require('chai-http');
var server = require('../index');
var should = chai.should();
chai.use(chaiHttp);
/*
* Teste da rota: /GET
*/
describe('/GET usuario', function() {
it('Deve retornar todos os usuar... | true |
74134a11cbef8733856337cd6e29f8be5bf3d525 | JavaScript | jsdelivrbot/todolist-7 | /app/web/assets/js/tools/prototype.js | UTF-8 | 8,289 | 2.65625 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | function prototype() {
//collection-list.html.twig
// set these values with your own
// {% set myCollectionId = 'collection-list' %}
// {% set myCollectionName = '__name1__' %}
// {% set collectionForm = form.collectionListName %}
// then use the markup as below //your can use any container you... | true |
4c02cfe8c3091cb8415b7fb2f37ed8eb3e8704fb | JavaScript | BMariscal/coding-challenges | /FreeCodeCamp_Algos-master/BasicAlgorithm/mutations.js | UTF-8 | 302 | 3.53125 | 4 | [] | no_license | function mutation(arr) {
var final ="";
var arr0 = arr[0].toLowerCase();
var arr1= arr[1].toLowerCase().split('');
for (var i=0; i < arr1.length; i++){
if (arr0.indexOf(arr1[i]) >= 0){
final += arr1[i];
}
}return (final.length == arr1.length);
}
mutation(["floor", "for"]); | true |
cf0f7e48a254af8a034768d498ba4f3ad67cb161 | JavaScript | Chad414/RSClan-Tools | /js/vorago.js | UTF-8 | 801 | 2.953125 | 3 | [] | no_license | export function vorago() {
let firstRotationDate = new Date('June 2, 2021 00:00:00 GMT+0:00');
//let currentDate = new Date('July 13, 2021 00:00:00 GMT+0:00');
let currentDate = new Date();
let timeDifference = currentDate.getTime() - firstRotationDate.getTime();
let daysDifference = Math.floor(timeD... | true |
34875fbff5f759cafbf98115a59c986bb13725f0 | JavaScript | bkawk/divergence2 | /src/slope.js | UTF-8 | 2,229 | 2.890625 | 3 | [
"MIT"
] | permissive | // @ts-check
'use strict';
const divergenceModel = require('./model/divergence');
/**
* get subscriptions
* @param {Object} columns The value to the left of target
* @param {number} period The tagets value
* @param {String} direction The value to the right of target
* @param {String} type The value to the right of... | true |
3d9181c6ccd030a2eccc3e833afd398382f5a18e | JavaScript | Preciouschukwuemeka/project-2 | /js/script.js | UTF-8 | 3,073 | 3.484375 | 3 | [] | no_license | /******************************************
Treehouse Techdegree:
FSJS project 2 - List Filter and Pagination
******************************************/
// NAME: PRECIOUS C. CHUKWUEMEKA
// Study guide for this project - https://drive.google.com/file/d/1OD1diUsTMdpfMDv677TfL1xO2CEkykSz/view?usp=sharing
/... | true |
69632ec08ff853dbeb4c1d7b48b5808a779009a0 | JavaScript | Throwback74/goSoftPhone | /public/assets/js/phoneList.js | UTF-8 | 622 | 2.53125 | 3 | [] | no_license | $(document).ready(function(){
// var table = $("#table tbody");
$.post("/api/contacts", function(data){
console.log(data);
$(".tableAppend").append(data.data);
});
$(".add-btn").click(function() {
// event.preventDefault();
// $.get("/api/contact/create",
// function (data) {
// ... | true |
49a933a39c41af2b3b7f7890260b41e3d06187c3 | JavaScript | CC-cat/case-PhaserJs | /0-test/动画/1水平移动动画事件/js/main.js | UTF-8 | 2,096 | 3.265625 | 3 | [] | no_license | // 实际应用场景改为window.innerWidth和window.innerHeight。
// 这里是为了方便查看示例。
var width = window.innerWidth;
var height = window.innerHeight;
console.log('width: ' + width);
// 创建游戏实例
var game = new Phaser.Game(width, height, Phaser.AUTO, 'game', { preload: preload, create: create, update: update });
// 加载场景
function preload () ... | true |
f890c1b84605589a85d1dae7394773e74ad666e3 | JavaScript | with-two-dashes/a-diary | /coding-math/ep-16-springs-part-2/world.js | UTF-8 | 2,333 | 2.796875 | 3 | [] | no_license | import {
registerRenderCycle,
getCanvas,
clearCanvas,
startRender
} from './main.js'
import { drawCircle } from '../common/drawCircle.js'
import { drawLineBetween } from '../common/drawLineBetween.js'
import { makeParticle } from '../common/makeParticle.js'
import { randomRange } from '../common/randomRange.js... | true |
ac68c6b17af8caecc8234c211365539a44087087 | JavaScript | R0maric/PlayPauseFirefox | /data/multibutton-html5-player.js | UTF-8 | 2,128 | 2.625 | 3 | [
"MIT"
] | permissive | // This file is part of Play/Pause extension for Mozilla Firefox
// https://github.com/DanielKamkha/PlayPauseFirefox
// (c) 2015-2016 Daniel Kamkha
// Play/Pause is free software distributed under the terms of the MIT license.
(function() {
"use strict";
function MultiButtonHtml5Player(id, win, se... | true |
0f19a41428acc326ae3e52056b04c8dd24e7f2d7 | JavaScript | SouVangLee/PracticeProblems | /9_20_2021/balancedBrackets.js | UTF-8 | 451 | 3.625 | 4 | [] | no_license | function balancedBrackets(string) {
const stack = [];
const allBrackets = "{}[]()".split('');
const match = {
"}": "{",
"]": "[",
")": "("
};
for (const char of string) {
if (allBrackets.includes(char)) {
if (!match[char]) stack.push(char);
else {
const leftBracket = stack[stack.length - 1];... | true |
99e024e8f13e498d2ef05cdef57c7896ff3c0d9b | JavaScript | gablou/bundleSize | /src/package-buider.js | UTF-8 | 2,809 | 2.609375 | 3 | [] | no_license | const NpmUtils = require("./npm-util");
const path = require("path");
const fs = require("fs");
const webpack = require("webpack");
const mkdir = require("mkdirp");
const TerserPlugin = require("terser-webpack-plugin");
const gzipSize = require("gzip-size");
const rimraf = require("rimraf");
const PackageBuilder = {
... | true |
7415e2b265aafe951096e1a02e3e6f5d9cb54275 | JavaScript | eugenejscray-zz/eugenescray.com | /test/bg.js | UTF-8 | 4,838 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | // runtime
// We have to make this so we can have multiple animation lines in the canvas.
$(document).ready(function(){
document.getElementById('bg').height = $(document).height();
document.getElementById('bg').width = $(document).width();
// ranomize this accross the screen.
var animation = new animatedLine(Math... | true |
b2d6e6f8221dee4b414ab5d0ee80966022092445 | JavaScript | poakapx/Reacting_to_day_time_2 | /script.js | UTF-8 | 1,741 | 3.59375 | 4 | [] | no_license | sayTime(function()
{
document.getElementById('TimeID');
});
function sayTime()
{
var now = new Date();
var hours = now.getHours()
var divider = ":";
if (now.getMinutes() < 10)
{
divider = ":0";
}
var time = "" + hours + divider + now.getMinutes();
document.write("Сейчас <b... | true |
26a30fd8f427016ad3b7611155aa2aecf1534dbb | JavaScript | blazed95/NodeJs-ReactJs-Ecommerce | /src/Contexts/AuthContext.js | UTF-8 | 3,990 | 2.703125 | 3 | [
"MIT"
] | permissive | import React, { useContext, useState, useEffect } from "react"
import firebase from "../config/firebase"
//import { useHistory } from "react-router-dom"
require('dotenv').config();
const AuthContext = React.createContext();
export const useAuth = () => {
return useContext(AuthContext)
}
export const AuthProvid... | true |
b456b98e1124ca45b4fcc644dde36be8ccb6801f | JavaScript | avaire/avaire-node | /app/bot/commands/administration/ToggleModuleCommand.js | UTF-8 | 5,743 | 2.609375 | 3 | [
"MIT"
] | permissive | /** @ignore */
const _ = require('lodash');
/** @ignore */
const Command = require('./../Command');
/** @ignore */
let categories = _.orderBy(require('./../Categories'));
/**
* Toggle Module Command, allows users to toggle command modules on or off for
* any given text channel, or globally for all channels on their... | true |
6321d625aa39ee9eb77c1ae2276fed46853ae7a1 | JavaScript | crystalngo88/Eat-Da-Burger | /routes/api-routes.js | UTF-8 | 831 | 2.53125 | 3 | [
"MIT"
] | permissive | var burger = require("../models/burger.js")
module.exports = function (app) {
app.get("/api/:burgers?", function (req, res) {
if (req.params.burgers) {
burger.findOne({
where: {
routeName: req.params.burgers
}
}).then(function (res... | true |
1d22c2df0aa723bcd1e654435d693232dce40c28 | JavaScript | ModernSolutions2019/PizzariaCapitaoGancho | /src/actions/RankingActions.js | UTF-8 | 1,358 | 2.546875 | 3 | [] | no_license | import firebase from '../FirebaseConnection';
export const getRankingList = () => {
return dispatch => {
firebase
.database()
.ref('clientes')
.orderByChild('pizzas')
.on('value', snapshot => {
let clientes = [];
snapshot.forEach(childItem => {
clientes.push({
... | true |
5b2d2c8b38204bff27cf2a4220a97e34ddaeff71 | JavaScript | arte921/caster | /client/minimap.js | UTF-8 | 1,220 | 3.078125 | 3 | [] | no_license | class Minimap {
constructor(minx, miny, xsize, scenewidth, sceneheight, walls) {
this.xsize = xsize;
this.ysize = (xsize / scenewidth) * sceneheight;
this.minx = minx;
this.miny = miny;
this.maxx = minx + xsize;
this.maxy = miny + this.ysize;
this.scenewidth =... | true |
bccb3493572c25b998b547b382a37f2348a9fc69 | JavaScript | pomazafa/RS-Node-2 | /src/resources/tasks/task.memory.repository.js | UTF-8 | 844 | 2.546875 | 3 | [] | no_license | const db = require('../../common/inMemoryDB');
const TABLE_NAME = 'Tasks';
const Task = require('./task.model');
const getAll = async () => {
return db.getAllEntities(TABLE_NAME);
};
const get = async id => {
const task = await db.getEntity(TABLE_NAME, id);
if (!task) {
console.error(`Task Not found: id=${i... | true |
95ff12a24d61e771862e0ca5fe1ae212eddba9cc | JavaScript | avijassra/CodeLab | /src/Games/Foundation/resources/jewel-warrior/board.worker.js | UTF-8 | 795 | 2.828125 | 3 | [] | no_license | // this is initialialize for the worker group thread.
// Since jewel is initialize in UI thread hence it wont be accessible in the worker thread
var jewel = {};
// importing original board.js to all the functions
importScripts("board.js");
// add message event lister for worker
addEventListener("message", function(e)... | true |
54aaf224482f2674131a61b1f5ebab926e43862e | JavaScript | ronny0005/facturationPHP_DEV_JEE | /js/Structure/Comptabilite/script_clotureCaisse.js | UTF-8 | 432 | 2.78125 | 3 | [
"MIT"
] | permissive | jQuery(function($){
$("#dateCloture").datepicker({
dateFormat: "ddmmy", altFormat: "ddmmy",
autoclose: true
});
$("#dateCloture").datepicker({dateFormat: "ddmmy"}).datepicker("setDate", new Date());
var dateObj=new Date();
var time = ("0"+dateObj.getHours()).substr(-2)+":"+("0"+dat... | true |
4e1566f92c14e99d134f79ac6b406f14d28a24df | JavaScript | tyjmills/tyjmills.github.io | /lesson11/js/sodasprings.js | UTF-8 | 2,278 | 3.25 | 3 | [] | no_license | const apiURL = "https://api.openweathermap.org/data/2.5/weather?id=5607916&APPID=efd675dac7a1f59deb4d112586940beb&units=imperial";
const apiForcast = "https://api.openweathermap.org/data/2.5/forecast?id=5607916&APPID=efd675dac7a1f59deb4d112586940beb&units=imperial";
fetch(apiURL)
.then((response) => response.json(... | true |
36dafe9842d988b46a15cf92283f4d3e3a6636ff | JavaScript | d-bryan/moore-than-detailing | /client/src/components/user-pages/services-pages/AdditionalServices.js | UTF-8 | 2,388 | 2.703125 | 3 | [] | no_license | import React from 'react';
// import components
import ServiceTableHeader from './ServiceTableHeader';
import TableContainerLeft from './TableContainerLeft';
import TableContainerRight from './TableContainerRight';
export default class AdditionalServices extends React.PureComponent {
state = {
serviceList: [],... | true |