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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8c7682610ab7a3185042d4b97f850308462fdb4c | JavaScript | alvinthen/yaobin.me | /gatsby-node.js | UTF-8 | 4,214 | 2.546875 | 3 | [] | no_license | const path = require('path');
const { createFilePath } = require('gatsby-source-filesystem');
const urlize = require('urlize').urlize;
const createTagPages = (createPage, edges, title) => {
const tagTemplate = path.resolve(`src/templates/tags.js`);
const tags = {};
edges.forEach(({ node }) => {
// Quick and... | true |
2e90b5107bebea97fa59e797afaf549d0deaf089 | JavaScript | serghine/api-super-hero-entrainement | /public/js/scrypt.js | UTF-8 | 725 | 2.921875 | 3 | [] | no_license | 'use strict';
const forms = document.querySelectorAll('form');
//const inputhero1=document.getElementById('inputhero1');
//const inputhero2=document.getElementById('inputhero2');
//console.log(forms)
forms.forEach(function(form){
form.addEventListener('submit',function(e){
e.preventDefault()
... | true |
e8c6d892352fa1ec551195f110ce69d1eea30e83 | JavaScript | extra808/cscie31-grad-assignment | /public/javascripts/call-api.js | UTF-8 | 1,024 | 3.203125 | 3 | [] | no_license | console.log('script loaded.');
function testAPI(port) {
// use current protocol and domain with port number passed to the function
const base_url = location.protocol + '//' + location.hostname + ':' + port;
console.log('base_url: ' + base_url);
// make the API request
fetch(base_url + '/api')
.then(response =>... | true |
db50ffbab65d74c67088e0d404b57a172eed7b0b | JavaScript | hackingbeauty/chat-living-room2 | /web.js | UTF-8 | 358 | 2.53125 | 3 | [] | no_license | var app = require('express').createServer(),
io = require('socket.io').listen(app);
app.listen(80);
app.get('/', function(req, res){
res.sendfile(__dirname__ + '/index.html');
});
io.sockets.on('connection', function(socket){
socket.emit('news', { hello: 'world' });
socket.on('my other event', function(da... | true |
a43f690d63de7b5600edbb0027a88724f4657ba9 | JavaScript | shenanigans/node-cachew | /lib/ChainCache.js | UTF-8 | 6,950 | 3.078125 | 3 | [
"MIT"
] | permissive |
/** @module/class cachew.ChainCache
Simple, lightweight, efficient cache for large numbers of keys which expire on a uniform TTL but
may be renewed frequently. This cache type uses a double-linked-list structure. A single timer
is used and no events are provided.
@argument/Number duration
@optional... | true |
91172d7ef8ce86d39a8f274f4cb651472a0fb285 | JavaScript | benmatheson/iditarod2019 | /js/main.js | UTF-8 | 12,503 | 2.75 | 3 | [
"MIT"
] | permissive | var musherHighlight = "Peter Kaiser"
// const sortTimes =times.sort((a,b)=> b-a);
// console.log(times)
// const units = 500;
const yUnits = 550;
const screenWidth = window.innerWidth;
var units;
screenWidth < 500 ? units = 350 : units= (screenWidth -30)/2;
console.log(units+"units");
const lineScaleX = d3.... | true |
c65994fa63bf1a4ba3a4c9a423572a3a16a9a933 | JavaScript | pissang/doubi | /data/csv2json2.js | UTF-8 | 1,665 | 2.625 | 3 | [] | no_license | var fs = require('fs');
// var fileName = process.argv[2];
// if (!fileName) {
// console.log('Miss input file');
// }
//
var fileName = 'relation3.txt';
var json = {}
var content = fs.readFileSync(fileName, 'utf-8');
var currentActor;
var radius = 50;
content.split('\n').forEach(function(line) {
var i... | true |
29f15db7c6a9738b52f9dd07c182b10687e2ba62 | JavaScript | jamesfmurphy/miniature-octo-spice | /public/javascripts/signup.js | UTF-8 | 2,605 | 2.734375 | 3 | [] | no_license | var main= function () {
"use strict";
$('#signupBtn').on('click',function (event){
if(!validation()) return;
$.ajax({
url:"/signup",
error : function () {
$("#messageDiv").empty();
$("#messageDiv").text("error ajax call");
},dataType: "json",
... | true |
ab84f83b359599ff48761e6a07a5cb6db5f5aae8 | JavaScript | starosta1721/js_programming | /JS_training/Строковый буфер с очисткой_notReady.js | UTF-8 | 538 | 3.234375 | 3 | [] | no_license | "use strict";
function makeBuffer() {
var i = "";
function buffer(value) {
if (value === undefined) {value = ""};
i = i + value;
return i;
}
buffer.clear = function () {
i = "";
}
}
var buffer = makeBuffer();
// Строковый буфер с очисткой
// Добавьте буферу из решения задачи... | true |
245bd0cd5dea3e26aecd62e213912ff9a4cbd784 | JavaScript | bryanjwong/bud | /docs/src/Components/HomePage.js | UTF-8 | 5,937 | 2.59375 | 3 | [] | no_license | import { makeStyles } from "@material-ui/core";
import React, { useEffect, useState } from "react";
import Grid from "@material-ui/core/Grid";
import ActivityLog from "./ActivityLog";
import Dashboard from "./Dashboard";
import axios from "axios";
import {db} from "../Services/Firebase"
const useStyles = makeStyles(
... | true |
84f3dd577f93ea7a9652570163ceca8a500923b9 | JavaScript | piotrww/Math | /script/script.js | UTF-8 | 4,474 | 3.265625 | 3 | [] | no_license | $( document ).ready(function() {
console.log( "ready!!!" );
///DOM
////Section A
//1. Square
$('#calculateA1').on('click', function(){
var result = $( "#resultA1" );
var a = $("#myInputA1").val();
if ( a == "" ) {
result.html('Input can not be left blank').addC... | true |
14045c387350a10c89f5184dd2bb761a1d0fc166 | JavaScript | familyburger/dist | /js/menu.js | UTF-8 | 12,213 | 2.9375 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
let $images = $('.product-img');
let itemImg = Array.prototype.slice.call(document.querySelectorAll('.container .item-img'));
for (let i = 0; i < itemImg.length; i++) {
itemImg[i].onclick = addImage;
}
function addImage() {
let num = itemImg.indexOf(this) + 1;
let price = doc... | true |
4c7bc10e30b355f2506405ad4db21d089a743c73 | JavaScript | rennerborges/webscraping-produtos-OLX | /src/scraping.js | UTF-8 | 1,302 | 2.96875 | 3 | [] | no_license | const axios = require('axios');
const cheerio = require('cheerio');
const siteAlvo = 'https://go.olx.com.br/autos-e-pecas/carros-vans-e-utilitarios';
const dados = [];
const getPage = async (link) => {
try {
const res = await axios.get(link);
return res.data;
} catch (error) {
consol... | true |
053d847d6ec31b9ba972ae6a7c6a2106e5a9352e | JavaScript | brunowoisa/elda | /assets/ajax.js | UTF-8 | 8,756 | 2.515625 | 3 | [
"MIT"
] | permissive | var mostra_loading = true;
$(document).on({
ajaxStart: function() {
if (mostra_loading)
$('body').addClass("loading");
else
mostra_loading = true;
},
ajaxComplete: function() { $('body').removeClass("loading"); }
});
$(document).ready(function() {
$('body').removeClass("loading");
});
... | true |
8327643f14883aebca65d1a0d612993b2e245e8e | JavaScript | middaywords/Vis-proj | /js/pie.js | UTF-8 | 8,801 | 2.6875 | 3 | [] | no_license | var room_minute_data;
var pie;
var key_pie;
var color_pie, arc_pie, outerArc_pie, svgPie;
//var rooms = ['other'];
//var day = 1;
function draw_pie(day, gt, rooms) {
// -----------------------------
// Parameters:
// 1. rooms : list e.g. ['room1', 'room2']
// 2. t: : int 0 - 782
// 3... | true |
9bccfbe16f11d51deb15f4a36bcbad0b93453601 | JavaScript | open-source-labs/Swell | /test/subSuites/testHelper.js | UTF-8 | 7,121 | 2.953125 | 3 | [
"MIT"
] | permissive | /**
* This module contains helper functions that facilitates with
* filling in information, adding and sending requests in the UI
* for E2E testing.
*/
const isButtonDisabled = async (page, path) => {
const button = await page.locator(path);
const isDisabled = await button.getAttribute('disabled');
return is... | true |
dde6ccfbece5e223d8efef401030d2d5e45d3809 | JavaScript | tadeoguerra/coursera-spa-angular | /module-1/app.js | UTF-8 | 1,329 | 2.78125 | 3 | [] | no_license | (function () {
'use strict';
angular.module('LunchCheck', [])
.controller('LunchCheckController', LunchCheckController);
LunchCheckController.$inject = ['$scope'];
function LunchCheckController($scope) {
$scope.message = "";
$scope.lunchOpts = "";
$scope.sendMessage = function () {
// let's say if it's ok... | true |
4c0f9b73b45b9e52ef544eea49d186c8c03402d0 | JavaScript | MAOKG/leetcode-js | /0091.decode-ways/numDecodings.test.js | UTF-8 | 603 | 2.75 | 3 | [] | no_license | const numDecodings = require('./numDecodings')
test('test case 1', () => {
const s = '12'
const output = 2
const result = numDecodings(s)
expect(result).toBe(output)
})
test('test case 2', () => {
const s = '226'
const output = 3
const result = numDecodings(s)
expect(result).toBe(outpu... | true |
ecf3484cc737b45ac1db2dc79cc4fd09e180c8e0 | JavaScript | blynnerup/file-converter | /assets/js/menu.js | UTF-8 | 2,513 | 2.71875 | 3 | [
"MIT"
] | permissive | /*
Model is responsible for left menu
menu is based on sections HTML pages
each page start with <template> tag with class "section-template" and others subs classes where menu events is based on
*/
window.navigation = window.navigation || {},
function (n) {
navigation.menu = {
constants: {
... | true |
1263c549d1324752513e6a4915a87fc7b5117bde | JavaScript | filipgad/API-search-engine | /src/containers/SelectCountry.js | UTF-8 | 1,166 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react'
import PropTypes from 'prop-types'
export default class SelectCountry extends Component {
render() {
let countryArr = [];
let country = this.props.universityResults.map( universityElem => {
return universityElem.country
}).forEach ( count... | true |
0fa3c1d5091be5cf62adb7c0d968a9c6356ccbab | JavaScript | BlockABC/i18n-abc | /lib/translate-excel.js | UTF-8 | 1,371 | 2.625 | 3 | [] | no_license | const xlsx = require('xlsx')
const path = require('path')
const fs = require('fs')
const utils = require('./utils')
module.exports = function (translateConfig) {
translateConfig.langs.forEach((lang) => {
const workbook = xlsx.readFile(path.resolve(translateConfig.input, `${lang}.xlsx`))
const jsonPath = path... | true |
e43d257f670f67fc2a420fb4be77be6504c9122a | JavaScript | dfci/omero-iviewer | /ol3-viewer/src/ome/ol3/utils/Misc.js | UTF-8 | 14,618 | 2.78125 | 3 | [] | no_license | //
// Copyright (C) 2017 University of Dundee & Open Microscopy Environment.
// All rights reserved.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// Licen... | true |
e6b90732e87511ad28eab4155f7ee96a0f2c4d61 | JavaScript | arcticmonkey07/reactive-media | /src/Components/CreateUser/CreateUser.js | UTF-8 | 2,059 | 2.53125 | 3 | [] | no_license | import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import { useHistory } from 'react-router-dom';
import { setUser, setUserPosts } from './../../redux/actions/users';
const CreateUser = () => {
const dispatch = useDispatch();
let history = useHistory();
const [name, setName] = ... | true |
13c3b893bdfe44275c7d1c0c52790ee6c31ca269 | JavaScript | thEpisode/PicoYPlacaApp | /Mobile/www/js/storageHelper.js | UTF-8 | 1,502 | 3.203125 | 3 | [
"MIT"
] | permissive | // storageHelper.js
// ----------------------------------------------
//
// Helper created for simplify the use for localStorage in HTML5.
//
// This library have functions for create, modify, get, delete and
// check the status. Enjoy.
//
// Copyrigth: Creative Commons - attribution 4.0 - http://creativecommons.org/l... | true |
7d463f4ea59660b6fca85d6d9f15a4b1a69afbb8 | JavaScript | valentinem1/player-collection-react-practice | /src/components/PlayerCard.js | UTF-8 | 781 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
class PlayerCard extends Component {
state={
display: "no-display",
}
render() {
let {name, image, team, likes} = this.props.player
return (
<div>
<div /*onClick={this.handleClick}*/ className="pl... | true |
08cb5ba4d4b9de379034fb7f83fff22062434580 | JavaScript | karlvr/consistent.js | /test/consistent.tests.js | UTF-8 | 1,837 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | jasmine.getFixtures().containerId = "fixture";
jasmine.getFixtures().fixturesPath = fixtureBase;
function dispatchSimpleEvent(dom, name) {
var ev;
if (document.createEvent) {
ev = document.createEvent("HTMLEvents");
ev.initEvent(name, true, true);
dom.dispatchEvent(ev);
} else if (document.createEventObject) ... | true |
0e37fa2afd714985467c77edb2b7508cd4d53d05 | JavaScript | disgraceful/BookShelfServer | /api/controllers/seriesController.js | UTF-8 | 1,218 | 2.53125 | 3 | [] | no_license | import { ErrorWithHttpCode } from "../error/ErrorWithHttpCode";
import GoodreadsSeriesService from "../services/goodreads/goodreadsSeriesService";
import FormatSeriesService from "../services/formatting/formatSeriesService";
import { tokenInterceptor } from "../http/interceptors";
const formatSeriesService = new Forma... | true |
bdcb96b8e940cdfe16fa4c913cfe418594a9ea41 | JavaScript | arwa1203/ToDoList | /assets/js/todo.js | UTF-8 | 861 | 3.40625 | 3 | [] | no_license | /* Variables */
/* Code to execute */
addDelete();
checkOff();
inputEnter();
/*Functions*/
function addDelete(){
$("ul").on("click", ".delete",function(e){
// fade and delete element
$(this).parent().fadeOut(500, function(){
$(this).remove();
});
e.stopPropagation();
});
}
function checkOff(){
$... | true |
ca99ad075287a1785fe3f6dac2efbf6aa5e9e2bf | JavaScript | ogm710811/lab-authentication-with-passport | /starter-code/config/passport-config.js | UTF-8 | 5,119 | 2.671875 | 3 | [] | no_license | const User = require('../models/user-model');
const bcrypt = require('bcrypt');
const passport = require('passport');
const LocalStrategy = require('passport-local').Strategy;
const FbStrategy = require('passport-facebook').Strategy;
const GloogleStrategy = require('passpor... | true |
ffd6c273c576ad7b95c211b6537067921d9b9715 | JavaScript | StephenRoddy/WebAudioXML | /Classes/Loader.js | UTF-8 | 1,017 | 2.859375 | 3 | [
"MIT"
] | permissive |
class Loader {
constructor(src, callBack){
this.href = src;
this.complete = false;
if(src){
fetch(src)
.then(response => response.text())
.then(xml => {
let parser = new DOMParser();
let xmlDoc = parser.parseFromString(xml,"text/xml");
this.complete = true;
cal... | true |
474634435de0a1f88ed8f8010726ee9090d7ce35 | JavaScript | hubertwwong/react-practice | /todo/src/components/TodoItem.jsx | UTF-8 | 698 | 3 | 3 | [] | no_license | import React from 'react';
// class TodoItem extends React.Component {
// render() {
// return (
// <li key={this.props.id}>
// {this.props.note}
// </li>
// );
// }
// }
// ES6 functional component.
// Using destructing to get props.
const TodoItem = ({id, note, deleteNote}) => (
<l... | true |
cad10938697fab1658522ae34fe4eff7c8bc9fd2 | JavaScript | TkachenkoD/react-gourmaniacs-store | /src/context.js | UTF-8 | 6,247 | 2.9375 | 3 | [] | no_license | import React, { Component } from "react";
import { storeProducts, detailProduct } from "./data";
//Context API
//Provider
//Consumer
//the object includes two Components
//Provider
//Consumer
//Provider is going to seat on the top of Components Tree
//and it have return props.children of App
//the Top of Co... | true |
8e94f7359ef136cac6e434fe6e880ff142e052a2 | JavaScript | oliverfeher/js-advanced-functions-introduction-to-map-and-reduce-lab-onl01-seng-ft-012120 | /index.js | UTF-8 | 1,041 | 3.578125 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Your code here
const mapToNegativize = (arr) => {
let result = [];
for(let i = 0; i< arr.length; i++) {
result.push(arr[i] * -1 );
};
return result;
}
const mapToNoChange = (arr) => {
let result = [];
for(let i = 0; i< arr.length; i++) {
result.push(arr[i] * -1 );
};
... | true |
02b848d3d5091430ae24a669345373cf146b0a62 | JavaScript | Laboralphy/h5-raycaster-lab | /libraries/O876/Mediator.js | UTF-8 | 4,059 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* An implementation of the Mediator Design Pattern
* This pattern allows application to communicate with plugins
* The Client Application instanciate Mediator
* The plugins are extends of the Plugin Class
*
* good to GIT
*/
O2.createClass('O876.Mediator.Plugin', {
_oMediator: null,
_NAME: '',
getNa... | true |
3457beb7de32f4ff876f70d17f42b2f889989e31 | JavaScript | Matiullahsyed/internship | /javascript/script/studentManager.js | UTF-8 | 2,451 | 3.140625 | 3 | [] | no_license | function storingInLocalStorage(student){
let array = JSON.parse(localStorage.getItem("information"));
if(array==null) array=[];
array.push(student);
localStorage.setItem("information",JSON.stringify(array));
}
function validate(studentData){
var validation = true;
if(!namedFieldCheck(studentD... | true |
789b4a4eb8cc6808aafcfc9b731957c644e1fe7f | JavaScript | Anirban20001962/agar | /sockets/classes/PlayerData.js | UTF-8 | 702 | 2.78125 | 3 | [] | no_license | const { v4: uuidv4 } = require('uuid');
class PlayerData {
constructor(playerName,settings) {
this.uid = uuidv4();
this.name = playerName;
this.locX = Math.floor(settings.worldWidth*Math.random()+10);
this.locY = Math.floor(settings.worldHeight*Math.random()+10);
this.radius... | true |
f9e34b5510777e566d54786a1806d4c59ed2ab4d | JavaScript | JeffersonMiranda/OrdersApplicationVue.js | /src/components/mixins/PedidoMixin.js | UTF-8 | 2,210 | 2.625 | 3 | [] | no_license | // MIXIN PARA REUNIR PROPRIEDADES E MÉTODOS COMUNS EM NOVO PEDIDO E MODIFICAR PEDIDO
import { mapActions, mapGetters } from "vuex";
export default {
data() {
return {
ListaClientes: [], // CLIENTES RECUPERADOS DO SISTEMA A SEREM RENDERIZADOS
ListaProdutos: [], // PRODUTOS RECUPERADO... | true |
861b6a1ce43345f58ce8ba1f6b836fc0124f4402 | JavaScript | CB987/dchomework | /JavaScript/scripts/10-04/hello.js | UTF-8 | 859 | 4.40625 | 4 | [] | no_license | // JavaScript comment
console.log("Hello");
//Getting input
//using var and camelCase
// var promptText = "What is your name?"
// var userName = prompt(promptText);
//uses string interpolation
// var greeting = "Hello, " + userName + "!";
// console.log(greeting);
// ========= preferred syntax: let and const
// ru... | true |
9d9d05a2ad7959db1f663dc5b0169e3c2689dd89 | JavaScript | denislozitskiy/project-portfolio-marvel | /js/map.js | UTF-8 | 361 | 3 | 3 | [] | no_license | // Initialize and add the map
function initMap() {
// The location of Uluru
var pinsk = {lat: 52.112, lng: 26.106};
// The map, centered at Uluru
var map = new google.maps.Map(document.getElementById('map'), {zoom: 6, center: pinsk});
// The marker, positioned at Uluru
var marker = new google.ma... | true |
482c32a82de65037f1e694b701c7265ca621e00a | JavaScript | fox-yokai/leet-code-answers | /ReverseInteger.js | UTF-8 | 873 | 4.71875 | 5 | [] | no_license | /*
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Output: 21
Note:
Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, 231 − 1]. For the pur... | true |
3991e82a28869f663f30e91c20f947cbb5f19ee4 | JavaScript | BarberSenpai/Web-Dev | /GuessingGame/GuessingGame.js | UTF-8 | 1,006 | 3.75 | 4 | [] | no_license | var ok;
ok = true;
var num = 1;
function Game() {
if (window.ok) {
window.num = document.getElementById("player").value;
document.getElementById("response").innerHTML = num;
var tries = 0;
document.getElementById("response").innerHTML
= "Player 2 Please Enter y... | true |
26bb5392ccb895b12661b564b03768080d29d9fd | JavaScript | mancas/release-scripts | /scripts/helpers.js | UTF-8 | 286 | 2.671875 | 3 | [] | no_license | const getArgsObject = () => {
const args = {};
process.argv.forEach(function (par) {
const keyValueArr = par.split('=');
args[keyValueArr[0]] =
keyValueArr.length === 2 ? keyValueArr[1] : keyValueArr[0];
});
return args;
};
module.exports = {
getArgsObject,
};
| true |
0f634352a89e38611c1bc5dc45808296b7326dab | JavaScript | andreasbrake/geneal | /Old/init_db.js | UTF-8 | 881 | 2.734375 | 3 | [] | no_license | var fs = require('fs')
var pg = require('pg');
var conString = "postgres://postgres:admin@localhost/mydb";
function init(){
var client = new pg.Client(conString);
client.connect(function(err) {
if(err) {
return console.error('could not connect to postgres', err);
}
client.query('SELECT NOW() AS "theTime"',... | true |
33c8ffd2072b5c753cc1c550c0a87a38a51a7a27 | JavaScript | TenviLi/shiro | /public/gallery/accordion-panel/dist/script.js | UTF-8 | 285 | 2.90625 | 3 | [
"MIT"
] | permissive | var accordionToggles = document.querySelectorAll(".accordion a");
accordionToggles.forEach(function (toggle) {
return toggle.addEventListener("click", function () {
toggle.classList.toggle("active");
toggle.nextElementSibling.classList.toggle("active");
});
}); | true |
6db91849e958cd3500c6a41775e485bf104096e6 | JavaScript | mastersoftwaremedia/romanticismlibrary | /controllers/authorController.js | UTF-8 | 5,299 | 2.59375 | 3 | [] | no_license | var Author=require('../models/author')
var Book=require('../models/book')
var async=require('async')
//Display list of all authors
exports.authorList=function(req,res,next){
Author.find()
.sort([['family_name','ascending']])
.exec(function(err,author_list){
if(err){return next(err)}
res.render('author_list'... | true |
5e93e147e165adf618bc31938c364699fd9c9334 | JavaScript | shankarbanjara/City-Gallery | /app.js | UTF-8 | 2,461 | 3.171875 | 3 | [] | no_license | // THE SPACE FOR THE LARGE IMAGE
let current = document.querySelector('#current');
// WITHOUT LOOP (THE LONG WAY)
// const img1 = document.getElementById('img1');
// const img2 = document.getElementById('img2');
// const img3 = document.getElementById('img3');
// const img4 = document.getElementById('img4');
// const ... | true |
ae801b42523cecc2cd2b5cbec0e00f3c721326bc | JavaScript | sebaq1989/search-pagination | /js/model.js | UTF-8 | 3,890 | 3.265625 | 3 | [] | no_license | const model = ( function() {
// global vars
const liCount = $('ul').children().length;
const $pageHeader = $('.page-header');
const $pageDiv = $('.page');
const $studentList = $( "li.student-item" );
// PAGEINIT HANDLERS
// =============================================================================
// on... | true |
d01f20819781c1405ccec757660253b5147e90c8 | JavaScript | cysgg/js-deep | /codewar/ESOAA.js | UTF-8 | 282 | 3.3125 | 3 | [] | no_license | /**
*
* @param {Array} arr
*/
function findEvenIndex(arr) {
//Code goes here!
return arr.findIndex((v, i, arr1) => arr1.slice(0, i).reduce((p, c) => p + c,0) == arr1.slice(i + 1).reduce((p, c) => p + c,0))
}
let a = [1, 2, 3, 4, 3, 2, 1]
console.log(findEvenIndex(a)); | true |
a6456d9f2a9e72732678d84480c6c5fb42f4672d | JavaScript | elias-fadeyev/elias-fadeyev.github.io | /game/src/gameModes/mode.js | UTF-8 | 1,952 | 2.78125 | 3 | [] | no_license | export default class Mode {
constructor(canvas, resources, player, enemies = []) {
this.canvas = canvas;
this.canvasContext = this.canvas.getContext('2d');
this.resources = resources;
this.player = player;
this.enemies = enemies;
this.hasHandlers = false;
}
render() {
this.renderBackg... | true |
dd69dbb8b57ebe1a5861270fd0869aa81b0454de | JavaScript | camoore1979/sequelize-cli-helpers | /src/lib/getSafeString.js | UTF-8 | 516 | 2.875 | 3 | [] | no_license | 'use strict';
const filenamify = require('filenamify');
// TODO: make `separator` allow for array of separators
// and iterate and replace all of those
const getSafeString = (string, separator, substitute = '_') => {
const safeSeparator = substitute;
const replaceSeparator = new RegExp(separator, 'g');
string =... | true |
fa69f5b24ea5a8f61e20d7e6129539bfe54f2b6f | JavaScript | mike442144/seenreq-repo-redis | /index.js | UTF-8 | 1,130 | 2.59375 | 3 | [] | no_license |
'use strict';
const Repo = require('seenreq/repo');
const Redis = require('ioredis');
class RedisRepo extends Repo{
constructor(options) {
super(options);
const defaultOptions = {
port: 6379, // Redis port
host: '127.0.0.1', // Redis host
family: 4, // 4 (IPv4) or 6 (IPv6)
password: ''
};
th... | true |
8694be2021a60f0a9e512ba6f6dec2f3957fc710 | JavaScript | Tima99/stopwatch | /script.js | UTF-8 | 3,431 | 2.859375 | 3 | [] | no_license | const playBtn = document.querySelector('.play-btn')
const pauseBtn = document.querySelector('.pause-btn')
const resetBtn = document.querySelector('.reset-btn')
const playBtnAfterPause = document.querySelector('.after-pause .play-btn')
const flagBtn = document.querySelector('.flag')
const afterPlay = document.que... | true |
7d1f6b15b7c6a8759f02f4ef5a82f584484dc55e | JavaScript | brsjak/ReactExercises | /src/components/MainContent.js | UTF-8 | 469 | 3.046875 | 3 | [] | no_license | import React from 'react'
function MainContent(){
const date = new Date();
const hours = date.getHours;
let timeOfDay
if(hours<12){
timeOfDay="Morning"
}else if(hours>12 && hours <16){
timeOfDay="Afternoon"
} else{
timeO... | true |
00b72442e9310b4acf8ca089fcd4032e494aabc3 | JavaScript | learnwithjason/accessible-react-audio-player | /src/components/audio-player.js | UTF-8 | 2,955 | 2.890625 | 3 | [] | no_license | import { useRef, useState } from 'react';
/*
TODO:
- X play/pause toggle (button)
- X current time
- X total duration
- x playback scrubber (range input)
- x playback rate button
- jump/rewind X seconds (button)
- volume control (range input)
- mute toggle (button)
Acceptance c... | true |
fe73eb9a4c32f645aafc42240d9c93aca3d716f1 | JavaScript | jayd3e-archive/Upboat | /upboat/static/js/upboat.js | UTF-8 | 1,454 | 2.6875 | 3 | [] | no_license | toggle_vote = function(node, user_id, object_id, vote) {
object_vote = node.parentNode;
object = object_vote.parentNode;
removeActiveClass = function(node) {
index = node.className.indexOf(" active");
node.className = (index != -1) ? node.className.substring(0, index) : node.classNa... | true |
8936586d40b956034b755754dd42de362a9e658f | JavaScript | rosids/trybe-exercises | /desenvolvimento-back-end/bloco_26/dia_01/my-scripts/velocidade.js | UTF-8 | 372 | 3.25 | 3 | [] | no_license | const readline = require('readline-sync');
function calculaVelocidadeMedia() {
const distancia = readline.questionInt('Qual a distancia? (metros) ');
const tempo = readline.questionInt('Qual o tempo? (segundos) ');
const velocidadeMedia = (distancia / tempo).toFixed(2);
console.log(`A velocidade média é ${vel... | true |
84ccfdf95e8230f4ecf92f69cea7f9e46dce9942 | JavaScript | 67tallchris/odin | /javascript/functions/arrow-expression-function.js | UTF-8 | 375 | 4.6875 | 5 | [] | no_license | let sum = (a, b) => a + b;
/* The arrow function is a shorter form of:
let sum = function(a, b) {
return a + b;
};
*/
alert( sum(1, 2) ); // 3
// multiline arrow function
let sum = (a, b) => { // the figure bracket opens a multiline function
let result = a + b;
return result; // if we use figure brackets, u... | true |
894bcb5f66b34580bf60cde8955556a395265585 | JavaScript | greenfox-zerda-lasers/gygabor | /week-09/day-3/mysqlproba/todo/backend.js | UTF-8 | 1,814 | 2.515625 | 3 | [] | no_license | 'use strict';
var mysql = require("mysql");
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Request... | true |
695534fbe1485eb1d1fe00ac574f824c492590f2 | JavaScript | yangqiong123/test12 | /js/zhuce.js | UTF-8 | 2,411 | 2.515625 | 3 | [] | no_license | $(function(){
$('.personal').on('click',function(){
$(this).addClass('btom');
$('.company').removeClass('btom');
});
$('.company').on('click',function(){
$(this).addClass('btom');
$('.personal').removeClass('btom');
});
// 用户名检查
$('#userName').on('focus',function(){
$(this).next().html('请输入手机号');
}).on... | true |
06781a9cbeabb4235b1c539e2f5b2fdd2a88993f | JavaScript | hlyford/algorithms | /fibonacciWithMemoize.js | UTF-8 | 324 | 3.265625 | 3 | [] | no_license |
var memos = {};
var fb = function(num) {
if (num === 0) {return 0;}
else if (num === 1) {return 1;}
else {
if (num in memos) {
console.log('found ', num);
return memos[num];
} else {
memos[num] = fb(num - 1) + fb(num - 2);
return memos[num];
}
}
};
// TEST
console.log(fb(10)); // 55 ... | true |
c97ed862c1cef6ea5eccd786c2e1cd6897543e90 | JavaScript | WeruSSia/bai | /02-JSCoreConcepts/trapezium.js | UTF-8 | 129 | 2.9375 | 3 | [] | no_license | console.log("**********5**********");
const trapeziumArea = (a, b, h) => ((a + b) / 2) * h
console.log(trapeziumArea(2, 4, 2)); | true |
d2016a60c18c221fdc6ea51425d95c9da0c1440d | JavaScript | iolk/webgl-tmn | /src/scripts/Player.js | UTF-8 | 4,659 | 2.78125 | 3 | [] | no_license | import GameState from './GameState.js'
import Terrain from './Terrain.js'
import Sword from './Sword.js'
import Rectangle from './Rectangle.js'
export default (function () {
class Player {
constructor() {
/**
* 0 - resting
* 1 - left-bottom
* 2 - left
* 3 - left-up
* 4 - right-bottom
* ... | true |
e4af2b781698ac92cb8a1cbabac5b430da507afe | JavaScript | JEonjinwon/TCPIP_project | /TCPIP네트워킹_REPORT/atom_소스/code_3.js | UTF-8 | 431 | 2.96875 | 3 | [] | no_license | let date = new Date();
switch (date.getMonth()+1) {
case 12:
case 1:
case 2:
console.log("겨울입니다.");
break;
case 3:
case 4:
case 5:
console.log("봄입니다.");
break;
case 6:
case 7:
case 8:
console.log("여름입니다.")
break;
case 9:
case 10:
case 11:
console.log("가을입니다.");
break;
defa... | true |
f05426e695e037159c5bdd38ce40dea9b7df5455 | JavaScript | shreyanshsaha/leetcode-circle-and-rectangle-overlapping | /sketch.js | UTF-8 | 3,844 | 3.65625 | 4 | [] | no_license | /**
* To understand logic go to Line 88 Collision->render() function. Required code is commented there.
*
* @author Shreyansh Saha
*/
let mouseCircle = undefined;
let collisionRect = undefined;
let collision = undefined;
function setup() {
createCanvas(windowWidth, windowHeight);
frameRate(120);
mouseCir... | true |
4419d39520691d308bf6c9f57de2840c6704a2e5 | JavaScript | Winchess1/bigDataScience | /webScraper.js | UTF-8 | 3,698 | 2.984375 | 3 | [] | no_license | const dateFormat = require('dateformat');
const cheerio = require('cheerio');
const request = require('request');
const mkdirp = require('mkdirp');
const date = dateFormat(new Date(), "yyyymmdd");
const path = require('path');
const fs = require('fs-extra');
const _ = require('underscore');
const allStocks = {
url... | true |
b1709139345f184b6e63114496a96564c52b9fd4 | JavaScript | connected-web/product-monitor | /lib/monitor/models/preflight.js | UTF-8 | 646 | 2.640625 | 3 | [] | no_license | function create (workItems) {
workItems = workItems || []
function add (workItem) {
workItems.push(workItem)
}
function all (res, req, next) {
work(res, req, next, 0)
}
function work (res, req, next, i) {
var workItem = workItems[i]
var itemType = typeof workItem
if (itemType === 'fun... | true |
2a2040aab9958f53f76df89793bef7f540a91939 | JavaScript | rathishanmugam/inventry-mongodb-project | /client/src/store/modules/product.js | UTF-8 | 3,574 | 2.59375 | 3 | [] | no_license | import Vue from 'vue'
import axios from 'axios'
export default {
namespaced: true,
state: {
product: []
},
getters: {},
actions: {
saveProduct({commit, dispatch, state, rootState}, product) {
// Add product to the database
console.log('the saving product record is:', product)
const... | true |
4f661580afa1fa159e04e3f313235931cf565ec5 | JavaScript | ValeriiSyrov/docker-kubernetes_node_react | /backend/kubernetes/test.js | UTF-8 | 201 | 3.046875 | 3 | [] | no_license | console.log(sum(2,3)); // 5
console.log(sum(2)(3)); // 5
function sum (a,b) {
if (b) {
return a+b
} else {
return function (c) {
return a+c
}
}
}
| true |
2e4a2015f74a178f62312c582636b2140a6bccf6 | JavaScript | lrowe/experimental-falcor-persistent-cache | /src/util.js | UTF-8 | 1,486 | 2.609375 | 3 | [] | no_license | // @flow
"use strict";
import type {
JsonGraph,
JsonGraphNode,
JsonGraphLeaf,
Path,
PathSet
} from "falcor-json-graph";
export type JsonGraphEnvelopeWithMissingPaths = {
jsonGraph: JsonGraph,
paths?: PathSet[],
missingPaths?: PathSet[],
invalidated?: PathSet[],
context?: JsonGraph
};
function isR... | true |
b8a646d40bf73e0dc7a86fbf3a852ed3ed7ff2fb | JavaScript | pankajbandewar0617/Assignment | /string.js | UTF-8 | 2,058 | 4.1875 | 4 | [] | no_license | // Write a function to manipulate the provided string
// 1. Padded Number
// Pad given single numbers in array to look like "10", "05", "16", "02"
const nums = ['2', '4', '25', '10', '3']
const paddedNum = text => {
// Insert function
for (var i = 0; i<text.length; i++){
if (text[i].length === 1){
text[i... | true |
4608dbc34535036cfd78edcac4d23702b974aaef | JavaScript | ascartabelli/lamb | /src/privates/_getInsertionIndex.js | UTF-8 | 966 | 3.328125 | 3 | [
"MIT"
] | permissive | /**
* Establishes at which index an element should be inserted in a sorted array to respect
* the array order. Needs the comparer used to sort the array.
* @private
* @param {Array} array
* @param {*} element
* @param {Function} comparer
* @param {Number} start
* @param {Number} end
* @returns {Number}
*/
fun... | true |
e07593f84f094bfb00880633518f1f4515a3e2c6 | JavaScript | MurlocHolmes/xrewda | /src/components/contacts/contacts.js | UTF-8 | 2,364 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import { connect } from 'react-redux';
import axios from "axios/index";
import { storeContacts, initializeContacts } from "./redux/actions";
import ContactForm from "./contactForm";
import ContactTable from './contactTable';
/**
* Contacts Component that fetches contacts acc... | true |
a7279d50dc76f1489409504a83bbca2be8223d40 | JavaScript | yOoMarvin/adventofcode-2019 | /02-program-alarm/puzzle-02.js | UTF-8 | 1,594 | 3.609375 | 4 | [] | no_license | var fs = require("fs");
var arr = fs.readFileSync("./input.txt", "utf8").split(",");
const fixLanding = (noun, verb) => {
const input = arr.map(Number)
let i = 0
let running = true
input[1] = noun
input[2] = verb
do {
const opCode = input[i]
switch(opCode) {
case ... | true |
8196f59190383fa798b22e46036e01adbdf45afe | JavaScript | leye195/threeJS-study | /fundamentals/practice5/index.js | UTF-8 | 4,225 | 2.515625 | 3 | [] | no_license | const main = () => {
const canvas = document.querySelector('#c');
const progressBar = document.querySelector('.progress__bar');
//create renderer, it takes all data and rendering to the canvas
//WebGLRenderer is thate use WebGL to render 3d to the canvas
const renderer = new THREE.WebGLRenderer({canvas});
... | true |
e3f8e811c394155fdb2751cb46ea241f31dbf0d6 | JavaScript | merveerd/favorite_spots_react_native_with_api | /server/models/users.model.js | UTF-8 | 1,770 | 2.578125 | 3 | [] | no_license | const mongoose = require("mongoose");
//mongoose.set('useCreateIndex', true);
const { isEmail } = require("validator");
const bcrypt = require("bcrypt");
const userSchema = new mongoose.Schema({
email: {
type: String,
required: [true, "Please enter an email"],
unique: true, //we cant give error ... | true |
c0de24e0dfc95d99762e59388e0a0ddba918d69b | JavaScript | MANISHUKIRADE/swabhavrepo | /nodejs/welcome.js | UTF-8 | 291 | 3.03125 | 3 | [] | no_license | console.log(this)
var a
console.log(a)
//console.log(global)
f1();
function f1() {
console.log("inside f1")
var a= 1
console.log(a+ "of f1")
}
f1()
var f2 = function () {
console.log("inside f2")
}
setTimeout(function () {
console.log("Timeout Funtion")
}, 5000)
f2(); | true |
c5aacf7d96407aab138a671854e37ba5394779b3 | JavaScript | micahmosley/leetcode-practice | /problems/recursion/factorial.js | UTF-8 | 429 | 4.125 | 4 | [] | no_license |
//Create a function that returns the factorial of any given input number
const memo={};
const factorial = (num) => {
if (num===0) return 1
else if (num === 1) return 1
if (memo[num]) return memo[num]
else {
let fact=factorial(num-1) * num
memo[num]=fact ;
return fact
... | true |
855ff9847646a02d2d23a7b85a108f908fbd18cf | JavaScript | CoinCircle/icostats | /src/server/lib/merge-coinmarketcap-data.js | UTF-8 | 514 | 2.734375 | 3 | [] | no_license | /* eslint-disable camelcase */
export default function merge(coinmarketcapPrices, priceHistory) {
const res = [...coinmarketcapPrices];
for (let i = 0; i < priceHistory.length; i++) {
const { symbol, prices } = priceHistory[i];
const exists = res.some(el => el.symbol === symbol);
if (!exists) {
... | true |
21253e139c8c76f09aa7f11abd4851a72859328c | JavaScript | WuYuQi0301/Web2.0 | /homework6/v2/js/event.js | UTF-8 | 4,192 | 2.828125 | 3 | [] | no_license | window.onload = startGame;
var restart_flag = 0;
var difficulty = 4;
function startGame() {
initialJigsaw();
$("#restart").click(restartGame);
$("select").change(changeDifficulty);
}
function changeDifficulty() {
difficulty = $("select").val();
$("#info").text(" ");
var new_css = "./css/style_" + difficulty + "... | true |
43ffaf6f6ec8872ddf81ca75df1e6ef5b4ac1c86 | JavaScript | AltCampus/AC-JS-data-structure-TJaaac | /Ex5-assignment-level-2-EJaaar/block-03-BJaaco/code/index.js | UTF-8 | 3,149 | 3.953125 | 4 | [] | no_license | let numbers = [6, 8, 10, 12, 43, 56, 98];
let userIds = [1230, 234, 1278, 984, 763, 900];
// 1. Add all the values of numbers and userIds array into the new newly created array named `collection`
// 2. Add all the even numbers from both arrays numbers and userIds into a newly created array named `evenCollection`
//... | true |
b51a0f950c0f2471f9d699ecfafc229eb6517496 | JavaScript | juddroid/2021CodeSquadMasters | /al/210618-codility-1-Binary-Gap.js | UTF-8 | 392 | 3.28125 | 3 | [] | no_license | const N = 1041;
function solution(N) {
let bin = N.toString(2);
let list = bin.split('');
console.log(list);
let count = 0;
let gap = [];
for (let i = 0; i < list.length; i++) {
if (+list[i] === 0) {
count++;
} else {
gap.push(count);
count = 0;
}
}
console.log(gap);
ret... | true |
3d39d50d9cff9fb7dc3e40fb9ed0803f44a59233 | JavaScript | jesselpalmer/BASIC | /src/exec_program/executors/commands/abs_command.js | UTF-8 | 184 | 3.15625 | 3 | [
"MIT"
] | permissive | export default function abs(line) {
const number = parseFloat(line);
if (isNaN(number)) {
console.error('Invalid number');
} else {
console.log(Math.abs(number));
}
}
| true |
33e655648524332daa2628500c7de545b69d65c4 | JavaScript | WaneLiu/cxread2 | /src/actions/getCurrentChapterContentAction.js | UTF-8 | 1,277 | 2.703125 | 3 | [] | no_license | import { START_GET_CUR_CHAPTER_CONTENT, FAIL_GET_CUR_CHAPTER_CONTENT, SUCCESS_GET_CUR_CHAPTER_CONTENT } from "../constants/actionTypes";
import { api } from "../constants/api";
export const getCurrentChapterContent = (chapterLink) => {
chapterLink = chapterLink.replace(/\//g, '%2F').replace('?', '%3F')
return ... | true |
fe94178c3d81731cb753c50a4af7862084280be9 | JavaScript | sawankhanchi/other-projects-gohunting-usa | /src/marketplace-custom-config.js | UTF-8 | 16,390 | 2.75 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Marketplace specific configuration.
*
* Every filter needs to have following keys:
* - id: Unique id of the filter.
* - label: The default label of the filter.
* - type: String that represents one of the existing filter components:
* BookingDateRangeFilter, KeywordFilter, PriceFilter,
* ... | true |
2f6f58d6ae11716d2eef76bd2a5837088a09a5be | JavaScript | HadiSalehWeb/neuro-evolutional-snake-legacy | /neural.js | UTF-8 | 2,703 | 2.984375 | 3 | [
"MIT"
] | permissive | 'use strict';
const NeuralNetwork = function (layers, weights) {
if (layers.count < 2) throw new Error('Network must have at least 2 layers.');
if (layers.some(x => x < 1)) throw new Error('Every layer must have positive non-zero number of neurons..');
if ((Array.isArray(weights) && (weights.length !== lay... | true |
183c4c6c9ca907bfcd70295099f2c6c8a4dca059 | JavaScript | abobco/Catatonia | /src/graphics/lighting/PointLight.js | UTF-8 | 1,747 | 2.625 | 3 | [
"MIT"
] | permissive | import {RayCaster} from './RayCaster.js';
import { Boundary } from '../../entities/terrain.js';
/**
* - Handles light animation
* - Parent object of the actual ray caster
* @class
*
*/
export class PointLight {
/**
* - Handles light animation
* - Parent object of the actual ray caster
* @param {number... | true |
89513713f4a8ca2c9c5735016855bfea39413a2f | JavaScript | PatriceG/MMM-MPR121 | /node_helper.js | UTF-8 | 1,939 | 2.5625 | 3 | [
"MIT"
] | permissive | /* Magic Mirror
* Node Helper: Buttons
*
* By Patrice Godard & Joseph Bethge
* MIT Licensed.
*/
const MPR121 = require('adafruit-mpr121');
const mpr121 = new MPR121(0x5A, 1);
const NodeHelper = require("node_helper");
module.exports = NodeHelper.create({
// Subclass start method.
start: function() {
... | true |
8f5dff3db779532c42a5663e3ce173c40d7d32c2 | JavaScript | zh1993zh1993/learn_nodejs | /learn_nodejs/demo02/02-http创建web服务.js | UTF-8 | 628 | 3.046875 | 3 | [] | no_license | // 表示引入HTTP模块
var http = require('http');
/*
request:回应客户端传过来的信息
response:给浏览器响应信息
*/
http.createServer(function (request, response) {
// 设置响应头
// 状态码是 200,文件类型是 html 字符集是 utf-8,不加单引号就不会乱码
response.writeHead(200, {"Content-Type": "text/html;charset=utf-8"});
response.write('你好 nodejs')
response.write('<... | true |
bdbfa9cdded7ae172cbf7efd2798a0ea838428b0 | JavaScript | vla15/practice-problems | /balancedParens/balancedParens.js | UTF-8 | 2,238 | 4.84375 | 5 | [] | no_license | /*
* write a function that takes a string of text and returns true if
* the parentheses are balanced and false otherwise.
*
* Example:
* balancedParens('('); // false
* balancedParens('()'); // true
* balancedParens(')('); // false
* balancedParens('(())'); // true
*
* Step 2:
* make your soluti... | true |
131330d50c109774b038800b28e224d4f9e1271b | JavaScript | billsun9/heart-disease-project | /static/js/app.js | UTF-8 | 254 | 3.21875 | 3 | [] | no_license | const varNames = document.querySelectorAll('.var-name');
console.log(varNames);
varNames.forEach(varName => {
varName.addEventListener('click', () => {
let info = varName.nextElementSibling;
info.classList.toggle('show');
});
}); | true |
dc04f0b5cb3c2c3891c039fd4a1001a332b6005c | JavaScript | TnS101/Algorithms | /Problems/JS/Add Digits.js | UTF-8 | 266 | 3.6875 | 4 | [] | no_license | var addDigits = function (num) {
while (true) {
if (num < 10) {
return num;
}
num = num.toString().split('').reduce(function (a, b) {
return Number(a) + Number(b);
});
}
};
console.log(addDigits(38)); | true |
7b0b577b915b49f72f0749ebc96268764b1caf0b | JavaScript | Boris-Madonov/timer | /src/components/App/index.jsx | UTF-8 | 2,086 | 2.953125 | 3 | [] | no_license | import React, { useState, useRef } from 'react';
import './index.css';
export default function App() {
const [title, setTitle] = useState('Начните отсчет!');
const [count, setCount] = useState(25 * 60);
const [countdownOn, isCountDownOn] = useState(false);
const minutes = Math.floor(count / 60).toString().pad... | true |
5fe3e2bfc03f33d33588654de415cbe457a55797 | JavaScript | chunpu/browser-mocha | /assets/fill.js | UTF-8 | 1,541 | 2.75 | 3 | [
"ISC"
] | permissive | !function() {
var __head = document.getElementsByTagName('head')[0]
function __getSyncScript(url, cb) {
var script = document.createElement('script')
script.onload = script.onerror = script.onreadystatechange = function(ev) {
var state = script.readyState
if (ev && 'error' == ev.type) { // old browser has no one... | true |
6a13115fc32df2b0246548a006a37446b4579a54 | JavaScript | langfy/cczqRep | /web/broker/chat/js/isAlert.js | UTF-8 | 801 | 2.90625 | 3 | [] | no_license | var isAlert = false;
function isAlertMsg(msg){
if(isAlert){
DOAlertShowMsgInterFace(msg);
}
}
function runScript(strscript){
eval(strscript);
}
/*
* get time
*/
function toGetNowTime(){
var day = new Date();
var year = day.getFullYear();
var month = day.getMonth() + 1;
var today = day.getDate();
if(... | true |
1ce4a4c0e9156d2c7606a4bd10592a754cbbf645 | JavaScript | debojyoti/ng-debojyoti-xyz | /js/custom.js | UTF-8 | 1,525 | 2.65625 | 3 | [
"MIT"
] | permissive | document.addEventListener("DOMContentLoaded", event => {
// Landing section slider and cards
var counter = 1;
setInterval(() => {
switch (counter) {
case 0:
// Show scholarly slide
$("#page-meter-slider-wrapper").toggleClass("show");
$("#sc... | true |
0c0050134ae5730961d72a84b869a110bbe8d3b9 | JavaScript | s992/csgo-gamestate | /index.js | UTF-8 | 598 | 2.59375 | 3 | [] | no_license | var fs = require("fs");
var express = require("express");
var bodyParser = require("body-parser");
var app = express();
var sampleDataStream = fs.createWriteStream(`./sample-data/sample.json`, { flags: "a" });
sampleDataStream.write("[");
app.use( bodyParser.json() );
app.post("/", function( req, res ) {
sampleData... | true |
eba495dc8bee5156b6e93e6644f5dd7b98586978 | JavaScript | aanon4/8bitrobots | /vehicle/robot.js | UTF-8 | 6,591 | 2.609375 | 3 | [
"MIT"
] | permissive | 'use strict';
console.info('Loading Robot.');
const PI = Math.PI;
const PId2 = PI / 2;
const PIx2 = PI * 2;
// robot modes
const DISABLED = 0;
const ACTIVE = 1;
const SHUTDOWN = 3;
// Heartbeat
const NOHEARTBEAT = 0;
const HEARTBEAT = 1;
const WAITINGHEARTBEAT = 2;
const IDLE_TIMEOUT = 60 * 60 * 1000; // 60 minu... | true |
31314107bd6122a39f130bf4009a3f7a760b60dc | JavaScript | SangwookYun/2020-Vancouver-TAIWANfest-Online-Gallery | /src/Sky/skyArtist6.js | UTF-8 | 5,288 | 2.53125 | 3 | [] | no_license | import React from 'react';
import SkyArtist from './skyArtist_Itallic';
import huang_profile from '../assets/人物照 -黃約農.jpg';
import Slider from '../modules/img_slider_final'
import sara_profile from '../assets/人物照-Sara.jpg';
import valerie_profile from '../assets/人物照-Valerie.jpg';
import peter_profile from '../assets/人物... | true |
fddfa95224339ddefe9e71d326eff03d53ae3cf4 | JavaScript | Immortalsun/GeneticMaze | /scripts/classes/engine/individual.js | UTF-8 | 1,054 | 2.984375 | 3 | [] | no_license | class Individual{
constructor(chromosomeLength,id,geneConstraint){
this.chromosome = new Chromosome(chromosomeLength,geneConstraint);
this.id = id;
this.fitnessScore = 0;
this.solveLine = undefined;
}
get Chromosome(){
return this.chromosome;
}
get Solv... | true |
b571e06ffe15bd6b198ce18aed183368a5a4f35e | JavaScript | BelalFaouri/rbk4-self-assessment-week2 | /algo-complexity/complexityAnalysis.js | UTF-8 | 1,063 | 4.03125 | 4 | [] | no_license | // List and briefly describe the types of algorithmic time complexity.
// Be as clear and complete as necessary to demonstrate your mastery.
// Write your explanation below as a comment
/*
1-Constant time complexity:O(1) has a constant time to excute any number of operations and is independent on any parameters such as... | true |