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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
82e40cdd8d0c0c17e357c392d45e30b0da1edca7 | JavaScript | marianasdf/Trybe_exercicies | /fundamentos/dia-2-javascript-array-e-loop-for/ex09.js | UTF-8 | 324 | 4.125 | 4 | [] | no_license | /*Utilizando o array criado no exercício anterior imprima o resultado da divisão de cada um dos
elementos por 2 .*/
let numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25];
for (let index = 0; index < numbers.length; index += 1) {
console.log(numbers[index] / 2);
... | true |
bd07314a2cd944d5a06664f9de5b857c05ad5f06 | JavaScript | Akamaozu/ringabell | /ringabell.js | UTF-8 | 554 | 2.890625 | 3 | [] | no_license | "use strict";
var player = require('play-sound')();
class RingABell{
/**
Define all useful variables for this Class
*/
constructor() {
this.bellPath = './bells/bell.mp3';
}
/**
ring the belle as many times as define in the parameter
*/
ring(nb){
for(var cpt=0; cpt<nb; cpt++){
player.p... | true |
1e08c74ffeb259b75e55569e9c9b3498614a1c9a | JavaScript | kmxz/fyp-support | /server.js | UTF-8 | 1,434 | 2.53125 | 3 | [] | no_license | var nodeStatic = require('node-static');
var http = require('http');
var ws = require('ws');
// port 10000: static file - serving static files in this directory
var fileServer = new nodeStatic.Server(__dirname, { cache: 0 });
http.createServer(function (request, response) {
request.addListener('end', function () {... | true |
c70ec85f37e9d3e6c3b00c2c95aeb56fa6eca357 | JavaScript | weiTimes/front-source-code | /algorithms/topics/abccba转换aaabbc.js | UTF-8 | 1,060 | 3.703125 | 4 | [] | no_license | /*
* @Author: yewei
* @Date: 2020-12-21 10:49:58
* @Last Modified by: yewei
* @Last Modified time: 2020-12-21 12:06:33
*
* abacba 转成 aaa,bb,c
*
*
*/
/**
* 方法一:排序后,使用两个指针,遇到不一样则插入逗号
* @param {*} str
*/
function transformStr(str) {
let sortStr = str.split('').sort().join('');
let prev = 0;
let cur = ... | true |
4279b6acafbec6f8a364a7bcd21dc2dbedf37897 | JavaScript | Rewindz/NewPlugDj-Bot | /newplugdjbot.js | UTF-8 | 2,450 | 2.921875 | 3 | [] | no_license | //------ PLUG.DJ BOT 2016+ -----//
//------ BY STEAM ID DEFENDERREWINDZ -----//
//-- To Do:
//-- Black List/White List
//-- Farm Mode
//-- Anti-Bot (Auto-Chatting/Humanizer type thing)
prevSong = "";
doEcho = true;
doWoot = true;
doGrab = false;
doMeh = false;
function createMenu(){
list = $('#app').children()[3].c... | true |
46e0e7c2fbc01d30351c0d64833d5f933fc647f7 | JavaScript | GabrielVGobbi/hortfruit | /resources/js/cart.js | UTF-8 | 4,216 | 2.625 | 3 | [
"MIT"
] | permissive | const { data } = require('jquery');
window.$ = window.jQuery = require('jquery');
let cart = [];
let itens = [];
if (localStorage.getItem('cart')) {
cart = JSON.parse(localStorage.getItem('cart'));
itens = cart[0].itens
} else {
cart = [{
phone: '',
itens: itens
}];
localStorage.s... | true |
566e3ec02d995071fb8ba5f2ec03b3621c744e6c | JavaScript | aperaham/jypsy-orm | /src/fields.js | UTF-8 | 14,536 | 2.828125 | 3 | [] | no_license |
function CreateField(baseField, name, classProps) {
let constructor = {
[name]: function(opts = {}) {
if(!(this instanceof constructor[name])) {
return new constructor[name](opts);
}
this.construct(opts);
}
};
let newField = constructor[name];
newField.prototype = Object.crea... | true |
fa6e7ab6bb9833bf6551bf96d610c9459627e5f3 | JavaScript | junlongtao/react-zui | /src/components/CheckList.js | UTF-8 | 2,068 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* 单选框组件
*/
"use strict"
import './less/check-list.less'
import React from 'react'
import Message from './Message'
export default class CheckList extends React.Component {
static defaultProps = {
value: [],
prefix: 'zui',
name: '请选择',
className: '',
max: Infinity,
... | true |
0fc73aad883723a56aea7cb28e861f928b2ca545 | JavaScript | TheShubham99/GithubActions-Trello | /TrelloWrapper.js | UTF-8 | 1,666 | 2.796875 | 3 | [] | no_license | //const trello_api_key = process.env.TRELLO_API_KEY;
//const trello_api_token = process.env.TRELLO_API_TOKEN;
const listId='5e9c0ee94f859847a991d53b';
function newCard(cardName,Description,ListID=listId){
$.post("https://api.trello.com/1/cards",
{
idList:ListID,
key: trello_api_key,
token: trello_api... | true |
799eaac823c75d67b6bb65812e50e553bb1ba34d | JavaScript | Mahendras1ngh/WebDev-Bootcamp | /assignment 7 (Weather app)/app.js | UTF-8 | 3,892 | 3.078125 | 3 | [] | no_license | const input = document.querySelector("#input");
const API_key = "09e19865d1bdfd4b435d0f706a1cafc7";
const cityp = document.querySelector(".cityp");
const current_temp = document.querySelector(".current_temp");
const feels_like = document.querySelector(".feels_like");
const mintemp = document.querySelector(".mintemp");... | true |
4e0ff7948fb87d261d23281bb001fd7ded809d70 | JavaScript | tae-lim/interviewprep | /hammingDistance.js | UTF-8 | 331 | 3.6875 | 4 | [] | no_license | var hammingDistance = function(str1, str2) {
var counter = 0;
if (typeof str1 !== 'string' && typeof str2 !== 'string') {
str1 = String(str1);
str2 = String(str2);
}
for (var i = 0; i < str1.length; i++) {
if (str1[i] !== str2[i]) {
counter++;
}
}
return c... | true |
9e8681380dacc535fac7843af96659e34b329d7e | JavaScript | avoronkin/any-sync | /test/util.spec.js | UTF-8 | 754 | 2.875 | 3 | [] | no_license | var assert = require('assert')
var util = require('../lib/util')
var keyIterator = util.keyIterator
describe('util', function () {
describe('keyIterator', function () {
it('should iterate over object keys', function () {
var obj = { one: 1, two: 2, three: 3 }
var nextKey = keyIterator(obj)
ass... | true |
7c3b0a1ce39f9ca25139eb9a164cc5664b591ab4 | JavaScript | sammndhr/algorithms | /interview_kickstart/02_recursion_and_backtracking/video_problems/00_raise_int_to_power.js | UTF-8 | 847 | 4.1875 | 4 | [
"MIT"
] | permissive | // Given two integers, n and k, calcuate n^k. n > 0, k >= 0
/*
Recursive
Time Complexity - O(k)
Space Complexity - O(k). From call stack
*/
function rRaiseIntToPower(n, k) {
if (k === 0) return 1
else return n * rRaiseIntToPower(n, k - 1)
}
// ----------------------------------------------
/*
Iterative
Time Com... | true |
f348007ca048edfdca0165775cd867521cdc009f | JavaScript | kvolechka/online-zoo | /pages/landing/landing.js | UTF-8 | 4,286 | 2.890625 | 3 | [] | no_license | /*Блок слайдера Pets*/
const sliderContainer = document.querySelector('.animals-card .wrapper-card-item');
const slidesItem = sliderContainer.querySelectorAll('.slide-item');
const leftBtn = document.querySelector('.left-arrow');
const rightBtn = document.querySelector('.right-arrow');
let counter = 1;
const size... | true |
89f1431fc1ab68704d54024d07742b596c55c071 | JavaScript | SEIAROTg/wheels | /biubiu/src/compiler.js | UTF-8 | 1,692 | 2.8125 | 3 | [] | no_license | import { escapeString } from './utils';
export default function compile(selectorOrHtml) {
const templateStr = selectorOrHtml.startsWith('#')
? document.querySelector(selectorOrHtml).innerHTML
: selectorOrHtml;
const templateEl = document.createElement('template');
templateEl.innerHTML = templateStr;
const fra... | true |
48914b478378b472fcb889d8cff065eef2899e63 | JavaScript | devcosmos/1207349-big-trip-12 | /src/view/statistics-view.js | UTF-8 | 4,014 | 2.734375 | 3 | [] | no_license | import {ChartType} from "../const";
import {splitEventsByChartType} from "../utils/index";
import SmartView from "./smart-view";
import Chart from "chart.js";
import ChartDataLabels from "chartjs-plugin-datalabels";
const renderChart = (canvas, chartType, events) => {
const labels = [];
const data = [];
let form... | true |
b64fc3e0a68c0977cda77fe06c38a79f961b087e | JavaScript | krom-xr/GunMeat | /js/utils.js | UTF-8 | 11,637 | 3.0625 | 3 | [] | no_license | /*global _, global*/
if (typeof global !== 'undefined') {
window._ = global._;
}
var utils = {};
/*
* возвращает значение гет параметра из урл адреса.
* url - строка урл
* param - строка с именем параметра
* если параметр не существует возвращает undefined,
* если существуте но без значения - возвращает '' (на... | true |
bcaef3fbeb2b171c8b7f9e5759f9038185d211f0 | JavaScript | ashutosh7246/ReactjsNodejsStarter | /react-js/src/src/common/validator.js | UTF-8 | 583 | 2.5625 | 3 | [] | no_license | export const validator = {
email: {
presence: {
message: '^Please enter an email address'
},
format: {
pattern: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
message:... | true |
349e2bb7bebe42d902669cd5c28e9a29e62dbaac | JavaScript | hrr13-thedreamteam/dreambot | /app/reducers/notificationsReducer.js | UTF-8 | 604 | 2.671875 | 3 | [] | no_license | import { ADD_NOTIFICATION, NEXT_NOTIFICATION } from '../actions/notificationsActions';
const initialState = {
currentNotification: false,
queue: []
};
export default function notificationsReducer(state = initialState, action) {
switch (action.type) {
case ADD_NOTIFICATION:
return {
...state,
... | true |
69ceeec0ddec38d1369fb8a83072680856a86171 | JavaScript | 9aa5/9aa5.github.io | /focustest.js | UTF-8 | 973 | 3.171875 | 3 | [] | no_license | function setSelection(div_id) {
setTimeout(function () {
setSelectionNow(div_id);
}, 3000);
}
function setSelectionNow(div_id) {
var sel = window.getSelection(),
div_elem = document.getElementById(div_id),
text_node = div_elem.childNodes[0],
range = document.createRange();
sel.remo... | true |
e5246b10a88b06b18b7fcaa1c215a88cc7ee314c | JavaScript | giraffesyo/final-project-lp | /src/utils/fetch.js | UTF-8 | 994 | 2.84375 | 3 | [] | no_license | function checkStatus(response) {
if (response.status >= 200 && response.status < 300) return response
else {
let error = new Error(response.statusText)
error.response = response
throw error
}
}
function ajaxFetch(url, options = {}) {
return fetch(url, { credentials: 'same-origin', ...options }).the... | true |
018196c435720390652913cfed3c28f02373f085 | JavaScript | Sharvanand/mean-employment-app | /routes/route.js | UTF-8 | 1,284 | 2.609375 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const Employee = require('../models/model');
router.get('/', (req, res) => {
Employee.getEmployees((err,employees) =>{
if(err) throw err;
res.json(employees);
});
});
router.post('/',(req, res)=>{
var newEmp = {
name: req.bo... | true |
85de7ee2c89934a935ff0ca81ed5912866beb235 | JavaScript | shownoso/note | /javascript/es6/Array.js | UTF-8 | 1,112 | 4.21875 | 4 | [] | no_license | let json = {
'0': 'A',
'1': 'B',
'2': 'C',
length: 3
};
console.log(Array.from(json));
console.log(Array.of(1,2,3));
// 实例上的新方法
let instance = [1,2,3];
console.log(instance.find((item, index, arr) => item ===2)); //2
instance.fill('shown', 0, 2); // 从index为0开始填充2位
console.log(instance); // [ 'shown... | true |
60228cf93beb65e16fd5326991938b9d81906156 | JavaScript | randoms/p2p-udp | /src/utils/mConsole.js | UTF-8 | 108 | 2.53125 | 3 | [] | no_license |
function print(res){
process.stdout.write(res+'\n> ');
return res;
}
module.exports.print = print; | true |
f57ff24d3b8c5483652fd91f2a91d1643b4c0f28 | JavaScript | pavel-tagiltsev/taskmanager | /src/model/tasks.js | UTF-8 | 1,088 | 2.703125 | 3 | [] | no_license | import Observer from '../utils/observer.js';
export default class Tasks extends Observer {
constructor() {
super();
this._tasks = [];
}
setTasks(tasks) {
this._tasks = tasks.slice();
}
getTasks() {
return this._tasks;
}
updateTask(updateType, update) {
const index = this._tasks.fin... | true |
acfb4d3f7c7b7d97772e409d8c4a286bb3b63562 | JavaScript | elwiller/weather-dashboard | /script.js | UTF-8 | 2,871 | 3.046875 | 3 | [] | no_license | function getWeather(city) {
var queryURL = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&units=imperial&appid=3c5df29c7c4104b411776c9903d99c5f";
$.ajax({
url: queryURL,
method: "GET"
}).then(function(response){
icon = "https://openweathermap.org/img/wn/" + response.weather[0].icon + ... | true |
68a34e641409aa461eb85a34fcd5476087706fc1 | JavaScript | VarillasFriend/Notes | /index.js | UTF-8 | 18,094 | 2.53125 | 3 | [] | no_license | function encrypt(message = "", key = "") {
var message = CryptoJS.AES.encrypt(message, key);
return message.toString();
}
function decrypt(message = "", key = "") {
var code = CryptoJS.AES.decrypt(message, key);
var decryptedMessage = code.toString(CryptoJS.enc.Utf8);
return decryptedMessage;
}
/... | true |
740372525c5b70f76443f7ad9cd7e2cf505b7aab | JavaScript | blandblom/js-framework | /src/js/app/util.uri.js | UTF-8 | 2,784 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | myapp.define({
name: "util-uri",
main: function() {
"use strict";
/************************* Static Helpers *************************/
var _static = {};
_static.convertParts = function(path, idx) {
if (typeof path === "undefined" || (typeof path === "string" && path.trim() === "")) {
return undefin... | true |
7100ec034bf2362286f3eca8aaaf0aa42d21d2a4 | JavaScript | Oleg724/cdb | /src/js/functions/cart/show-cart.js | UTF-8 | 1,980 | 2.71875 | 3 | [] | no_license | import {checkItem} from "./check-item-in-localstorage";
import {increaseItemQuantity} from "./increase-item-quantity";
import {addItem} from "./add-item";
import {setItemQuantity} from "./set-item-quantity";
import {createCart} from "./create-cart";
import {createDiv} from "../create-div";
import {getTotalItemPrice} fr... | true |
6fc851e9244aaa673bcfe7653e5deffc97d42f23 | JavaScript | sterlesser/clinical-trials-gov | /js/trial_location.js | UTF-8 | 983 | 2.59375 | 3 | [] | no_license | /**
* A trial location.
*/
var TrialLocation = can.Construct({
},
{
distance: null,
init: function(json) {
for (var key in json) {
if (json.hasOwnProperty(key)) {
this[key] = json[key];
}
}
},
kmDistanceTo: function(to_location) {
if (to_location && 'geodata' in this) {
t... | true |
0384780e627c95c8e96c03cca252d0b7bfd21fcc | JavaScript | przemyslawjurkiewicz/learning-es6-basic | /script-compiled-zad2.js | UTF-8 | 781 | 4.125 | 4 | [] | no_license | "use strict";
/*Stwórz funkcję multiply, która ma zwracać wynik działania operacji mnożenia dwóch wartości a i b. Przykładowo:
multiply(2, 5) // 10
multiply(6, 6) // 36
Zadanie wydaje się być proste, ale co jeśli użytkownik poda na wejściu tylko jedną wartość? Przykładowo:
multiply(5) // ?
Chcemy, aby wynik takieg... | true |
acfa1d993a0dbffdd618aa9c2769f92e78713d30 | JavaScript | nguyenhoangvuong/GGMapAPI_Nhom3_Buoi3 | /index.js | UTF-8 | 4,732 | 2.8125 | 3 | [] | no_license | //
let map;
const buudien = { lat: 10.780026517140083,lng: 106.69987531437627 };
const quoctugiam = { lat: 21.029499687701918, lng:105.83270940424262 };
const radius = 13;
let buudienLL;
let quoctugiamLL;
var point1, point2, point3;
function initMap() {
map = new google.maps.Map(document.getElementById("map"), {
... | true |
0e45cc39ada673909ac5be297d2af62d88bdc0de | JavaScript | timik44452/GamePlay | /node/sqlcontroller.js | UTF-8 | 4,038 | 2.8125 | 3 | [] | no_license | const DatabaseState = [
{STOPPED : 1 << 0},
{CONNECTED_READ : 1 << 1},
{CONNECTED_WRITE : 1 << 2},
{CONNECTED_READ_WRITE : 1 << 1 | 1 << 2}
];
const emptystring = '';
const sqlite = require('sqlite3').verbose();
var state = DatabaseState.STOPPED;
module.exports = {
openOrCreate : function (confi... | true |
209a008f0d8cd1f7df31f085068558087a13f932 | JavaScript | creositi/esercizi-di-programmazione-javascript | /esercizi-cicli/vinci-tu.js | UTF-8 | 877 | 3.609375 | 4 | [] | no_license | /*
Vinci tu!
Scrivi un programma che simula un gioco di dadi tra due utenti, prendi in input il numero di quanti tiri effettuare per ciascun giocatore (N), dopodiché ogni utente tira N volte un dado a sei facce.
Stampa il vincitore che ha totalizza più punti.
http://www.imparareaprogrammare.it
*/
var tiri = 5;
... | true |
88167c400d5379f44802bd4b4667b1dd693943ba | JavaScript | rwhitmire/angular-demo | /app/services/StoryCardService.js | UTF-8 | 1,346 | 3 | 3 | [] | no_license | app.service('StoryCardService', [function(){
var self = this;
self.getAll = function(callback) {
var json = localStorage.getItem('cards');
if(callback) callback(JSON.parse(json) || []);
};
self.upsert = function(card, callback) {
if(!card.id) insert(card, callback);
else update(card, callback);
};
self... | true |
74cc4bb11713a9f23800423ac40f7b956910b2ff | JavaScript | JimmyPepinosaC/Ejercicio-Node | /index.js | UTF-8 | 2,788 | 2.5625 | 3 | [] | no_license | const fs = require("fs");
const http = require("http");
const axios = require("axios");
const urlProveedores =
"https://gist.githubusercontent.com/josejbocanegra/d3b26f97573a823a9d0df4ec68fef45f/raw/66440575649e007a9770bcd480badcbbc6a41ba7/proveedores.json";
const urlClientes =
"https://gist.githubusercontent.com/... | true |
dd73638e6268411b403ee50f04ed4b45f5872bcc | JavaScript | scamisay/openlaw3 | /src/main/resources/static/js/createLaw.js | UTF-8 | 971 | 2.96875 | 3 | [] | no_license | function saveLaw() {
if(!isLawValid()){
BootstrapDialog.alert('Todos los campos son obligatorios');
}else{
$.ajax({
type: 'POST',
url: "/api/saveLaw",
data: {
"title" : $('#lawTitle').val(),
"number" : $('#lawNumber').val(),
... | true |
84a4a0c60f8c350b6a4b72d50886b3817e657f1b | JavaScript | JeremiAnastaziak/smart-home | /src/reducers/device-reducer.js | UTF-8 | 2,259 | 2.53125 | 3 | [] | no_license | import {
DEVICE_CREATE,
DEVICE_CREATE_ERROR,
DEVICE_CREATE_SUCCESS,
DEVICE_EDIT,
DEVICE_EDIT_ERROR,
DEVICE_EDIT_SUCCESS,
DEVICE_REMOVE,
DEVICE_REMOVE_ERROR,
DEVICE_REMOVE_SUCCESS,
DEVICE_SELECT,
DEVICE_GET,
DEVICE_GET_ERROR,
DEVICE_GET_SUCCESS
} from '../actions/devic... | true |
9f06379937c98c7182eb94011e6d90e4ebcbbe10 | JavaScript | MTASZTAKI/ApertusVR | /plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/test/parallel/test-whatwg-url-searchparams-has.js | UTF-8 | 2,273 | 2.796875 | 3 | [
"ISC",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"Artistic-2.0",
"NAIST-2003",
"MIT",
"BSD-3-Clause",
"Zlib",
"NTP",
"LicenseRef-scancode-openssl",
"ICU",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-free-unknown"
] | permissive | 'use strict';
const common = require('../common');
const assert = require('assert');
const URLSearchParams = require('url').URLSearchParams;
const { test, assert_false, assert_true } = require('../common/wpt');
/* The following tests are copied from WPT. Modifications to them should be
upstreamed first. Refs:
h... | true |
e9bc5570589e206e5a61f2cec461362405e20696 | JavaScript | EMGroup/js-eden | /tests/library.string.test.js | UTF-8 | 5,248 | 3.046875 | 3 | [
"BSD-2-Clause-Views"
] | permissive | var Eden = require('../js/core/eden').Eden;
describe("Library String Functions", () => {
describe("edenCode", () => {
test("can generate a list string", async () => {
let eden = await Eden.create();
await eden.exec("do lib;");
expect(eden.root.symbols["edenCode"]).toBeTruthy();
let val = eden.evalEden... | true |
bf9941509822cf84d29597c493a2b6b5834ab0ff | JavaScript | kellyselden/ember-cli-dependency-graph | /test/fixtures/percy-web/addon-tree-output/ember-data/-private/system/model/errors.js | UTF-8 | 11,287 | 2.828125 | 3 | [
"MIT"
] | permissive | define('ember-data/-private/system/model/errors', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
var get = _ember['default'].get;
var set = _ember['default'].set;
var isEmpty = _ember['default'].isEmpty;
var makeArray = _ember['default'].makeArray;
va... | true |
64a6ae7a61bd9ef6076149a3b1627d13eae05e74 | JavaScript | Diren52/Chatbot | /public/javascripts/signup.js | UTF-8 | 1,178 | 2.734375 | 3 | [] | no_license | $(document).ready(function() {
$(document).on('click', '#register-btn', register); //註冊
});
function register() {
let fname = document.getElementById('first-name').value;
let lname = document.getElementById('last-name').value;
let email = document.getElementById('register-email').value;
let password = docume... | true |
14c8c897366857a8a0a25ccb21c2f786706fc6a6 | JavaScript | paulpdaniels/streamish | /test/debounce.test.js | UTF-8 | 1,576 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* Created by paulp on 7/4/2017.
*/
import {sandbox} from "./helpers/sandbox";
import debounce from "../src/stream/operators/debounce";
import {Stream} from "../src/stream/Stream";
import subscribe from "../src/stream/operators/subscribe";
import pipe from "../src/stream/operators/pipe";
import {Record} from "../... | true |
61625f6f5915add46fa517aff9df4c3fb802b3c1 | JavaScript | quangdz1704/Project3 | /server/modules/human-resource/annual-leave/annualLeave.service.js | UTF-8 | 12,039 | 2.640625 | 3 | [] | no_license | const {
Employee,
AnnualLeave
} = require(`${SERVER_MODELS_DIR}`);
const {
connect
} = require(`${SERVER_HELPERS_DIR}/dbHelper`);
/**
* Lấy số lượng ngày nghỉ phép đã được chấp nhận của nhân viên theo email và năm
* @param {*} email : email công ty nhân viên
* @param {*} company : Id công ty
*/
expo... | true |
7ee01db2863b8efa3c05352426611eeb421e8a6a | JavaScript | mosaedb/rtl-md | /src/index.js | UTF-8 | 950 | 2.703125 | 3 | [
"MIT"
] | permissive | import marked from 'marked';
import cheerio from 'cheerio';
import { AllHtmlEntities as HtmlEntities } from 'html-entities';
function isRTL(string) {
const regexString = '[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]';
const rtlDirCheck = new RegExp(regexString);
return rtlDirCheck.test(string);
}
export default fu... | true |
580a98704e67782db5ac93b53d6a30d20091895a | JavaScript | chidea/chidea.github.io | /wasm-creole-live-editor-910d668ca6c0f6bd.js | UTF-8 | 31,819 | 3.0625 | 3 | [] | no_license |
let wasm;
const heap = new Array(32).fill(undefined);
heap.push(undefined, null, true, false);
function getObject(idx) { return heap[idx]; }
let heap_next = heap.length;
function addHeapObject(obj) {
if (heap_next === heap.length) heap.push(heap.length + 1);
const idx = heap_next;
heap_next = heap[idx... | true |
7a0dca45275c087a170f48124c64b479c8f0602f | JavaScript | aminprm/zend-cms | /frontend/templates/melorin/assets/js/general/layout.js | UTF-8 | 187 | 2.515625 | 3 | [] | no_license | var myOverlay = document.getElementById("myOverlay");
function openSearch() {
myOverlay.style.display = "block";
}
function closeSearch() {
myOverlay.style.display = "none";
}
| true |
b726c68332561b5198156c68a24add45c8173dd2 | JavaScript | svaarala/duktape | /tests/ecmascript/bi-json/test-bi-json-enc-obj-undef.js | UTF-8 | 505 | 3.359375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*===
{}
{}
{"bar":2}
{}
===*/
function objectUndefinedTest() {
var obj;
obj = {}
print(JSON.stringify(obj));
obj = { foo: undefined };
print(JSON.stringify(obj));
obj = { foo: undefined, bar: 2, quux: undefined };
print(JSON.stringify(obj));
// all values become undefined after the... | true |
2b3ae6b5b3b3cf48a7c28a7a5855770dd27c594c | JavaScript | arunsinghthakur/ole | /OLE/WebContent/js/exam.js | UTF-8 | 11,961 | 2.671875 | 3 | [] | no_license | function addExam(resourceUrl) {
var e = new Object();
e.examName = $("#exam-add-form .examName").val();
e.totalQuestion = $("#exam-add-form .totalQuestion").val();
e.examTime = $("#exam-add-form .examTime").val();
e.examDescription = $("#exam-add-form .examDescription").val();
e.passPercentage = $("#exam-ad... | true |
913ef98baceb8cc0b6b6e6040b2fe068411a29d2 | JavaScript | fibo/geohash-neighbours | /src/southOf.js | UTF-8 | 1,743 | 2.8125 | 3 | [
"MIT"
] | permissive | const validate = require('./validate')
function southOf (geoHash) {
validate(geoHash)
// Number of iterations.
const n = geoHash.length
const edgeCase = [
// n = 0
{'0': null},
// n = 1
{'0': null, '1': null},
// n = 2
{
'00': '10',
'01': '11',
'10': null,
'11'... | true |
af3ac008043f7921e9e936df276292f80950265c | JavaScript | pangeon/js-trainzone | /functional/I/7/main.js | UTF-8 | 165 | 2.953125 | 3 | [] | no_license | function fn(a) {
return a * 2;
}
function fnx(b) {
return b * 3;
}
console.log(fn());
console.log(fn.name);
console.log(fn.length);
console.log(fnx(fn(2)));
| true |
449724a8aba3642e1df01c764e6f0b775d14ba41 | JavaScript | wiseshrimp/caryatid-rebellion | /src/components/Stage.jsx | UTF-8 | 8,875 | 2.53125 | 3 | [] | no_license | import React from 'react'
import createjs from 'createjs-module'
import Buttons from './Buttons'
import Landing from './Landing'
import Placard from './Placard'
import Popup from './Popup'
import Sprite from './Sprite'
import Still from './Still'
import { FRAMERATE, PLACARDS, SPRITE_SHEETS, STILLS, TOTAL_ASSETS } fro... | true |
1c4fd1712a3e76a62a78c8acd86c26695585dee1 | JavaScript | weylermaldonado/js-exercises | /live-coding/exercise-2.js | UTF-8 | 481 | 3.75 | 4 | [] | no_license | /*
Write a function that gets any object
and returns the sum of the lenghts of
all the strings inside the object
Considerations: Values can be nested and datypes Number, String or Object.
*/
/**
* Input
* {
a: 'Hello',
b: {
c: 'Hey',
d: 23,
f: {
g: 'A string',
... | true |
f626e6d0b1714333b38082adc9cfbdf1652e69be | JavaScript | Sameer-Xoriant/freshersbatch-aug16 | /Javascript/AQ15/rs.js | UTF-8 | 155 | 3.0625 | 3 | [] | no_license | function removeSpaces(){
var string = document.getElementById("str1").value;
newString = string.replace(/\s+/g,' ').trim();
document.write(newString);
} | true |
65768f216aa562255f50b21c1f73457473ce9a51 | JavaScript | marunpeng93/tas | /examples/usage/web_requirejs/js/src/7.log_tree/tree.js | UTF-8 | 4,067 | 2.71875 | 3 | [
"MIT"
] | permissive | /**
* Examples of Tas.js
* (c) 2017 Owen Luke
* https://github.com/tasjs/tas
* Released under the MIT License.
*/
define(['../tas'],
function(tas){
var log = tas.tree.log;
var a = 0;
tas(function(){
// Enable printing log tree in this module.
tas.enableTree();
});
tas.await({
t1: function(){
a +... | true |
cd684f6e19e7c19c40cd88db7cb7962037180d45 | JavaScript | tanyagarg2509/Food-Restaurant | /js/login.js | UTF-8 | 1,823 | 3.34375 | 3 | [
"MIT"
] | permissive | const signUpButton = document.getElementById('signUp');
const signInButton = document.getElementById('signIn');
const container = document.getElementById('container');
signUpButton.addEventListener('click', () => {
container.classList.add("right-panel-active");
});
signInButton.addEventListener('click', () => {
c... | true |
4c430f0658c3631557e605ebaa793f77272ba152 | JavaScript | Wayne-Bai/AST-normalize | /data/bocoup/mobilevis/api/app/classes/database.js | UTF-8 | 2,135 | 2.640625 | 3 | [] | no_license | const Bookshelf = require('bookshelf');
const fs = require('fs');
const sequence = require('when/sequence');
var config;
var newDB = false;
/*
When initializing a database connection, check the environment variable
'testing'. If set, then use the sqlite db. Otherwise, if the second
argument to the run is 'sqlite3', u... | true |
d4d079e2d522a1624de21dba532ec49dd58965d7 | JavaScript | kiryanenko/keklik_frontend | /static/modules/FormValidator.js | UTF-8 | 984 | 2.84375 | 3 | [] | no_license | "use strict";
const messagesToForm = {
OK_MESSAGE: "ok",
EMPTY_MESSAGE : "empty",
INCORRECT_MESSAGE : "incorrect",
};
export default class FormValidator {
static responseOk() {
return messagesToForm.OK_MESSAGE;
}
static responseEmpty() {
return messagesToForm.EMPTY_MESSAGE;
... | true |
0488727f9434e1aad77cf5dcfdf60df9bd989d29 | JavaScript | KimKeepLearning/LeetCode-with-JS | /744.寻找比目标字母大的最小字母.js | UTF-8 | 559 | 3.5625 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=744 lang=javascript
*
* [744] 寻找比目标字母大的最小字母
*/
// @lc code=start
/**
* @param {character[]} letters
* @param {character} target
* @return {character}
*/
var nextGreatestLetter = function(letters, target) {
let low = 0, high = letters.length - 1;
while (low <= high) {
... | true |
0bec7e754b6a7ee9e1c9f39ddfb08122cf436924 | JavaScript | happymuzhik/bomb | /js/PlayFieldClass.js | UTF-8 | 895 | 2.65625 | 3 | [] | no_license | var Playfield = function(params){
var playfield = {
dom: {}
};
playfield.size = {
width: params.width||640,
height: params.height||480
};
playfield.dom.conteiner = document.createElement('div');
playfield.dom.conteiner.setAttribute('id', 'Bomb_wrapper');
playfield.dom.playfield = document.createElement('d... | true |
503f8a0bbc983419d23404b89434a7e8a05949eb | JavaScript | jenykin24/HNG_storm-task | /testScripts/oyinkan.js | UTF-8 | 438 | 2.921875 | 3 | [] | no_license | function Output() {
const Internship = [
{
lastName: "Yahaya",
firstName: "Oyinkansola",
id: "HNG-01876",
language: "javascript",
email: "yahayaoyinkansola@gmail.com",
},
];
Internship.map((Intern) =>
console.log(
`Hello World, this is ${Intern.lastName} ${Intern.f... | true |
cf37f610d99af70354b12d1e3c489cf89307f630 | JavaScript | KoryNunn/notchy | /index.js | UTF-8 | 992 | 3.296875 | 3 | [] | no_license |
function getNotchForValue(notches, value){
var closestNotch;
for(var i = 0; i < notches.length; i++){
var currentNotch = notches[i];
if(Math.abs(currentNotch - value) < (closestNotch != null ? Math.abs(closestNotch - value) : Infinity)){
closestNotch = currentNotch;
}
}... | true |
6a537c60a6d9a819040b93fd310849fb1926ea45 | JavaScript | wiched/SoftUni | /Programming-Basics-JS-May-2020/16-Nested-Loops-Lab/04-Sum-of-Two-Numbers.js | UTF-8 | 938 | 3.75 | 4 | [] | no_license | function sumOfTwoNumbers(params) {
const start = +params.shift();
const end = +params.shift();
const magic = +params.shift();
let combination = 0;
let flag = false;
let firstNumber = 0;
let secondNumber = 0;
for (let i = start; i <= end; i++) {
firstNumber = i;
for (let j = start; j <= end; j++... | true |
a7c60b6eb4112191e26a4ccc6fd4c9bbad3549f2 | JavaScript | Leojanas/dog-api-assignment1 | /index.js | UTF-8 | 710 | 3.65625 | 4 | [] | no_license | //Javascript for simple GET request to Dog API
//define default value for number of images
let number = 3;
//function to send GET request
function getDogPhotos(){
fetch(`https://dog.ceo/api/breeds/image/random/${number}`)
.then(response => response.json())
.then(responseJson => console.log(respon... | true |
cbf74c4b5f94b8dbb60a530b888131d393fba9d1 | JavaScript | aporadonelly/adonis-nextjs-basic-program | /app/Controllers/Http/UserController.js | UTF-8 | 1,036 | 2.6875 | 3 | [] | no_license | 'use strict'
const User = use('App/Models/User')
class UserController {
async showAllUsers({}){
const users = await User.all();
return users;
}
async userDetails({params, response}){
let id = params.id;
const user = await User.find(id);
const res = {
... | true |
81e4445ec380ae2136eab8b4f5d1782a15e0c504 | JavaScript | CharlotteBones/Codewars | /Javascript/8-Kyu/Reversed-words.js | UTF-8 | 277 | 3.6875 | 4 | [] | no_license | // Reversed words
function reverseWords(str){
return str.split(' ').reverse().join(' ');
};
// Tests
console.log(reverseWords('hello world!')); // --> 'world! hello'
console.log(reverseWords('yoda doesn\'t speak like this')); // --> 'this like speak doesn't yoda'
| true |
a3c748bbfb1feba54ecea0d6def1a324ccb741a6 | JavaScript | AnthonyMonsalve/admin-responsive | /ui-admin/client/app/data/cache.factory.js | UTF-8 | 3,743 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Created by daniel on 1/25/17.
*/
((function () {
'use strict';
/* @ngInject */
function CacheFactory(common) {
var Cache = function(dataType) {
this.dataLoaded = false;
this.dataType = dataType;
this.identifier = "";
if (this.dataType == 'ar... | true |
10e623120427a2aefc26e5ed85a86af9c2121641 | JavaScript | dvargas46/adventofcode | /2020/src/cleaned/16-day-cleaned.js | UTF-8 | 2,071 | 2.984375 | 3 | [
"MIT"
] | permissive | const inputFile = '../../inputs/16-input.txt';
const processFile = require('../../common/file-processor');
const input1 = processFile(inputFile, { lineSeparator: new RegExp('\\n\\n', 'g') });
// PART I
const [rules, yourTicket, otherTickets] = input1;
const ruleGroups = rules.split(/\n/).map(rule => rule.split(/\:\s+... | true |
970675f208d8d3113329353a2f05a7718e0e34f9 | JavaScript | CodeHunt101/nyc-dumbo-web-111819 | /33-oojs/index.js | UTF-8 | 1,570 | 3.9375 | 4 | [] | no_license | class Person{
eat(){
return "I am eating."
}
}
class Instructor extends Person{
static all = []
constructor(name, fullName){
super()
console.log("THIS IS THE NAME: ", name);
console.log("THIS IS THE FULL NAME: ", fullName);
// `this` -> self (instance)
this.name = name
this.ful... | true |
6a0ee2cc71ea9e9f974aef0352a50ea24e09e942 | JavaScript | gandalf117/coursera-spwa | /assignment1-solution/app.js | UTF-8 | 1,542 | 3.109375 | 3 | [] | no_license | (function () {
'use strict';
angular.module('LunchCheck', [])
.controller('LunchCheckController', LunchController);
LunchController.$inject = ['$scope'];
function LunchController($scope) {
$scope.csv_list = null;
$scope.msg = '';
$scope.msg_note = '';
$scope.checkList = function () {
... | true |
79c7b58d4d4a269cb948bb288c7f9fa30b3deb3e | JavaScript | hongquan2216492/Technology-Shop | /dist/js/viewproduct.js | UTF-8 | 292 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | $(function () {
const cart = JSON.parse(localStorage.getItem("cart"));
cart.map((val) => {
$(`
<div class = "item">
<img src=${val.image} alt="item image">
<span>Price: ${val.price}$</span>
</div>
`).appendTo(".cart");
})
}) | true |
661e9ec8001eb64102d25ba471d106b7a4d82005 | JavaScript | Valinor13/holbertonschool-web_front_end | /0x00-Javascript_advanced/5-mode.js | UTF-8 | 386 | 2.859375 | 3 | [] | no_license | function changeMode(size, weight, transform, background, color) {
}
function main() {
let spooky = changeMode(9, bold, uppercase, pink, green);
let darkMode = changeMode(12, bold, capitalize, black, white);
let screamMode = changeMode(12, normal, lowercase, white, black);
let p = document.body.createEl... | true |
565f5758f9c96339aa3af78e6fd370477ec9c497 | JavaScript | pinknoiz/lineboi3000 | /src/plotting/AxidrawAPI.js | UTF-8 | 2,992 | 2.703125 | 3 | [
"MIT"
] | permissive | const API_URL = 'http://localhost:4242/v1';
const headers = {
Accept: '*/*',
'Cache-Control': 'no-cache',
'Accept-Encoding': 'gzip, deflate',
Referer: 'http://localhost:4242/v1/pen',
Connection: 'keep-alive',
'cache-control': 'no-cache'
};
const PLOTTER_CONNECTION_STATES = {
0: 'connected'... | true |
49e519742a3edc4ffff8f00701505dc3df668dd0 | JavaScript | Firajest/elbrus.lyceum | /frontend/src/redux/reducers/modalsReducer.js | UTF-8 | 1,054 | 2.546875 | 3 | [
"MIT"
] | permissive | import {
LOGIN_MODAL_FLAG_ON,
LOGIN_MODAL_FLAG_OFF,
NEWUSER_MODAL_FLAG_ON,
NEWUSER_MODAL_FLAG_OFF,
ADD_MATERIALS_MODAL_FLAG_ON,
ADD_MATERIALS_MODAL_FLAG_OFF,
} from "../actionTypes";
const initialState = {
loginFlag: false,
newUserFlag: false,
materialsFlag: false,
};
export default function ModalFl... | true |
062b260a0b0cb781ca7012a9e7775c66342e56e1 | JavaScript | kirkcoy/preMEAN-assignments | /12Gamify.js | UTF-8 | 3,258 | 3.4375 | 3 | [] | no_license | var tigger = {
character : "Tigger",
greet : function(){
console.log("The wonderful thing about Tiggers is Tiggers are wonderful things!");
}
};
var piglet = {
character : "Piglet",
greet : function(){
console.log("Oh d-d-d-d-dear! I wasn't expecting company!");
}
};
var pooh... | true |
6d54e4c19363c7938fe1810033af7104b8eaeb94 | JavaScript | KartikeyPokhriyal/promiseAll | /Promise.js | UTF-8 | 1,280 | 3.65625 | 4 | [] | no_license |
const getString = (word) => {
return new Promise(function(resolve, reject) {
if(word === " ") {
error = new Error(word)
reject(error)
}
else {
resolve(word)
}
});
}
const promiseAll = function(promises) {
const resolvedPromi... | true |
d22d69f6cfb6daa49b296fdf7e45f415062df753 | JavaScript | Mastermindzh/Quizzer-dwa-sharon-rick | /apps/scoreboard/src/components/ChartComponent.jsx | UTF-8 | 1,756 | 2.5625 | 3 | [] | no_license | import React, { Component } from "react";
import { Chart } from 'react-google-charts';
import store from "../store/RootStore"
class ChartComponent extends Component {
constructor(props) {
super(props);
this.state = {
options: {
legend: 'none',
backgroundColor: "transparent"
},
... | true |
0ae6c5ed0c3984b5359e81cfbb64c370dfe17375 | JavaScript | HoganMcDonald/evuary.com | /src/scripts/landing_parallax.js | UTF-8 | 342 | 2.6875 | 3 | [] | no_license | // toggle classes on landing images
$('.landing-img').mouseenter(event=> {
if ($(window).innerWidth() >= 992) {
for (var i = 1; i <= 3; i++) {
if ($('.landing-img').hasClass(`position${i}`)) {
$('.landing-img').removeClass(`position${i}`).addClass(`position${(i === 3) ? 1 : i + 1}`);
break;... | true |
729caba23c6e6af5e6e44ce12b738eaf0720aaec | JavaScript | dolphin0618/dol-datepicker | /js/dol-datepicker.js | UTF-8 | 22,231 | 2.609375 | 3 | [
"MIT"
] | permissive | /*
dol-datepicker 0.1.0 <https://github.com/dolphin0618/dol-datepicker>
shanghang 2017-12-12
*/
"use strict";
var Datepicker = (function(){
// -- 核心工具方法 -- //
var Utils = {};
Utils.on = function(elem, even, target, fn){ //--事件监听器
if(typeof target === 'string'){
elem.addEventListener(even, function... | true |
ab1b8467192139625bc8407488b7fac3fa84113e | JavaScript | taniacoder/JS | /Ejercicios funciones/Ejercicio6 - Operaciones matematicas/Problema/main.js | UTF-8 | 726 | 3.90625 | 4 | [] | no_license |
function operacion(simbolo){
var result, operation;
switch (simbolo){
case "+":
result=a+b;
operation="sumados";
break;
case "-":
result=Math.abs(a-b);
operation="restados";
break;
case "*":
result=a*b;
operation="multiplicados";
break;
case "/":
result=a/b;
operation="divididos";
bre... | true |
2bb94f4735343ca915cf6d7df43ccb2a3a0dc510 | JavaScript | davemcg3/design_patterns | /real/memento/notetaker/front/js/components/Auth.js | UTF-8 | 4,370 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* @file Auth component.
*/
import React from 'react';
import PropTypes from 'prop-types';
class Auth extends React.Component {
static propTypes = {
isLoggedIn: PropTypes.bool,
token: PropTypes.string,
postAuthDetails: PropTypes.func,
postLogin: PropTypes.func,
logout: PropTypes.func,
s... | true |
fbe282eecfebf2a62982173d4ff75bb3a109fa6f | JavaScript | climboid/ontouchstart.github.com | /12-12-26/deleteTable.js | UTF-8 | 626 | 2.578125 | 3 | [
"CC-BY-3.0"
] | permissive | (function () {
var root = this;
function run () {
document.body.innerHTML = '';
var db = openDatabase("db121226", "1.0", "db", 1024 * 1024);
db.transaction(function(tx) {
var sql = "DROP TABLE ";
sql += " geo_path";
tx.executeSql(sql, [], function () {
alert("geo_path table has been deleted!");
... | true |
831372d5866f40bd537fb1d94a95e88f4aeede07 | JavaScript | vchandu111/Samurai_Interview_prep | /Pawan/day2.js | UTF-8 | 4,279 | 3.359375 | 3 | [] | no_license | // Question-4 What is JSON and its common operations
// full form of JSON is "javascript object notation"
// it is primirily used to transmit data between a server and web applications,
// Web services and APIs use JSON format to provide public data.it can be used in modern programming
// language
// common... | true |
15d25b2c292987ea35cdf596d06e5d55a649a5cd | JavaScript | CutieCat6778/moddy-djs | /tools/string/textsplit.js | UTF-8 | 855 | 2.953125 | 3 | [
"MIT"
] | permissive | const StringTools = require("string-toolkit");
const stringTools = new StringTools;
module.exports = (string, bool) => {
if (bool && bool == true) {
let array = stringTools.toChunks(string, 5);
const narary = array.slice(0, Math.floor((1800 / 5))).join('');
let output = `\`\`\`console\n${nar... | true |
42b05bd036f6f664e317d93d2bd4f14eddff7dc4 | JavaScript | DiegoDemontier/trybe-exercises | /Fundamentos/bloco_8/dia_1/exercise_2.js | UTF-8 | 281 | 3.71875 | 4 | [] | no_license | const sorteio = (numeroEscolhido, numeroSorteado) => {
if (numeroSorteado === numeroEscolhido) {
return "Parabéns você ganhou"
} else {
return "Tente novamente"
}
}
const numeroSorteado = () => Math.trunc(Math.random()*6)
console.log(sorteio(2, numeroSorteado)); | true |
98a9ae844d80e16a777a7af256f7edbf780bc74c | JavaScript | JBanuelos00/newsletterPageProject | /app.js | UTF-8 | 608 | 2.671875 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const app = express();
const port = 3000;
app.use(express.static('public'));
app.use(bodyParser.urlencoded({extended: true}))
app.get('/', (req, res) => {
res.sendFile(__dirname + "/signu... | true |
cb38698affd0a11894821f995575ce8daa896ecc | JavaScript | p-indhu/arcade-game | /js/app.js | UTF-8 | 5,097 | 3.625 | 4 | [] | no_license | // Enemies our player must avoid
class Enemy {
constructor(x, y) {
this.sprite = 'images/enemy-bug.png';
this.x = x;
this.y = y;
this.speed = Math.floor(Math.random() * (8 - 4 + 1)) + 4;
}
}
// Update the enemy's position, required method for game
// Parameter: dt, a time delta between ticks
Enemy.prot... | true |
995bccd0563a3dbd99ac149642002d056164add1 | JavaScript | Ari-M/crowdsight | /routes/groups.js | UTF-8 | 2,398 | 2.53125 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
// Twilio Credentials
const accountSid = 'ACef781bfa27de25d1d9cee3fa9d48590d';
const authToken = 'a47d38c302690f6613068ebe30823de3';
// INSTALLING TWILLIO
var twilio = require('twilio');
//INSTALLING GOOGLE PHONE NUMBER FORMAT
var PNF = require('google-li... | true |
fafbec611fc010ca6dd3e4847f682680e6a4bb1a | JavaScript | jagritparajuli/movie-ticket | /assets/js/signin.js | UTF-8 | 3,471 | 2.859375 | 3 | [] | no_license | const signin_form = document.getElementById('signin');
const email_in = document.getElementById('signin_email');
const password_in = document.getElementById('signin_password');
const signup_form = document.getElementById('signup');
const name = document.getElementById('name');
const email_up = document.getElementById(... | true |
08f578d771db9e2940ac5b219e4eb953c90877da | JavaScript | bdjk/FEC-NavBar | /old/oldProxyServer/src/cluster.js | UTF-8 | 480 | 2.5625 | 3 | [] | no_license | const cluster = require('cluster');
const cores = require('os').cpus().length;
// if cluster is master, take care of managing child processes
if (cluster.isMaster) {
// create cluster
for (let i = 0; i < cores; i++) {
console.log('creating new cluster');
cluster.fork();
}
// whenever a cluster dies, cr... | true |
37a6e5e9e4a6acea6bb6144b0b9d70ddfdecf380 | JavaScript | pitther/csmap | /public/script.js | UTF-8 | 12,256 | 2.59375 | 3 | [] | no_license | var INSERT_YOUR_LOCAL_IP_HERE = "192.168.1.192";
var socket = io.connect(INSERT_YOUR_LOCAL_IP_HERE+':8080');
let points = new Map();
socket.on('update', function(data){
//console.log(points);
for(let p of points.values()) {
p.updated = false;
}
for (var i = 0; i < data.players.leng... | true |
92df75ee287ed67a752a5cef2bcab80c88b3279d | JavaScript | xtrembaker/samples | /js/async/bluebird.js | UTF-8 | 2,080 | 3.359375 | 3 | [] | no_license | //#########################
//
// NOT DONE YET !
//
//#########################
// var Sequelize = require('sequelize');
// var Promise = require("bluebird");
//
// function PingPong() {
//
// }
//
// PingPong.prototype.ping = function(val){
// var self = this;
// function* ping(val){
// console.log("Ping?", va... | true |
5aa58746030869de33ff76c4137ca7a936727a8e | JavaScript | jason860709/Physijs-master | /finall/toget/Ballb.js | UTF-8 | 1,113 | 2.875 | 3 | [] | no_license | class Ballb {
constructor (center,rad=2,mass) {
this.type = 'ball';
this.center = center;
this.mass = mass||6; // may need to differentiate basketball & bowling ball
this.rad = rad;
// for dynamics calculation
this.pos = new THREE.Vector3();
this.vel = new THREE.Vector3();
this.force =... | true |
7b5d141cb3f7c794e7f1a4c90afa26d18a0e4e12 | JavaScript | Vinessan/setTimeout | /exercicio 1/Script.js | UTF-8 | 275 | 2.890625 | 3 | [] | no_license | new Promise((resolve, reject) => {
setTimeout(() => {
resolve("ok")
}, 3000);
}).then(res => {
document.querySelector("header").innerHTML = "<h1>Welcome!</h1>";
}).catch(err => {
document.querySelector("header").innerHTML = "<h1>Undefined!</h1>";
}) | true |
10063944f3def3dd3176ee8faa697102a9020024 | JavaScript | hdev0301/Vue_music_player | /src/app/sound/WebAudio.js | UTF-8 | 8,750 | 2.65625 | 3 | [] | no_license | var utils = require('./utils');
var isWebkit = typeof window.chrome !== 'undefined' || utils.isSafari();
module.exports = function WebAudio(audioContext) {
var callbacks = {
onCurrentTimeChanged: utils.createCallback(),
onComplete: utils.createCallback(),
onPlay: utils.createCallback(),
onPause: uti... | true |
2dc05b206deece99358628ae8990c3cff5c2e7fe | JavaScript | silvaemota/leapmotion-space-invaders | /src/utils/index.js | UTF-8 | 699 | 2.625 | 3 | [] | no_license | /*
* utils.js
* Copyright (C) 2015 adelciotto <anthdel.developer@gmail.com>
*
* Distributed under terms of the MIT license.
*/
import _ from 'underscore';
const utils = {
objFreezeRecursive(obj) {
// makes first level of props read-only
Object.freeze(obj);
// iterates over props and ... | true |
fde91f3100a6109fba3629ab2068b648149df5c3 | JavaScript | phamtuan090720/ToDoList_API | /js/main.js | UTF-8 | 4,007 | 2.859375 | 3 | [] | no_license | var listTask = new TaskList();
var validation = new Validation();
var isLoading = false;
getListTask();
function loading(isLoading) {
if (isLoading === true) {
document.body.innerHTML = document.body.innerHTML + `<div class="loader"></div>`;
} else {
document.getElementsByClassName("loader")[0]... | true |
2d79544ca9325b857aaf62b830e5127d189f27db | JavaScript | HenrickyL/fn_2021_1 | /Atividades/atv04/javascript/Menores.js | UTF-8 | 413 | 3 | 3 | [] | no_license | function maximum(xs, maior=-999){
for(x of xs)
if(x>maior) maior = x
return maior;
}
function removeMaior(xs){
if(x.length>0){
if(xs[0]==maximum(xs)){
return xs.slice(1)
}else return [xs[0],...removeMaior(xs.slice(1))]
}return []
}
function menores(n,xs){
if(xs... | true |
c5c192e93a014f8730df3c6974e0409684163190 | JavaScript | laxat/Arezue-Backend | /routes/API/search/search.js | UTF-8 | 5,914 | 2.6875 | 3 | [] | no_license | // Global var and functions
const pool = require('../../../config');
const validator = require('validator');
function sendJSON(statusCode, payload) {
return JSON.stringify({
status_code: statusCode,
payload: payload
})
}
function sendError(statusCode, message, additionalInfo = {}) {
return... | true |
4ccf012c2ed605317ba0ee4f4c3646d8a8bc05cc | JavaScript | sokolik1983-hub/jsbasic-20200727_aleksey-sokolov | /6-module/3-task/index.js | UTF-8 | 3,379 | 2.796875 | 3 | [] | no_license | import createElement from '../../assets/lib/create-element.js';
export default class Carousel {
constructor(slides) {
this.slides = slides;
this.render(slides);
this.onClickBtn(slides);
this.onClickSlide(slides);
}
render(slides) {
let list = slides.map((item) => `<div class="carousel__sli... | true |