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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f7600c1f32673912e4d85d92f5c10ec1903e1a2a | JavaScript | guysyml/alfresco | /root/projects/remote-api/config/alfresco/templates/webscripts/org/alfresco/slingshot/profile/resetavatar.put.json.js | UTF-8 | 1,309 | 2.734375 | 3 | [] | no_license | /**
* User Profile - Reset user avatar REST method
*
* Current user can only modify their own settings or an admin can reset all.
*
* @method PUT
*/
function main()
{
// Get the person details and ensure they exist for update
var userName = url.extension;
var user = people.getPerson(userName);
if (... | true |
acf319231933e044def3b505e97537df96a2853f | JavaScript | OliverSjostrand/HashtagGenerator | /routes/index.js | UTF-8 | 10,176 | 2.984375 | 3 | [] | no_license | //Author: Oliver Sjostrand
//Email: Oliver.Sjostrand@hotmail.se
//
//This is an API that returns JSON-formatted hastags based on location.
//URL query is in the format /events?lat="LATITUDE"&lng="LONGITUDE"&distance="DISTANCE"
//Example:
//http://localhost:3000/events?lat=51.5074247&lng=-0.1283064&distance=1000
var e... | true |
80659760daec7c4e1151f66ad2e32e43c65c6025 | JavaScript | eileenrose/boujiest | /js/result.js | UTF-8 | 2,020 | 2.8125 | 3 | [] | no_license | window.onLoad = function() {
var url = document.location.href,
params = url.split('?')[1].split('&'),
data = {}, tmp;
for (var i = 0, l = params.length; i < l; i++) {
tmp = params[i].split('=');
data[tmp[0]] = tmp[1];
}
var points = data[tmp[0]];
var result = "";... | true |
3d9df85ebd1008c82920d25ad87f4da3f2733f83 | JavaScript | bandgarmamta/mehfil | /src/App.js | UTF-8 | 2,139 | 2.71875 | 3 | [] | no_license | import { useState } from "react";
import "./styles.css";
import React from "react";
export default function App() {
const topic = {
Lata_Mangeshkar: [
{
name: "Lag ja gale",
description: "A sweet pain",
ratings: "4.7/5"
},
{
name: "Ek pyaar ka nagma hai",
... | true |
388b9bae311544febce0936a11cbd629914b028b | JavaScript | Mykolahist/CLI | /db/getContactById.js | UTF-8 | 430 | 2.6875 | 3 | [] | no_license | const getAll = require("./getAll");
const getContactById = async (id) => {
try {
const contacts = await getAll();
const selectContact = contacts.find(item => item.id.toString() === id);
if (!selectContact) {
throw new Error(`Contact with id=${id} not found`);
}
r... | true |
623a7f99807b49d3b94cb6efe0967cc6f3eb4325 | JavaScript | pablotron/micromeet | /public/js/micromeet.js | UTF-8 | 8,263 | 2.671875 | 3 | [
"MIT"
] | permissive | (function() {
"use strict";
// micromeet namespace
var MM = {
/**
* event list generator
*/
get_events: (function() {
// create a new date object in local time from given date and time
// strings
function make_date(date, time) {
return (new Date(date + 'T' + time + ':0... | true |
364847b39c809c0153a6bfb69b3a0fc9ce60a22d | JavaScript | edevars/var-let-const | /2 - problemWithVar1.js | UTF-8 | 223 | 4.03125 | 4 | [] | no_license | // ! Sobrescribe la variable declarada dentro del local scope.
var nombre = 'Enrique'
if(true){
var nombre = 'Juan'
console.log(`El nombre en el if es: ${nombre}`)
}
console.log(`El nombre original es: ${nombre}`) | true |
5d477731fcea924cdfc2e78ebd5952f3a0acba78 | JavaScript | pareot/pareot.github.io | /p_le_local/p5js/exercise6/exercise6.js | UTF-8 | 4,551 | 3.265625 | 3 | [] | no_license | var currentkey;
var bRad;
var pulseOpa;
//color setup
var bg;
var rd;
var yl;
var bl;
function setup () {
createCanvas(1200, 1200);
smooth();
currentkey = '1';
bRad = 5;
pulseOpa = 5;
bg = color(255);
rd = color(255, 0, 0);
yl = color(255, 255, 0);
bl = color(0, 0, 255);
background(bg);
}
... | true |
a542cd780c2b2e05493c28a83139f259bc5bb8d9 | JavaScript | Amethyst-Armadillos/Grace-Shopper | /client/components/EditUser.js | UTF-8 | 2,496 | 2.515625 | 3 | [
"MIT"
] | permissive | import React, { useEffect, useState } from "react";
import axios from "axios";
import { useDispatch, useSelector } from "react-redux";
export const EditUser = (props) => {
const hasAccess = useSelector((state) => {
if (
state.auth.securityLevel === "admin" ||
state.auth.id === props.match.params.id
... | true |
147a950d16b356c83c0f24661b6c4b79272848b4 | JavaScript | hyunwns78/study_vue | /deali-music/src/filters/index.js | UTF-8 | 2,550 | 2.921875 | 3 | [] | no_license |
export default {
timeForToday(value) {
const today = new Date();
const timeValue = new Date(value);
const betweenTime = Math.floor((today.getTime() - timeValue.getTime()) / 1000 / 60);
if (betweenTime < 1) return '방금전';
if (betweenTime < 60) {
return `${betweenT... | true |
092d40681af8ecd0e814fc4a9cad03a8c4da35e2 | JavaScript | ar-insect/bui-manage | /lib/bui/form/rule.js | UTF-8 | 3,228 | 2.640625 | 3 | [] | no_license | /**
* @fileOverview 验证规则
* @ignore
*/
define('bui/form/rule',['bui/common'],function (require) {
var BUI = require('bui/common');
/**
* @class BUI.Form.Rule
* 验证规则
* @extends BUI.Base
*/
var Rule = function (config){
Rule.superclass.constructor.call(this,config);
}
BUI.extend(Rule,BUI.Ba... | true |
452dd2c44cc8602470256aaeb9e0208eb81f4069 | JavaScript | farassharp/PrintMyName | /printer.js | UTF-8 | 404 | 2.890625 | 3 | [] | no_license | $(() => {
const contributorsList = $("#contributorsList");
const contributors = [
{ name: "Didier Valdez", github: "https://github.com/xDidier901" }
];
function printNames() {
contributors.forEach(contributor => {
contributorsList.append(`
<div>
<p>${contributor.name} <a href="${co... | true |
1c4fa3b84ab7561ceffa30f415708faf7d30c1b4 | JavaScript | abhaygupta08/Devsnest6Month | /5. FRONTEND/DAY 12/script.js | UTF-8 | 2,634 | 2.921875 | 3 | [] | no_license | var arr = [];
// console.log(localStorage.tasksAbhay)
var btn = document.getElementById("submitBtn");
btn.onclick = function(){
var newTask = document.getElementById("taskToAdd");
if(newTask.value.length==0 || search(newTask.value,arr)){return;}
arr.push(String(newTask.value));
var taskList = document.g... | true |
1effab499e23cea5fc73df2b5e621f6d54ccb4e7 | JavaScript | NIMPI/nimpi-api | /src/controllers/publisherController.js | UTF-8 | 3,136 | 2.859375 | 3 | [
"MIT"
] | permissive | const Publisher = require('../models/Publisher');
// Criar autores
exports.createPublisher = async (req, res) => {
try {
const publisher = await Publisher.create({
name: req.body.name
});
await publisher.save();
return res.json(publisher);
} catch (error) {
return res.status(400).send({... | true |
f08f318f1412bafed8ee32222ac1fd1b9092adc4 | JavaScript | willsenw/reactjs-on-off-timer | /src/App.js | UTF-8 | 1,770 | 2.71875 | 3 | [] | no_license | import React , {Component} from 'react';
import logo from './logo.svg';
import './App.css';
// Context
const MyContext = React.createContext();
// Component
class Timer extends Component{
constructor( props ){
super(props);
this.state = {
time : props.startTime,
toggleStatus : true,
};
... | true |
cd7553b484ce783cde8fb87eeccbd7c6092d010c | JavaScript | Weslley-Stein/javascript-studys | /objects/getters-and-setters.js | UTF-8 | 500 | 3.453125 | 3 | [] | no_license | function Product(name, price, stock) {
this.name = name;
this.price = price;
Object.defineProperty(this, 'stock',{
enumerable: true,
configurable: false,
get: function () {
return stock;
},
set: function(value){
if(typeof value !== 'number'){
... | true |
355e741d5f1e1101c804a86a435167998779c9fd | JavaScript | cloudinary-devs/cloudinary-doctor | /contentScript/panel.js | UTF-8 | 1,926 | 3.015625 | 3 | [] | no_license | class Panel {
constructor(className = "", styles = {}) {
this.panel = createElement("div", `cld-ext-panel ${className}`, styles);
this.head = createElement("div", "cld-ext-pa3 cld-ext-pointer");
this.body = createElement("div", "cld-ext-panel-body");
this.head.addEventListener("clic... | true |
a39d80563d27d6f180291bc3debb2c61f31a61e3 | JavaScript | o0/functional-programming | /speech-slides/01-3.js | UTF-8 | 467 | 3.21875 | 3 | [] | no_license | const trim = it => it.trim();
const removeExcessSpaces = it => it.replace(/\s{1,}/, ` `);
const lowercase = it => it.toLowerCase();
const normalizeLetters = it => it.replace(/ё/g, `е`);
`#Привет #сказочноебали #явсказке #youth #girl #beautiful #instachick #summer #привет`
.split(` `)
.map(normalizeVal);
const nor... | true |
1716cc707216d1906732eb0f479a5b7d49a09183 | JavaScript | Thomas-Langlais/CortexSrc | /unsorted-src/Suite/DocumentParser.js/access/AccessReader.js | UTF-8 | 6,183 | 2.921875 | 3 | [] | no_license | /**
* Callbacks used here are for handling issues
* @callback handler
* @param {string} err - string used for error message
* @param {string} result - string used for the result message for completion
*/
const winston = require('winston');
const languageEnum = require('../common/Enums').languageEnum;
//build a c... | true |
87970bfd9482a0d077f3ca76f71ce30ee9ea18c5 | JavaScript | tampon3/JavaScript-pogodi-broj | /script.js | UTF-8 | 318 | 3.296875 | 3 | [] | no_license |
// Uzmi nasumičan - random broj od 1 do 10
var numero = Math.ceil(Math.random() * 10);
var slanac = prompt("pgodi broj izmedu jedan i deset");
if (slanac == numero) {
alert ("ti si genije, cudo prirode");
}
else
{
alert ("nebu išlo, traženi broj je:" + numero);
}
| true |
4798c6c40b653884d305f258e813d2c5f1c2f2cf | JavaScript | freebz/RxJS-in-Action | /ch10/ex10-3.js | UTF-8 | 1,212 | 2.953125 | 3 | [] | no_license | const mathReducer = (state = {
result: 0
}, action) => {
switch(action.type) {
case 'ADD':
return {
...state, result: state.result + action.value
};
case 'SUBTRACT':
return {
...state, result: state.result - action.value
};
default:
return state;
}
};
const store = createStore(... | true |
7e8a4d35feda1694d6507d207ce82ea2217f939d | JavaScript | DamienWheatley/2-JS-Strings | /Unicode.js | UTF-8 | 3,708 | 3.140625 | 3 | [] | no_license | //Question 1
/*
Quite stuck on this one.. I'm not even sure where to begin. I got this far and my brain just went into self-doubt mode - is putting it into an array the right way to go? How then
am I supposed to set a character limit?- using Trim? array[0].trim(22)?
*/
let string = `Publication Date,Title,Authors... | true |
4f3fdac490d45a3606162c04ccefd6ab05bb3224 | JavaScript | PatrickSandoval21/ProyectoS.I | /RestaurantProject/client_admin/src/components/OrdersFinals.js | UTF-8 | 2,882 | 2.765625 | 3 | [] | no_license | import Axios from 'axios';
import {useState, useEffect} from 'react';
function OrdersFinals(){
const [orders, setOrders] = useState([]);
function ADM_getCategories() {
return new Promise((resolve, reject) => {
Axios.get(`http://localhost:3001/getAllOrders`)
.then((response) => ... | true |
f59fd295e6dec6c24ff1c76478c74171bf7289d3 | JavaScript | pedrocoelho94/imersao.dev | /projeto4/js/script.js | UTF-8 | 3,167 | 2.75 | 3 | [
"MIT"
] | permissive | const catalogo = document.querySelector('#catalogo')
const msg = document.querySelector('.operacao')
let filmes = ['inception', 'sing street', 'whiplash', 'hamilton', 'ready player one', 'promising young woman']
let listaImgFilmes = ['https://m.media-amazon.com/images/M/MV5BMjAxMzY3NjcxNF5BMl5BanBnXkFtZTcwNTI5OTM0Mw... | true |
8b7331982d662b09e2aa22b7f3743b55c6102a6c | JavaScript | daninmontreal/UIComponent | /public/quiz/scores.js | UTF-8 | 276 | 3.015625 | 3 | [] | no_license | const scoreList = document.getElementById("scorelist");
const scoreHistory = JSON.parse(localStorage.getItem("scorehistory")) || [];
scoreList.innerHTML = scoreHistory.map(score => {
return `<li class="highscore"> ${score.name} : ${score.score} </li>`;
}).join("");
| true |
ec2402ee445fe28dd9dbc30bcee7fdf897781c6c | JavaScript | grantharper/recipe-websocket | /src/main/resources/static/index.js | UTF-8 | 1,982 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | var stompClient = null;
var messageUrl = "/app/update";
function connect(callback) {
var socket = new SockJS('/recipe');
stompClient = Stomp.over(socket);
stompClient.connect({}, function (frame) {
console.log('Connected: ' + frame);
stompClient.subscribe('/user/queue/update', function (recipe) {
v... | true |
f895912101897093c4dd02690a469334109478d4 | JavaScript | rodominguez/PolynomialRegressionInteractive | /p5/ML/Model.js | UTF-8 | 7,719 | 3.21875 | 3 | [] | no_license | class Model {
/**
Constructor for a new Model
@author Rodrigo Dominguez
@param {float} posX starting screen x position
@param {float} posY starting screen y position
@param {float} dimension starting dimension
@param {float} alfa starting alfa
@param {float} accuracy starting target accuracy
@param {bool}... | true |
fbb54bb60eb6892b0e69bba11290f6e530925617 | JavaScript | rtoshkov/jsAdvancedSoftuni | /07. Unit-Testing-and-Error-Handling-Exercise-Resources/03. char_lookup/03. char_lookup_test.js | UTF-8 | 1,332 | 3.203125 | 3 | [] | no_license | const expect = require('chai').expect;
const {lookupChar} = require('./03. char_lookup');
const {isOddOrEven} = require("../02. even_or_odd/02 even_or_odd");
describe('Char Lookup', () => {
it('returns undefined when the first parameter is not a string or second is not a number', () => {
expect(lookupChar(... | true |
21bfb089c164cb45498168d80e67338d2df408f0 | JavaScript | plikipie/resto-apps-pwa | /src/scripts/scroll.js | UTF-8 | 556 | 2.671875 | 3 | [] | no_license | window.onscroll = () => {
scrollFunction();
};
function scrollFunction() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
document.getElementById("slide").style.backgroundColor = "#bedbbf";
document.getElementById("slide").style.opacity = "1";
document.getElementById("sl... | true |
7cf0323400a6070f1bd4b9bc333d5e0bce9be2b4 | JavaScript | dmitry-nizovsky/path-store | /src/core/store/index.js | UTF-8 | 2,925 | 2.890625 | 3 | [
"MIT"
] | permissive | import get from 'lodash/get';
import set from 'lodash/set';
/**
* Execute handler callback for provide new state to subscribers.
*
* @return {void}
*/
function privateExecuteNextSubscribes() {
this.nextSubscribers.map((sub) => {
const isCache = typeof sub.conditionCache === 'function' ?
sub.conditionCa... | true |
019aa0af24e2fec2bbab327cb2379bbb2210b0b9 | JavaScript | sashbhagav/BeatIT | /Frontend/index.js | UTF-8 | 2,868 | 2.8125 | 3 | [] | no_license | const recordAudio = () =>
new Promise(async resolve => {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
const mediaRecorder = new MediaRecorder(stream);
mediaRecorder.mimeType = "audio/wav"
//console.log(mediaRecorder.audioChannels);
// mediaRecorder.recorderType = Ster... | true |
f5672ee86c3f4ec1df96699538ae89336afa36e2 | JavaScript | FrozenCow/evolutionarydesigner | /linesegment.js | UTF-8 | 449 | 2.515625 | 3 | [] | no_license | define(['cclass','vector'],function(cclass,Vector) {
return cclass({
constructor: function(startx, starty, endx, endy, next, previous) {
this.start = new Vector(startx, starty);
this.end = new Vector(endx, endy);
var n = new Vector(0,0);
n.setV(this.end);
n.substractV(this.start);
this.length = n.l... | true |
7b2135aa5cce2fbf876750aff10fcf30e41819c7 | JavaScript | larry358/js_sidebar | /sidebar.js | UTF-8 | 4,660 | 2.703125 | 3 | [] | no_license | /**
* My sidebar for jQuery
*/
;(function ($){
var bootstrapTemplate = {
'ulclass' : 'nav nav-pills flex-column',
'liclass' : 'nav-item',
'liclasswithchild' : 'nav-item',
'subulclass' : 'nav nav-pills'
};
var adminLTETemplate = {
'ulclass' : 'sidebar-menu tree',
'liclass' : null,
'lic... | true |
d2f6684ad29c56eae4611028be19978a3cdcadfc | JavaScript | bi3mer/poor_shot_on_the_run | /js/instructions.js | UTF-8 | 1,930 | 2.859375 | 3 | [] | no_license | const Instructions = {};
Instructions.draw = (display) => {
// kill menu drawing interval
clearInterval(runningInterval);
// kill event lsitener for menu
window.removeEventListener('keydown', runningEventListener);
display.clear();
// display instructions
let x = (width - (config.title.length / 2)... | true |
14632c897db290c6ea7369ff104b1f5b04716784 | JavaScript | tayler/read-shakespeare | /use-read.js | UTF-8 | 1,885 | 2.90625 | 3 | [
"LicenseRef-scancode-public-domain",
"MIT"
] | permissive | (function() {
"use strict";
var fs = require('fs');
var q = require('Q');
var RS = require('read-shakespeare/ReadShakespeare');
var rs = new RS();
// results = {
// text: textName,
// words: (obj. with word as key and count as value),
// wordsString: JSON.stringify(words)
// };
var sendResults = function(results... | true |
df72800690a379f78c9a074595e254a453c3c7b3 | JavaScript | Pikiner94/HW_new | /js_hw_11/src/task 3.0/index.js | UTF-8 | 2,932 | 2.9375 | 3 | [] | no_license | import { differenceBy, isArrayLikeObject } from 'lodash';
import './style.css';
const _ = require('lodash');
const input = document.querySelector('.enter');
const divEnter = document.querySelector('.input');
const body = document.querySelector('body');
const divForCards = document.createElement('div');
body.append(div... | true |
32f218a77046485a17d45a61f1dd6fa7f3f0dc37 | JavaScript | izonder/bidding | /src/models/bid.model.js | UTF-8 | 1,171 | 2.859375 | 3 | [
"MIT"
] | permissive | export class BidModel {
#collection = new Map();
#index = new Map();
/**
* Commit updates and refresh index
*/
commit() {
const index = new Map();
for (const [id, bid] of this.#collection) {
for (const seg of bid) {
const entry = index.get(seg) || ... | true |
d3d31c600e4027f5ad7896ca237b8d1c8a216dcf | JavaScript | ManuelDavid97/trimestre3 | /3ºtrimestre/XML-DOM/Actividad 2/Actvidad 2.3.js | UTF-8 | 187 | 2.578125 | 3 | [] | no_license | company = "";
n = document.getElementsByTagName("COMPANY").length;
for(i=0; i < n; i++)
company +- document-getElementsByTagName("COMPANY")[i].childNodes[0].nodeValue + " <br> ";
| true |
e2898f51cc3a508465119723124052f5e7b4ad97 | JavaScript | swith/RecrApp_chrome_extension | /openCandidate.js | UTF-8 | 1,465 | 2.671875 | 3 | [] | no_license | const serverAddress = 'https://recr.ittalent.ee';
var openCandidateButton = document.getElementById('open-candidate');
var response = document.getElementById('response');
var candidateName = document.getElementById('name');
var userName = document.getElementById('owner-name');
var created = document.getElementById('cre... | true |
80168445700f33c4dde91ded48f2f8cb40b3d599 | JavaScript | Sv443-Network/JokeAPI | /src/classes/AllJokes.js | UTF-8 | 4,596 | 3.140625 | 3 | [
"MIT"
] | permissive | const jsl = require("svjsl");
const parseJokes = require("../parseJokes");
const languages = require("../languages");
const settings = require("../../settings");
jsl.unused(parseJokes); // only used for typedefs
// expected format:
/*
{
"en": {
info: {
formatVersion: 2
},
jo... | true |
bb5478cc2f02e7be194e57ca5555c4ff362b8cc8 | JavaScript | JavascriptTips/flow-examples | /src/array.js | UTF-8 | 528 | 3.40625 | 3 | [] | no_license | /**
* 数组
*/
//@flow
//基于基本类似的数组,数组内都是相同类型
var numberArr:number[] = [12,3,12,5,2];
//另一个写法
var numberAr2r:Array<number> = [12,3,2,3];
var stringArr:string[] = ['12','a','cc'];
var booleanArr:boolean[] = [true,true,false];
var nullArr:null[] = [null,null,null];
var voidArr:void[] = [ , , undefined,void(0)];
//数组内... | true |
556abfec554b4f128d1d251187e17c1810792598 | JavaScript | Sushmita01/header-bidder | /auctionManager.js | UTF-8 | 1,674 | 2.578125 | 3 | [] | no_license | "use strict";
/// Hello from auctionManager.js
// I conduct Auctions
exports.__esModule = true;
exports.registeredAuctions = {};
var Auction = /** @class */ (function () {
function Auction(slotID, slotSize) {
this.bids = [];
this.registerAuction = function () {
this.auctionID = "A" + (th... | true |
7fdea54f2f5c432e4865e3e2e424dbf525f1d6ae | JavaScript | devnalwa/amazon-clone | /src/Header.js | UTF-8 | 2,745 | 2.59375 | 3 | [] | no_license | import React from "react";
import "./Header.css"; // Connecting the Styling File for different header components
import SearchIcon from "@material-ui/icons/Search";
import ShoppingBasketIcon from "@material-ui/icons/ShoppingBasket"; // Needed to Import Icons from Material-UI
import { Link } from "react-router-dom"; // ... | true |
efc93cbaad3d52c9dde360c8bf00a5a9872ba7c2 | JavaScript | w3tsa/Vanilla-JavaScript-Projects | /Image Search with API Request/index.js | UTF-8 | 1,730 | 3.015625 | 3 | [
"MIT"
] | permissive | const form = document.querySelector("form");
const input = document.querySelector("input");
const loadingImage = document.querySelector("#loadingImage");
const imageSection = document.querySelector(".images");
const loader = document.querySelector(".loader");
const lost = document.querySelector(".lost");
loadin... | true |
704930b215c1eeccd348abcd63ec11f95b20fb31 | JavaScript | autoscatto/autoscatto.github.io | /js/git.js | UTF-8 | 1,091 | 2.703125 | 3 | [] | no_license | jQuery.githubUser = function(username, callback) {
jQuery.getJSON('https://api.github.com/users/'+username+'/repos?callback=?',callback)
}
jQuery.fn.loadRepositories = function(username) {
var target = this;
$.githubUser(username, function(data) {
var repos = data.data;
sortB... | true |
e0df2d0b8a0636d7c89cbdd6c497aaf4fc259b95 | JavaScript | ekarelg82/counter_state | /src/index.js | UTF-8 | 957 | 2.71875 | 3 | [] | no_license | import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import './index.css';
function Child({onAction, onChange}){
return (
<div>
<button onClick={onAction}>Click Me</button>
<button onClick={onChange}>Reset</button>
</div>
)
}
class CountingParent extends Component{
state ={... | true |
16f9b3a40e5ba7fc2ae57c44976e07aebdefe8b0 | JavaScript | M4dNation/jstoolbox | /test/number/isInteger.test.js | UTF-8 | 673 | 2.8125 | 3 | [
"MIT"
] | permissive | require("should");
const isInteger = require("../../lib/number/isInteger.js");
describe("isInteger", function()
{
it("Should be able to say -5 is an integer.", function()
{
isInteger(-5).should.be.exactly(true);
});
it("Should be able to say 0 is an integer.", function()
{
... | true |
7758cb75b83654005688a57ef8502385731dc531 | JavaScript | JoyeshDebnath/HEX-CODE-GENERATOR | /app.js | UTF-8 | 557 | 3.390625 | 3 | [] | no_license | const hex_array=[0,1,2,3,4,5,6,7,8,9,'A','B','C','D','E','F'];//hex array
const hex_btn=document.querySelector('.hex_btn');
const body_bg=document.querySelector('body');
hex_btn.addEventListener('click', show_hex);
function show_hex()
{
let hex='#';
for(let i=0;i<6;i++)
{
... | true |
9cfb30a8e92fae2c31c505eebc130a37cd7485d8 | JavaScript | hannakortetjarvi/FullStack2020 | /osa1/unicafe/src/index.js | UTF-8 | 2,516 | 3.046875 | 3 | [] | no_license | import React, { useState } from 'react'
import ReactDOM from 'react-dom'
/**
* Napin komponentti
*/
const Button = ({onClick, text}) => (
<button onClick={onClick}>
{text}
</button>
)
/**
* Huolehtii tilastorivien näyttämisestä
*/
const StatisticLine = ({text, value}) => (
<tr>
<td>{text}</td>
<... | true |
e64df3882b5506ac36477de8f691d8f88aee60e7 | JavaScript | wrazowshpa/Javascript-API-App | /js/movieDetails.js | UTF-8 | 1,927 | 2.859375 | 3 | [] | no_license | let goBack = document.querySelector("#goBack");
goBack.addEventListener("click", goBackToHome);
function goBackToHome(){
window.open("../index.html");
}
let movieDetailsContainer = document.createElement("div");
movieDetails.appendChild(movieDetailsContainer);
let specificMovie = JSON.parse(sessionStorage.get... | true |
ceb0b78849132d1d074175a954241e92e9a24872 | JavaScript | lianav-90/Homeworks | /Homework 3.js | UTF-8 | 4,256 | 4.15625 | 4 | [] | no_license | /*1. Write a function, which receives an array as an argument which elements arrays of numbers.
Find biggest negative number of each array. Return product of that numbers.If there is not any negative number
in an array, ignore that one. Check that items of the given array are arrays.*/
function product(mainArr){
... | true |
f74e2a4aac4103d73c1d0c8ae9e7dbb4fdb14e4b | JavaScript | nanoutils/nanoutils | /lib/prepend/prepend.test.js | UTF-8 | 377 | 2.9375 | 3 | [
"MIT"
] | permissive | import prepend from '../../cjs/prepend'
it('returns a list with given element in front and followed by other list items', () => {
expect(prepend('a', [1, 2, 3])).toEqual(['a', 1, 2, 3])
})
test('provided list is not mutating', () => {
const list = [1, 2, 3]
const result = prepend('a', list)
expect(list).toEq... | true |
0a8fa665f765818e20ddc5d8fef235f67daeed14 | JavaScript | Milanzor/stein.js | /src/Mediator.js | UTF-8 | 2,041 | 3.265625 | 3 | [
"MIT"
] | permissive | /*!
* Authored by Milan van As
* Released under the MIT license
*
* Mediator pattern taken from https://gist.github.com/TCotton/d85e879fdbf856ddae3511652f9260f0
* With a bit of own magic
*/
export const Mediator = (() => {
/**
* @description Subscribe to an event, supply a callback to be executed when... | true |
860e5d1f09a74b319f0a5aa1be34d501ea8b599f | JavaScript | cag2050/async_program_demo | /src/readfile-async.js | UTF-8 | 735 | 2.71875 | 3 | [] | no_license | const fs = require('fs')
var readFile = function (filePath) {
return new Promise((resolve, reject) => {
fs.readFile(filePath, 'utf8', (error, data) => {
if (error) {
console.log('error')
console.log(typeof error)
console.log(error)
... | true |
0598defa672d3a52cecd6a4883376d2d94097872 | JavaScript | marcelloalbuca/ApiHealthCare | /controllers/pedido.js | UTF-8 | 1,275 | 2.75 | 3 | [] | no_license | class PedidoController {
constructor (Pedido) {
this.Pedido = Pedido
}
async findAll (req, res) {
try {
const pedido = await this.Pedido.find({})
res.send({ pedido })
} catch (error) {
res.status(400).send(error.message)
}
}
async getById (req, res... | true |
1238c117c5861645db76c1083e28cb74950f8de8 | JavaScript | Sumner1185/checkoutChallange | /src/shop.js | UTF-8 | 1,294 | 3.140625 | 3 | [] | no_license | class Shop {
constructor() {
this.items = {
'A': 50,
'B': 30,
'C': 20,
'D': 15
}
this.AAA_SPECIAL = 130
this.BB_SPECIAL = 45
}
checkout = (str) => {
let array = str.split('')
let total = 0
if (this.hasIllegalCharacters(str)) {
return -1
} else if... | true |
313d6b83d7df8748a03d8988d25f158b40485c1b | JavaScript | david195/21 | /main.js | UTF-8 | 2,024 | 2.828125 | 3 | [] | no_license | //Class
function baraja(){
this.cards = [];
for(var i=1;i<=13;i++){
for(var j=1;j<=4;j++){
var card = [i,j];
this.cards.push(card);
}
}
}
baraja.prototype.mess = function(){
this.cards.sort(function() {return Math.random() - 0.5});
};
baraja.prototype.pop = function(){
var card = this.car... | true |
e6dc0f66fce7661e6c4cead13b1b04c1befddd67 | JavaScript | surya-trv-13/React-KT | /src/component/Functional.jsx | UTF-8 | 646 | 3.03125 | 3 | [] | no_license | import React, { useCallback, useEffect } from "react";
function Functional({ data }) {
// props.data
const [count, setCount] = React.useState(0);
const [count1, setCount2] = React.useState(0);
// useEffect
useEffect(() => {
console.log("Count Called", count1);
}, [count1, count]);
// us... | true |
5244a839cb0188ebb1014c40984b8d49e03f2887 | JavaScript | kailashnath/iRobot | /ticker.js | UTF-8 | 621 | 2.546875 | 3 | [] | no_license | var errors = require('./errors');
var Ticker = function (code) {
'use strict';
if (!code || code.length === 0) {
throw errors.warn("Invalid ticker: " + code);
}
this.codes = code.split('');
};
Ticker.prototype.executeInSeries = function (codeExecutor, onComplete) {
'use strict';
var codes = this.codes,
rec... | true |
9abb0b21ab90551e01e35aa677a4f5e058fd6606 | JavaScript | Wayne-Bai/AST-normalize | /data/tomekmarchi/ACID/build/shared/modules/DOM/faceplate.js | UTF-8 | 395 | 2.609375 | 3 | [] | no_license | //takes a data object then places over based on nodes
var _faceplateDOM = function (node, data, name) {
if(!name){
var name='data-faceplate';
}
if(_isString(name)){//faster
if(_has(name,'data-')){
var face = _faceplate[node.getAttribute(name)];
}else{
var face = _faceplate[name];
}
}else... | true |
caa1fc7cbb16ce8cfc1e7672da79debe9c48e71f | JavaScript | Matheus-Rian/CursoWebCompleto-Cod3r | /CursoWebCompleto-Cod3r/funcaoJS/exerciciosJS/questao7Resolvida.js | UTF-8 | 386 | 3.6875 | 4 | [
"MIT"
] | permissive | function bhaskara (ax2, bx, c) {
let resultados = []
let delta = (bx ** 2) - (4 * ax2 * c)
if(delta < 0){
return "Delta é negativo"
}
let x1 = (-bx + Math.sqrt(delta))/2*ax2
let x2 = (-bx - Math.sqrt(delta))/2*ax2
resultados.push(x1)
resultados.push(x2)
return resultados
... | true |
4ca81acd0c28ce409b0f32c52cc9478b00891e04 | JavaScript | GonzaloCarcamo/JS-JQuery-WebPage | /js/main.js | UTF-8 | 2,467 | 2.65625 | 3 | [] | no_license | $(document).ready(function(){
// Slider
$('.bxslider').bxSlider({
mode: 'fade',
captions: true,
slideWidth: 1200
});
// Posts json
var posts = [
{
title: 'Artículo con JSON 1',
date: 'Publicado el '+ moment().day()+ ' de '+ moment().f... | true |
4aa51f02c9a6483318245bf7ec5886bf6fc07216 | JavaScript | Viktor-Rybakov/Mortal-Kombat | /game.js | UTF-8 | 3,776 | 3.25 | 3 | [] | no_license | import { Player } from './player.js';
import { generateLog } from './log.js';
import { getRandomNumber, createElement } from './utils.js';
export class Game {
constructor(arenasClass, buttonClass) {
this.$arenas = document.querySelector(arenasClass),
this.$formFight = document.forms.attack,
this.$buttonFight =... | true |
6350d3ace2278cf85744d53264d574dd00a51b15 | JavaScript | nishus266/sk-academy | /script/main.js | UTF-8 | 936 | 2.734375 | 3 | [] | no_license | setInterval(function(){
document.getElementById("homemain").className= "homemain1";
document.getElementById("change").innerHTML= "Your Child's Future Starts here";
document.getElementById("addbt").style.display= "none";
document.getElementById("change").style.opacity= ".8";
},10000);
function gh(a){
if(a==1){
wi... | true |
31656355f5af8b3dd0b30a1f47121cad65c39b16 | JavaScript | slonigiraf/slon-token | /test/SlonigirafToken.test.js | UTF-8 | 20,883 | 2.640625 | 3 | [
"MIT"
] | permissive | //TODO: overflow and underflow issues should be tested in all functions
const BigNumber = require('bignumber.js');
const truffleAssert = require('truffle-assertions');
require('truffle-test-utils').init();
const SlonigirafToken = artifacts.require("SlonigirafToken");
const expectedInitialTokenSupply = new BigNumber(1e3... | true |
f8bcd56d6d7bc16c4776ed77580915de41d04855 | JavaScript | learnin-tap/LeetCode_practice | /daily/哈希表/哈希表medium/347. 前 K 个高频元素.js | UTF-8 | 532 | 3.53125 | 4 | [] | no_license | /**
* @param {number[]} nums
* @param {number} k
* @return {number[]}
*/
// 1.用哈希表存放数据,arr数组存放去重之后的value值
// 2.排序得出结果,但是时间复杂度上不符合题目要求,择日改进写法
var topKFrequent = function(nums, k) {
let map = new Map(), arr=[...new Set(nums)]
nums.forEach(item=>{
if(map.has(item))
map.set(item,map.get(item... | true |
51d107268c75c5f3c487f6ffb99ca51b72633dbe | JavaScript | kimsangwond/1st-assignment | /first.js | UTF-8 | 556 | 2.984375 | 3 | [] | no_license | const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.on("line", function(input_num) {
const number=input_num
let result=0
for(let i=3; i<=number; i++){
let y=String(i)
if ((y.match(/3/g)|| []).length != 0 || (y.match(/6/g)|| []).length... | true |
92708f79cec81ba9749be4731dbc6e8356dcbf1c | JavaScript | vbarturen/curso-javascript | /clase1Barturen/main.js | UTF-8 | 182 | 2.734375 | 3 | [] | no_license | let entradaNombre = prompt('Ingresa tu nombre');
let salidaNombre = entradaNombre;
console.log(entradaNombre);
alert('"' + entradaNombre + '"' + ' ' + 'se ingresó correctamente.'); | true |
6067388ebac784eb4978bcbe418dc12dfa894ff9 | JavaScript | rationality6/codewars | /8kyu/js/prototype.js | UTF-8 | 166 | 3.515625 | 4 | [] | no_license | function foo(x) {
this.x = x;
};
var A = new foo('hello');
console.log(A.x);
// > hello
foo.prototype.x = 'foo'
// console.log(A.prototype.x)
// > syntax error
| true |
07e07ae61d7e3f32bb3f36fb51f94fe2d397150c | JavaScript | shilad/macademia | /Macademia/web-app/js/editprofile.js | UTF-8 | 364 | 2.953125 | 3 | [] | no_license | $(document).ready(function(){
$("div#changePw input").click(function(event){
$("div#passwordWrapper").css({"visibility":"visible"})
});
$("div#submitPassword input").click(function(event){
$("div#passwordWrapper").css({"visibility":"collapse"})
});
$("[value$='Remove']").click(function(event){... | true |
fe79d15c11fb7e397c3b9b8acb00eacbd5a9f74a | JavaScript | rt12/adventofcode-2020 | /23/solve2.js | UTF-8 | 1,162 | 3.421875 | 3 | [] | no_license | const mln = 1_000_000;
// const input = "389125467"; // test
const input = "193467258";
const pre = input.split("").map(Number);
const lookup = new Map(); // value => list node
let head = {};
let tail = pre.reduce((tail, val) => {
const node = {val};
lookup.set(val, node);
tail.next = node;
return no... | true |
124c70d0bec4ebdf177329aef746d266bcb30dd7 | JavaScript | zoldello/jsdoc-talk | /demo-code/expected/animal.js | UTF-8 | 753 | 3.703125 | 4 | [
"MIT"
] | permissive | /**
* @file Animal- Template for a living thing
* @author Phil example@example.com
* @license MIT
* @since 0.0.1
* @copyright Copyright Phil
*/
/**
* Animal template
*/
export default class Animal {
/**
* @param {object} Animal annotation information
*/
constructor(label) {
thi... | true |
594b97f1f764231c13406a0b2e6ab0aa84d10c22 | JavaScript | Devin-Uner/slothintelligence | /simple example on the interface/python to JS AJAX/script.js | UTF-8 | 1,064 | 3.21875 | 3 | [] | no_license | // the function called by the button press
function get_output() {
get_request('output_generator.py', draw_output, draw_error);
return false;
}
// what to do if theres an error
// note that until it is succsessful, it assumes theres an error, so while its loading it assumes it just didnt work
// but it will update i... | true |
9007c212d802e8d409fbad814170027bb07e65b9 | JavaScript | sansonegonzalo/quizz | /src/components/Trivias/Trivias.js | UTF-8 | 1,959 | 3.015625 | 3 | [] | no_license | import React, { Component } from 'react';
import Trivia from '../Trivia/Trivia'
class Trivias extends Component {
// indexPregunta, se utiliza p/iterar lista de preguntas q llega de props
state = {
pasarSig: false,
indexPregunta: 0,
resCorrecta: '',
puntaje: 0
}
sigP... | true |
b21dbf06a041d55eb517ccbc301cfcc05b20b4d4 | JavaScript | GSingh1994/UDEMY_Projects | /JS/objects.js | UTF-8 | 497 | 3.5 | 4 | [] | no_license | var movies = [
{
title: 'In Bruges',
rating: 5,
watched: true
},
{
title: 'Frozen',
rating: 4.5,
watched: false
},
{
title: 'Mad Max',
rating: 5,
watched: true
},
{
title: 'Les Miserables',
rating: 3.5,
watched: false
}
];
movies.forEach( function(movie) {
// statements
if (movie.... | true |
d4a5feb2f199c87a41303edd913039d0bae24da3 | JavaScript | Pelogren/pelogren.github.io | /assets/js/categories.js | UTF-8 | 3,483 | 3.15625 | 3 | [] | no_license | var categories = [
{ //EDUCATION
name:'Education',
color:'#D95246', //red
limit: '100',
expenses: [
{name: 'Bear Neurowissenschaften',
price: 98.90,
date: '10.6.14',
},
{name: 'Schöning Theo. Informatik',
price: 19.90,
... | true |
5f36fc34a875716e4ba3f0e7d12caef02e188b15 | JavaScript | matiasjl/pruebasdeseleccion | /dep-pba.js | UTF-8 | 419 | 3.265625 | 3 | [
"MIT"
] | permissive | // VARIABLES COLOR ~
let cCeleste, cCeleste1, cCeleste2, cCeleste3;
let cGris, cAcento;
// VARIABLES FUENTES: textStyle(theStyle)
let encode = "Encode Sans";
function inicializarDiseno(){
cCeleste = color(0, 174, 195);
cCeleste1 = color(116, 201, 227);
cCeleste2 = color(163, 216, 231);
cCeleste3 = color(202, ... | true |
438273f32266c7b9ad33b03ceb9edd26644c1ab6 | JavaScript | FrancoSirena/dumpster | /isSubtree.js | UTF-8 | 1,683 | 3.515625 | 4 | [] | no_license | const fs = require("fs");
//
// Binary trees are already defined with this interface:
// function Tree(x) {
// this.value = x;
// this.left = null;
// this.right = null;
// }
function isEqual(node, node2) {
if (!node && !node2) {
return true;
}
if (!node || !node2) {
return false;
}
if (node.va... | true |
7bb8c22811557b4a01b3d3851f74b9f86f14d7e8 | JavaScript | nathanhilbert/nodeangtest | /public/js/map.js | UTF-8 | 707 | 2.875 | 3 | [] | no_license | // create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([10, 10], 2);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
v... | true |
fc156af048953a646f122c02b7690a46bdea3362 | JavaScript | ru5199/dev_ruproject_web | /javascript2/1122_Wed/js/new.js | UTF-8 | 2,736 | 3.46875 | 3 | [] | no_license |
/*
var now = new Date();
var year = now.getFullYear();
var month = now.getMonth();
var date1 = now.getDate() ;
var hour = now.getHours() ;
var minute = now.getMinutes() ;
var second = now.getSeconds() ;*/
//console.log(now);
var Person = function (name, job, live, post, date) {
this.name = name ;
this.job ... | true |
f816fb60624e02f721a57f28b9f712e84fef4e9f | JavaScript | ekaterina-abr/coursera-frontend | /Course1-JavaScript1/Week_4/index.js | UTF-8 | 2,087 | 3.109375 | 3 | [] | no_license | /**
* @param {Array} collection
* @params {Function[]} – Функции для запроса
* @returns {Array}
*/
function query(collection) {
var args = [].slice.call(arguments);
var resArray = args[0];
for (var i = 1; i < args.length; i++) {
if (args[i].name == "filterIn") resArray = args[i].action(resArray)... | true |
690c767ddb9d6f820ca2a2bc6d78adc34b8e70de | JavaScript | pc-mbevilac/onestopbot | /bot.js | UTF-8 | 8,425 | 2.65625 | 3 | [] | no_license | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
const { ActivityHandler, MessageFactory, CardFactory } = require('botbuilder');
class OneStopBot extends ActivityHandler {
constructor() {
super();
this.state = {};
this.default = MessageFactory.suggest... | true |
889270a815019d3f3d81c5166229a4501c4f648f | JavaScript | ethan-gallant/CoinStop-API | /helpers/parse-pool-hashrate.js | UTF-8 | 1,355 | 2.859375 | 3 | [] | no_license | const convertPoolHashrate = function (hashrate, callback) {
return new Promise((resolve, reject) => {
if (Math.ceil(hashrate).toString().length < 4) {//Kilohash
return resolve(Math.round(Math.ceil(hashrate)) + ' KH/s')
}
if (Math.ceil(hashrate).toString().length >= 4 && Ma... | true |
ca5f03dcf7427d4241876262453ba9911cf19a28 | JavaScript | Mukesh-Kumar-Bhati/React-Project | /src/SignUp/showList.js | UTF-8 | 676 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
class showList extends React.Component {
render() {
console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
console.log(this.props.data)
//const data = this.props.data;
// let datalist = '';
// data.forEach((value) => {
// console.log('***************... | true |
710d4b1a63cd70f633d191f4d16c13899490b62b | JavaScript | omarben1/TeamBuilder | /Frontend/src/reducer.js | UTF-8 | 1,271 | 2.609375 | 3 | [] | no_license | import axios from 'axios';
export const reducer = (state, action) => {
switch(action.type){
case 'GetTeams' :
return {...state,Teams:action.payload,loading:false};
case 'loading' :
return {...state,loading:true};
case 'addTeam' :
let {te... | true |
26641d6ffb687c25df247fcbc60b4c682edcdae2 | JavaScript | geohouse/numberPath | /numberPath_solveRandom_manual.js | UTF-8 | 17,721 | 3.59375 | 4 | [
"MIT"
] | permissive | let numRows = 9;
let numCols = 9;
let mainTable = document.createElement('table');
let tableRow = undefined;
let createdCell = undefined;
document.body.appendChild(mainTable);
// Initialize the table by looping through the desired number of rows first, creating those
// then looping through the desired number of col... | true |
e0d93992f510d42ec95c7c9e6bf1cecc274fb6ba | JavaScript | ether200/jest-tuto | /__test__/true.test.js | UTF-8 | 697 | 2.53125 | 3 | [] | no_license | import { isNull, isTrue, isFalse, isUndefined } from "../true";
describe("Probar resultados nullos", () => {
test("Si es null", () => {
expect(isNull()).toBeNull();
});
});
describe("Probar resultados true", () => {
test("Si es true", () => {
expect(isTrue()).toBeTruthy();
});
});
describe("Probar re... | true |
27b1d0c334558c7ad7136373d3e4e1b38aa1909b | JavaScript | merargin/tournament | /client/TournamentManager.js | UTF-8 | 3,530 | 2.875 | 3 | [] | no_license | function getTeam(tournamentId, teamId) {
return new Promise(async(resolve, reject) => {
try {
if (tournamentId == null) {
return reject(new TournamentError(TOURNAMENT_ERRORS.TOURNAMENT_ID));
}
let response = await RequestProcessor.get(URLS.TEAM, {
tournamentId,
teamId
... | true |
2ec2b1c154afbf05c322e0d9658d6543c3bf4067 | JavaScript | EvgenyStarovoitov/BSUIR | /OPIS/Course_project/CourseOscillDraw/courseW.js | UTF-8 | 7,187 | 2.921875 | 3 | [] | no_license | // Обьявление переменных
let mimi=0,
inputText = document.querySelector('.text_value'),
canvasElem = document.querySelector('.canvas__row'),
clearbtn = document.querySelector('.button_clear'),
AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext... | true |
e1c1c0c6ce44cfc2e4eaa62d0ee60527606f9d83 | JavaScript | lundner/svgize | /svgize.js | UTF-8 | 4,031 | 2.609375 | 3 | [] | no_license | // Generated by CoffeeScript 1.6.2
(function() {
var svgize, _ref;
svgize = function() {
var setSVGAttributes;
this.pixelize = function(src, canvasId, svgId, scale) {
var context, img, svg;
img = new Image();
svg = document.getElementById(svgId);
context = document.getElementById(... | true |
64774fe2b8cd8e7f703e99e553f726724b87586d | JavaScript | yanghu199/slave-to-the-algorithm. | /voice-library/phone.js | UTF-8 | 2,123 | 2.71875 | 3 | [] | no_license | var song1;
let phone,butterfly,ufo,hand,toycar;
let tietu,green,orange,di,black,red;
function preload() {
song1 = loadSound('data/song1.mp3',true);
// Load model with normalise parameter set to true
butterfly = loadModel('data/butterfly.obj', true);
phone = loadModel('data/phone.obj', true);
toycar = loadM... | true |
3a2d0a47cbe1a63a61e7f92de3a8bf7e49fccc5f | JavaScript | KumarOjas/A-repo-made-in-order-to-learn-web-development- | /2.1 CanvasCourseSource/mover.js | UTF-8 | 499 | 3.453125 | 3 | [] | no_license | const canvas = document.querySelector('#canvas');
const ctx = canvas.getContext('2d');
window.requestAnimationFrame(draw);
const pos = { x:canvas.width/2, y:canvas.height/2, speed : 5};
function draw() {
pos.x += pos.speed;
if(pos.x > canvas.width){ pos.x =0;}
console.log(pos.x);
createImage();
window.requestAnimation... | true |
fefacedf496011f08d9444a4e94da9c1169ac7c9 | JavaScript | angleguan/TUTO | /js/util.js | UTF-8 | 7,225 | 2.90625 | 3 | [] | no_license | /**
* This file contains functions that are used in more than two javascipt files.
*/
'use strict';
function isLoggedIn() {
$.get('is-logged-in', function(data) {
if (data) {
document.getElementById('container').appendChild(addMsgs(data[0], data[1]));
} else {
document.getElementById('container').append... | true |
691707d4af1d22cea6bf05adccacaed28c651541 | JavaScript | AbuJobayerSarkar/ReactBasic-ticTactoe | /src/test.js | UTF-8 | 402 | 2.84375 | 3 | [] | no_license | async function fn(){
const devices = await navigator.mediaDevices.enumerateDevices();
const audioDevices = devices.filter(device => device.kind === 'audiooutput');
const audio = document.createElement('audio');
console.log(audioDevices)
//await audio.setSinkId(audioDevices[0].deviceId);
/... | true |
fef7851dcf329dfcbb6ce05cdd3c5af070f36927 | JavaScript | tanvirtanjum/Business-Tool-v4 | /assets/js/editProfile.js | UTF-8 | 532 | 2.890625 | 3 | [] | no_license | function validate(){
if(document.myForm.fullname.value=="")
{
alert("Please provide Full Name!");
document.myForm.fullname.focus();
return false;
}
if(document.myForm.email.value=="")
{
alert("Please provide valid Email!");
document.myForm.email.focus();
... | true |
c94e84757f5ab405b1205ab4c7b563046c5310e9 | JavaScript | ethw/n-discordbot | /nbot/utils/LogUtil.js | UTF-8 | 483 | 2.84375 | 3 | [] | no_license | const fs = require('fs')
class LogUtil {
logWithTime (logString) {
var now = new Date()
var calendarString = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate()
var timeInDayString = now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds()
var logStringWithDate = calendarStri... | true |
f40f3a1abb87e95ef2a61203e5bdc6f1707a7d9d | JavaScript | GeorgiSv/SoftUni-Repo | /JS Advance/JS Application/Template/01. List Towns/app.js | UTF-8 | 540 | 2.921875 | 3 | [] | no_license | (function(){
let button = document.getElementById('btnLoadTowns');
let container = document.getElementById('root');
button.addEventListener("click", async function(){
let towns = document.getElementById('towns').value.split(', ');
let source = await fetch('http://127.0.0.1:5500/01... | true |
abe76bd14848601ab1813bb29d4d993b7cd9cec5 | JavaScript | sodacitylabs/boring-framework | /test/cli/Interpreter/Expressions/New.test.js | UTF-8 | 456 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | const NewExpression = require("../../../../src/cli/Interpreter/Expressions/New");
const InterpreterContext = require("../../../../src/cli/Interpreter/InterpreterContext");
test("if context input is correct, sets the proper command", () => {
const context = new InterpreterContext(["$", "Boring", "new"]);
const expr... | true |
251657ab07443cba3c4faa9dd344fdeb5bb3f4c8 | JavaScript | merodeadorNocturno/json_rust | /nodejs/main.js | UTF-8 | 359 | 2.5625 | 3 | [] | no_license | console.time('nodejs');
const myCurrencies = require('../json_files/currencies.json');
const myFilter = () => {
return myCurrencies
// .filter(currency => currency.id > 76 && currency.id < 1899)
.filter(currency => currency.name === "XRP");
};
const result = myFilter();
console.timeEnd('nodejs');
... | true |
c29ee6a9e7a9574e674c318c43a9a79df37ebb82 | JavaScript | s4pearce/Learn2Gather | /routes/login.js | UTF-8 | 1,208 | 2.5625 | 3 | [
"BSD-2-Clause"
] | permissive | var express = require('express');
var router = express.Router();
var jwt = require('jsonwebtoken'); // used to create, sign, and verify tokens
var cookie = require('cookies');
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('login');
});
router.post('/', function(req, res) {
// Se... | true |