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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
62a8c98349cb3db32be9130ce8675b95de32ad48 | JavaScript | jazyx/monika | /js/game/levels/03_odd_consonants.js | UTF-8 | 1,818 | 2.75 | 3 | [] | no_license | "use strict"
;(function levelLoaded(monika){
// monika = { map: { <name>: <object>, ... }, name: <string> }
if (!monika.classes) {
monika.classes = {}
monika.levels = {}
}
class OddConsonants extends monika.layouts.Digits {
constructor (options) {
options.cue_range = options.cue_range ... | true |
1cc4dd50767d82ffad1548d5759f981a1f11bd2e | JavaScript | zxhycxq/flame | /controllers/queries/index.js | UTF-8 | 1,971 | 2.515625 | 3 | [
"MIT"
] | permissive | const asyncWrapper = require('../../middleware/asyncWrapper');
const File = require('../../utils/File');
const { join } = require('path');
const QUERIES_PATH = join(__dirname, '../../data/customQueries.json');
// @desc Add custom search query
// @route POST /api/queries
// @access Public
exports.addQuery ... | true |
68fe83e126a73e801a85633701e37979b69ad804 | JavaScript | Ilomansur9999/TUGAS-3-JS | /tugas3.js | UTF-8 | 180 | 2.734375 | 3 | [] | no_license | // SEBELUM DIKIRM NILAI
function mintadata(x = 100){
console.log(x);
}
mintadata();
// SESUDAH DIKIRIM NILAI
function mintadata(x = 100){
console.log(x);
}
mintadata(50);
| true |
6283162d46e6e97f221ec7cd0e688a85aba480a1 | JavaScript | shreedharbhat98/clock-app | /src/components/Stopwatch.jsx | UTF-8 | 2,123 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react';
export default class Stopwatch extends Component {
constructor(props) {
super(props);
this.state = {
msec: 0,
sec: 0,
min: 0,
isTimerOn: false,
value: "START",
}
if(this.props.isActive === true){
this.setState({
is... | true |
d62db52a8f6f98d902fd75f6a3b398e03f060ef5 | JavaScript | DmitriyDubravin/game_Tetris | /dist/js/global.js | UTF-8 | 16,955 | 2.828125 | 3 | [] | no_license | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.ex... | true |
108956a5f501d215fa7fb93d4e515f17bf76f49d | JavaScript | cfacon/robotv1 | /assets/script.js | UTF-8 | 951 | 3.265625 | 3 | [] | no_license | /*Code relative to the fullscreen api inspired from this source: http://html5professor.com/tutoriels-18.html */
function enterFullscreen(element) {
if(element.requestFullScreen) {
//fonction officielle du w3c
element.requestFullScreen();
} else if(element.webkitRequestFullScreen) {
//fonction pour Goog... | true |
6d665fe820c31ba35630cd751f6a2847fc18055b | JavaScript | Liubomyr-Kinash-1995/HOMEWORK-On-JS | /Home8/TASK_4/JS/script.js | UTF-8 | 294 | 2.640625 | 3 | [] | no_license | tog.addEventListener('scroll', function() {
if (this.scrollTop < 200) {
document.getElementById("text").classList.remove('text2');
} else if (this.scrollTop > 200) {
document.getElementById("text").classList.add("text2")
console.log("SCROLL");
}
}); | true |
5c37ef133ce5f6e1d17bfd86db39d63c98a72ef2 | JavaScript | unique4/sct-chrome-extension | /get_started_complete/script.js | UTF-8 | 1,406 | 2.890625 | 3 | [] | no_license | 'use strict';
chrome.storage.sync.get('color', function(data) {
document.body.style.backgroundColor = data.color;
});
var item_actions = document.getElementsByClassName("item-action");
/*for (var i = 0; i < 2; i++) {
var btns = item_actions[i].getElementsByTagName("button");
if (btns.length > 0 && ! btns[0].class... | true |
0d8d58b590c62aeca360d4c23e1fc6b84fa1f375 | JavaScript | ronaldaguerrero/react | /second-app/src/index.js | UTF-8 | 579 | 3.34375 | 3 | [] | no_license | import React from 'react'; // import the React library
import ReactDOM from 'react-dom'; // import the ReactDOM library
// we can create a simple element to display on our HTML page
// const App = React.createElement("h1", null, "Hello World");
// import React, ReactDOM statements
const App = (props) => {
return ... | true |
e30cd10334ba9e19f763454373e8692736b1f742 | JavaScript | colbin8r/colbin8r-theme | /source/scripts/index.js | UTF-8 | 1,484 | 2.609375 | 3 | [] | no_license | import $ from 'jquery';
console.log('index.js');
$.fn.extend({
animateCSS: function (animationName, callback) {
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
this.addClass('animated ' + animationName).one(animationEnd, function() {
$(this).removeCla... | true |
ee06380885d7c12edc50db8e5bbeb57fd6165037 | JavaScript | hkwweber/chin-to-win | /app/store/celebs.js | UTF-8 | 1,209 | 2.875 | 3 | [] | no_license | import axios from "axios";
//action types
const GET_ALL_CELEBS_FROM_SERVER = "GET_ALL_CELEBS_FROM_SERVER";
const SET_NEXT_CELEB = "SET_NEXT_CELEB";
//action creators
const getAllCelebsFromServer = celebs => ({
type: GET_ALL_CELEBS_FROM_SERVER,
celebs
});
export const setNextCeleb = index => ({
type: SET_NEXT_CELE... | true |
61d1240db1c1b13cec1d45aed93721047f87ce4b | JavaScript | R-Steel3/Homework5 | /app.js | UTF-8 | 526 | 2.71875 | 3 | [] | no_license | var d = new Date();
document.getElementById("currentDay").innerHTML = d;
var newEvent = {
types: ['Mindful', 'Productive', 'Fun', 'Important'],
hours: ['7 AM', '8 AM', '9 AM', '10 AM', '11 AM', '12 PM', '1 PM', '2 PM', '3 PM', '4 PM', '5 PM', '6 PM', '7 PM'],
days: ['Monday', 'Tuesday', 'Wednesday', 'Thur... | true |
d1105505f200b2069ce2372a31c1e5b4894fd7b6 | JavaScript | RnbWd/parse-browserify | /lib/object.js | UTF-8 | 56,747 | 2.90625 | 3 | [
"MIT"
] | permissive | // Parse.Object is analogous to the Java ParseObject.
// It also implements the same interface as a Backbone model.
var Parse = require('./Parse').Parse;
var _ = Parse._;
/**
* Creates a new model with defined attributes. A client id (cid) is
* automatically generated and assigned for you.
*
* <p>Yo... | true |
0d1c2c0031367d7ff1907bf876f01007c4a5c077 | JavaScript | bragerosberg/blackjack-game | /src/components/board/Board.jsx | UTF-8 | 3,018 | 2.921875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import Dealer from '../dealer/Dealer';
import Player from '../player/Player';
import cards from '../card/carddeck';
import './Board.css';
const Board = () => {
const [allDealerCards, setAllDealerCards] = useState([]);
const [allPlayerCards, setAllPlayerCards] = u... | true |
57df9a482f8ccf82c345dd637c16ec72b873ff59 | JavaScript | alightedlamp/devmakers-javascript-class | /getLengthOfLongestElement.js | UTF-8 | 347 | 3.875 | 4 | [] | no_license | function getLengthOfLongestElement(arr) {
if (arr.length > 0) {
var longest = arr[0];
arr.forEach(function(el) {
if (longest.length < el.length) {
longest = el;
}
});
return longest.length;
}
else {
return 0;
}
}
var output = getLengthOfLongestElement(['one', 'two', 'thr... | true |
c798fa18f9f9f440ebe6804d8972dd87fdb33a74 | JavaScript | jussik/jussik.github.com | /hextype/wordPrompt.js | UTF-8 | 1,357 | 3.140625 | 3 | [] | no_license | import { InputEvent } from "./game.js";
import { GameObject } from "./gameObject.js";
import { GameState } from "./gameState.js";
export class WordPrompt extends GameObject {
currentWord = "";
constructor(game) {
super(game);
game.events.addEventListener(InputEvent.Character, ev => {... | true |
126eb722b36935552f3804f6e1d9d9a854df245a | JavaScript | vmoonpy/chatbotTest | /main.js | UTF-8 | 3,842 | 3.671875 | 4 | [
"MIT"
] | permissive | /*
En este ejercicio crearemos modelos de usuarios con de la siguiente manera
{
nombre: string,
apellido: string,
telefono: string,
email: string,
genero: string (hombre | mujer),
}
*/
//declaro variable para la API
const api = `https://605e4a309386d200171bc0d6.mockapi.io/api/v1/usuarios`;
//fun... | true |
1a921fa513d5047c0fc7b86cd797955760a81bdd | JavaScript | Luks753/API-Checkout | /services/database.js | UTF-8 | 1,087 | 2.5625 | 3 | [] | no_license | //Configura a conexão com o banco
//Plugin do banco
const mysql = require('mysql');
//Arquivos importados
const dbConfig = require('../config/database.js');
//Função que inicia o pool de conexões
async function initialize() {
await mysql.createPool(dbConfig.hrPool);
}
module.exports.initialize = init... | true |
6266dc423ad92a9467357703a1eebedb4c9a1c79 | JavaScript | camertron/scuttle-server | /app/assets/javascripts/scuttle.js | UTF-8 | 2,832 | 2.578125 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function(_event) {
var timeoutHandle = null;
var editor = ace.edit(document.querySelector(".editor"));
var chkUseArelHelpers = document.querySelector("#chk-use-arel-helpers");
var chkSimplifyArelNodes = document.querySelector("#chk-simplify-arel-nodes");
var selRa... | true |
699f3cb63c8215383a72ddbd73a6a3e8d90ed394 | JavaScript | mumacus/Diecezny_kviz_final | /js/vlastne/videa.js | UTF-8 | 1,204 | 2.609375 | 3 | [
"MIT"
] | permissive | $(function () {
generujVidea();
$(window).keydown(function(e) {
keydownSpolocne(e);
if (e.keyCode == 32) { //space
if ("activeElement" in document) {
document.activeElement.blur();
}
$('#sourceList button').focus().blur();
h... | true |
c86ec2256769f89187e8ac4582b1c51764a0e0df | JavaScript | dnkm/yoonblog | /src/App.js | UTF-8 | 2,253 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import { firebase, db } from "./utils/firebase";
import Post from "./containers/Post";
import Login from "./components/Login";
class App extends Component {
constructor() {
super();
this.state = {
posts: [],
log... | true |
e87d6b090846b2b3ade5edb0a8b3225b8ce5d14d | JavaScript | ortizjs/algorithms_ | /Memoization/howSum.js | UTF-8 | 734 | 3.765625 | 4 | [] | no_license | //Brute force time: O(n^m) and space: O(m^2)
//Memoized solution: O(n*m^2) space: O(m^2)
function howSum(targetSum, numbers, memo = {}) {
if (targetSum in memo) return memo[targetSum];
if (targetSum === 0) return [];
if (targetSum < 0) return null;
for (let num of numbers) {
let diff = targetS... | true |
d955fdcf84b83f1498f449b6c525b791724f6ebc | JavaScript | PicomilesProve/picomilesprove.github.io | /npc15/leafletembed_l.js | UTF-8 | 4,208 | 2.578125 | 3 | [] | no_license | var map;
var ajaxRequest;
var plotlist;
var plotlayers=[];
function initmap() {
// set up AJAX request
ajaxRequest=getXmlHttpObject();
if (ajaxRequest==null) {
alert ("This browser does not support HTTP Request");
return;
}
// set up the map
map = new L.Map('map');
// create the tile layer... | true |
e192e88b043c8696ee0ea0574e3a543855b877b5 | JavaScript | infaro28/finalExam | /main.js | UTF-8 | 3,962 | 3.09375 | 3 | [] | no_license | var products = [];
//var orderSumary = [];
function table(){
var i = 0;
let dataList = document.getElementById("dataList");
dataList.innerHTML=''
while(i < products.length){
var listItem = document.createElement("section");
console.log(products[i]);
l... | true |
133c603d5205c92213cac0b292005e5297e52251 | JavaScript | qiudaoermu/weakMap | /node-demo-Api/async/string.js | UTF-8 | 327 | 3.21875 | 3 | [] | no_license | function sleep(milliSeconds) { // 模拟卡顿
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliSeconds);
}
function outputString(response) {
sleep(10000); // 阻塞 10s
response.end('Hello World\n'); // 先执行耗时操作,再输出
}
exports.output = outputString;
| true |
18fad57839f8bec7efb5effe504f43356fa075fc | JavaScript | KenACollins/advanced-react-redux | /auth/client/src/components/Feature.js | UTF-8 | 353 | 2.515625 | 3 | [] | no_license | // Feature just represents any component you want to lock down and only show if user is authenticated.
import React, { Component } from 'react';
import requireAuth from './requireAuth';
class Feature extends Component {
render() {
return (
<div>This is the feature!</div>
);
}
}
exp... | true |
c6cf8a17cb84f1bb1bddd4b471200a7519a91eda | JavaScript | moubAde/ESP_departement_social | /vue/accordion.js | UTF-8 | 2,837 | 2.640625 | 3 | [] | no_license |
function change(span) {
var gly = document.getElementById(span);
if (gly.getAttribute("class")=="glyphicon glyphicon-chevron-down") {
gly.setAttribute("class", "glyphicon glyphicon-chevron-right");
}
else{
for (var i = 1; i<6; i++) {
if (document.getElementById(''+i).getAttribute(... | true |
0026ba6b683f76008d0af2d454aabb2f95d68af6 | JavaScript | bendewey/WinRtForWebDevs | /MetroFlipSlides/MetroFlipSlides/slides/Slide17/accelerometer.js | UTF-8 | 6,900 | 2.5625 | 3 | [] | no_license | (function () {
"use strict";
var rotationAngle = 0;
var accelerometer;
var isStarted;
WinJS.UI.Pages.define("/slides/Slide17/accelerometer.html", {
// This function is called whenever a user navigates to this page. It
// populates the page elements with the app's data.
rea... | true |
747982b7d009e6391e18f6b27077c9f3556d224b | JavaScript | akaiserg/DeferredPromiseExample | /js/app/dataServer.js | UTF-8 | 629 | 2.625 | 3 | [] | no_license | /**
* Module which connects with the service
*/
var dataServerModule = (function ($) {
/**
* Getting data from the service
* @returns {*}
*/
var asyncData= function(){
//Deferred defined
var dfd= new $.Deferred()
$.ajax({
url: 'http://api.citybik.es/v2/ne... | true |
9e46750fe6f5d0e91579e47391c5b9ed5288e061 | JavaScript | jeqs/jeqs-unipilot-apm-4 | /Modulo 10/lab4/index.js | UTF-8 | 1,255 | 2.59375 | 3 | [] | no_license | 'use strict';
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var User = (function () {
function User(_fir... | true |
cccd43ddbcf146b7cec952109e5c169c7335ee9c | JavaScript | newip/campus_delivery_simulation | /src/unfinished/Untitled-1.js | UTF-8 | 6,572 | 3.265625 | 3 | [
"CC0-1.0",
"ISC",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause",
"WTFPL",
"MIT"
] | permissive | // 有这么几个变量:
// a 其值可能为 0、1
// b 其值可能为 3、4、5
// c 其值可能为 6、7
// 实现一个函数 getArranging 可以返回它们的可能值的排列组合二维数组:
var a = [0, 1];
var b = [3, 4, 5];
var c = [6, 7];
var ret = getArranging( a, b, c );
// ret 值为:
/**
[ [0,3,6], [0,3,7], [0,4,6], [0,4,7], [0,5,6], [0,5,7], [1,3,6], [1,3,7], [1,4,6], [1,4,7], [1,5,6], [1,5,7] ]
*... | true |
04ae1e3c196214b16fb54bd69f05242e00692932 | JavaScript | romtom35/booklib-front | /src/Component/FormFilterBook.js | UTF-8 | 2,188 | 2.578125 | 3 | [] | no_license | import React, {Component} from 'react';
import {Form, FormGroup, Input, Label} from 'reactstrap';
class FormFilterBook extends Component {
constructor(props) {
super(props);
this.state = {categories: [], authors: []};
}
componentDidMount() {
fetch('http://localhost/php/booklib/pub... | true |
7bb7c39d576fbe34411d058c21307646eb07f885 | JavaScript | GabrielMM182/trabalho-animais-facu | /script.js | UTF-8 | 2,292 | 3 | 3 | [] | no_license | const lex = document.querySelectorAll('.js-menu a[href^="#"]');
function scrollToSection(event) {
event.preventDefault();
const href = this.getAttribute('href');
const section = document.querySelector(href);
section.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
lex.for... | true |
44ce8d8af4bdf2f45d243d49dbefd0b80f066f7f | JavaScript | xiaobogithub/Test | /TestChangeTech/UI/ChangeTech.DeveloperWeb/Scripts/IF-SET-bak.js | UTF-8 | 2,292 | 3.140625 | 3 | [
"MIT"
] | permissive | //check IF expression
var count = 0;
function checkIf(str,XMLobj){
var IFArr = [];
IFArr[count]=[];
//recursion to check all the "IF" expression
if(str.match(/^IF[^IF\[ELSE]+\.\d+/)){
var temp = str.match(/^IF[^IF\[ELSE]+\.\d+/).toString();
IFArr[count][0] = temp.split('{V:')[1].split('}')[0].trim(... | true |
20e1f402243422a44a9ca063807f2afc51171833 | JavaScript | giovannalinda/bootcamp-react-brainn | /aulas-complementares/es-modules/vanilla-js/main.js | UTF-8 | 179 | 2.546875 | 3 | [] | no_license | // * as exporta tudo de um arquivo
import teste, { sum, mult } from './calculator.js'
console.log('sum:', sum(1, 2))
console.log('mult:', mult(1, 2))
console.log('teste:', teste) | true |
8494af12c908b55f67a311a0356172c06afe57d6 | JavaScript | Lagryma/telegram_bot_erp | /bot.js | UTF-8 | 24,252 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
This game is based on a telegram game called DERP: Assassination.
The rules can be seen here: https://drive.google.com/file/d/1Cf7frrCWlBqoG64SVPrLkcMjCPaYcm0x/view?usp=sharing
*/
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const telegram = require... | true |
d09b277896bee4c0c2e5c7e8957187fe070a11a8 | JavaScript | unionplatform/orbiter | /src/orbiter/CollectionEvent.js | UTF-8 | 1,137 | 2.625 | 3 | [] | no_license | //==============================================================================
// CLASS DECLARATION
//==============================================================================
/**
* @private
*/
net.user1.orbiter.CollectionEvent = function (type, item) {
net.user1.events.Event.call(this, type);
this.ite... | true |
882989ad25cb81be2fbebb17647ed5c8b9142271 | JavaScript | dumbapple/react-playground | /face-finder-api/server.js | UTF-8 | 3,099 | 3.1875 | 3 | [] | no_license | const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const cors = require('cors');
// Need this to parse req.body into JSON!!!
app.use(bodyParser.json());
app.use(cors());
const database = {
users: [
{
id: '123',
name: '... | true |
099ccb977b282c160bc92c0032044027942dfe07 | JavaScript | davideastmond/github-avatar-downloader | /download_avatars.js | UTF-8 | 2,414 | 3.09375 | 3 | [] | no_license | var request = require('request');
var fs = require("fs");
var secrets = require("./secrets");
var testSite = "https://api.github.com/repos/jquery/jquery/contributors";
// Pull the repoOwner and repoName from the command line
var clRepoOwner = process.argv[2];
var clRepoName = process.argv[3];
function getRepoContribu... | true |
8a37dd88d0633ccb41a5b8b5e76495fa3ccb6096 | JavaScript | gadgetsan/Exponent_Reactor | /src/Redux/actions/meta-actions.js | UTF-8 | 1,503 | 2.515625 | 3 | [] | no_license | export const SAVE = "META_SAVE";
export const LOAD = "META_LOAD";
export const CLEAR = "META_CLEAR";
import BuildingFactory from "../../Mechanic/Buildings/BuildingFactory";
import RessourceFactory from "../../Mechanic/Ressources/RessourceFactory";
export function saveGame() {
return {
type: SAVE
};
}... | true |
e991db73d94904a5e2c43ca2a2a22a5d904cba27 | JavaScript | junkawa/pwa | /yearweek_day/src/js/app.js | UTF-8 | 3,571 | 3.125 | 3 | [
"MIT"
] | permissive | 'use strict';
let yearHundredsPlace = '20';
let yearTensPlace = '1';
let yearOnesPlace = '8';
let weekTensPlace = '1';
let weekOnesPlace = '0';
const setYearHundredsPlace = (h) => {
switch(h) {
case '19':
case '20':
yearHundredsPlace = h;
break;
default:
throw new Error('invalid argument:'+h);
... | true |
a432495ac2598385e170c633a3afba2582a8be99 | JavaScript | mshehan/iTunesSearch | /js/itunes.js | UTF-8 | 2,610 | 2.65625 | 3 | [] | no_license | /*
/Matthew Shehan
//mshehan@my.smccd.edu
//CIS
//114 OL
//itunes.js
//final
// 05-27-2016
*/
var iTunes = {
urlEncode: function (obj) {
var s = '';
for (var key in obj) {
s += encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]) + '&';
}
if (s.length > 0) {
s = s.substr(0, s.len... | true |
284181692a9e8c15e4e236ee821d19b79564cd63 | JavaScript | EpicDeng/FE6 | /L19/task19-01.js | UTF-8 | 1,614 | 4.46875 | 4 | [
"MIT"
] | permissive | // 第 19 课
// 作业 1
//
// var find = function(array, callback) { }
//
// array 是数组
// callback 是一个测试函数,参数是数组 array 中的元素
//
// find 函数的返回值是数组中第一个满足测试条件的元素
// 如果对于数组中的所有元素都不满足测试条件,则返回 undefined
// 参考 https://lodash.com/docs/4.17.4#find
//
//
// 对于下面的函数调用来说
// find([12, 5, 8, 130, 44], function(element) {
// return... | true |
711d3a33332745e30c0bf70c735f094e3b98a808 | JavaScript | ardhiansyahputra/h8-p0-w5 | /[Exercises 6] Kali Terus Rekursif.js | UTF-8 | 451 | 3.15625 | 3 | [] | no_license | function kaliTerusRekursif(angka) {
if (angka.toString().length == 1) {
return angka;
} else {
return kaliTerusRekursif(Number(angka.toString().slice(0, 1)) * kaliTerusRekursif(Number(angka.toString().slice(1))));
}
}
// TEST CASES
console.log(kaliTerusRekursif(66)); // 8
console.log(kaliTerusRekursif(3));... | true |
5f23765ecbde0fb2aaf6a4dfe78247840fbe8460 | JavaScript | copremesis/numberjs.github.io | /js/number.js | UTF-8 | 1,656 | 3.515625 | 4 | [
"MIT"
] | permissive | //enumerators
Number.prototype.times = function(callback) {
var callback = callback || function(e){ return e;};
for(var i = 0; i<this; i++) callback(i);
};
Number.prototype.map = function(callback) {
var x = [],
callback = callback || function(e){ return e}; //identity function if no other is passed ... ac... | true |
8e447578963a981cfdc445065a5c8d1b877cf9f1 | JavaScript | terryszhou/diy-api-mongoose | /testDb.js | UTF-8 | 646 | 2.9375 | 3 | [] | no_license | const db = require('./models')
db.connect()
const blogCRUD = async () => {
try {
// const newEntry = await new db.Blog({
// name: "Test Blog",
// title: 1,
// content: "You see Mr. Bond, it was all a test."
// })
// await newEntry.save()
// consol... | true |
8781e6237dac9acee8f0599cbe08f611936dedd1 | JavaScript | mhario/biteswipelite | /src/components/ResultsView.jsx | UTF-8 | 816 | 2.5625 | 3 | [] | no_license | import React from 'react'
const resultsView = props => {
const randomPickIndex = Math.floor(Math.random() * props.results.length)
const pick = props.results[randomPickIndex]
return (
<article className="results-view">
<h1>GO HERE.</h1>
{pick.name}
<button
className="reset-btn"
disabled
ti... | true |
52248913ef5ec6162d752d01a98f2c09615ed4b5 | JavaScript | GeoffAtHome/muzak | /lambda/custom/intents/unsync.js | UTF-8 | 1,277 | 2.625 | 3 | [
"MIT"
] | permissive | const Utils = require("../utils");
const Intent = require("./intent");
class Unsync extends Intent {
/**
* Un-sync a player
*
* @param player The player to un-sync
* @param session The current session
* @param callback The callback to use to return the result
*/
static unsync(play... | true |
6ce65a61d287f2c8f2859a1c4e65c0247296a2c9 | JavaScript | bryanh78/javamod1 | /final?.js | UTF-8 | 7,240 | 3.34375 | 3 | [] | no_license | // var canvas = document.getElementById('canvas'),
// ctx = canvas.getContext('2d'),
// height = 400,
// width = 400,
// x = 200,
// y = 0,
// vy = 0,
// ay = 0,
// m = 0.1, // Ball mass in kg
// r = 10, // Ball radius in cm, or pixels.
// dt = 0.02, // Time step.
// ... | true |
0925842cafe7135ee36907571ec280109eed6971 | JavaScript | NSGRZ/CursoIngresoJS | /3-InstruccionSwitch/jsInstruccionSwitch(1).js | UTF-8 | 429 | 2.75 | 3 | [] | no_license | function mostrar()
{
//tomo la edad
var mesDelAño = document.getElementById('mes').value;
var mensaje
switch(mesDelAño)
{ case"Enero":
mensaje ="que comiences bien el año!!!"
break;
case"Marzo":
mensaje ="a clases!!!"
break;
case"Julio":
mensaje ="se vienen las vacaciones!!!"
break;
case"Diciembre":
mensaje... | true |
7e9fdc4db1e90f2680079319d8173a26359f904f | JavaScript | Andrii-Velhan/goit-js-hw-07 | /JS/task-6.js | UTF-8 | 1,418 | 3.421875 | 3 | [] | no_license | console.log(document.querySelectorAll('.task')[5].textContent);
const validationInput = document.querySelector('#validation-input');
console.log(validationInput);
validationInput.addEventListener('focus', () => {
validationInput.classList = '';
});
function onValidationInput() {
validationInput.value.length !== ... | true |
2e5dbdc7143a40ee1ec76651e5b49fbcbaf82cf7 | JavaScript | Chinchuluun1029/aoc20 | /day6-1.js | UTF-8 | 318 | 3.515625 | 4 | [] | no_license | const answers = document.getElementsByTagName("pre")[0].textContent.split("\n\n");
let count = 0;
for (answer of answers) {
answer = answer.replace(/(\r\n|\n|\r)/gm,""); //remove whitespaces, newlines
let set = new Set();
for (letter of answer) set.add(letter);
count += set.size;
}
console.log(count); | true |
d8e50a6d46bbe2bf0f9c2c0de1eb0a044b089ec4 | JavaScript | Goutham1706/blog | /src/actions/index.js | UTF-8 | 862 | 2.5625 | 3 | [] | no_license | import jsonPlaceholer from '../apis/jsonPlaceholder';
import axios from 'axios';
const fetchPosts = () => async (dispatch) => {
const response = await jsonPlaceholer.get('/posts');
dispatch({ type: 'FETCH_POSTS', payload: response });
};
const getId = (id) => {
return {
type: 'FETCH_BY_ID',
payload: id
};
};
... | true |
4381314d8a0e0b268878cab4d7e90f5b65b602e0 | JavaScript | Chukalov816/Fundamentals | /MagicSum.js | UTF-8 | 380 | 3.203125 | 3 | [] | no_license | function solve(arr1,n){
for (let i = 0; i < arr1.length; i++) {
for (let j =i+1; j < arr1.length; j++) {
let firstEl=arr1[i];
let secondEl=arr1[j];
if ((firstEl+secondEl)===n) {
console.log(firstEl,secondEl);
}
}
... | true |
1f5e23088c354d4e3ec7c38b0b907865e33396af | JavaScript | AleksandarOynakov/js-fundamentals | /Data Types and Variables Exercise/Calculator.js | UTF-8 | 243 | 2.921875 | 3 | [] | no_license | function calc(first, operator, sec) {
let operations = {
'+': (a, b) => a + b,
'-': (a, b) => a - b,
'*': (a, b) => a * b,
'/': (a, b) => a / b
}
return operations[operator](first, sec).toFixed(2);
} | true |
6463954cb56006bbd1985a395130cf254a1bc87d | JavaScript | alessamohammed/smart_methods_control_panel | /static/index.js | UTF-8 | 1,868 | 2.796875 | 3 | [] | no_license | const allRanges = document.querySelectorAll(".range-wrap");
allRanges.forEach(wrap => {
const range = wrap.querySelector(".range");
const bubble = wrap.querySelector(".bubble");
const engine = wrap.querySelector(".engine")
range.addEventListener("input", () => {
setBubble(range, bubble);
});
engine.ra... | true |
a86183e6fd6990c02f2737598a877261faf4896d | JavaScript | marijav97/gusto | /js/main.js | UTF-8 | 5,165 | 2.75 | 3 | [
"MIT"
] | permissive | window.onload=function(){
document.getElementById("register").addEventListener("click", function() {
var validno = true;
var podaci = [];
var ime = document.getElementById("firstName").value.trim();
var prezime = document.getElementById("lastName").value.trim();
var email=document.getEl... | true |
a396ab76018e55fc53eea9559756f99079e3eacc | JavaScript | gieanpino/PhpConJS | /controlador/inicioSesion.js | UTF-8 | 1,777 | 2.859375 | 3 | [] | no_license | $(document).ready(function()
{
$(document).on('click', '#iniciar', (e) => {
var datos={
user:$('#user').val(),
clave:$('#clave').val()
}
IniciarSesion(datos).then(d => {
if(d==true){
window.location.href='../vista/inicio.php';
... | true |
d8fd54fd74b84c58535728b7e31d9c0f30a32777 | JavaScript | SteeleSR/Simon-Sam-Skelly | /simpleFrontEnd/src/modules/Main.test.js | UTF-8 | 5,951 | 2.875 | 3 | [] | no_license | import { Main } from './Main'
import { render, screen, fireEvent } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import * as axios from 'axios';
import { act } from 'react-dom/test-utils';
import { when } from 'jest-when'
jest.mock('axios');
const renderPage = async () => ren... | true |
56c8a4636b78e880450f2ec8a146f529f67ec8c2 | JavaScript | alanbacon/react-bootstrap-webpack-babel | /www/scripts/storeCtrl/actions.js | UTF-8 | 1,983 | 2.734375 | 3 | [] | no_license | import actionNames from "./actionNames";
import Item from '../Item'
async function sleep (ms) {
let prm = new Promise(resolve => setTimeout(resolve, ms));
await prm;
}
async function getItemsFromServer () { // mock slow server call with sleep function
await sleep(1000);
return [new Item('Sausages', 3), new I... | true |
65fad4e3a3905ad07c193dc76a0b685705a7137e | JavaScript | marcusjensen15/Tic-Tac-Toe-Game- | /js/scripts.js | UTF-8 | 583 | 2.609375 | 3 | [] | no_license | $( document ).ready(function() {
console.log( "ready!" );
});
// General Requirements:
//
// 1. Switch player back and forth Manage the active player between 1 and 0.
// 2. Board Layout - this is going to be a constructor - Three rows: Top, Middle, Bottom (all arrays)
// 3. Indicate if X or O mark depending o... | true |
cdbdf96b3cc87511f8d134afc70b311020ae6542 | JavaScript | rsnazario/restaurant-JS | /src/homeTab.js | UTF-8 | 1,490 | 2.703125 | 3 | [
"CC0-1.0"
] | permissive | const Home = () => {
const createHomeElements = function () {
const contentDiv = document.getElementById('content');
const homeDiv = document.createElement('div');
const spanOne = document.createElement('span');
const spanTwo = document.createElement('span');
const spanThree = document.createElem... | true |
c3e37283a1992ea5ed28156f68469670b61fd2ed | JavaScript | PACE190107/1901_jan07_pe | /html-css-bootstrap-js/examples/1901_maven_js/src/main/webapp/js/domExample.js | UTF-8 | 633 | 3.796875 | 4 | [] | no_license | console.log("did the page load???");
let d = document;
let c = console;
//simplest example for listener
window.onload = () => {
c.log("page should be loaded now...");
//creating an object for add button
let addButton = d.getElementById("addBtn");
//add event listeners for this button when a click occurs
addButton.... | true |
b4e38cad41b515fc299b5d2be61dc080a106a13a | JavaScript | nadershbib/AA-HU-INTERVIEW | /test/functions.test.js | UTF-8 | 287 | 2.90625 | 3 | [] | no_license | import { sumOfTwo } from "../functions/functions.js";
test("expect 1 + 3 to equal 4",()=>{
expect(sumOfTwo(1,3)).toBe(4);
});
// failing test for the right reasons
test("expect 2 + 6 to equal 8",()=>{
expect(sumOfTwo(2,5)).toBe(8);
})
| true |
48ce578c6ccbb2cbdbbf03ee78df45af49cb30d0 | JavaScript | armando-avelar/rango-fechas | /index.js | UTF-8 | 711 | 3.34375 | 3 | [] | no_license | const moment = require('moment');
(() => {
let rango1 = {
inicio : moment().startOf('day'),
fin: moment().add(5, 'days').startOf('day')
}
let rango2 = {
inicio : moment().subtract(5, 'days').startOf('day'),
fin: moment().subtract(2, 'days').startOf('day')
}
if(ran... | true |
c0720651ff8cc356ac742dcd5872a87cc92688e0 | JavaScript | dak2/js-training | /questions/question51_100/q_59.js | UTF-8 | 502 | 3.796875 | 4 | [] | no_license | // [{name: 'Scott'},{name: 'James'}]の要素のvalueを次のように書き出してください
// 期待する結果 ['Scottsan', 'Jamessan']
const nameObj = [{name: 'Scott'},{name: 'James'}]
// 解答
const appendString = (nameObj) => {
return nameObj.flatMap(obj => {
return Object.values(obj) + 'san'
})
}
// 答え
const nameObj = [{name: 'kenji'},{name: 'mo... | true |
9e3a48996596448eff544cd57b9304fa3637bb6c | JavaScript | mohityadav11/Score-Keeper | /scorekeeper.js | UTF-8 | 1,325 | 3.421875 | 3 | [] | no_license | var p1Button = document.querySelector("#p1");
var p2Button = document.querySelector("#p2");
var p1score=0;
var p1Display = document.querySelector("#p1Display");
var p2Display = document.querySelector("#p2Display");
var numInput = document.querySelector("input");
var p = document.querySelector("p");
var winningsc... | true |
342523e1f44c8f1b44408259e078d3f0204451ae | JavaScript | v2tokens/screen-1 | /assets/scripts/App_chaturbate_website.js | UTF-8 | 5,157 | 2.71875 | 3 | [] | no_license | var counter = 0;
$(document).ready(function(){
$('#vjs_video_3_html5_api').get(0).play();
count_and_reset(10); // set timer in seconds
//inputName();
// resetTokenPosition();
// drag();
// manageZindex();
});
function count_and_reset(timer){
// convert seconds to milliseconds
var timerInMs = time... | true |
0b067a93ef5f7b7022e35154112be7686aa0ed5d | JavaScript | WWPOL/RTShips | /public/js/initGame.js | UTF-8 | 1,231 | 3.15625 | 3 | [
"MIT"
] | permissive | function initGame(){
var gcanvas = document.getElementById('game');
var gctx = gcanvas.getContext('2d');
gcanvas.width = clientWidth;
gcanvas.height = clientHeight;
var tiles = [];
var ship = new Ship(50,50,"battleship","red");
for (var x = 0; x < 50;x++) {
for (var y = 0; y < 30;y++) {
var tile = new Ti... | true |
607379f88361147e5d3358ad2bfc96a3f8669cf5 | JavaScript | Wacqo/Cart253 | /experiments/Variables/js/script.js | UTF-8 | 680 | 3.265625 | 3 | [] | no_license | /**************************************************
Template p5 project
Pippin Barr
Here is a description of this template p5 project.
**************************************************/
// setup()
//
// Description of setup() goes here.
var circle1 = {
x: 0,
y: 250,
height: 100,
}
function setup() {
createCa... | true |
0b6f6485a6b281f229119a6e50bba358d994f76f | JavaScript | xil248/CSE134BPA5 | /src/reducers/userReducer.test.js | UTF-8 | 752 | 2.640625 | 3 | [] | no_license | import expect from 'expect';
import userReducer from './userReducer';
import * as actions from '../actions/userActions';
describe('User Reducer',() => {
it('should create a user when passed CREATE_USER_SUCCESS', () => {
// arrange
const initialState =[
{title: 'A'},
... | true |
246b4b6e2c9b3ff3129d1437b382d324394fef26 | JavaScript | wilhelmhb/labelabeille | /LabelAbeille/platforms/android/assets/www/js/custom_notes.js | UTF-8 | 5,429 | 2.515625 | 3 | [
"MIT"
] | permissive | /**
* add a new custom note, allow user to use it on his/her hives
* @Object data: contains the necessary informations to create the note (name, message, level)
*/
function addCustomNote(data) {
charge();
$.ajax({
type: 'POST',
url: url+'pscustomnote',
xhrFields: {
withCre... | true |
77df68d59a92524e5d3e8c1087d3640943a3e7e5 | JavaScript | frankandreasbauer/dhbw-ka-wwi18b2-webprog-fitnessapp | /LenasSpace/Loesung/page-personal-data/page-personal-data.js | UTF-8 | 12,073 | 2.609375 | 3 | [] | no_license |
"use strict";
/**
* Klasse PageNotFound: Stellt eine Defaultseite zur Verfügung, die immer
* dann angezeigt wird, wenn der Anwender eine unbekannte URL aufruft.
*/
class PagePersonalData {
/**
* Konstruktor
* @param {App} app Zentrale Instanz der App-Klasse
*/
constructor(app) {
this... | true |
b33d5cf0edff2291f1b8a36568500e60a2e0f61b | JavaScript | j-goodman/robotopia | /lib/mapbuilder.js | UTF-8 | 5,807 | 2.875 | 3 | [] | no_license | var mapbuilder = {};
mapbuilder.structures = [];
mapbuilder.buildGrid = function () {
var grid;
var shipwreckCount;
var object;
var square;
var spawn;
var x;
var y;
spawn = game.settings.spawn;
grid = [];
for (i=0 ; i<game.settings.grid.height ; i++) {
row = [];
for (j=0 ; j<game.settings.... | true |
e1a6d8ad423d9586d8d1b7d007978b1b94b82cc8 | JavaScript | stevevis/thumbtackdb | /test/runner | UTF-8 | 1,635 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env node
/**
* Super simple test runner that runs test cases defined in JSON files. I would usually use something like Mocha and
* Chai but I'm trying not to introduce any dependencies to make running this package easier.
*/
"use strict";
var fs = require("fs");
var path = require("path");
var Thumbtac... | true |
8a25e8242d555c3758af00ffc0a695fef58479b1 | JavaScript | ndorado3/W05-MyDaily-Planner | /assets/JSS/script.js | UTF-8 | 2,877 | 3.140625 | 3 | [] | no_license | //Current date & time display at the header
var today = moment().format("dddd, MMMM Do YYYY");
$("#currentDay").text(today);
//variables need it
// var saveBtn = $("#saveBtn");
// var areaText = $(".form-control");
// var timeHour = $(".input-group-text");
// var hour = hours[i];
var containerEl = $(".container");
v... | true |
8037f43ace9c54b5e8daa77caf1d500b6aaa5979 | JavaScript | trueworthy/web-231 | /week-3/trueworthy-assignment-3.2.js | UTF-8 | 2,037 | 4.1875 | 4 | [] | no_license | /*
Expected output:
FirstName LastName
Exercise 3.2
Today's Date
// output from the match() function
false
true
// output from the if...else blocks
Truck and Car do not match!
Bike and Bike do match!
Four and Three do not match!
============================================
; Title: Exercise 3.2... | true |
bf20b89bfb406f54086efd317c071be5ade13f4b | JavaScript | mdayaram/allin1petservice | /menu.js | UTF-8 | 1,482 | 2.625 | 3 | [] | no_license | //Start of Drop down Menu.
showMenu = function() {
var subMenuItems = document.getElementById("topMenu").getElementsByTagName("li");
for (var i=0; i<subMenuItems.length; i++) {
subMenuItems[i].onmouseover=function() {
this.className+=" showMenu";
}
subMenuItems[i].onmouseout=function() {
... | true |
71202c017762b5c817573fe05e72164c98e26131 | JavaScript | CrocJS/crocjs | /source/croc/cmp/form/field/Transform.js | UTF-8 | 3,146 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* Функции трансформации значения поля
* todo comment me
* todo trim... - разбить
*/
croc.define('croc.cmp.form.field.Transform', {
/**
* @param value
* @param old
* @param chars
* @returns {string}
*/
allowedChars: function(value, old, chars) {
return value && typeo... | true |
a88f253d56c1b0c5b15bd2f8b864f15880420720 | JavaScript | kevinrdahl/mmo-online-hd | /mmo-online-2/www/v2/js/util/util.js | UTF-8 | 1,884 | 2.890625 | 3 | [] | no_license | var MmooUtil = {};
MmooUtil.shallowClone = function(o) {
var r = {};
for (var prop in o) {
r[prop] = o[prop];
}
return r;
};
MmooUtil.applyProps = function(obj, props, onlyNew) {
if (typeof props === 'undefined')
return
for (var propName in props) {
if (!onlyNew || typeof obj[propName] === 'undefined') {... | true |
9f20f40ce05d3aad087aac23fccf877d628ccbbb | JavaScript | tiffanyposs/codingFun | /prime.js | UTF-8 | 225 | 3.515625 | 4 | [] | no_license | var isPrime = function(num){
if(num % 2 === 0 && num !== 2) return false
for(var i = 2; i < Math.floor(num/2); i++){
if(num % i === 0){
return false
}
}
return true
}
var number = isPrime(2);
console.log(number);
| true |
6043cc6c1a08fe55413e2b5a5e877434ddfd1ba0 | JavaScript | jakoblorz/jsx-serializers | /index.js | UTF-8 | 1,750 | 3.09375 | 3 | [
"MIT"
] | permissive |
const createDomRenderer = function (fn) {
return function (nodeName, attributes, ...args) {
let children = args.length ? [].concat(...args) : null;
return fn(nodeName, attributes, children);
}
}
const renderJSONDomTree = createDomRenderer(function (nodeName, attributes, children) {
let ser... | true |
46723826bc53249221d272538f2a7e4f2a552f9d | JavaScript | lhunker/catan | /src/player.js | UTF-8 | 7,715 | 3.28125 | 3 | [] | no_license | /**
* Created by lhunker on 10/10/15.
* A game player class
*/
/**
* Makes a player
* @constructor
* @param placement a function containing the heuristic for placement
* @param board the game board
* TODO figure out what data is needed
*/
var utility = require('./utility');
var _ = require('underscore');
fu... | true |
d48fc4dfbb80405dfcd12c02bf5adaaafb784142 | JavaScript | monkeyFeathers/f2-pdx-simple-site | /assets/js/main.js | UTF-8 | 5,017 | 3.390625 | 3 | [] | no_license | var course = {
level: 201,
name: "Foundations 2: JavaScript",
lectures:[
{topic: "Paperwork, SetupPreview the documentView in a new window & Javascript Basics (Part 1)"},
{topic: "JavaScript Basics (Part 2) & Intro to Node"},
{topic: "Array Methods, Functions & Scope/Hoisting"},
{topic: "OOP in J... | true |
6f81d3ec2fb343b239efd8db9e5af1b8365349bc | JavaScript | hungry4h/electron-pdf-viewer | /home.js | UTF-8 | 500 | 2.515625 | 3 | [] | no_license | const {ipcRenderer} = require('electron');
const list = [
{ id : "sample", name : "sample", filename : "sample"},
{ id : "sample.1", name : "sample.1", filename : "sample.1"},
{ id : "sample.2", name : "sample.2", filename : "sample.2"}
]
for(i=0; i<list.length; i++) {
const login = document.getEleme... | true |
987b4e60a72a90f8c9f7c6fb2adaef3778987a7a | JavaScript | Gustacro/hostile-architecture | /app/js/load_map.js | UTF-8 | 2,094 | 3.390625 | 3 | [] | no_license | /*
function load() {
var map = new google.maps.Map(document.getElementById("map"),
{
zoom: 16,
center: new google.maps.LatLng(45.523064, -122.676483), //latitude and longitudes can be obtained from the link tab on google maps.
mapTypeId: google.maps.MapTypeId.SATELLITE //other parameter... | true |
a80783a37c0942aa75f4f1af6de84c7374953144 | JavaScript | gregetmaxs/superstorev2 | /commands/Utility/fliptext.js | UTF-8 | 716 | 2.96875 | 3 | [
"MIT"
] | permissive | const Discord = require("discord.js");
const flip = require("flip-text");
module.exports = {
name: "fliptext",
aliases: [],
run: async(client, message, args, data, db) => {
if (args.length <= 0) return message.channel.send({embed: {
color: 16734039,
description: "You must provide a text!... | true |
ab478860b3a3076840f11650167c36aa46009eea | JavaScript | silverwind/node-playpen | /algorithms/problems/problem-mincut.js | UTF-8 | 981 | 2.9375 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const { mincut } = require('../src/graph-mincut');
const { Graph } = require('../src/graph-adj-list-oop');
function readInput() {
let input = fs.readFileSync('./input/minCut.txt', 'utf8');
return input
.split('\n')
.filter(p => p)
.map(l =>
l
.split('\t')
.map(p => parseInt... | true |
535f7b92b8cf6d849b5b8bf48f07415cbeda29c0 | JavaScript | dojot/cron | /app/Utils.js | UTF-8 | 605 | 2.765625 | 3 | [
"CC-BY-4.0",
"Apache-2.0",
"CC0-1.0",
"0BSD"
] | permissive | /**
* A module with helper functions
* @module utils
*/
/**
* Object Rename Key.
* @function objectRenameKey
*/
const objectRenameKey = (obj, oldKey, newKey) => {
const newObj = { ...obj };
Object.defineProperty(
newObj,
newKey,
Object.getOwnPropertyDescriptor(newObj, oldKey)
);
// eslint-dis... | true |
391b3e4cdf29782236c6c4ece0c156cf548589ba | JavaScript | mschlitz/SWS | /js/pageInit.js | UTF-8 | 3,913 | 2.515625 | 3 | [] | no_license | // handle slide switching
function switchToSlide(targetSlide, slideTotal, nameSlide, nameFloat, nameThumb, nameThumbBg) {
for (j=1;j<=slideTotal;j++) {
(function( ){
var jLoop = j;
// set opacity for thumbs
$(nameThumb+jLoop).css( { background: 'transparent' } );
$(nameThumb+jLoop+" "+nameThumbBg).css( {... | true |
64195ae83fa4695903455a59d8cd0f90bd9da21a | JavaScript | brendapdx/dom | /js/scripts.js | UTF-8 | 283 | 2.6875 | 3 | [] | no_license | $(document).ready(function() {
$("button#kitty").click(function() {
$("ul").prepende("<li>Meow!</li>");
});
$("button#dog").click(function() {
$("ul").prepend("<li>Bark!</li>");
});
$("button#stop").click(function() {
$("ul").prepend("<li>?</li>");
});
});
| true |
c79b9c54b3b2033de686b8774fcecabb6388077b | JavaScript | 00-00-00-11/dev-Discord-bot-pokeclicker | /helpers/conversion.js | UTF-8 | 1,457 | 3.109375 | 3 | [] | no_license | const {
SECOND,
MINUTE,
HOUR,
DAY,
WEEK,
} = require('./constants.js');
const dateToString = date => `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, 0)}-${date.getDate().toString().padStart(2, 0)}`;
const dateToUTCString = date => date.toISOString().substr(0, 10);
const formatSecondsFul... | true |
467330b7329a984600ce59684be5cdd60153cc52 | JavaScript | kevinthomaskane/currency | /routes/cost_route.js | UTF-8 | 2,498 | 3.03125 | 3 | [] | no_license | const Moment = require("moment");
const MomentRange = require("moment-range");
const moment = MomentRange.extendMoment(Moment);
const dateFns = require("date-fns");
function convertDateFormatForMoment(date) {
let newArray = [];
const dateArray = date.split("/");
newArray.push(dateArray[2], dateArray[0], dateArra... | true |
8b5a443036a04b0fd6dd4acd7efd8273c871a2da | JavaScript | poppinlp/leetcode | /code/224.js | UTF-8 | 831 | 3.703125 | 4 | [
"MIT"
] | permissive | const calculate = (s) => {
const stack = [];
let cur = '';
s = s.split('').reverse().join('');
s = `)${s}(`;
for (let i = 0; i < s.length; ++i) {
if (s[i] === ' ') continue;
if (s[i] === ')') { stack.push(s[i]); continue; }
if (s[i] === '+' || s[i] === '-') { cur !== '' && stack.push(+cur); stack... | true |
f1e0b3433b912d69bd46f8916884280ee2353ebe | JavaScript | fafazalfa/praxis-academy | /novice/02-03/latihan/aku.js | UTF-8 | 336 | 3.453125 | 3 | [] | no_license | async function toUppercase(string){
if (typeof string !== "sting"){
throw TypeError("Wrong type given, expected in string");
}
return string.toUppercase();
}
toUppercase("abc")
.then (result => console.log (result))
.catch(Error => console.error(error.massage))
.finally(() => console.log ("Always runs!"));
... | true |
ec0642539b501f57236764e00baa420c80292b2a | JavaScript | ehuntsman/conservatorydiy | /src/GardenPaths/ReflectionPool.js | UTF-8 | 2,012 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import { Link } from 'react-router-dom';
import fountain from '../img/fountain.jpg'
export default class ReflectionPool extends Component {
state = {
per: false,
initial: true,
dontseeit: false
}
seeit = () => {
this.setState({
per: true,
init... | true |
165e6fc446bfca76c6635b8bbb430e5882c6993c | JavaScript | jjackbauer/GpsSupervisorSystem | /supervisor/public/js/script.js | UTF-8 | 3,117 | 2.875 | 3 | [] | no_license |
//iniciando mapa setando uma posição aleatória
const mymap = L.map('mapid',{
center: [-9.4,-40.5],
zoom: 10,
zoomControl: false,
zoomSnap: 0.25});
//setando a layer da openstreet para renderizar o mapa
const tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attrib... | true |
acd665c5ee1c6b570dc52fbacbd5c8ece8746323 | JavaScript | shrif120/shrif120.Js-Crud-Project | /js/main.js | UTF-8 | 5,146 | 3.0625 | 3 | [] | no_license | var productName = document.getElementById("productName");
var productprice = document.getElementById("productPrice");
var productCategory = document.getElementById("productCategory");
var productDescription = document.getElementById("productDescription");
var searchInput = document.getElementById("searchInput");
var ad... | true |
ebd22cb07b7f3a1149502763e281ef3b6067b44a | JavaScript | rob-leach/k-sim | /client/src/ksim/utils/utils.js | UTF-8 | 1,708 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | import { has } from "lodash"
export const hasRequiredKeys = (payload, keys, label) => {
for (let k of keys) {
if (!has(payload, k)) {
console.log(`${label} invoked, payload missing required key ${k}`, payload)
return(false)
}
}
return(true)
}
// Returns an instance... | true |
98e4f5425e5260ace8065cfe3751c53c0268b5f6 | JavaScript | jonike/3dinterface | /server/geo/ConfigGenerators/V_PP.js | UTF-8 | 3,425 | 2.625 | 3 | [] | no_license | /**
* Class that represents a generator that streams the frustum, and tries to preload recommendations that might be clicked
* @constructor
* @augments geo.ConfigGenerator
* @param streamer {geo.MeshStreamer} the parent mesh streamer
*/
geo.V_PP_Generator = function() {
geo.ConfigGenerator.apply(this, argumen... | true |