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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
1ca888596e5d9fbd84048b9b4f974c29af2c013f | JavaScript | nesterone/fcc-random-quote-machine | /quote-machine.js | UTF-8 | 3,083 | 2.9375 | 3 | [
"MIT"
] | permissive | var fetchWithCache = _.memoize(fetchJsonp);
function getRandomQuote() {
var famousPeople = [
"Dante Alighieri",
"Aristotle",
"Charles Darwin",
"Albert Einstein",
"William Shakespeare",
"Virgil",
"Martin Luther King, Jr.",
"Leo Tolstoy",
"Volt... | true |
f45ddeca15cd3e8383dfb4f374c797ff8d9ebccb | JavaScript | Mstrange8/NodeJS_PersonalWebsite | /models/books.js | UTF-8 | 1,712 | 2.765625 | 3 | [] | no_license | const getDb = require('../util/database').getDb;
const mongo = require('mongodb');
class Books {
constructor(order, title, author, description, id) {
this.order = parseInt(order);
this.title = title;
this.author = author;
this.description = description;
this._id = id ? new m... | true |
7cb8f443f0073456e082c0b0a3cf9fa5e6be1bfb | JavaScript | DanielLin0516/ByteDance_project | /js/choujiang.js | UTF-8 | 3,461 | 2.84375 | 3 | [] | no_license | //签到按钮
var btn = document.querySelector(".qiandao button");
btn.addEventListener('click', function() {
// console.log(123);
btn.style.background = "#999";
btn.innerHTML = "已签到";
})
//抽奖功能
var lottery = {
index: -1, //当前转动到哪个位置,起点位置
count: 0, //总共有多少个位置
timer: 0, //setTimeout的ID,用clearTimeout清... | true |
03d6013af5d595fec40c0ba630fdbbfdd837a2d1 | JavaScript | roblafeve/test-starter | /test/add.spec.js | UTF-8 | 253 | 2.53125 | 3 | [] | no_license | import add from 'add'
describe('add()', function() {
it('exists', () => {
expect(add).to.exist
})
it('adds things', () => {
expect(add(1, 1)).to.equal(2)
})
it('does other stuff', () => {
expect(add(2, 3)).to.equal(5)
})
})
| true |
b98a0bc7ebc86308a7171dfdbc1847f1ba8ef93e | JavaScript | msmurali/lyric-finder | /public/index.js | UTF-8 | 673 | 3.25 | 3 | [] | no_license | const artist = document.querySelector("#artist");
const song = document.querySelector("#song");
const btn = document.querySelector("button");
const main = document.querySelector("main");
const url = `https://lyric-finder-application.herokuapp.com`;
btn.addEventListener("click", async (e) => {
e.preventDefau... | true |
85ba524ac8d81c1f79043480d0dc669bc853bbf1 | JavaScript | bekahjaned/animal-crossing-now | /src/Components/Critters/index.js | UTF-8 | 3,034 | 2.765625 | 3 | [] | no_license | import React from "react";
import BugCard from "../Cards/BugCard/index";
import FishCard from "../Cards/FishCard/index";
import SeaCreatureCard from "../Cards/SeaCreatureCard";
import { CritterDisplay } from "../../Elements/CritterDisplay/";
import { CritterGrid } from "../../Elements/CritterGrid/";
// TODO
// Chang... | true |
dc9f7bd3456cdd8bf4c255f88f2ee5515e5efdbc | JavaScript | phamhungthinh1/React-call-API | /src/reducers/itemEditing.js | UTF-8 | 440 | 2.53125 | 3 | [] | no_license | import * as Types from './../constants/ActionTypes';
var initialState = {};
// Quản lý các product by id
const itemEditing = (state = initialState, action) => {
switch (action.type) {
// Lưu lên store (product)
// product ở đây được truyền bên action
case Types.GET_PRODUCT_BY_ID:
... | true |
1ef8376f897ba9088775c52895ff2746f94d15a6 | JavaScript | williampansky/hsclone | /src/utils/replace-constants.js | UTF-8 | 433 | 2.546875 | 3 | [
"MIT"
] | permissive | import CONSTANTS from 'enums/CONSTANTS.json';
import exists from './element.exists';
/**
* Parses string and replaces the symbol with the relative constant.
* @param {String} string HTML string to parse
* @param {String} symbol Symbol to target and replace
*/
export default function replaceConstant(string, json = ... | true |
1010e55f8a241ed3002b59fe78bac60d38f63275 | JavaScript | Kianelc/exercicios-livros | /Estrutura de dados e algoritmos JS/js/arrays/insere-elemento.js | UTF-8 | 4,053 | 4.125 | 4 | [] | no_license | let numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
numbers.push(11);
numbers.push(12, 13);
/* Acrescenta um novo elemento ao array na primeira posição */
Array.prototype.insertFirstPosition = value => {
for (let i = this.length; i >= 0; i--) {
this[i] = this[i - 1];
}
this[0] = value;
};
numbers.insertFirstPos... | true |
111b4ee4493a97182935a2a4f1162c3135796fd9 | JavaScript | MichalSajdik/TGR4 | /teamsCompile | UTF-8 | 2,925 | 3 | 3 | [] | no_license | #!/usr/bin/env node
let debugPass = false;
let firstLine = true;
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
});
var dict = [];
var matrix = {};
function debug(s) {
if (debugPass) {
console.log(s);
}
}
function createMatrix(line) {
var i = ... | true |
043693c5fe7622707540032bc8c44828713c569d | JavaScript | cdadityang/odin-project-assignments | /js-jasmine/tests/tempConversion/tempConversion.js | UTF-8 | 210 | 2.609375 | 3 | [] | no_license | var ftoc = function(a) {
let num = ((5 * (a-32))/9)
return Math.round(num*10)/10
}
var ctof = function(a) {
let num = (((9*a)/5)+32)
return Math.round(num*10)/10
}
module.exports = {
ftoc,
ctof
}
| true |
975f8cd180d723b15e8bb1a755c635c341cc7ba6 | JavaScript | sindooja2554/JavaScriptNew | /Test/BubbleTest.js | UTF-8 | 505 | 2.53125 | 3 | [] | no_license | var assert = require('chai').assert;
var utility = require('../utility/utility');
describe('BubbleSort',function(){
it('Values should not be undefined',function(){
let a = utility.BubbleSort(undefined);
assert.equal(a,undefined);
});
it('Values should not be null',function(){
let ... | true |
1b90cb769970b162af1a47caa8b7b3ee7752d4e8 | JavaScript | ramzesav/my-widgets-in-the-DOM | /Чат/scripts/common.js | UTF-8 | 3,953 | 2.734375 | 3 | [] | no_license | 'use strict';
const socket = new WebSocket('wss://neto-api.herokuapp.com/chat');
const chatStatus = document.getElementsByClassName('chat-status')[0];
const sumbitSms = document.getElementsByClassName('message-submit')[0];
const messageStatus = document.getElementsByClassName('message-status')[0];
const messagesCon... | true |
8c9f39b98997f5ab5d12f49beae069c42889a6d0 | JavaScript | alanhermanns/Emoji | /curriculum/class-04/in-class-demo/lib/models/Color.test.js | UTF-8 | 3,066 | 2.671875 | 3 | [] | no_license | const Color = require('./Color');
describe('Color Model', () => {
describe('name', () => {
it('requires a name', () => {
const color = new Color({
red: 255,
green: 0,
blue: 0
});
const { errors } = color.validateSync();
expect(errors.name.message).toEqual('Path `n... | true |
1bd443c92b85cdb71b9b154f8c8ca86ff4f3e843 | JavaScript | zlqGitHub/HTML-CSS-JS | /JS框架/React框架/my-app2/src/TodoList.js | UTF-8 | 1,520 | 2.640625 | 3 | [] | no_license | import React,{Component} from 'react';
import {connect} from 'react-redux';
class TodoList extends Component{
render(){
// 可以通过解构赋值来获取数据
const {inputVaule, list, handleInputValue, handleClickAddItem} = this.props;
return (
<div>
<input onChange={handleInputValue}... | true |
672839bc7f6bc85b1eaa6dc9b79507d8f7182239 | JavaScript | joseluiscaicedo/challenge-javascript-01 | /src/index.js | UTF-8 | 355 | 3.234375 | 3 | [
"MIT"
] | permissive | //const readline = require("readline-sync")
const triangleArea = (base, height) => {
const area = (base * height)/2
console.log("El area del triangulo es: "+ area)
return area
//
}
// base = parseFloat(readline.question("Base: "))
// height= parseFloat(readline.question("height: "))
// triangleArea(base, heigh... | true |
bcae0dc3d5e9ccc3e445b6958dbf78a26c10fe5f | JavaScript | s-a/iron-node-process-exit-break | /index.js | UTF-8 | 358 | 2.515625 | 3 | [
"MIT"
] | permissive | var Plugin = function() {
this.init();
return this;
}
/*
The debugger paused here because the script you are debugging called process.exit().
You can check the call stack to get more informations.
*/
var _exit = function(code) {
debugger;
}
Plugin.prototype.init = function() {
process.exit = _e... | true |
fc253ebbad6366bbbd7a9e52f23ac682be9fbf37 | JavaScript | yPerrot/25_5_Clock | /src/App.js | UTF-8 | 3,532 | 2.765625 | 3 | [] | no_license | import React from 'react'
import './App.css';
import Controler from './Controler'
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
isSession: true,
isRunning: false,
didStart: false,
breakDuration: 5,
sessionDuration: 25,
runningMin: 25,
runningSec: 0... | true |
e8d0cd7e95aa85d18af594c99533670f486e9dd7 | JavaScript | keviinliuu/TabTrakr | /index.js | UTF-8 | 678 | 3.265625 | 3 | [] | no_license | /* When the user scrolls down, hide the navbar. When the user scrolls up, show the navbar */
let prevScrollpos = window.pageYOffset;
window.onscroll = function () {
let currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
showNavBar("navbar")
} else {
hideNavBar("na... | true |
22d959303c6565fd0f10b89150994282a27df9f5 | JavaScript | mindreframer/reactjs-stuff | /github.com/Khan/perseus/src/widgets/interactive-number-line.jsx | UTF-8 | 13,778 | 2.53125 | 3 | [
"MIT"
] | permissive | /** @jsx React.DOM */
(function(Perseus) {
require("../core.js");
var Util = require("../util.js");
require("../widgets.js");
var InfoTip = require("../components/info-tip.jsx");
var PropCheckBox = require("../components/prop-check-box.jsx");
function eq(x, y) {
return Math.abs(x - y) < 1e-9;
}
var reverse... | true |
6f21c08cc557949e01471134194517214cadc775 | JavaScript | mgeorge10/FSJS---Project-1 | /js/script.js | UTF-8 | 3,186 | 3.96875 | 4 | [] | no_license | /******************************************
Treehouse FSJS Techdegree:
project 1 - A Random Quote Generator
Matthew George - 10/6/2019
******************************************/
/***
Coding Project - Part 1
An array of 5 or more quotes with 4 properties - quote, source, citation, year.
Some quotes are without citatio... | true |
edb80cb47112ee675cd6c4f2a9b78d01045a484d | JavaScript | CoryMcCartan/election-2016 | /president/electoral-college.js | UTF-8 | 1,184 | 2.625 | 3 | [] | no_license | /*
* Calculate Electoral College
*/
"use strict";
const DEM = 0, GOP = 1;
const electors = {
AL: 9,
AK: 3,
AZ: 11,
AR: 6,
CA: 55,
CO: 9,
CT: 7,
DC: 3,
DE: 3,
FL: 29,
GA: 16,
HI: 4,
ID: 4,
IL: 20,
IN: 11,
IA: 6,
KS: 6,
KY: 8,
LA: 8,
ME: ... | true |
ea3ca0f1f77675e49d8a6242fe20753d3fdb5f12 | JavaScript | mohsenshafiei/webpack-shower | /src/lib/log-background.js | UTF-8 | 975 | 2.546875 | 3 | [
"MIT"
] | permissive | const chalk = require('chalk');
const { log, spaces } = require('./util.js');
const logInfoBG = (state) => {
if (state === 'error') {
const str = 'COMPILATION FAILED';
log(chalk.bgRedBright(str + spaces(str.length)))
}
if (state === 'warning') {
const str = 'COMPILED WITH WARNINGS';
log(chalk.bgY... | true |
410c5d535444619a3b432366dca1496066158671 | JavaScript | lukaaspl/one-armed-bandit | /js/Statistics.js | UTF-8 | 576 | 3.140625 | 3 | [] | no_license | class Statistics {
constructor() {
this.gameResults = [];
this.turnover = 0;
}
addGameToStatistics(win, turnover) {
this.gameResults.push({
win
});
this.turnover += turnover;
}
getStatistics() {
return {
totalGames: this.game... | true |
ec2b792ac745d5b0138a0d4acf1374d59538947d | JavaScript | UmamaheshMaxwell/rxjs-using-events | /src/app.js | UTF-8 | 881 | 2.8125 | 3 | [] | no_license | import $ from 'jquery';
import Rx from 'rxjs/Rx';
const btn = $('#btnClick');
const txtbox = $('#txtName');
const outputDiv = $('#outputDiv');
const btnStream$ = Rx.Observable.fromEvent(btn, 'click');
btnStream$.subscribe(
(event) =>{
console.log(event.target.innerHTML)
},
(error) =>{
console.log(error)
},
... | true |
100d54f993bdee3d0b3149804069c2dda51c4d46 | JavaScript | JBartscher/WebProgrammierungSnakeSpiel | /SnakeGame/src/GameEntities/Point/PointSpawner.js | UTF-8 | 1,909 | 3.375 | 3 | [] | no_license | "use strict";
import Point from "./Point.js";
import {StaticGameObject} from "../GameObject.js";
/**
* class which handles the spawning of new points on the playing field.
*/
export default class PointSpawner {
constructor(displayWidth, displayHeight) {
this.xMax = displayWidth - Point.SIZE;
th... | true |
77322588f88952183deafd6e4ca22a53ba97a736 | JavaScript | yjhu/wowewe | /web/js/jquery.highlight.js | UTF-8 | 2,646 | 2.921875 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Created by kzeng on 14-8-1.
*/
(function($){
$.fn.highLight = function(str) {
if(str == undefined || str ==" ") {
return this.find("span.highlight").each(function() {
this.parentNode.firstChild.nodeName;
with (this.parentNode) {
replac... | true |
58e91a20b2e7d3175a67d59f2fede942aa267ad8 | JavaScript | EasonYou/EasonYou.github.io | /myPractice/ife2016Spring/Step 3/scripts/task38.js | UTF-8 | 3,844 | 2.609375 | 3 | [] | no_license | function g(classs){
return document.getElementsByClassName(classs);
}
var TableTool=(function(){
function init(options){
var instance=new table(options);
return instance;
}
function table(options){
this.aaa='aaa';
this.setOptions(options);
this.render();
this.event();
this.frozen();
}
... | true |
5a8314bf4093959b290c9df7698eb8ff7f891512 | JavaScript | seppegadeyne/kdg-webtechnology-javascript | /scripts/demoWeek2.js | UTF-8 | 5,007 | 4.09375 | 4 | [] | no_license | function geefRandomLetters(aantal) {
let letters = "abcdefghijklmnopqrstuvwxyz";
for(let i = 0; i < aantal; i++) {
console.log(letters[Math.floor(Math.random() * letters.length)]);
}
}
console.log(geefRandomLetters(6));
function checkOfWoordInLijstZit(woord) {
let woordenlijst = ["appel", "pee... | true |
3a12d6e46ef7ae192a0a126ff52bc66f8772b067 | JavaScript | riasingh12/Supreme-Catto-Bot | /bot.js | UTF-8 | 1,423 | 2.90625 | 3 | [] | no_license | require("dotenv").config();
const Discord = require('discord.js');
const { prefix, token } = require('./config.json');
const client = new Discord.Client(); // js object that connects to discord api to manage to run the bot
client.login(token);
client.on('ready', readyDiscord);
function readyDiscord() {
console.l... | true |
a43b177371b2adde9f813532af4ce5670a4d23b2 | JavaScript | ZacharyDagnall/zachary-dagnall | /src/Skills.js | UTF-8 | 1,755 | 2.78125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
const bigSkills = [
"Object-Oriented Programming",
"Web Development",
"Debugging",
"Javascript",
"React",
"Rails",
"Ruby",
"HTML",
"CSS",
];
const mediumSkills = [
"Java",
"Python",
"Communication",
"Full-Stack Development",
"Git",
"JSON"... | true |
3b2084520c17f37dda8a132945e4e1d4dac5a91c | JavaScript | SimonaBolgradova/JS-Fundamentals | /Functions/DistinctArray.js | UTF-8 | 222 | 3.28125 | 3 | [] | no_license | function DistinctArray( array){
let isRepeat = array.filter(x=> x==x);
if(isRepeat== true){
console.log(isRepeat)
}else{
console.log(array.join(' '))
}
}
DistinctArray([1, 2, 3, 3, 4])
| true |
eb197d6e1251457f4c3f3eb1c3908e0619146ce9 | JavaScript | megamsys/nilavu | /app/assets/javascripts/nilavu/lib/key-value-store.js.es6 | UTF-8 | 1,908 | 3.15625 | 3 | [
"MIT"
] | permissive | // A simple key value store that uses LocalStorage
let safeLocalStorage;
try {
safeLocalStorage = localStorage;
if (localStorage["disableLocalStorage"] === "true") {
safeLocalStorage = null;
} else {
// makes sure we can write to the local storage
safeLocalStorage["safeLocalStorage"] = true;
}
} ca... | true |
02d00328453aa41598a6bf5e146313a3774a76fe | JavaScript | VinodAkkepalli/javascript-practice | /memoization.js | UTF-8 | 907 | 4.25 | 4 | [] | no_license | /**
* Memoization is a form of caching where the return value of a
* function is cached based on its parameters. If the parameter
* of that function is not changed, the cached version of the
* function is returned.
*
* Although using memoization saves time, it results in larger
* consumption of memory since we... | true |
430ea6fc68c4e17179ae5829aabf10ae4a3a2bdc | JavaScript | anoopsinghjaswal/nodejs-cookie-session-example | /users.js | UTF-8 | 1,093 | 2.953125 | 3 | [] | no_license | /* jshint esversion: 6 */
class Users {
constructor() {
this._users = [{
userName: 'johndoe',
password: 'test123',
emailId: 'johndoe@exmaple.com',
contactNumber: '9985654123',
firstName: 'John',
lastName: 'Doe',
}, {
... | true |
346847c3c6b350ace56c16a1cd14317a546bfbad | JavaScript | ultimateFergal/FunFunFunctionJS | /HigherOrdenFunctions.js | UTF-8 | 1,403 | 4.46875 | 4 | [] | no_license | // Higher orders fucntions are functions that take other functions as arguments
// in functional programming languages, functions are values
var triple = function (x) {
return x * 3;
};
var waffle = triple;
waffle(30);
var animals = [
{ name: 'Fluffykins', species: 'rabbit' },
{ name: 'Caro', species: '... | true |
d2c2b7b7ba96618f7432cac7f41a1f62b91f03fb | JavaScript | Mohammed-Mamoun98/TodoApp | /src/client/client.js | UTF-8 | 996 | 2.78125 | 3 | [] | no_license | // const fetch = require('node-fetch')
// // fetch('http://localhost:3000/tasks/test',{method: 'POST'})
// // .then(res => res.json())
// // .then(json => console.log(json));
// const fetchMethod = async ()=>{
// const data = await fetch('http://localhost:3000/tasks/test',{method: 'POST'})
// console.... | true |
b5d10418425f09942ff1668d76aead0ac01f80d8 | JavaScript | blakevanlan/blakevanlan.github.com | /js/script.js | UTF-8 | 3,617 | 2.625 | 3 | [] | no_license | /* iOS orientation change bug fix */
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
var viewportmeta = document.querySelector('meta[name="viewport"]');
if (viewportmeta) {
viewportmeta.content = 'width=device-width, minimum-scale=1.0, maximum-scale=1.0';
document.bod... | true |
a64ec5bf6b74c972e447f2ffe703a1934a2f631d | JavaScript | fsiqueirag/weather-app | /src/helpers/getWeather.js | UTF-8 | 1,833 | 2.90625 | 3 | [] | no_license |
export const getWeather = (city, setWeather, setLoading, setLoadingCharts, setFetchFailed) => {
const appid = "64e269369a377ab327de5a052b008e9a";
const url = `https://api.openweathermap.org/data/2.5/weather?q=${encodeURI(
city
)}&units=metric&appid=${appid}&lang=es`;
fetch(url)
.then... | true |
fb6f30a871794b277ffc376d9b1fb196312c824a | JavaScript | Raan03/PingPong | /bin/js/pingpong.js | UTF-8 | 1,245 | 2.703125 | 3 | [] | no_license | var KEY =
{
UP: 38,
DOWN: 40,
W: 90,
S: 83
}
$(function () {
// listen to keydown
$(document).keydown(function (e) {
console.log(e.which);
switch (e.which) {
case KEY.UP: //arrow up
// get paddleB Y value (int)
... | true |
53c96dc85246be39353c2830f0fb38e0d5d42425 | JavaScript | sergiorgiraldo/JSStudies | /NextJS/third/components/events/event-search.js | UTF-8 | 1,687 | 2.65625 | 3 | [] | no_license | import Button from "../ui/button";
import classes from "./event-search.module.css";
import React from "react";
function EventSearch(props) {
const [formData, setFormData] = React.useState({ year: "", month: "" });
function handleChange(event) {
const { name, value, type, checked } = event.target;
setFormData((p... | true |
0606926c5e9d8794737f7e09a6436ac18f36c7a0 | JavaScript | levivictor/landing_fcamara | /script.js | UTF-8 | 436 | 2.5625 | 3 | [] | no_license | function openModal() {
let modal = document.getElementById("queroVoltar");
if (typeof modal == "underfined" || modal === null) return;
modal.style.display = "Block";
document.body.style.overflow = "hidden";
}
function closeModal() {
let modal = document.getElementById("queroVoltar");
if (typeof modal ==... | true |
521ab093938df42887a270a7cec32a9d74bfe5a7 | JavaScript | btabaska/Homework-Week-4 | /assets/homepagerouter.js | UTF-8 | 592 | 3.171875 | 3 | [] | no_license | //Event listener to start the game, also resets all the values to their default state
var startButton = document.querySelector("#start");
startButton.addEventListener("click", () => {
var oneMinute = totalTime,
display = document.querySelector("#time");
startTimer(oneMinute, display);
gameOver = false;
tota... | true |
f68000dc32e849d96785b2957ef105f34681a7d2 | JavaScript | BenFisher17/BenFisher17.github.io | /Javascript1Assignment/java1.js | UTF-8 | 513 | 3.59375 | 4 | [] | no_license |
function function1 (tArray){
var randIndex = Math.round(Math.random() * (tArray.length - 1));
return tArray[randIndex];
}
var tArray = new Array (1, 2, 3, 4, 5, 6);
var item1 = document.getElementById("first");
var item2 = document.getElementById("second");
var item3 = document.getElementById("third");
var item4 ... | true |
a6cfabfe690de47a7385f5b6fddf74ab221770fe | JavaScript | pavlo-shcherbukha/WatsonAssistant-inegration-demo | /app-id-icf/bnkapi-appid/src/getAuthInfo.js | UTF-8 | 3,190 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
*
* main() will be run when you invoke this action
* i_url - заменить на свой URL
*/
const axios = require('axios');
const i_url = 'https://[указать свой URL].mybluemix.net';
const i_logid = 'appid: ';
function main(a_params) {
var l_step='';
var result_err ;
var result_ok ;
var i_headers... | true |
880d5bb243b02024a51061bfdf5187a810a85be1 | JavaScript | somnifero/Viridian-Pokemon-Showdown | /config/commands.js | UTF-8 | 151,613 | 3.296875 | 3 | [
"MIT"
] | permissive | /**
* Commands
* Pokemon Showdown - https://pokemonshowdown.com/
*
* These are commands. For instance, you can define the command 'whois'
* here, then use it by typing /whois into Pokemon Showdown.
*
* A command can be in the form:
* ip: 'whois',
* This is called an alias: it makes it so /ip does the same th... | true |
c9de39e3750e91dcca5d2c9a688af1f49918ab6a | JavaScript | vantanferny/neon-sign-maker | /scripts/main.js | UTF-8 | 5,775 | 2.984375 | 3 | [] | no_license | let message
let color
let borderColor
let colorIntensity = 2
let borderColorIntensity = 2
let red = 255
let green = 0
let blue = 0
window.onload = function() {
message = document.getElementById('message');
color = "rgb(" + red + "," + green + "," + blue + ")"
borderColor = "rgb(" + red + "," + green + ","... | true |
e357728eaf3365a49e3fb85010d5987894a7c5f8 | JavaScript | pavleta-gyokova/SoftUni | /Programming Basic with Java Script/Complex Conditional Statements/Complex Conditional Statements - Exercises/Cinema.js | UTF-8 | 454 | 3.3125 | 3 | [] | no_license | function cinema(type,row,coloum){
row = Number(row);
coloum = Number(coloum);
let profit = 0;
if (type === "Premiere") {
profit = row * coloum * 12;
} else if (type === "Normal") {
profit = row * coloum * 7.50;
} else if (type === "Discount") {
... | true |
3602cecd716cffc8d5084bce9c85fb9751d87d5a | JavaScript | adam-kosinski/adam-kosinski.github.io | /Pig Latin/pigLatin.js | UTF-8 | 1,642 | 3.765625 | 4 | [] | no_license | //define functions --------------------
function textNodesIn(el){
var textNodes = [];
var n; //current node
var treeWalker = document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false);
//args: root node, whatToShow property, additional filter, entityReferenceExpansion(some weird thing when parsing)
while(n ... | true |
f3faf9c1f8dac8598dab5d864ee536190a2d05f7 | JavaScript | irfanullahjan/sorting-visualizations | /insertion-sort/sketch.js | UTF-8 | 1,703 | 3.34375 | 3 | [] | no_license | class SortableItem {
constructor(i, value) {
this.index = i;
this.visibility = true;
this.value = value;
this.color = [150, 150, 150];
}
}
const numItems = 10;
const maxValue = 20;
let numbers = [];
var darkGreen = [];
var current = -1;
var sorted = 0;
for (let i = 0; i < numI... | true |
ad64980a79eb5722df8aa9521a46f4ad9216e7c1 | JavaScript | terrapass/genetic-tsp | /js/genetic.js | UTF-8 | 13,436 | 2.671875 | 3 | [] | no_license | import * as debug from 'js/debug.js';
//var SelectionType = Object.freeze({
// ROULETTE : 0,
// TOURNAMENT : 1,
// SUS : 2, // Stochastic Universal Sampling
// STEADY : 3 // Steady State Selection
// // etc.
//});
//var CrossoverType = Object.freeze({
// PMX : 0, // Partial... | true |
04c9cd9431b486fc1bd519d908d9c4019d4f7a5e | JavaScript | ljwrer/leetcode-in-js | /problems/longest-common-prefix.js | UTF-8 | 660 | 3.578125 | 4 | [] | no_license | /**
* @param {string[]} strs
* @return {string}
*/
var longestCommonPrefix = function(strs) {
if(!strs.length) return ''
let prefix = ''
let i = 0
while(true){
let same=0;
for(let j=0;j<strs.length;j++){
const code = strs[j].charCodeAt(i)
if(!code){
... | true |
3d0c856d11238d5244f2ed5cb7c6e0077fb548f4 | JavaScript | enactjs/moonstone | /tests/ui/specs/ToggleButton/ToggleButton-specs.js | UTF-8 | 10,821 | 2.53125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | const Page = require('./ToggleButtonPage');
describe('ToggleButton', function () {
beforeEach(async function () {
await Page.open();
});
it('should have focus on first item at start', async function () {
expect(await Page.components.toggleDefault.self.isFocused()).to.be.true();
});
// Note, the 5-way up/do... | true |
a87835c29c559f730a089f2b009c68a403649901 | JavaScript | Dragiyski/node-http-framework | /src/controller/route.js | UTF-8 | 12,860 | 2.828125 | 3 | [] | no_license | export const properties = {
definition: Symbol('definition'),
parent: Symbol('parent')
};
export const methods = {
processDefinition: Symbol('processDefinition'),
match: Symbol('match'),
generate: Symbol('generate')
};
export class Route {
/**
* @param {RouteDefinitionList} definition
... | true |
62a33659fe80b4149a3bce9cf7df86ce2a2c0bdf | JavaScript | DragonofWest/Kevins_Public_site | /assignments/FinalProject/js/weatherapi.js | UTF-8 | 4,230 | 3.46875 | 3 | [] | no_license | /* My weather ID---> &APPID=93fbe2520d7c4cd0113025de258c34ad <---*/
/* LA weather # is 5368361 */
/* Newport weather # 5376890 */
/* Redlands weather # 5386754 */
/* San Diego weather # 5391811 */
/*-----------------Los Angeles---------------------------------------*/
var weatherRequest = new XMLHttpRequest();
var ... | true |
15fb34bbbd4818903a19eae65245e32cc9c225e2 | JavaScript | navin-moorthy/The-Web-Developer-Bootcamp | /Notes/30_YelpCamp: Data Persistence/YelpCamp v2/app.js | UTF-8 | 2,388 | 2.609375 | 3 | [] | no_license | // Node Packages
var express = require("express"),
app = express(),
bodyParser = require("body-parser"),
mongoose = require("mongoose");
// Package Initializations
mongoose.connect("mongodb://localhost:27017/yelp_camp", {useNewUrlParser: true});
app.use(bodyParser.urlencoded({extended: ... | true |
fe4a59435eac6536985c4eba36b28569281d1b33 | JavaScript | nikki003/cypress | /cypress/integration/printmymemory-register.spec.js | UTF-8 | 782 | 2.515625 | 3 | [] | no_license | const faker = require('faker');
describe('PrintMyMemory', function() {
it("Register", function() {
// visits page
cy.visit("https://printmymemory.com/register")
// takes action like filling up the form
let firstName = faker.name.firstName();
let lastName = faker.name.lastNa... | true |
a8450a5ae8c6b0d3683d020a16bf340a1045e38c | JavaScript | pavanbhansali95/MyApp | /src/App.js | UTF-8 | 718 | 2.71875 | 3 | [] | no_license | import logo from './logo.svg';
import './App.css';
import {useState} from 'react';
import Person from './Persons/Person';
function App(props) {
const [persons,setPersons] = useState (
[
{
name: 'mark',age: 22
},
{
name: 'alen',age: 25
}
]
);
const changeNameHandler = (newName) => {
setP... | true |
c17e91518eec3619432b65f4516ff637dca72a4e | JavaScript | dyldlewis/track-suggester | /js/scripts.js | UTF-8 | 1,823 | 2.78125 | 3 | [] | no_license | $(document).ready(function() {
$("#info").submit(function(event){
event.preventDefault();
var interest = $("input:radio[name=interests]:checked").val();
var money = $("input:radio[name=money]:checked").val();
var business = $("input:radio[name=business]:checked").val();
var frequency = $("input:ra... | true |
752259840b39fc72d9a440c80dadd343b9297163 | JavaScript | michaelkantor/web-xdk | /src/ui/components/layer-conversation-list/layer-channel-item.js | UTF-8 | 3,640 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | /**
* The Layer Channel Item widget renders a single Channel, typically for use representing a
* channel within a list of channels.
*
* This is designed to go inside of the Layer.UI.components.ConversationListPanel.List widget, and be a
* concise enough summary that it can be scrolled through along
* with hundred... | true |
df246a1a0214e6cad63534f5a74d99438af7f1b3 | JavaScript | BlockathonMC/cli | /src/cli/ui.js | UTF-8 | 565 | 2.703125 | 3 | [] | no_license | const chalk = require('chalk');
class UI {
writeLine(text) {
console.log(text);
}
writeInfo(text) {
this.writeLine(chalk.blue(' info: ') + text);
}
writeNotice(text) {
this.writeLine(chalk.cyan(' notice: ') + text);
}
writeCreate(text) {
this.writeLine(... | true |
d354dba2b9a43bb96343da407638ae54f1009c4c | JavaScript | ChuyOleg/Client_Development | /1-lab/index.js | UTF-8 | 272 | 3.125 | 3 | [
"MIT"
] | permissive | 'use strict';
const input = document.querySelector('input');
const button = document.all[7];
const div = document.all[8];
const startLine = div.textContent;
button.addEventListener('click', () => {
const text = input.value;
div.textContent = startLine + text;
});
| true |
b74a403e33379abfad31859154594c6b5f3e2875 | JavaScript | VitaliyOsin/fast-company-form-2 | /src/components/common/pagination.jsx | UTF-8 | 921 | 2.546875 | 3 | [] | no_license | import React from "react";
import _ from "lodash";
import PropTypes from "prop-types";
const Pagination = ({itemsCount, pageSize, onPageChange, currentPage}) => {
const pageCount = Math.ceil(itemsCount/pageSize);
const pages = _.range(1, pageCount +1);
if(pageCount === 1) return null;
return (
<nav aria-la... | true |
344a02f5ec57bfce14737c49caff4806c77c1199 | JavaScript | MarthaPotts/DevStaffRedo | /index.js | UTF-8 | 13,912 | 2.8125 | 3 | [] | no_license | //dependencies
const mysql = require('mysql');
const inquirer = require('inquirer');
const cTable = require('console.table');
//import query functions
const db = require('../DevStaffRedo/db');
// const { inherits } = require('node:util');
// const { exit } = require('node:process');
// const { addDepartment, delet... | true |
b4da6a68ede808092541a894d3cde3adce912087 | JavaScript | yurimida/TIL | /09_JS/04_helperMethods/filter.js | UTF-8 | 928 | 3.390625 | 3 | [] | no_license | // ES5 for loop
// var products = [
// {name:'cucumber', type:'vege',},
// {name:'banana', type:'fruit',},
// {name:'carrot', type:'vege',},
// {name:'tangerin', type:'fruit',},
// ];
//
// var frites = [];
//
//
//
// for(var i = 0; i < products.length; i++){
// if (products[i].type==='friut'){
// ... | true |
d96e185f645a47af28f39335369a7f65d9de9be7 | JavaScript | maxim218/PresentationSimpleMaker | /static/scripts/MainScript.js | UTF-8 | 9,547 | 3.0625 | 3 | [] | no_license | "use strict";
import BoxTextCreator from "./BoxTextCreator.js";
import HTMLgetter from "./HTMLgetter.js";
import JSONworker from "./JSONworker.js";
class MainScript{
constructor(){
console.log("---");
console.log("---");
console.log("---");
document.getElementById("sceneBox").st... | true |
7d967f69cd54ab0805f78406f6b7baaa098440be | JavaScript | lejolly/cs3205 | /frontend/js/form.js | UTF-8 | 608 | 2.625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function addDangerAlert(message) {
$('#alerts').append('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button><strong>Validation Error!</strong> ' + message + '</div>');
}
function s... | true |
83745cac33998b1572d38f89d7ca4efe8a237fcb | JavaScript | gullwings13/yay-walker | /wtapi/client/src/services/apiCalls.js | UTF-8 | 1,639 | 2.546875 | 3 | [] | no_license | import { api } from './auth'
const tryCatchAPICall = async (methodString, urlString, data = null) =>
{
// console.log(urlString + " " + data)
try
{
let response = await api({ method: methodString, url: urlString, data: data })
return response
}
catch (error)
{
console.lo... | true |
def88d5a418f56d214ea6e147e7fd938c37a0570 | JavaScript | LoX3/ALonelyHill | /js/class/map.js | UTF-8 | 1,373 | 3.578125 | 4 | [] | no_license | /**
* @class Clase para establecer los parametros de los mapas
*
* @param {Number} index
* @param {String} name
* @param {Number[]} mapas
*/
class Map {
/**
* Mapas para jugar al juego
* @constructor
* @param {Number} index Indice del mapa
* @param {String} name Nombre del mapa
* @p... | true |
0521eadd85005d5db7ed0ca0370537c0047cae89 | JavaScript | shilpashreejr/SurveyRabbit | /src/js/surveyRabbitController.js | UTF-8 | 1,723 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
* Controller
*/
// a controller is where the model and the view are used together.
var SurveyRabbitController = function () {
this.model = new SurveyRabbitModel;
this.view = new SurveyRabbitView(this.model);
return this;
};
/* Render the widget by calling the render from the View */
SurveyRabbitController.pro... | true |
dd0d238cfc8ba98507be57974313e5c3dd383002 | JavaScript | okv/conform.js | /test/validator-test.js | UTF-8 | 36,473 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | var assert = require('assert'),
vows = require('vows'),
revalidator = require('../lib/revalidator');
function clone(object) {
return Object.keys(object).reduce(function (obj, k) {
obj[k] = object[k];
return obj;
}, {});
};
function assertInvalid(res) {
assert.isObject(res);
assert.strictEqual... | true |
b0100d7c9731dddfa889348e37db83a514ed1d89 | JavaScript | FaisalJulaidan/SearchBase | /Client/src/store/sagas/account.saga.js | UTF-8 | 4,562 | 2.515625 | 3 | [] | no_license | import { all, put, takeEvery, takeLatest } from 'redux-saga/effects';
import * as actionTypes from '../actions/actionTypes';
import { accountActions } from '../actions';
import {
errorMessage,
http,
loadingMessage,
successMessage,
updateUsername,
updateTimezone
} from 'helpers';
function* getAc... | true |
676a235147e4b0cc57421cf4a19aa1cb54259894 | JavaScript | yibizzi/REST_API_Security | /app/controllers/appointment.js | UTF-8 | 4,776 | 2.59375 | 3 | [] | no_license | const Appointment = require("../models/Appointment");
const Doctor = require("../models/Doctor");
const Patient = require("../models/Patient");
const pagination = require("../helpers/pagination");
exports.getAppointmentbyId = (req, res) => {
Appointment.findOne({ _id: req.params.appointmentId })
.then((appointme... | true |
a42ff106041598a02fe59d8501e3d41f0371f2db | JavaScript | Automedon/Codewars | /7-kyu-part1/Coding 3min _ A_B=C.js | UTF-8 | 753 | 4.25 | 4 | [] | no_license | /*
Description:
Coding 3min : A*B=C
This is the simple version of Fastest Code series. If you need some challenges, please try the Performance version
Task:
Give you a number array numbers and a number c.
Find out a pair of numbers(we called them number a and number b) from the array numbers, let a*b=c, result forma... | true |
293fdded7994fe3802b592349f4931f27b58cf14 | JavaScript | VeselaVideva/SoftUni | /2021.02 JavaScript Applications/06. Asynchronous Programming - Exercise/01. Bus-Stop/app.js | UTF-8 | 774 | 3.0625 | 3 | [] | no_license | async function getInfo() {
const id = document.getElementById('stopId').value;
const url = `http://localhost:3030/jsonstore/bus/businfo/` + id;
try {
const ul = document.getElementById('buses');
ul.innerHTML = '';
const response = await fetch(url);
const data = awa... | true |
32e542ff7adeee3348d673280ae418b3235c62db | JavaScript | maxplomer/javascript-advanced-problems | /tictactoe.js | UTF-8 | 3,173 | 3.359375 | 3 | [] | no_license | Array.prototype.transpose = function () {
var columns = [];
for (var i = 0; i < this[0].length; i++) {
columns.push([]);
}
for (var i = 0; i < this.length; i++) {
for (var j = 0; j < this[i].length; j++) {
columns[j].push(this[i][j]);
}
}
return columns;
};
var readline = require('readl... | true |
a684e418bd7d6163020413bee74873faca4842d0 | JavaScript | learndaily1/Spread-operator--Todo-React-App | /es6-spread-operator-practicetodo-app/src/components/App.jsx | UTF-8 | 876 | 2.78125 | 3 | [] | no_license | import React, { useState } from "react";
import Item1 from "./Item";
function App() {
const [item, setItem] = useState("");
const [listItems, setListitems] = useState([]);
function handleClick() {
setListitems((pre) => [...pre, item]);
setItem("");
}
function handleChange(e) {
const value = e.ta... | true |
c6b1c3b268baf49612699d4d5732077848af5bac | JavaScript | alarner/react-recipes | /respond-to-user-actions-models/scripts/main.js | UTF-8 | 1,097 | 3.03125 | 3 | [] | no_license | 'use strict';
var React = require('react');
var LikeButton = require('./components/LikeButton.js');
var LikeModel = require('./models/LikeModel.js');
// Here we've instantiated a new LikeModel and passed in a hard coded id. You
// won't normally hard code an id, but I want our like button to save to and
// retreive fr... | true |
a476c7126cf4eb4fe58c41934df42d852c961fad | JavaScript | beupyTech/avAdmin | /admin/assets/scripts/main.js | UTF-8 | 15,627 | 2.71875 | 3 | [] | no_license | var xhttp;
var message;
var order;
var mainElement;
var orBtn;
var comBtn;
var productObj;
var selectBox;
var neworder;
var completedOrder;
var ipInfos;
var htmlElement = {};
htmlElement.newOrder = document.getElementById('newOrder');
htmlElement.messages = document.getElementById('messages');
htmlElement.mainNavigati... | true |
32bf1efc44523de94e7bf9a9ac3b7f47d42b41dd | JavaScript | a2337230/new-Up | /static/utils.js | UTF-8 | 1,019 | 2.734375 | 3 | [] | no_license | export default {
convertImgToBase64: function (url, callback, outputFormat){
var canvas = document.createElement('CANVAS'),
ctx = canvas.getContext('2d'),
img = new Image;
img.crossOrigin = 'Anonymous';
img.onload = function(){
canvas.height = img.height;
canvas.width = img.wid... | true |
068c092a9b34d363f651845fdc2e024246231b10 | JavaScript | neilomagic/magic-expensify-app | /src/playground/destructuring.js | UTF-8 | 341 | 3.015625 | 3 | [] | no_license | console.log('boom');
const person ={
name:'neso',
age: 25,
location:{
city:'makindye',
temp: 25
}
}
const {name, age} = person;
//console.log(`${name} is ${age}.`);
const item = ['Coffee (hot)','$2.00','$2.50','$2.75'];
const [coffee, ,amount, ] = item;
console.log(`A medium ${coffe... | true |
fb362dd7108d99309350bcb9a89d16c0ed70caaa | JavaScript | Clementine-d/hsbc-color2 | /sketch.js | UTF-8 | 751 | 3.015625 | 3 | [] | no_license | // if mouseX value of pixels of the screen then can change anyting
let myFont;
function preload() {
myFont = loadFont('assets/UniversNextforHSBC-Regular.otf');
}
let t = 'Together';
let t2 = 'We';
let t3 = 'Thrive';
function setup() {
createCanvas(600, 400);
cursor('assets/cursor-people.png');
}
function d... | true |
0cf2095ebc43f3ea4861ce6e85ee860876b232df | JavaScript | AAI-USZ/FixJS | /input/100+/before/6613192235160ffc11a7348c763d1ba561e41328_3_2.js | UTF-8 | 296 | 2.8125 | 3 | [
"MIT"
] | permissive | function(other, epsilon) {
epsilon = epsilon || 0.0;
return (Math.abs(this.x - other.x) <= epsilon) &&
(Math.abs(this.y - other.y) <= epsilon) &&
(Math.abs(this.z - other.z) <= epsilon) &&
(Math.abs(this.w - other.w) <= epsilon);
} | true |
58873eb3bf82242eebcae4af2057a2d22f91db60 | JavaScript | VasudevSharma666/Test_Project | /src/Components/NewPost.js | UTF-8 | 2,584 | 2.609375 | 3 | [] | no_license | import React, { useReducer } from "react";
import { Redirect, Link } from "react-router-dom";
import { Button, Form, Input, FormGroup, Label } from "reactstrap";
const initialState = {
todoTitle: "",
todoBody: "",
todopostCompleted: false,
};
const reducer = (state, action) => {
switch (action.type) {
case... | true |
0cd4d16829443bd65deaa6a56041f12b8c2c732b | JavaScript | andredias/course-builder | /coursebuilder/modules/skill_map/templates/skill_tagging_lib.js | UTF-8 | 15,993 | 2.859375 | 3 | [
"CC-BY-2.5",
"CC-BY-3.0",
"Apache-2.0"
] | permissive | /**
* This file contains the classes to manage Skill Mapping widgets.
*
* The following variables must be set in scope for correct operation:
*
* SKILL_API_VERSION: '1';
* parseAjaxResponse: a function ro strip XSSI prefix and parse JSON
* showMsg: a butterbar display function
* showMsgAutoHide:... | true |
60032ef4a448cfc36b79fd47e539d98f3bc8e8f2 | JavaScript | MattMcMurray/guitar-map | /guitar-map/src/util/util.js | UTF-8 | 3,267 | 2.9375 | 3 | [
"MIT"
] | permissive | const {
ALL_VALID_NOTES,
FLAT,
NATURAL,
NOTES,
SHARP,
} = require("../constants");
// Clockwise from top
const circleOfFifthsMajors = [
"C",
"G",
"D",
"A",
"E",
"B",
`F${SHARP}`,
`D${FLAT}`,
`A${FLAT}`,
`E${FLAT}`,
`B${FLAT}`,
"F",
];
const WHOLE = "W";
const HALF = "H";
const MAJOR_... | true |
368a5741161f7730449723c21917e85992ce4a60 | JavaScript | sparck75/node-crypto | /eth/contract.js | UTF-8 | 2,108 | 2.609375 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const Web3 = require('web3');
const CryptoJS = require('crypto-js');
// const coder = require('./web3/lib/solidity/coder');
// ropsten
// const web3 = new Web3(new Web3.providers.HttpProvider('https://ropsten.infura.io/v3/' + process.env.projectId));
// var web3 = new Web3(new Web3.provide... | true |
381a227febbb08feaca0bd2c3b67d5828f295f4b | JavaScript | MuhamedSalihSeyedIbrahim/udemy-js-course-practice | /EMBEDDING_OBJECTS&ARRAYS_12.JS | UTF-8 | 483 | 3.265625 | 3 | [] | no_license | /*
COMBINING OBJECT AND ARRAYS
OBJECT CONTAIN ARRAY AND VICE VERSA
OBJECT CAN CONTAIN OBJECT AND ARRAY CAN CONTAIN ARRAY
[[]],{{}},[{}],{[]}
*/
var car={
maker:"valvo",
engine:{
size:2.0,
make:"bmw",
feul:"pertrol",
piston:[{make:"bmw"},{make:"bmw"}]
},
drive:function(){console.log("move");}
}
/... | true |
74d717158e5695a120e26072982f3724d567fa93 | JavaScript | cs-fullstack-2019-spring/react-liftstate-cw-Litterial | /hoisting/src/Daddy.js | UTF-8 | 827 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | import React, {Component} from 'react'
import Son from "./Son";
import './App.css'
class Daddy extends Component{
state={element:''}; //makes element a state
constructor(props){
super(props);
}
whoClicked=(e)=> //function that grabs an element from the function clicker in the child
{
// saves ... | true |
2c63dba1c85a54c5f256ac30a7da0751fcdaca6b | JavaScript | ShankarBhandari01/EmarketWeb | /Api/route/UserRoute.js | UTF-8 | 2,920 | 2.515625 | 3 | [] | no_license | const express = require('express');
const User = require('../model/signup');
const router = express.Router();
const bcryptjs = require('bcryptjs')
const jwt = require('jsonwebtoken');
const { check, validationResult } = require('express-validator')
router.post('/signUp', [
check('fullname', "fullname is required ... | true |
24dbd1a7efa60e28ccd959c31e90328626819cef | JavaScript | rolortizg/dogShelterProject | /helpers/autocompleteMaps.js | UTF-8 | 483 | 3.171875 | 3 | [] | no_license | let address = document.getElementById('address')
let lat = document.getElementById('lat')
let lng = document.getElementById('lng')
function autoComplete(input, inputLat, inputLng){
const dropdown = new google.maps.places.Autocomplete(input)
dropdown.addListener('place_changed', ()=>{
let place = dropdown.get... | true |
4ad4c17e4728d5b5f6ba0fdab65ea9634211362a | JavaScript | wly731/phase-0 | /week-9/dom-manipulation/home_page.js | UTF-8 | 1,235 | 3.890625 | 4 | [
"MIT"
] | permissive | // DOM Manipulation Challenge
// I worked on this challenge with: Brett Ripley
// Add your JavaScript calls to this page:
// Release 0:
document.getElementById("release-0").className = "done";
// Release 1:
document.getElementById("release-1").style.display = "none";
// Release 2:
document.getElementsByTa... | true |
d5623d6503e8b1eb7f35b71734a13fa8b026ebe3 | JavaScript | hebohan/AccountsKeminl | /JS/target.js | GB18030 | 2,844 | 2.59375 | 3 | [] | no_license | //ѡ
function SearchAdapter(w,h)
{
var type = document.form1.all("BusinessType").value;
var url = "SelectAdapter.aspx?BusinessType=" + type;
var vsRe = window.showModalDialog(url,window,"dialogwidth:" + w + "px; dialogheight:" + h + "px");
if(vsRe != undefined && vsRe != null && vsRe != "")
{
var vals =... | true |
0581b8b040cdd472af5c680e0053d0c08921d921 | JavaScript | leopen-hu/js-tool-functions | /findItemInLoopList.js | UTF-8 | 735 | 2.9375 | 3 | [
"MIT"
] | permissive | import { forEach } from 'lodash';
export const isMatchIdentifier = (item, identifier) => {
let matched = true;
forEach(identifier, (value, key) => {
if (item[key] !== value) {
matched = false;
}
});
return matched;
};
export const findItemInLoopList = (list, identifier, loopPropName = 'children'... | true |
ceb8a7d1f9947e9397cc0cbd6bfe5ce3b253382b | JavaScript | shachafn/shachafn-sqe-workshop-2018-exercise-2 | /src/js/app.js | UTF-8 | 4,968 | 2.640625 | 3 | [] | no_license | import * as esco from 'escodegen';
import * as esp from 'esprima';
import $ from 'jquery';
import {getRoutes, getEnvironment} from './code-analyzer';
import {Parser} from 'expr-eval';
const BlockStatement = 'BlockStatement';
const IfStatement = 'IfStatement';
const WhileStatement = 'WhileStatement';
var result;
var p... | true |
054a02137867d917ed4a58efb6ad88284ad5f8bd | JavaScript | freethejazz/dlook-cli | /src/index.js | UTF-8 | 3,458 | 2.640625 | 3 | [
"MIT"
] | permissive | import axios from 'axios';
import meow from 'meow';
import chalk from 'chalk';
import ora from 'ora';
import terminalLink from 'terminal-link';
import Table from 'cli-table';
const addLatestTags = (image) => {
return axios.get(
`https://hub.docker.com/v2/repositories/library/${image.slug}/tags/`,
{
par... | true |
effbd57db00423a43a00eed320d6eee175c515ac | JavaScript | mmmaaatttttt/site_music_users | /routes/math.test.js | UTF-8 | 725 | 2.5625 | 3 | [] | no_license | const request = require("supertest");
const app = require("../app");
describe("math routes", () => {
it("GET /add works", async () => {
const response = await request(app).get("/add/7/5");
expect(response.statusCode).toEqual(200);
expect(response.body).toEqual({ total: 7 + 5 });
});
it("GET /multipl... | true |
527b080a88fac7f982e48353aed61fae9f808ed3 | JavaScript | xHrid/cannon-game.github.io | /index.js | UTF-8 | 6,543 | 3.25 | 3 | [] | no_license | const canvas = document.querySelector('canvas')
const c = canvas.getContext('2d') // C for Context it allows us to draw on Canvas
const scoreEl = document.querySelector('#score')
const startbtn = document.querySelector('.button')
const startGui = document.querySelector('.container')
const result = document.querySelecto... | true |
573960c64fefd6376b9976ae804a9b63417cca8e | JavaScript | NeilwHartley/Clock | /Clock.js | UTF-8 | 2,269 | 3.546875 | 4 | [] | no_license | class Clock {
static totalDegrees = 360;
static hoursOnClock = 12; //12hr clock
static minutesInHour = 60;
static morning = 8;
static evening = 16;
static midday = 12;
time = null;
whenClockStateUpdates = null;
nighttime = null;
daytime = null;
constructor () {
this.setTime(new Date());
}
setTime (... | true |
78f7b7603d8a30e6e7530740f64cc5ebe5858990 | JavaScript | Auri1979/rick-and-morty | /src/store/index.js | UTF-8 | 1,827 | 2.828125 | 3 | [] | no_license | import { createStore } from 'vuex'
export default createStore({
state: {
characters:[], // variable array para guardar todos los personajes
charactersFilter:[] //variable array para hacer consultas y filtros que vamos a guardar en nuesto proyecto
},
mutations: { //para poder modificar las states tenemos ... | true |