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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0e103230f2b21b5a48c723fbdc089dfdc6625905 | JavaScript | moosichu/hack-cambridge-website | /src/js/client/fractal.js | UTF-8 | 8,825 | 2.984375 | 3 | [
"MIT"
] | permissive | 'use strict';
function shuffleArray(array) {
for (let i = array.length - 1; i > 0; -- i) {
let j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
return array;
}
const iterations = 80;
const threshold = 100;
function getFractalValue(f, [zr, zi]) {
let [znr, zni] = ... | true |
cdcc121179de42a35efacdc98e82b377182dbc96 | JavaScript | renancvalladao/cod3r-curso-web-moderno | /JavaScript - Fundamentos/hoisting.js | UTF-8 | 224 | 3.3125 | 3 | [] | no_license | console.log("a =", a)
var a = 2
console.log("a =", a)
/**
* Hoisting faz com que a interpretador "puxe" a variável para ser declarada no início
*/
/**
* console.log("b =", b)
* let b = 2
* console.log("b =", b)
*/
| true |
df5fcdbb40f95cf9ee4fdc7c1b985ab671e65225 | JavaScript | DeshmukhChinmay/Wanderer | /server/routes/apiRoutes.js | UTF-8 | 1,282 | 2.859375 | 3 | [] | no_license | const applicationKeys = require("../config/applicationKeys");
const axios = require("axios");
const WEATHER_API_URL = "https://api.openweathermap.org/data/2.5/forecast";
const WEATHER_API_KEY = applicationKeys.weatherAPIKey;
const GOOGLE_PLACES_API_URL = "https://maps.googleapis.com/maps/api/place";
const GOOGLE_PLAC... | true |
97bb66e3a0764d73d8ff8e621a8a9cf39843d304 | JavaScript | oraNge-M112/Academie | /Projects Nicolae Marius/JavaScript/OOP/car.js | UTF-8 | 1,580 | 3.75 | 4 | [] | no_license | var car = {
make: "Ford",
model: "Focus",
year: 2019,
color: "orange",
passengers: 2,
sport: true,
mileage: 0,
engineIsOn: false,
fuel: 50,
maxFuel: 50,
mediumConsumption: 7.5,
stop: function() {
if (this.engineIsOn) {
this.engineIsOn = false;
console.log("The car has stopped");
... | true |
22117a74593ab3cac9f267b703ee2833fe9d59f4 | JavaScript | samuasouza/shorts_javascript | /metaProgramação/reflect/reflect.js | UTF-8 | 578 | 3.890625 | 4 | [] | no_license | // Verificando se um objeto contém determinadas propriedades
const duck = {
name: 'Maurice',
color: 'white',
greeting: function() {
console.log(`Quaaaack! My name is ${this.name}`);
}
}
Reflect.has(duck, 'color');
// true
Reflect.has(duck, 'haircut');
// false
//Retornando as própri... | true |
e4cf012a47a054f75d98b3a08ad1462b6819b170 | JavaScript | ashub17/Weather-app | /app.js | UTF-8 | 1,571 | 3.359375 | 3 | [] | no_license | let weather ={
apiKey : '620ff13ff44752d4e129b75f20a635c6',
fetchWeather: function (city){
fetch("https://api.openweathermap.org/data/2.5/weather?q=" +city+ "&units=metric&appid="+ this.apiKey
).then((response)=>response.json())
.then((data)=>this.displayWeather(data));
},
displa... | true |
9f7de544f9a1777f42997ff40a871799777389e2 | JavaScript | obiwan314/onair | /osx-node/onair/index.js | UTF-8 | 1,015 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | var exec = require('child_process').exec;
var sleep = require('system-sleep');
var child,child1,child2;
var command = "/usr/local/bin/do-not-disturb status";
var mqttCommand_on = "mosquitto_pub -t onair1/status -m \"1\" -d -h tank";
var mqttCommand_off = "mosquitto_pub -t onair1/status -m \"0\" -d -h tank";
while(true... | true |
0d0e93726258467f9d757d1d0801b6b0522ce63c | JavaScript | morenbuou3/Food | /src/Judge.js | UTF-8 | 415 | 2.5625 | 3 | [] | no_license | const getHalfDiscount = require('../src/getHalfDiscount')
const getDecress = require('../src/getDecress')
const getTotal = require('../src/getTotal')
const Judge = (input) => {
var result = getHalfDiscount(input);
if (result.discount < 6) {
result = getDecress(input);
}
if (getTotal(input) < 30) {
resu... | true |
31e2618395cb6b1abf6c17dc52398e7fdada9892 | JavaScript | dailyrandomphoto/new-repository-scaffold | /cli-simple/index.js | UTF-8 | 787 | 2.703125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
'use strict';
const { resolve } = require('path');
function main(filepath) {
if (!filepath) {
throw new TypeError('filepath is Required.');
}
console.log(filepath);
}
function exit(err) {
if (err) {
console.error('\n' + err);
process.exit(1);
}
process.exit();
}
if (r... | true |
a70dead5a0409eea02c572554b3e081cbba6f849 | JavaScript | FullstackAcademy/remote | /Builders-TestFirst/02-Arrays/03-flatten-arrays/flatten-arrays.js | UTF-8 | 417 | 3.609375 | 4 | [] | no_license | function flatten(arr){
var input = arr;
var output = [];
for(var i = 0; i < input.length; i++){
if(typeof input[i] != "object"){
output.push(input[i]);
} else {
console.log("Calling flatten(" + input[i] + ")");
output = output.concat(flatten(input[i]));
consol... | true |
98abb083f93b0f73fb24a2a8eaa3dffe64e8d468 | JavaScript | danielvtan/Canvas.js | /js/eleven/display/Loader.js | UTF-8 | 229 | 2.578125 | 3 | [] | no_license | var Loader = new Loader();
function Loader() {
this.load = function(url, onImageLoad) {
var image = new Image();
image.src = url;
image.onload = function() {
onImageLoad(image);
};
}
} | true |
2a99bde19d5189a234af5051f8556d9942e7c970 | JavaScript | Falldanger/JS-Sandbox | /Closures/app.js | UTF-8 | 1,028 | 4.21875 | 4 | [] | no_license | //Closures
function createCalcFunction(n) {
return function () {
console.log(1000 * n)
}
}
const calc = createCalcFunction(5)
calc()
//
function createIncrementor(n) {
return function (number) {
return n + number
}
}
const addOne = createIncrementor(1)
const addTen = createIncremen... | true |
aa11cc597f47b1a850f00fac42a0c3af3dda941b | JavaScript | Synbiota/GENtle2 | /public/scripts/sequence/views/edit_view.js | UTF-8 | 2,704 | 2.546875 | 3 | [] | no_license | /**
@class EditView
@module Sequence
@submodule Views
**/
// define(function(require) {
var template = require('../templates/edit_view.hbs'),
Backbone = require('backbone'),
Gentle = require('gentle'),
Sequences = require('../models/sequences'),
EditView;
EditView = Backbone.View.extend({
manag... | true |
f1a0ff2df556f1d837e58bfaccc5e36e6e2163e2 | JavaScript | andelkocvjetkovic/TodoMVC_REACT | /src/components/NewTodo.jsx | UTF-8 | 777 | 2.578125 | 3 | [] | no_license | import "./NewTodo.scss";
import Input from "./Input";
import { nanoid } from "nanoid";
import Uregent from "./Uregent";
function TodoInput({ addTodos }) {
function handleAddNew(e) {
e.preventDefault();
// <input id = "new-todo>"
// <checkbox id = "urgent>"
var title = e.target.elements["new-todo"];... | true |
b3c17202130b948efac102709673223dab72eb41 | JavaScript | shassain/react-class | /src/class2/App.jsx | UTF-8 | 1,957 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import './App.css'
import MiNumero from './MiNumero'
import MiTexto from './MiTexto'
import Contabilidad from './Contabilidad'
import Hook from './hook/MiHook'
import CallApi from './callApi/CallApi'
import CallApiWithHook from './callApi/CallApiWithHook'
class App extends Compo... | true |
619ccaa8dee6ef70b49dc50a76b3832d59078476 | JavaScript | MaxwellAllee/electronClockPi | /assets/settings.js | UTF-8 | 1,405 | 2.53125 | 3 | [] | no_license | /* eslint-disable no-unused-vars */
/* eslint-disable no-restricted-globals */
/* eslint-disable no-undef */
const clickCount = document.getElementsByClassName('numChange');
const submit = document.getElementById('sub');
const zipNum = document.getElementsByClassName('zipNum');
const changeAmount = (e) => {
const div... | true |
9cb40d85cc196d78ced3faec85568ebab66c2a6c | JavaScript | AkeemAllen/cups | /backend/routes/user.js | UTF-8 | 7,835 | 2.640625 | 3 | [] | no_license | /* eslint-disable no-console */
/* eslint-disable no-unused-expressions */
const router = require('express').Router();
const User = require('../models/user.model');
const jwt = require('jsonwebtoken');
/**
* bcrypt is a library which allows you to hash
* a password before it is stored in the database.
*
* This is ... | true |
f04d4937bba6df25cc0202f344a09ebbe6bf91e5 | JavaScript | semagarcia/rxjs-t3chfest-reactividad | /06-subject/simple-subject.js | UTF-8 | 203 | 2.921875 | 3 | [
"MIT"
] | permissive | const subject = new Rx.Subject();
subject.subscribe(d => console.log('[SUB1] Data: ', d));
subject.subscribe(d => console.log('[SUB2] Data: ', d));
for(let i=0; i<5; i++) {
subject.next(i * 10);
}
| true |
d417eff0c47712fa4f4f475458b416853b584919 | JavaScript | konnomiya/SER_594_SemanticWeb | /Spotify/testmusic/authorization_code/spotifytest.js | UTF-8 | 2,544 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | var SpotifyWebApi = require('spotify-web-api-node');
var scopes = ['user-read-private', 'user-read-email', 'playlist-read-private', 'playlist-read-collaborative', 'user-follow-read', 'user-library-read'],
redirectUri = 'https://example.com/callback',
clientId = '462eee0168014d178e3c9303d0b67ede',
clientSecret ... | true |
f9759dfee81c1b65caa743fc5afe15a08ed71ad1 | JavaScript | xuechong87/fitrecord | /project/test/Base64Test.js | UTF-8 | 192 | 2.625 | 3 | [] | no_license | var origin = "asd/dfq?1=3&d=f#333";
var buf = new Buffer(origin);
console.log(origin.length);
console.log(buf.length);
var result = buf.toString('base64',0,buf.length-1);
console.log(result); | true |
001e1ba0d27d35f6f32d3e4aecf89f73cc697bd7 | JavaScript | NareshPS/orb-functions | /src/index.test.js | UTF-8 | 1,178 | 2.90625 | 3 | [
"MIT"
] | permissive | const test = require('ava');
const { self, constant } = require('./index.js')
////////////////////////////// self [start] //////////////////////////////
test('self-with-primitive-type', t => {
const arg = 5
const result = self(arg)
t.is(arg, result)
})
test('self-with-list', t => {
const arg = [5, 10]
const... | true |
d6d9be0392618cd3f6079ab4f6f2e84ae1898a95 | JavaScript | rao-karthik/masai-local | /Unit-4/Week-16/04-22/material-dashboard/src/State/reducer.js | UTF-8 | 836 | 2.671875 | 3 | [] | no_license | import { GET_ORDER_DETAILS_FAILURE, GET_ORDER_DETAILS_REQUEST, GET_ORDER_DETAILS_SUCCESS } from "./actionType";
const initState = {
data: [],
isLoading: false,
isError: false
}
export const Reducer = (state=initState, action)=>{
const { payload } = action;
switch(action?.type){
case GET_OR... | true |
b34509f2b5609dd71653bda032aca7e1f507a9d5 | JavaScript | lbarrous/Sparklines-Table | /es6/models/CurrencyPair.js | UTF-8 | 1,033 | 2.859375 | 3 | [] | no_license | import { UPDATE_FRECUENCY_IN_MS } from "../constants";
export default class CurrencyPair {
constructor(lastUpdate) {
this.lastUpdate = lastUpdate;
this.midprices = [(lastUpdate.bestAsk + lastUpdate.bestBid) / 2];
}
getLastUpdate() {
return this.lastUpdate;
}
setLastUpdate(lastUpdate) {
this... | true |
d09adc2c12808f84fd139b2c9960a6a1f4529299 | JavaScript | irysius/polynomic | /src/path/from-ellipse/test.js | UTF-8 | 466 | 2.546875 | 3 | [
"MIT"
] | permissive | import isEqual from "../is-equal"
import fromEllipse from "./index"
test("should get the corresponding path from the SVG ellipse node", () => {
const node = document.createElement("ellipse")
node.setAttribute("cx", 100)
node.setAttribute("cy", 50)
node.setAttribute("rx", 100)
node.setAttribute("ry", 50)
... | true |
77af5565f8f03682548843ea3ee39f12f6ea19e5 | JavaScript | krka/sc2stats | /src/main/resources/charthelper.js | UTF-8 | 885 | 2.75 | 3 | [] | no_license | allcharts = {};
function loadChart(name, title, xtitle, ytitle, series) {
var layout = {
title: title,
xaxis: {
title: xtitle,
titlefont: {
family: 'Courier New, monospace',
size: 18,
color: '#7f7f7f'
}
},
yaxis: {
title: ytitle,
titlefont: {
... | true |
9b6fbf4e1341e0044f05c084514a797b0dba956a | JavaScript | KarolyRobert/zone-handler | /src/util/dig.js | UTF-8 | 668 | 2.59375 | 3 | [] | no_license | import child_process from "child_process";
export default function dig(params){
return new Promise((resolve,reject) => {
const dig = child_process.spawn('dig',params);
let result = '';
dig.stdout.on('data', data => {
result += data.toString();
});
dig.stderr.on('... | true |
d36ff486b04a03be969114cba28eca530710439f | JavaScript | KsLangxing/Myone | /小组个人/js/banner轮播.js | UTF-8 | 3,476 | 2.84375 | 3 | [] | no_license | //banner 轮播图
let banner_index = 0;
let banner_first = 0;
let bannerTimer = setInterval(lunbo, 2000);
let hb = $$(".hhj-right-banner");
let ho = $$(".hhj-dian-o");
let hd = $$(".hhj-banner-background")[0];
//自动播放
function lunbo() {
toright();
}
// 点击小圆点或左右切换按钮
$$(".hhj-yesbanner-right")[0].addEventListener("click... | true |
81ec3452d72e82255546aab6f4a0bd16a15960cd | JavaScript | cuulee/field-of-view | /index.js | UTF-8 | 5,935 | 2.890625 | 3 | [
"MIT"
] | permissive | import turfDestination from '@turf/destination'
import turfCentroid from '@turf/centroid'
import turfBearing from '@turf/bearing'
import turfDistance from '@turf/distance'
export function fromFeature (feature, options) {
options = options || {}
feature = checkFeatures(feature, options)
return processFeature(feat... | true |
35ac43481c51ffe33cc8e1ba1629c1ff80f1ec59 | JavaScript | jorke11/jelti.page | /public/vendor/plugins.js | UTF-8 | 17,438 | 2.546875 | 3 | [
"MIT"
] | permissive | function formatRepo(data) {
return data.text;
}
function formatRepoSelection(data) {
return data.text;
}
function formatRepoProduct(data) {
var text = '';
if (data.image != null) {
text = '<img src="' + data.image + '" width=10%>';
}
return text + data.text;
}
function formatRepoSel... | true |
54621aa0f4d6be3b925feb14d6b54825b8154b5d | JavaScript | AndreasCampan/Score-Keeper | /js/script.js | UTF-8 | 7,177 | 2.78125 | 3 | [] | no_license | const playerBttn = document.getElementById('playerBttn');
const form = document.querySelector('form');
let nameList = [];
let nameCount = 1;
function addNameCard() {
const li = document.createElement('li');
const topDiv = document.createElement('div');
const spanStarter = document.createElement('span');
const... | true |
5c5108a0c70d186d803c543c9538d5998284e9dd | JavaScript | hbmartin/chrome-jira | /common.js | UTF-8 | 3,160 | 2.796875 | 3 | [] | no_license | jira_url = localStorage['jira_url'] || "http://jira.pasadena.openx.org";
// Pass an Issue ID to get an HTML string
function getTransitions(issue) {
var j = 0;
var transitions = "";
var xhr_transitions = new XMLHttpRequest();
xhr_transitions.open("GET", jira_url + "/rest/api/2/issue/" + issue + "/transitions", ... | true |
159b14f18a7cfb8f7295de6993e51b9c61005c0f | JavaScript | filipemolina/Leitura | /src/utils/helpers.js | UTF-8 | 224 | 2.84375 | 3 | [] | no_license | export const capitalize = string => (string.charAt(0).toUpperCase() + string.slice(1))
export const toNormalCase = string => (string
.replace(/([A-Z])/g, ' $1')
.replace(/^./, function(str){ return str.toUpperCase(); })
) | true |
793e75f744e18d13877a487c5a84d03023b36e9b | JavaScript | kylehennig/control-panel | /ui/js/video.js | UTF-8 | 1,369 | 3 | 3 | [] | no_license | window.addEventListener("load", () => {
// Loads the respective videos into the elements video-one through video-six.
let videoIds = ["video-one", "video-two", "video-three", "video-four", "video-five", "video-six"];
videoIds.forEach(id => {
let videoElement = document.getElementById(id);
lo... | true |
87d411270e32efb959e1be05af990ab4e8f6bb7c | JavaScript | tfaithorn/forkify-app | /src/js/views/paginationView.js | UTF-8 | 2,201 | 2.921875 | 3 | [] | no_license | "use strict";
import View from './View.js';
import icons from 'url:../../img/icons.svg';
class PaginationView extends View{
_parentElement = document.querySelector(".pagination");
addHandlerClick(handler){
this._parentElement.addEventListener('click', function(e){
const btn = e.target.cl... | true |
3e038d15f469514be54f737d9efb168488cb3029 | JavaScript | phaothu591997/18PHP06 | /seesion6-javscrip/js/example2.js | UTF-8 | 345 | 3.65625 | 4 | [] | no_license | var n = prompt("xin vui lòng nhập số n vào: ");
if(n%2==0){
document.write(n +' là số chẵn');
document.write('</br>');
}
else{
document.write(n + ' là số lẻ');
document.write('</br>');
if (n%3==0) {
document.write(n + ' là số chia hết cho 3');
}
else{
document.write(n + ' là số không chia hết cho 3');
}
} | true |
b0061ecca7792f539c393d9563f88906aec44db7 | JavaScript | thiagola92/PUC-INF1407 | /Aula-17/json1.js | UTF-8 | 367 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
*
*/
onload = function() {
var voo = {
"aircraft": "A320",
"pilot": {
"firstName": "John",
"lastName": "Adams"
},
"passenger": [
"George Washington",
"Thomas Jefferson"
]
};
console.log("tipo do aviao: " + voo.aircraft);
console.log("piloto: " + voo.pilot.lastN... | true |
08f2f39bb01179a776c93d29c31ba204d1fa5362 | JavaScript | Leandro-GomesSilva/JavaScript-Full-Stack-App-with-React-and-a-REST-API | /api/routes/index.js | UTF-8 | 6,545 | 2.90625 | 3 | [] | no_license | const express = require('express');
const bcrypt = require('bcrypt');
const { User } = require('../models');
const { Course } = require('../models');
// Requiring Custom Middlewares
const { asyncHandler } = require('../middleware/async-handler');
const { userBasicAuthentication } = require('../middleware/basic-auth-us... | true |
e634ee145fd190257280b987a44c94e50235c379 | JavaScript | DanielKusyDev/Bushelper-DjangoApp | /static/js/bushelper/search_engine_autocomplete.js | UTF-8 | 1,646 | 2.625 | 3 | [] | no_license | let tags = [];
let origin = $('#id_origin');
let destination = $('#id_destination');
let direction = $("#id_direction");
function filterData(data) {
tags = [];
let full_stop_name;
for(let i = 0; i<data.length; i++){
if(data[i]['direction'] === direction.val()) {
if (data[i][... | true |
1b29449f5a9725b08a13b75807ce2998283646d2 | JavaScript | andreasonny83/carcassonne-scoreboard-server | /server/mongo.js | UTF-8 | 2,981 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* mongo.js
*
* Perform MongoDB connection and sync the games collection
*/
const MongoClient = require('mongodb').MongoClient;
const assert = require('assert');
// configuration
const config = require('../config/config.json');
const debug = process.env.DEBUG;
// MongoDB connection URL
let url = process.env.M... | true |
2a203f62121337a33882738573406bb51902c01c | JavaScript | DmitriEr/singolo | /burger.js | UTF-8 | 492 | 2.734375 | 3 | [] | no_license | const burgerMenu = document.querySelector("#burger-menu");
const navigationMenu = document.querySelector("#nav");
burgerMenu.onclick = function() {
navigationMenu.classList.toggle("header__navigation-on");
navigationMenu.classList.toggle("header__navigation-off");
document.querySelector(".logo").classList... | true |
0931f0e77383f022e20b935142a0df38879efb53 | JavaScript | AzySir/CICDTestProject | /myapp/src/Form.js | UTF-8 | 2,946 | 2.875 | 3 | [] | no_license | import React from 'react';
import './Form.css';
import './Validate.js'
class Form extends React.Component {
constructor() {
super();
this.onType = this.keyUpHandler.bind(this);
}
keyUpHandler(refName, e) {
console.log(refName.target.name);
this.validateInput(refName.target.... | true |
e7d15ceac166e163cf73b2976f2b794772675f6b | JavaScript | OsirisRoman/chat-app-nodejs | /public/javascripts/home-socket.js | UTF-8 | 214 | 2.53125 | 3 | [] | no_license | const socket = io();
// escuchar
socket.on("logout", () => {
document.location.replace("/");
});
// If the user logout, the socket
// emit a loggout event
const emitLogout = () => {
socket.emit("logout");
};
| true |
0b459f868c1adedc3352cfece411880cd58cec0d | JavaScript | iblurdesigner/fundamentosJS | /juego/js/memoizacion.js | UTF-8 | 930 | 4.21875 | 4 | [] | no_license | //MEMOIZACION
function factorial(n) {
if(!this.cache) {
this.cache = {}
}
if(this.cache[n]) {
return this.cache[n]
}
if(n === 1) {
return 1
}
this.cache[n] = n * factorial(n -1)
return this.cache[n]
}
// CLOSURES
function saludo(finalDeFrase) {
return f... | true |
504ef1ac3440d2e51a61a98480244871c6be9fd5 | JavaScript | gweltaz-calori/Twitter-Trend | /src/streams/SocketTweetStream.js | UTF-8 | 421 | 2.625 | 3 | [] | no_license | const { Writable } = require("stream");
const ON_TWEET = "ON_TWEET";
//This stream is a socket stream that will send the tweet output
module.exports = class SocketTweetStream extends Writable {
constructor(socket) {
super({ objectMode: true });
this.socket = socket;
}
_write(chunk, encoding, callback)... | true |
1159dc29e9a046209dc29f8d2bc9ebabdead81fd | JavaScript | NightshadeX9X/MVC-IPO-Test | /js/public/classes/Party.js | UTF-8 | 738 | 3.234375 | 3 | [] | no_license | export default class Party {
constructor() {
this.pokemon = [];
}
get head() {
return this.pokemon[0];
}
set head(value) {
const pokemon = Array.from(this.pokemon);
const index = this.pokemon.indexOf(value);
if (index === -1)
return;
const ... | true |
16ce2b6fc6cb31fdfc069abebc50a07ea3679a97 | JavaScript | hunhrabo/memory_card_game | /src/Components/Game.js | UTF-8 | 4,262 | 2.84375 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import ImageServices from "../Services/services";
import Tile from "./Tile";
const Game = ({ selectedGame }) => {
const [picUrls, setPicUrls] = useState([]);
const [cards, setCards] = useState([]);
const [isFinished, setIsFinished] = useState(false);
useEffe... | true |
10c7798a585fc6d432ebc64f5a1bbe13d49e1270 | JavaScript | kshmir/hci-2011 | /javascripts/qck.breadcrumb.js | UTF-8 | 16,408 | 2.546875 | 3 | [] | no_license | $.Controller("BreadcrumbController", {
init: function() {
this.loadArray([
{ url: "#", refname : "Home" },
{ url: "#", refname : "Home" }
]);
},
loadArray: function(array) {
var self = this;
$(self.element).fadeOut("slow", function() {
$(self.element).html($.View("views/breadcrum... | true |
35b398bf766ae5391635311c9df2416043631737 | JavaScript | allabakashb/data-structure-algorithms | /Javascript/Algo9-EditDistance.js | UTF-8 | 2,145 | 4.28125 | 4 | [] | no_license | //Problem Statement
/*
Given two strings A & B, find the minimum operations to convert from A to B.
INPUT => A - "Saturday", B - "Sunday"
OUTPUT => 3
*/
function editDistance(str1, str2) {
function minDistance(str1, str2, m, n) {
if (m == 0) return n;
if (n == 0) return m;
if (str1.charAt(m-1) == st... | true |
6b170f2200ec50a9b872ce46707c62097133fb7c | JavaScript | icypher-zizek/icontainer | /react/common/inputs/DateTimePicker.jsx | UTF-8 | 1,453 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* @jsx React.DOM
*/
var React=require('react');
var moment=require('moment');
var DateTimePicker=React.createClass({
componentDidMount: function(){
var ref=this;
var $datetimepicker=this.getPickerNode();
$datetimepicker.datetimepicker({
format: this.props.format,
useStrict: true,
defaultDate: th... | true |
d8a38a6390fdb8dc4450d44fa76cceb6a5d0d237 | JavaScript | lion-bro/paper-ball | /sketch.js | UTF-8 | 686 | 2.65625 | 3 | [] | no_license | const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
var engine,world;
function setup(){
var canvas = createCanvas(1200,400);
engine = Engine.create();
world = engine.world;
ball = new Ball(150,320,70);
ground = new Ground(600,390,1200,2... | true |
70a4e3bd9ed0361592245d0b8e782d77fe986aec | JavaScript | Alaanaldous/My-Cars-Garage | /app.js | UTF-8 | 2,336 | 3.296875 | 3 | [] | no_license | 'use strict';
var titles = ['Car Model', 'Model Year', 'Price', 'Manufacturer'];
var allData = [];
function Cars(model, year, price, manufacturer){
this.model = model;
this.year = year;
this.price = price;
this.manufacturer= manufacturer;
this.maxPrice = 10000;
this.minPrice = 7000;
allDat... | true |
77f2d4bd4e5e23ef5b1598bf2052ff6bb03182f0 | JavaScript | kirandesimone/EbbnLowe | /src/Components/Classes.js | UTF-8 | 8,851 | 2.6875 | 3 | [] | no_license | import React from 'react'
import Typography from '@material-ui/core/Typography'
import { makeStyles } from '@material-ui/core/styles'
import classes1 from '../Assets/rsz_classes1.jpg'
import classes2 from '../Assets/rsz_classes2.jpg'
import classes3 from '../Assets/rsz_classes3.jpg'
import classes4 from '../Assets/rsz_... | true |
5882e90676c6115469519eb3f1407464de9ab7d9 | JavaScript | AnnaG219/PigLatin | /js/scripts.js | UTF-8 | 1,143 | 2.953125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
var str;
var len;
var regex;
$("form#translate").submit(function(event) {
event.preventDefault();
var str = $("#userInput").val();
var len = str.length;
var regex = /[aeiouAEIOU]/;
var pigLatin = '';
for(var e = 0; e <= len; e++) {
if (len === 1 ... | true |
04480508df16dab6ccca1a5f02c4127e8b7fcb6a | JavaScript | erikaannesmith/NimbusPOS | /app/assets/javascripts/order_extras.js | UTF-8 | 802 | 2.671875 | 3 | [] | no_license | (function ($) {
$(document).ready(function() {
$(document).on('click', '.order-extra-fields .plus-btn', function (e) {
e.preventDefault();
var field = $(this).closest('.order-extra-fields').find('.quantity-field');
var value = parseInt(field.val());
if (isNaN(value)) {
field.val(... | true |
460f999a3255db969a279d3534dcade4f2197e38 | JavaScript | brianestavilla/netsuite | /duplicateItems.js | UTF-8 | 2,686 | 2.75 | 3 | [] | no_license | /*
* Description: Check duplicate items and units
* Author : Vanessa Sampang
*
Updated by : Redem
Date : Jan. 25, 2014.
Reason : Edit script in detecting duplicate item.
Add function to auto fill up memo if Free Goods
Add function before saving to check if amount is not 0.00 if Free Goods.
*/
functio... | true |
1fe64e716680d4296019a064bb76abcd72b2a449 | JavaScript | wangzhishou/Q.js | /object/Q.isFunction.js | UTF-8 | 235 | 2.6875 | 3 | [] | no_license | /**
* 判断对象是否是函数
* @name Q.isFunction
* @auther wangzhishou@qq.com
* @param {Object} object 需要判断的对象
* @return {Bolean} 布尔值
*/
Q.isFunction = function(object) {
return typeof object == "function";
}; | true |
9d5ab1fbb005a1d3e658f568141ca39988bea78c | JavaScript | XccelerateTech/jackychunkit | /Exercism(old)/javascript/list-ops/list-ops.js | UTF-8 | 1,382 | 3.234375 | 3 | [] | no_license | class List {
constructor(input) {
if (typeof input == 'undefined') {
this.values = [];
} else {
this.values = input;
}
}
length() {
return this.values.length;
}
append(input) {
var output = this.values;
for (var i = 0; i < input.values.length; i++ ) {
ou... | true |
dddf4191dba540787c13e962290a7a47f0c64098 | JavaScript | priera84/battleship | /src/Components/Game.js | UTF-8 | 8,682 | 3 | 3 | [] | no_license | import React, { Component } from 'react';
import Board from './Board';
import StatusSnippet from './StatusSnippet';
import ShipSnippet from './ShipSnippet';
import { Link } from 'react-router-dom';
class Coordinate {
constructor(x, y, touched) {
this.x = x;
this.y = y;
this.touched = touch... | true |
d12a21fdd1524c01fe0eeadf722493fb58538da9 | JavaScript | datgrog/Caduceus | /app/javascripts/form.js | UTF-8 | 2,983 | 3.09375 | 3 | [] | no_license | // assign 'NA' to input related to current checkbox element
function disableInput(el) {
let inputState = el.parentElement.nextElementSibling.disabled;
el.parentElement.nextElementSibling.disabled = !inputState;
if(!inputState) {
el.parentElement.nextElementSibling.placeholder = 'NA';
el.pa... | true |
0c5a62a644bcbc8eb88c31e31cf7e2374b8d1894 | JavaScript | OmniIndex/console | /web/scripts/notifications.js | UTF-8 | 3,326 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | /**********************************************************************************************************************
* COPYRIGHT NOTICE
* Copyright (c) OmniIndex Inc 2021
* @author Simon i Bain
* Email sibain@omniindex.io
* Date: August 2021
* Project: OmniIndex Management dashboard.
* @file notifications.js
... | true |
748c2f969b3ce0b2b55fd8703809d73ebd1d15b9 | JavaScript | hitore/leetcode-practise | /middle/129-SumRoot_to_LeafNumbers.js | UTF-8 | 953 | 3.484375 | 3 | [] | no_license | /*
给定一个二叉树,它的每个结点都存放一个 0-9 的数字,每条从根到叶子节点的路径都代表一个数字。
例如,从根到叶子节点路径 1->2->3 代表数字 123。
计算从根到叶子节点生成的所有数字之和。
说明: 叶子节点是指没有子节点的节点
2019-04-21
110 / 110 个通过测试用例
执行用时 : 92 ms, 在Sum Root to Leaf Numbers的JavaScript提交中击败了89.09% 的用户
内存消耗 : 33.9 MB, 在Sum Root to Leaf Numbers的JavaScript提交中击败了66.67% 的用户
*/
var sumNumbers = functio... | true |
88ba7ee65002efd16b07d6e535254005fa08f30c | JavaScript | AshRing/Simple-Journal | /src/selectors/entries.js | UTF-8 | 630 | 2.8125 | 3 | [] | no_license | import moment from 'moment';
const getVisibleEntries = (entries, {text, year, month}) => {
return entries.filter((entry) => {
const createdAtMoment = moment(entry.createdAt);
const content = entry.content.toLowerCase();
const yearMatch = createdAtMoment.year() === year || year === undefined... | true |
f792a991af9b6b010398b5de5f2f326aa47849e7 | JavaScript | karlhass15/firstangular | /server/public/assets/scripts/app.js | UTF-8 | 1,919 | 2.578125 | 3 | [] | no_license | var myApp = angular.module('myApp', []);
//$(document).ready(function(){
myApp.controller("ZetaMessages",['$scope', '$http', function($scope, $http){
$scope.note = {};
$scope.messageArray = [];
$scope.clickButton = function(kittyFooFoo) {
$http.post('/people', kittyFooFoo).then(function (response... | true |
54698b122ab862f3b6610767c334824254ded7f9 | JavaScript | rgt13/My-Website | /static/scripts/website.js | UTF-8 | 4,785 | 2.703125 | 3 | [] | no_license | var giphyArray = [
"https://media.giphy.com/media/arGdCUFTYzs2c/giphy.gif",
"https://media.giphy.com/media/LxnaFk7seJCnu/giphy.gif",
"https://media.giphy.com/media/CWjVOWaN6z6Gk/giphy.gif",
"https://media.giphy.com/media/aB8acJ0dByuGY/giphy.gif",
"https://media.giphy.com/media/zaDi0mXkYM3eg/giphy.gif",
... | true |
0a6d8db4f0fcc2d6ae6da89077895062482b571f | JavaScript | nagachinta/code-samples | /reactjs/reducer.js | UTF-8 | 1,139 | 2.765625 | 3 | [] | no_license | export default function reducer(state={
data: [],
fetching: false,
fetched: false,
error: null,
}, action) {
switch (action.type) {
case "FETCH_DATA": {
return {...state, fetching: true}
}
case "FETCH_DATA_REJECTED": {
return {...state, fetching: false, error: ac... | true |
9e6f08d95ea3b28d05e387400f4f97ce400d064c | JavaScript | RISHAB-S/C34 | /sketch.js | UTF-8 | 1,006 | 2.546875 | 3 | [] | no_license | const Engine = Matter.Engine;
const World= Matter.World;
const Bodies = Matter.Bodies;
const Constraint = Matter.Constraint;
function draw(){
background("green")
Engine.update(engine)
ground.display()
box1.display()
box2.display()
box3.display()
box4.display()
box5.display()
box6.display()
box7.display(... | true |
56b9a4f54d25857794814b799dc3000051bc18ea | JavaScript | KathleenMK/poi-react | /src/components/loginForm/index.js | UTF-8 | 1,851 | 2.53125 | 3 | [] | no_license | import React, {useState} from "react";
import { makeStyles } from "@material-ui/core/styles";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
import TextField from "@material-ui/core/TextField";
import Button from '@material-ui/core/Button';
const useStyles = makeSty... | true |
7dc8e293676dc1501bda42c0275b5f18a3792c51 | JavaScript | perlaballesteros/week4-RPGGame | /assets/javascript/game.js | UTF-8 | 5,879 | 3.140625 | 3 | [] | no_license | var SeptNegro={
hp: 120,
aP:1,
cP:11,
};
var CienCaras={
hp: 100,
aP:0.5,
cP:50,
};
var BlueDemon={
hp: 150,
aP:2,
cP:90,
};
var Zeus={
hp: 180,
aP:5,
cP:19,
};
var luchador;
var contrincante;
//luchador values
var hPluchador;
var hPluchadorreset;
var aPluchador;
//contrincante values
var hPcontrincante;
... | true |
f2fc2643c4fe78f395868773308641bda2e45136 | JavaScript | LyubaIvanova/-JS-Advanced-Softuni- | /Lab-Arrays/Last K Numbers Sequence.js | UTF-8 | 483 | 3.65625 | 4 | [] | no_license | function solve(n, k) {
let sequence = [1];
for (let i = 1; i < n; i++) {
let nextElement = 0;
if (sequence.length >= k) {
for (let j = k; j > 0; j--) {
let index = sequence.length - j;
nextElement += sequence[index];
}
} else {
... | true |
3a842c6b677a63d71f0de45c086b75f86982c36c | JavaScript | LocutusOfBorg/forecastfox | /chrome/content/options/ff-jquery.js | UTF-8 | 3,532 | 2.640625 | 3 | [] | no_license | (function($){
/*
* Example usage:
* $('.p.day5').ff.attach('toolbar.day5', {type:'by-boolean'});
* $('.p.temperature').ff.attach('units.temperature', {type:'by-id'});
* $('.p.days').ff.attach('units.days', {type:'by-id'});
*
*/
$.fn.ff = function(method) {
// Method calling logic
if (methods[method])
... | true |
b8bdb6275006488579502996bc4cee21e796f0fb | JavaScript | toxtli/gs-ui-components | /gsuiSpectrum/gsuiSpectrum.js | UTF-8 | 2,212 | 2.828125 | 3 | [
"MIT"
] | permissive | "use strict";
function gsuiSpectrum( canvas ) {
this.rootElement = canvas || document.createElement( "canvas" );
this.rootElement.classList.add( "gsuiSpectrum" );
this.ctx = this.rootElement.getContext( "2d" );
this.colors = [
[ 5, 2, 20 ], // 0
[ 8, 5, 30 ], // 1
[ 15, 7, 50 ], // 2
[ 75, ... | true |
7628b7aa826a4c9efeb89a1073ad09e21f3baea9 | JavaScript | HeartRough/HeartRough.github.io | /test/SuanGen.js | UTF-8 | 1,696 | 3.65625 | 4 | [
"MIT"
] | permissive | // var a=prompt("What is the value of 'a'?\n","");
// var b=prompt("What is the value of 'b'?\n","");
// var c=prompt("What is the value of 'c'?\n","");
// var d=b*b-4*a*c
// var root_part=Math.sqrt(d);
// if(a==0){
// document.write("There is only one root: ",-1*c/b,"<br/>");
// throw SyntaxError();//结束脚本运行
//... | true |
3ceeed605ded4159e144dda9e042d97eb3d20a94 | JavaScript | bcherny/frontend-interview-questions | /coding-harder/LinkedList.js | UTF-8 | 781 | 3.609375 | 4 | [] | no_license | /// solution
/**
* LinkedList has 2 members, head and tail:
* - head is a value
* - tail is either another LinkedList, or null
*/
export class LinkedList {
constructor(head, ...tail) {
this.head = head
this.tail = tail.length
? new LinkedList(...tail)
: null
}
add(item) {
if (this.tai... | true |
43f3d04c4a0bd60aae17e205b8afd835e917d108 | JavaScript | alavezzo/my-portfolio | /public/js/header-util.js | UTF-8 | 570 | 2.890625 | 3 | [] | no_license | const header = document.querySelector('.page-header')
const nav = document.querySelector('.nav')
const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
header.classList.add('header-disappear');
nav.classList.add('header-disappear... | true |
01fd5dc86f1ce2f9494e9cf3286e5cfc889085c6 | JavaScript | FSE-HYD-Raju/pet-breeds | /src/store.js | UTF-8 | 1,601 | 2.515625 | 3 | [] | no_license | import { createStore, combineReducers, applyMiddleware } from "redux";
import ReduxThunk from "redux-thunk";
const initialState = {
isEdit: false,
pets: [
{
id: 0,
name: "Puppy",
breed: "Husky",
age: 5,
price: 5000,
address: "hyderabad",
phone: "9789890989",
},
... | true |
50d2049f556c40fa1bbaabe8f7d37b728830aeb9 | JavaScript | farid10/SkillBox | /js/main.js | UTF-8 | 782 | 2.828125 | 3 | [] | no_license | let name = document.getElementById("userName");
let phone = document.getElementById("userPhone");
let email = document.getElementById("userEmail");
var checkBox = document.getElementById("checkInput")
var form = document.getElementById('form')
form.addEventListener('submit', (e) =>{
if(!name.value){
name... | true |
947d32df49f8cd412a2518d5683659b4e7701e3c | JavaScript | brycehill/js-algorithms | /data-structures/stacks/index.js | UTF-8 | 281 | 3.109375 | 3 | [] | no_license | const Stack = require('./array-dynamic-size-stack')
const strings = 'to be or not to - be - - that - - - is to be or not to - be - - that is'.split(' ')
const s = new Stack()
strings.forEach(str => {
if (str === '-') {
console.log(s.pop())
} else {
s.push(str)
}
})
| true |
8554b1dcf53ed0444ab77ed3cef717c9b19069ff | JavaScript | wanggz/resume-parser | /src/main/webapp/WEB-INF/statics/js/all.js | UTF-8 | 8,027 | 3.03125 | 3 | [] | no_license |
function initObjectData(obj) {
if(!obj) {
return '';
}
return obj;
}
//paraName 等找参数的名称
function getUrlParam(paraName) {
var url = document.location.toString();
var arrObj = url.split("?");
if(arrObj.length > 1) {
var arrPara = arrObj[1].split("&");
var arr;
for(var i = 0; i < arrPara.length; i++) {
... | true |
ed44de4c1bafcec25947f7917549580d5fd66251 | JavaScript | nestorhdez/Freecode-Algorithms | /projects/cash-register/cash-register.js | UTF-8 | 3,533 | 3.53125 | 4 | [] | no_license | const coinValue = {
PENNY: 0.01,
NICKEL: 0.05,
DIME: 0.10,
QUARTER: 0.25,
ONE: 1.00,
FIVE: 5.00,
TEN: 10.00,
TWENTY: 20.00,
"ONE HUNDRED": 100.00
}
const sumAmountOfMoney = (cid) => {
let total = 0;
cid.map( val => total += val[1]);
return total;
}
const calcChangeDue = (price, cash) => {
re... | true |
638a8b753f33489b3c3298f89937973859f4f71d | JavaScript | webarata3/JavaScript_sandbox | /mithril_test/01-tab1/src/app.js | UTF-8 | 1,270 | 2.578125 | 3 | [] | no_license | var m = require('mithril');
var Tab = function(data) {
this.tabKey = m.prop(data.tabKey);
this.title = m.prop(data.title);
this.content = m.prop(data.content);
};
var vm = {
init: function() {
vm.currentTabKey = m.prop('key1');
vm.list = m.prop([
new Tab({
tabKey: 'key1',
title: ... | true |
5c2104faad64bacbc049f39c3b3c13fb1d7c7389 | JavaScript | Sellerek/react_cart | /src/components/App/App.js | UTF-8 | 1,145 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import Cart from "../Cart/Cart";
import axios from "axios";
import "./App.css";
const App = () => {
const [productDetails, setProductDetails] = useState([]);
const [totalSum, setTotalSum] = useState(0);
useEffect(() => {
axios.get("/api/cart").then(({ data... | true |
eb82f7d5f957f0a1ea86fd29199108e0b526572a | JavaScript | davvidbaker/flambe | /frontend/packages/core/src/modules/activity.js | UTF-8 | 849 | 2.609375 | 3 | [] | no_license | import { colors } from '../styles';
export function categoryColor(categories, activity) {
const category = categories.find(({ id }) => activity.categories[0]) || {
color_background: colors.flames.main,
color_text: '#000',
};
return {
background: category.color_background,
text: category.color_te... | true |
4a63f3addfba2d4e95d6ee02d8f07fd53134ffed | JavaScript | lybo/alphadevs | /client/reducers/authUser.js | UTF-8 | 2,410 | 2.765625 | 3 | [] | no_license | import * as types from '../constants/ActionTypes'
import skill from './skill';
const initialState = {
id: 0,
name: '',
avatar: '',
role: '',
skills: [],
};
export default function(state = initialState, action = { type: '', payload: {} }) {
const mapSkill = (skillState) => {
return skil... | true |
e69f44c323acc8ec28fcbbdf0b31db0434a23112 | JavaScript | hakunana/wilhelmtell | /js/schemaorgRegex.js | UTF-8 | 4,669 | 3.015625 | 3 | [
"MIT"
] | permissive | /**
* Regex for validating a value of an input field assigned to the datatype {@link SchemaOrgDataTypeEnumeration.DATETIME|schemaorg datetime}.
* Returns false if input does not match regex.
* @memberof validateSchemaOrgElem
* @param {string} dateTimeValueToCheck
* @returns {boolean}
*/
function isValidDateTimeI... | true |
fa55e2bcc974e2a60e56e8c7c9c0475e9232cc2e | JavaScript | hunghung/globalize | /test/functional/relative-time/relative-time-formatter.js | UTF-8 | 1,999 | 2.515625 | 3 | [
"MIT"
] | permissive | define( [
"globalize",
"json!cldr-data/main/en/dateFields.json",
"json!cldr-data/main/de/dateFields.json",
"json!cldr-data/main/en/numbers.json",
"json!cldr-data/main/de/numbers.json",
"json!cldr-data/supplemental/likelySubtags.json",
"json!cldr-data/supplemental/numberingSystems.json",
"json!cldr-data/suppleme... | true |
3a837bd2615212f2378ebdd9f3f103298150bf48 | JavaScript | r-edamame/kiri-stg | /script/zunko.js | UTF-8 | 1,683 | 2.84375 | 3 | [] | no_license |
class Zunko extends GameObject {
constructor(pos, res){
//super(pos, "zunko", RectCollider(Vector(91)(68))(16)(11));
// (367,276) -> (425,309) size(58,33)
super(pos, "zunko", new RectCollider(Vector(46,35), Vector(8,5)));
this.speed = Vector(1.2, 0);
this.dying = false;
this.size = Zunko.siz... | true |
e658f8cb7bc466298b4b389bb84a8946431c458c | JavaScript | IFWEB/Share | /node.js/mongoDB/server.js | UTF-8 | 1,162 | 2.65625 | 3 | [] | no_license | var mongoose = require('mongoose'),
Users=require('./schema/user.js');
//连接mongodb
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'connection error:'));
db.once('open', function() {
console.log('connect success\r\n\r\n')
});
// 增加一条数据
// va... | true |
7bcf23321806f9b028764e904e67259c48c67a7a | JavaScript | puskuruk/simple-weekly-calendar | /app/javascript/store/actions/updateNewEvent.js | UTF-8 | 486 | 2.8125 | 3 | [
"MIT"
] | permissive | const updateNewEvent = (store, id) => {
const currentEvents = store.state.currentEvents;
const event = currentEvents.find(event => event.id === Number(id))
const newEvent = {
"start": new Date(event["start"]).toISOString().substr(0, 10),
"end": new Date(event["end"]).toISOString().substr(0,... | true |
6e439f271bb09543a28b7f8728de50eef5068904 | JavaScript | pjvalentini/Descending-String-Exersise | /desString.js | UTF-8 | 826 | 4.90625 | 5 | [] | no_license | // Descending String Exercise
// let counter stores a function with a number passed in.
// let asteriskArr stores an empty array that can be looped over.
// the array will hold asterisks that will be iterated over.
let counter = function(num) {
let asteriskArr = [];
for (var i = 0; i < num; i++) {
asteriskArr.push... | true |
06cc0823032eb8f2f622efeee803a33ce0b27181 | JavaScript | cadm-inc/osdm-extensions | /markdown/soco_cables/15.1/js/manifest.js | UTF-8 | 588 | 2.734375 | 3 | [] | no_license |
function update_manifest() {
var manifest = {
"version": "latest",
"buildDate": "today",
"copyright": "Copyright 2014-2020 CADM, Inc"
}
for (var key in manifest) {
var tag = document.getElementsByClassName(key);
for (var i in tag) {
tag[i].outerText... | true |
1899eebe3981e8b7a0a0d1d47fe941d2fef45f37 | JavaScript | dtex/j5e | /lib/relay/index.js | UTF-8 | 4,019 | 3.21875 | 3 | [
"MIT"
] | permissive | /**
* Relay
* @description A module for controlling an electrically operated switch. Relays are often used to control high voltage devices such as motors, motors, and even motors. These higher voltages can be dangerous, so excercise caution when using this module.
* @module j5e/relay
* @requires module:j5e/fn
* @l... | true |
baeaa9d3d731ace43c20af8b3508a7dc26aa77dd | JavaScript | PipeChess/myNestLogger | /job.js | UTF-8 | 2,331 | 2.84375 | 3 | [] | no_license | var dateFormat = require('dateformat');
var mysql = require('mysql');
var request = require("request");
var con = mysql.createConnection({
host: "",
user: "",
password: "",
database: ""
});
function drawOutput(count, date, con) {
var hours = Math.round(count/3600 *10) / 10;
var dateInsert = date.getFullYea... | true |
fee6751ae0b46effcebd11e53e4ad9c01c79acee | JavaScript | lf-dev/buscador-ams | /ams-scrapper/test/Credenciado.specs.js | UTF-8 | 2,033 | 2.875 | 3 | [] | no_license | var should = require('should');
var Credenciado = require('../src/Credenciado.js');
var Endereco = require('../src/Endereco.js');
describe('Credenciado', function() {
let json = {
pessoa: {
"razao social": "razao social ltda",
fantasia: "fantasia",
cnpj: "12345",
... | true |
4dce3f86f5e81b2d87cd342198be8c3c12162c68 | JavaScript | MysteryPancake/Fun | /js/jobtreegenerator.js | UTF-8 | 930 | 3.3125 | 3 | [
"MIT"
] | permissive | const jobMatrix = [
[4, 8, 8, 3, 4],
[9, 5, 5, 2, 7],
[4, 2, 4, 1, 3],
[7, 9, 6, 5, 8],
[3, 6, 4, 4, 5]
];
const workerNames = ["Anne", "Bob", "Carol", "Dave", "Ethan"];
let result = "";
function traverseSubtree(index, takenJobs, level, totalCost) {
for (let i = 0; i < jobMatrix[index].length; i++... | true |
7b8129ed749ae40859ae937c1f1f9fcaa6de4975 | JavaScript | sayersb/project-2-wdi | /controllers/results.js | UTF-8 | 1,864 | 2.625 | 3 | [] | no_license | const Result = require('../models/result.js');
function indexRoute(req, res){
Result
.find()
.populate('creator') //gonna take the id in field creator and replace with the object associated instead of id
.exec()
.then( results =>{
res.render('results/index', {results});
});
}
function sho... | true |
bb7230c5d2b0ad7dea57d010696ad485e044473b | JavaScript | theanmoldhillon/Matching-Game-9 | /js/app.js | UTF-8 | 2,320 | 3.34375 | 3 | [] | no_license | let openCards = []; // openCards array contains selected cards.
const matchedCards = document.getElementsByClassName("match"); // variable for number of matched cards.
const cards = document.querySelectorAll('.card'); // variable for selecting cards.
let deck = document.querySelectorAll('.deck'); // variable for sel... | true |
ef9323f12c2a6af66dcfc55d2abe2c0656b18ef2 | JavaScript | shard520/circle-composer-app | /src/js/model/state.js | UTF-8 | 4,334 | 3.40625 | 3 | [
"MIT"
] | permissive | import getCoords from './getCoords';
/**
* Module to export the state object
* @module State
*/
export default class State {
/**
* @property {Number} - the timer used to call the note scheduler.
*/
timer;
/**
* @property {Number} - the current note in the sequence.
*/
currentNote = 0;
/**
... | true |
c138d43acfb1ac0af4ee11b9d326b4ed4eb84a3f | JavaScript | plmercereau/behappi | /src/plugins/connection.js | UTF-8 | 850 | 2.5625 | 3 | [] | no_license | /***
* Plugin that makes connection status available everywhere through isOnline value
* */
const EVENTS = ['online', 'offline', 'load']
const VueConnection = {
install (Vue, options) {
Vue.mixin({
data () {
return {
isOnline: navigator.onLine || false
}
},
methods: {... | true |
35bab356ba73d23f669880657b9e798d7e54494a | JavaScript | 1605552882/jeeplustest | /jp1.4Test/.svn/pristine/35/35bab356ba73d23f669880657b9e798d7e54494a.svn-base | UTF-8 | 860 | 2.6875 | 3 | [] | no_license | <%@ page contentType="text/html;charset=UTF-8" %>
<script>
$(document).ready(function() {
$("#score").bind("click",function(){
doSum();
});
});
function addRadio(name){
var obj = $("[name='"+name+"']").filter(":checked");
if(obj != null){
return parseInt(obj.val());
}else{
... | true |
57e558cd13c8e48b20a01fdf7a05fd41bfca3b0b | JavaScript | FFluz/ffluz.github.io | /Surge/scripts/java.js | UTF-8 | 1,197 | 2.703125 | 3 | [] | no_license |
function hidediv() {
var options = document.getElementById("options");
options.style.display = "none";
}
function test() {
//Information Area
document.getElementById("type").innerHTML = "Structure Fire";
document.getElementById("location").innerHTML = "16 Traminer Row, Werribee 3030";
document... | true |