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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b56ed245d36f642d1d1f204b54e7566ea89f6830 | JavaScript | Muhnad/To-do-list | /main.js | UTF-8 | 1,772 | 3.390625 | 3 | [] | no_license | // Global Variables
var addBtn = document.getElementsByClassName("add-btn")[0],
todo = document.getElementsByClassName("todo-input")[0],
todoDate = document.getElementsByClassName("todo-input")[1],
todoForm = document.getElementsByClassName("todo-form")[0],
todoList = document.getElementsByClassName("to... | true |
1e431f5b7b11cec611ac73a0c95e4295422e70b9 | JavaScript | Penthious/blog.dev | /public/js/whackamole.js | UTF-8 | 1,830 | 3.203125 | 3 | [
"MIT"
] | permissive | var moleArray = [];
var moleIndex = 0;
var timeRemaining;
var randomSetNumber;
var scoreNumber = 0;
var randomNumber;
$('#startGame').on('click',function(){
getMoleImg();
})
//count down for the counter
$('#gameTime').change(function(){
timeRemaining = $('#gameTime').val();
});
var counterRemaining = setIn... | true |
16581bbbbbba017e38d37f3a01b12bc36ac08878 | JavaScript | monnhoccon/extensions | /webtruyen/page.js | UTF-8 | 344 | 2.640625 | 3 | [] | no_license | function execute(url) {
var data = [];
var doc = Http.get(url).html();
var pg = doc.select(".pagination li")
var totalPage = 1
if (pg.size() > 2) {
totalPage = pg.get(pg.size() - 2).text()
}
for (var i = 1; i <= totalPage; i++) {
data.push(url + "/" + i);
}
return ... | true |
5118873e52266bb7fe613f1713432661c07fd0f6 | JavaScript | mrdowden/cpl-2016-html5game | /game.js | UTF-8 | 6,497 | 2.78125 | 3 | [] | no_license | var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");
//context.fillStyle = "#f00";
//context.fillRect(270, 190, 100, 100);
var colors = [ "#ff0000", "#ee0000", "#dd0000", "#cc0000", "#bb0000", "#aa0000", "#990000" ];
var color = 0;
var keys = {
32: "space",
37: "left",
38... | true |
6d853abb62467513dfd7b3165300fed8198a476c | JavaScript | pritamhinger/ResponsiveWebsiteDevelopmentAndDesign_Week4 | /assignment.js | UTF-8 | 2,701 | 3.15625 | 3 | [] | no_license | // put your javascript code here
var categories_template, animals_template, all_animals_template, animal_template;
var current_category = animals_data.category[0];
var current_photo = current_category.animals[0].image1;
var current_image_src = current_photo
function showTemplate(template, data){
var html = templa... | true |
a6175cb84ba094c379de4f984769a4a17b20a3b1 | JavaScript | Michael-saeek/CRUD-Sistema-de-Produtos | /script.js | UTF-8 | 3,573 | 3.625 | 4 | [
"MIT"
] | permissive | class Produto {
constructor(id, nome, preco, ano) {
this.id = id
this.nome = nome
this.preco = preco
this.ano = ano
}
}
const listadeProdutos = []
class UserInterface {
constructor() {
}
Create(produto) {
const productTable = document.querySelector('.produto... | true |
640e5219359e3adb1ff2ef67b57fa6e626cd7013 | JavaScript | Noverish/codingtest-js | /src/baekjoon/11399.js | UTF-8 | 291 | 3.078125 | 3 | [] | no_license | const input = require('fs').readFileSync('/dev/stdin').toString().split('\n');
const people = input[1].split(' ').map(v => parseInt(v));
people.sort((a, b) => a - b);
console.log(people.reduce((prev, curr, i, arr) => {
return prev + arr.slice(0, i + 1).reduce((a, b) => a + b, 0);
}, 0)) | true |
1dfc8fb851cbdb0e69676d0bf4d62462b143aa1d | JavaScript | kirazzobu16/HowLongToDo | /src/Component/Context.jsx | UTF-8 | 854 | 2.546875 | 3 | [] | no_license |
import { createContext,useContext,useState} from "react"
import React from 'react'
const DoContext=createContext()
const getLocalTimes=()=>{
let list =localStorage.getItem("list")
if (list){
return JSON.parse(localStorage.getItem("list"))
} else {
return []
}
}
export const DoProv... | true |
4a6cc664cca21620984edcc41b8b12030c74049e | JavaScript | RodrigoRabeloBH/Sistema-de-Estacionamento | /js/app.js | UTF-8 | 1,863 | 3.046875 | 3 | [] | no_license | document.getElementById("formulario").addEventListener("submit",cadastrarVeiculo);
function cadastrarVeiculo(e){
var modeloCarro = document.getElementById("modeloCarro").value;
var placaCarro = document.getElementById("placaCarro").value;
var time = new Date();
if (modeloCarro==""||placaCarro=="") {
alert("Por... | true |
75760b03154ef7613807ab108b1eec23a2defdab | JavaScript | DarylPJ/HistoricalTrains | /screens/SearchScreen.js | UTF-8 | 7,493 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import {
ActivityIndicator,
Text,
Button,
View,
StyleSheet,
ScrollView,
TextInput,
Keyboard,
Alert,
} from "react-native";
import DateTimePicker from "@react-native-community/datetimepicker";
export default class SearchScreen extends Component {
constructor... | true |
518f24925f0ca9f13ce907026f7d2e6add59b6ee | JavaScript | JoseyDon/demo | /task118/js.js | UTF-8 | 4,112 | 2.828125 | 3 | [] | no_license | (function (){
var information = {
tdwidth:'150px',
tdHeight:'55px',
rowNum:'5',
colNum:'5',
thBgc:'#333',
border:'1px solid #ccc',
thcontent:['姓名','语文','数学','英语','总分'],
trcontent : [
['小明',80,90,70,240],
['小红',90,60,90,240],
['小亮',60,100,70,230],
['小强',100,70,80,250],
],
... | true |
9b923a4baad118198bbd7c6cb10d24e49a890fef | JavaScript | misaelbueno/trybe-exercises | /bloco_4-javascript/introducao-a-javascript-e-logica-de-programacao_1/descontoSalario(outraForma).js | UTF-8 | 1,013 | 3.046875 | 3 | [] | no_license | let aliquotINSS;
let aliquotIR = 0;
let salarioBruto = 1730;
// let salarioBruto = 3000;
// cálculo de destonto do INSS
if (salarioBruto <= 1556.94) {
aliquotINSS = salarioBruto * 0.08
} else if (salarioBruto > 1556.94 && salarioBruto <= 2594.92) {
aliquotINSS = salarioBruto * 0.09
} else if (salarioBruto... | true |
a0c0491b6eb701309c76c8706e1f5410d301ad3f | JavaScript | Kikec82/lab-javascript-memory-game | /js/memory.js | UTF-8 | 1,147 | 3.4375 | 3 | [] | no_license | class MemoryGame {
constructor(cards) {
this.cards = cards;
this.pickedCards=[];
this.pairsClicked= 0;
this.pairsGuessed=0;
// add the rest of the class properties here
}
shuffleCards(array) {
if (array === undefined ){
return undefined
}
var currentIndex = array.len... | true |
e9aecc2314e5f9bb196674c9a038d45eb0f37144 | JavaScript | Mvermouth/scrmVue | /frontend/scripts/utils/xml.js | UTF-8 | 1,012 | 2.640625 | 3 | [] | no_license | export function parseXml(xmlString) {
var xmlDoc = null
// 支持IE浏览器
if (!window.DOMParser && window.ActiveXObject) {
var xmlDomVersions = ['MSXML.2.DOMDocument.6.0', 'MSXML.2.DOMDocument.3.0', 'Microsoft.XMLDOM']
for (var i = 0; i < xmlDomVersions.length; i++) {
try {
xmlDoc = new ActiveXObject(xmlDomVers... | true |
61af403403490fbb68520034cd62824bcbe326dd | JavaScript | Harmeet-Singh19/Covid19-Tracker | /src/Table.js | UTF-8 | 1,323 | 2.6875 | 3 | [] | no_license | import React,{useState, useEffect} from 'react'
import './Table.css'
import numeral from 'numeral'
const sortData = (data,casesType) => {
let sortedData = [...data];
sortedData.sort((a, b) => {
if (a[casesType] > b[casesType]) {
return -1;
} else {
return 1;
}
});
... | true |
47d12d67c17b7c9682d116983fcba319e82297e3 | JavaScript | RavenOfSerenity/js_snake | /js_snake.js | UTF-8 | 4,304 | 2.953125 | 3 | [
"Beerware"
] | permissive | var KEY = {};
KEY.UP = 38;
KEY.DOWN = 40;
KEY.LEFT = 37;
KEY.RIGHT = 39;
var Game = function(canvasId) {
this.canvas = document.getElementById(canvasId);
this.ctx = this.canvas.getContext("2d");
this.defaultGridColour = COLOURS.BLUE;
this.defaultSnakeColour = COLOURS.YELLOW;
this.snakeGlowEffect = ... | true |
13850a0a9f713ab40caf72ebff4c8a4b423c897c | JavaScript | moiscmigu/BBS | /server/routes/functions/name.js | UTF-8 | 3,120 | 2.8125 | 3 | [] | no_license | let request = require('request'),
passport = require('../../../strategies/passport.strategy'),
userBookDB = require('../database/userBooksDB'),
booksDB = require('../database/abbrDB');
let username = process.env.BIBLEAPIKEY, //api key for bible.org,
password = process.env.PASSWORD;//password for api ... | true |
4c3c856e9b3a41392fcdb626fb142bcb56c6f6cd | JavaScript | smax253/adventofcode2020 | /day4/problem4a.js | UTF-8 | 562 | 2.765625 | 3 | [] | no_license | const fs = require("fs");
try {
const data = fs.readFileSync("input.txt", "utf8");
const reqFields = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"];
const parsedData = data
.split("\n\n")
.map((string) => string.replace(/\n/g, " "));
const valid = parsedData.filter((creds) => {
const fields = cr... | true |
f79e1293ac983bfbf166905e47ba076100064c07 | JavaScript | igormarcikic/execom | /src/Context/Context.js | UTF-8 | 1,439 | 2.578125 | 3 | [] | no_license | import React, { createContext, useReducer, useEffect } from 'react';
import reducer from './reducer';
import * as API from './../API';
import { setIDs, setStories, loading } from './actions';
export const Context = createContext();
const initialState = {
IDs: [],
stories: [],
comments: [],
lo... | true |
9180cd5ecab04771b7a464e7774419dbf6ef1690 | JavaScript | achyuthreddyi/javascript_basics | /maps_and_for.js | UTF-8 | 1,048 | 3.734375 | 4 | [] | no_license | var john = {
name: ' i am john',
age : 24,
isActive:true
}
var marry = {
name : ' iam marry',
age: 23,
isActive : true
}
var sam = {
name:' i am sam',
age: 29,
isActive: true
}
let users = new Map()
users.set('john1', john)
users.set('marry', ma... | true |
3cd2a5bc9952932869c2d129d4c49df33f9e780c | JavaScript | gamedevwebtools/gamedevwebtools.github.io | /js/tools/monitoring.js | UTF-8 | 1,937 | 2.671875 | 3 | [] | no_license | /**
* Delta time graph -
* plots raw and filtered(if present) dt for last N frames.
*
* Uses:
* tab with id profilingTimeGraphView.
*/
function FrameDtView() {
FrameDtView.superclass.constructor.call(this,
'profilingTimeGraphView',
[frameData.arrays.dt, frameData.arrays.rawDt],
{
labels:[["Frame start (... | true |
e5c41ca73030539216d6050cca552f5731a5b7e1 | JavaScript | onokokono/drag-and-drop-vanillaJS | /script.js | UTF-8 | 1,342 | 2.921875 | 3 | [] | no_license | window.addEventListener('load', () => {
const cards = document.querySelectorAll('.draggable');
const containers = document.querySelectorAll('.container');
cards.forEach(card => {
card.addEventListener('dragstart', () => {
card.classList.add('dragging');
});
card.addEven... | true |
224df17b8efa2328acb5875138db926e99a5c900 | JavaScript | ptzagk/redurx | /test/state/tree.js | UTF-8 | 3,614 | 2.8125 | 3 | [
"ISC"
] | permissive | import test from 'ava';
import Rx from 'rx';
import {
createState
} from '../../dist/state';
import {
createNode
} from '../../dist/state/node';
test('createLeaf observable should have initial value', t => {
const testVal = 2;
t.plan(1);
const state = createState(testVal)
state
.asObservable()
.su... | true |
144ab7e1057a43f297e344ec278a19ea9443148d | JavaScript | AracelyPrisga/Biblioteca_Test | /src/database.js | UTF-8 | 472 | 2.515625 | 3 | [] | no_license | // Objeto de conexion
//constante mysql
const mysql = require('mysql');
const myconnection= mysql.createConnection( {
host: 'localhost',
user: 'root',
password: 'password',
database: 'library'
});
myconnection.connect(function (err){
if(err){
console.log(err);
ret... | true |
817f591a8033b97f2578a22e71e7aa9ab307c553 | JavaScript | Masudchy95/es6-practice | /class.js | UTF-8 | 349 | 3.46875 | 3 | [] | no_license | // Class name always start with uppername.
class Student{
constructor(sId, sName){
this.id = sId;
this.name = sName;
this.status = "Muslim";
}
}
const student1 = new student(12, "Rimon");
const student2 = new student(11, "Raheel");
const student3 = new student(10, "Liza");
console.log(s... | true |
f56fe3bb0b853ef195134ed80ebf7aa59d3a86c8 | JavaScript | chandanws/javascript-basics | /008-logical-operators/logical-operators.js | UTF-8 | 683 | 4.375 | 4 | [] | no_license | // Examines 'return' behavior of || operator
var undefined;
var zero = 0;
var emptyString = "";
var greetingMessage = "Hello darkness my old friend";
var evaluatedResult = undefined || zero || greetingMessage || emptyString;
console.log(evaluatedResult); // prints value of greetingMessage variable
// Examines 'return... | true |
e87747a778c429eb1fe2247a6df4643350b14ed3 | JavaScript | peb7268/JavaScript | /aura-master/spec/js/mediator_spec.js | UTF-8 | 18,170 | 2.71875 | 3 | [
"MIT"
] | permissive | var SANDBOX1 = 'test_widget',
SANDBOX2 = 'test_sandbox2',
TEST_EVENT = 'stub';
define('sandbox_perms', ['aura_perms'], function(permissions) {
'use strict';
var channelPerms = {};
channelPerms[SANDBOX1] = {};
channelPerms[SANDBOX1][SANDBOX2] = true;
/* the above is equivalent to:
{
test_widget... | true |
1036da5a0cd6faf69e9c92d200b293819408b5e9 | JavaScript | ArshiaSaleem/Assignment2_JS_PIAIC67703 | /task2.js | UTF-8 | 292 | 3.328125 | 3 | [] | no_license | color=prompt("Enter traffic signal color: ");
if(color=="red")
{document.write("Must Stop");}
else if(color=="yellow")
{document.write("Ready to move");}
else if (color=="green"){
document.write("Move now");
}
else{
document.write("Enter correct color (i.e. red, green or yellow)");
} | true |
db03bf8b3ba58017fd8c63fd0690be32e97de3e1 | JavaScript | KinarOfficial/WEB-210-Final | /MyScript.js | UTF-8 | 2,423 | 3.15625 | 3 | [] | no_license |
var l = document.querySelector("#l");
var r = document.querySelector("#r");
var one = document.querySelector("#c1");
var two = document.querySelector("#c2");
var thr = document.querySelector("#c3");
var bgs = ["https://res.cloudinary.com/walkerh/image/upload/v1605208081/Splash%20Images/Akali_Splash_skr9bi.jpg", "htt... | true |
90bfbbe1ecdb6e0da62e311685126af312443dd8 | JavaScript | aaitken/modlets | /scripts/source/ama/augmentJson.js | UTF-8 | 154 | 2.859375 | 3 | [] | no_license | var augmentJson=function(jsonStr,augmentation){
jsonStr=jsonStr.slice(0,jsonStr.lastIndexOf('}'))+',';
jsonStr+=augmentation+'}';
return jsonStr;
} | true |
89619aeaa9eff9d1c562dfe664b0cbf17e1f83d4 | JavaScript | duki87/cars | /assets/js/user.js | UTF-8 | 9,122 | 2.65625 | 3 | [] | no_license | $(document).ready(function() {
session_message();
function session_message() {
var get_session_message = 1;
$.ajax({
url: "process/user_process.php",
method: 'post',
data: {get_session_message:get_session_message},
success: function(data) {
if(data !== '') {
var se... | true |
02f44b53fc8b0057273bd1385baa845625202715 | JavaScript | emilia-m26/html-css-js-practice | /event-practice.js | UTF-8 | 542 | 2.890625 | 3 | [] | no_license | console.log('it works');
const signupForm = document.querySelector('[name="signup"]');
signupForm.addEventListener('submit', function(event) {
event.preventDefault();
console.log(event.currentTarget.name.value);
console.log(event.currentTarget.email.value);
console.log(event.currentTarget.agree.checke... | true |
8c1c7d326ad771768cc20a1dcbf6bc3915e9781e | JavaScript | DevMaryan/ReactToDo | /src/components/App.js | UTF-8 | 1,438 | 3.203125 | 3 | [] | no_license | import React,{useState} from 'react';
import {Todos} from './Todos';
import '../css/style.css'
export function App(){
const [todos, setTodos] = useState([
{id:0, todoText:"React Course", done:false},
{id:1, todoText:"JS Course", done:false},
{id:2, todoText:"C# Course", done:false},
]);
const [newT... | true |
e304a6691f454ef1a0b9e14e903256ecfac9acfa | JavaScript | mlaanderson/firebase-budget | /webapp/dist/components/canvasreport.js | UTF-8 | 3,675 | 2.609375 | 3 | [
"ISC"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const report_1 = require("./report");
const events_1 = require("../controllers/events");
class CanvasSizeInt extends events_1.default {
constructor(size) {
super();
this.m_width = size ? size.width : 0;
this.m_heigh... | true |
21dceda663cf5b908fba64c607efdc38809052da | JavaScript | sanli/sharepage | /nodejs/data/maputils.js | UTF-8 | 15,517 | 2.734375 | 3 | [] | no_license | //maputils.js
var inspect = require('util').inspect,
http = require('http'),
isme = require('../sharepage.js').isme,
async = require('async'),
us = require('underscore');
// 从对象中提取loc对
function extractloc(data, opt){
var opt = opt || { lngname : '经度', latname : '纬度'};
var lng = parseFloat(data[opt.lngname]),
... | true |
ee59ca3bd97c199b5a0ccdbe7a1bf1debb5bff49 | JavaScript | ardyanfalah/simet-appi | /src/controllers/admin.controller.js | UTF-8 | 2,855 | 2.625 | 3 | [] | no_license | const Admin = require("../models/admin.model.js");
// Create and Save a new Customer
exports.create = (req, res) => {
// Validate request
if (!req.body) {
res.status(400).send({
message: "Content can not be empty!"
});
}
// Create a Customer
const admin = new Admin({
email_admin : req... | true |
d5bdd542146c96b297363c6d7139b40ea7c63123 | JavaScript | Parul-TTN/js_session | /js/q_4.js | UTF-8 | 203 | 3.1875 | 3 | [] | no_license | var employee = {
name: 'ABC',
city: 'city1',
department: 'd1'
};
var newEmployee = Object.assign(employee);
console.log('First Object: ',employee);
console.log('Second Object',newEmployee);
| true |
e1c3659cfc1d2f353185e61711c8fe5fcfaa445e | JavaScript | Vlad220994/ToDoList | /src/components/ItemAddForm/ItemAddForm.js | UTF-8 | 704 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import "./ItemAddForm.css"
export default class ItemAddForm extends Component {
state = {
label: ''
}
onChange = (e) => {
this.setState({
label: e.target.value
});
};
onSubmit = (e) => {
e.preventDefault();
this.props.onItemAdded(this.s... | true |
95607d89fab8b19ca8896eb87ba3851017eb6157 | JavaScript | dannyhannyford/Algos-and-Data-Structures | /AlgoExpert/graphs/youngestCommonAncestor.js | UTF-8 | 1,318 | 3.5625 | 4 | [] | no_license |
// Not optimal
// T-O(n) S-O(n)
function getYoungestCommonAncestor(topvsAncestor, descendantOne, descendantTwo) {
// d1 obj { node E: 0, node B: 1}
const d1Obj = {};
let d1 = descendantOne;
let d2 = descendantTwo;
// go through d1's ancestors
while(d1 !== null) {
d1Obj[d1.name] = d1;
d1 = d1.ancestor;
}
... | true |
6b4939e491bf3e2a62777c1f906804e6890c565b | JavaScript | JVBSouza/teste-ozmap | /src/controllers/userController.js | UTF-8 | 1,660 | 2.65625 | 3 | [] | no_license | const Users = require("../models/userModel");
const getAllUsers = async (ctx, next) => {
const page = Number(ctx.query.page || 0);
const size = Number(ctx.query.size || 10);
const user = await Users.findAll({
limit: size,
offset: page * size,
});
ctx.body = user;
};
const getUser = async (ctx, next)... | true |
660df5cf1b95efbd26bbc3411d7b33c1b973c042 | JavaScript | yahoo/dnscache | /examples/sample.js | UTF-8 | 1,519 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* Copyright (c) 2013, Yahoo! Inc. All rights reserved.
* Copyrights licensed under the New BSD License.
* See the accompanying LICENSE file for terms.
*/
var dns = require('dns'),
dnscache = require('../lib/index.js')({"enable" : true, "ttl" : 300, "cachesize" : 1000}),
now = Date.now(), now1;
//to ... | true |
5bed0b725da5ff2b7ea84e17df5008dc508242e0 | JavaScript | jmmostov/SkipTheLine | /controller/lineItem/lineItemGET.js | UTF-8 | 995 | 2.75 | 3 | [] | no_license | LineItem = require('../../models/LineItem');
module.exports = (req,res)=> {
// We create a new lineItem from the model which is based on the lineItem in the session. The question mark operator
// means that the thing before it is the condition. The first thing after the operator is the "if the condition is tr... | true |
2be619d08b968d276382962cab786b9b6053bfb3 | JavaScript | paralect/startup-summer-materials | /challenges/04-palindrome/index.js | UTF-8 | 1,358 | 3.03125 | 3 | [] | no_license | const isPalindrome = require('./palindrome');
const colors = require('colors');
const palindromeTestCases = [
"A but tuba.",
"A car, a man, a maraca.",
"A dog, a plan, a canal: pagoda.",
"A dog! A panic in a pagoda!",
"A lad named E. Mandala",
"A man, a plan, a canal: Panama.",
"A man, a plan, a cat, a ha... | true |
b3558bc9408a97b9cb2e5fc4c4ad793e37bbf6f6 | JavaScript | P4TY1977/prueba | /estructuracion01.js | UTF-8 | 220 | 2.703125 | 3 | [] | no_license | const nombre='Bambi'
const genero='Drama'
const clasificacion='A'
const pelicula=
{
nombre: nombre,
genero: genero,
clasificacion: clasificacion
}
console.log(pelicula)
console.log (JSON.stringify(pelicula)) | true |
20397ab4748781da9cd565322784b96a41f62fc2 | JavaScript | ranceliglesias/authuser | /app/routes.js | UTF-8 | 1,886 | 2.546875 | 3 | [] | no_license |
const Event = require('../app/models/event');
module.exports = function(app, passport) {
// Show the home page
app.get('/', (req, res) => {
res.render('pages/index.ejs');
});
// Show the profile page
app.get('/profile', isLoggedIn, (req, res) => {
res.render('pages/profile.ejs', {
user: req.u... | true |
81f41aed556a8aa648ebeacfb5023c88022d898f | JavaScript | AyyJ/GameDex | /public/final.js | UTF-8 | 16,113 | 2.578125 | 3 | [] | no_license | /*
* Firebase connection configuration.
*/
var config = {
apiKey: "AIzaSyCf9mEv6fjrsEk9ZryrfGZv-ygiBhpVt1Y",
authDomain: "gamedex-2d485.firebaseapp.com",
databaseURL: "https://gamedex-2d485.firebaseio.com",
storageBucket: "gamedex-2d485.appspot.com",
messagingSenderId: "1057082821990"
};
var ... | true |
bd491d8d6e380a79adbf9638a388275148ec600d | JavaScript | cujarrett/glimpse | /src/integrations/glimpse.test.js | UTF-8 | 3,297 | 2.9375 | 3 | [
"MIT"
] | permissive | import { getContributions } from "./glimpse.js"
let contributions
beforeAll(async () => {
contributions = await getContributions("cujarrett")
})
jest.setTimeout(10000)
test("(Integration) glimpse - All years data have twelve months", async () => {
for (const year of contributions) {
expect(year.data).toHave... | true |
61cf945a84fb56aafdc882792bcb674998ac6d08 | JavaScript | Serlomo/OpthiPharm | /Backend-OpthiPharm/server/routes/firebase.js | UTF-8 | 3,047 | 2.703125 | 3 | [] | no_license | const express = require("express"); //Importar express
const app = express();
const admin = require("firebase-admin"); //Importar el paquet de Firebase.
//Variable per portar les claus per poder-se connectar a la base de dades.
var serviceAccount = require("../../opthi-pharm-firebase-adminsdk-3kefy-74e6670030.json");... | true |
41cf691a98f0dbcef1762b2eaf5b7ce3e3ee40f1 | JavaScript | Nunnymolers/interro | /index.js | UTF-8 | 7,438 | 2.5625 | 3 | [] | no_license | /* The express module is used to look at the address of the request and send it to the correct function */
var express = require('express');
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var usermodel = require('./user.js').getModels();
var homeworkmodel = require('./hmwkuser1.js').getMod... | true |
bea8aac33620123f5691ae2e44c39b2e81581576 | JavaScript | crashb/javascript-analyzer | /test/fixtures/gigasecond/81/gigasecond.js | UTF-8 | 199 | 2.890625 | 3 | [
"MIT"
] | permissive | export const gigasecond = (date) => {
const startSeconds = date.getTime();
const timeLived = 10 ** 12;
const totalSeconds = startSeconds + timeLived;
return new Date(totalSeconds);
}
| true |
85321319efe1b8e0978f83d3ee72e694963986db | JavaScript | Osomhe1/hagman | /Js algebra/main.js | UTF-8 | 2,086 | 3.71875 | 4 | [] | no_license | var exp = new Expression ("x");
exp = exp(-3);
exp = exp("+x");
console.log(exp);
// var x = 5;
// var expr = new Expression("x");
// expr = expr.subtract(3);
// expr = expr.add("x");
// console.log(expr.toString());
// // 2x - 3
// var eq = new Equation(expr, 4);
// console.log(eq.toString());
// // 2x - 3 = 4
//... | true |
cb5eea36dc0b0fa7be5bcbb342e926099f5c8b63 | JavaScript | Benzeq/bootcamp-ex | /7Exercise 7_JavaScript Basics/5Guess_number/5Guess_number.js | UTF-8 | 237 | 3.609375 | 4 | [] | no_license | var userInput = prompt("try to guess! enter a number from 0-10:");
var compNum = Math.floor(Math.random() * 11);
console.log (compNum);
if (userInput == compNum) {
console.log ("GREAT SUCCESS!");
}
else {
console.log ("FAIL");
}
| true |
41f227f5b4afe3f680b4bd37f911970ed890cde1 | JavaScript | tomataso/examen2pabs | /examen2pabs/public/js/inicioSesion/auth.service.js | UTF-8 | 3,918 | 2.71875 | 3 | [] | no_license | function autenticarCredenciales (correo, contrasenna){
let listaUsuarios = getListaUsuarios();
let valido = false;
for (let i = 0; i < listaUsuarios.length; i++) {
if (listaUsuarios[i]["Correo"] == correo && listaUsuarios[i]["Contrasenna"] == contrasenna && listaUsuarios[i]["Desactivado"] != true) ... | true |
800013eb1f67d0e1ed4287e6688cd1edd7424246 | JavaScript | lxyqaq/html_css | /JavaScript/day04/02_循环语句.js | UTF-8 | 1,856 | 4.90625 | 5 | [] | no_license | /*
* 向页面中输出连续的数字
*/
/*var n = 1;
document.write(n++ +"<br />");*/
/*
* 循环语句:
* 通过循环语句可以反复的执行一段代码多次
*
* while循环
* - 语法:
* while(条件表达式){
* 语句...
* }
*
* - while语句在执行时,
* 先对条件表达式进行求值判断,
* 如果值为true,则执行循环体,
* 循环体执行完毕以后,继续对表达式进行判断
* 如果为true,则继续执行循环体,以此类推
* 如果值为false,则终止循环
*
* do... | true |
1316f38e18a63111dbbd672eb455d3e87d211a0e | JavaScript | demiazz/homey | /spec/fn/query.spec.js | UTF-8 | 801 | 2.5625 | 3 | [
"MIT"
] | permissive | import query from "../../src/fn/query";
describe("fn/query", () => {
afterEach(clearFixtures);
it("returns first child which matched by selector", () => {
useFixture(`
<div class="root" >
<div class="matched"></div>
<div class="other"></div>
</div>
<div class="matched"></div>... | true |
ef5741318cf3779034f926cd5e521a74137b9841 | JavaScript | g0blin2dex/teleport | /lib/pubkeys.js | UTF-8 | 915 | 2.8125 | 3 | [] | no_license |
/**
* Simple web service to serve public keys from a static directory.
* The directory contains a set of files; each filename is a user name, and the
* contents of the file are the public keys of that user.
*/
var express = require('express'),
dataStore = require('./dataStore')
;
var app = express();
app.get(... | true |
32e6c776ae3af14e90c51767797b6abd7ceb7a96 | JavaScript | devinleejones/stop-watch | /main.js | UTF-8 | 724 | 3.90625 | 4 | [] | no_license | var $myButton = document.querySelector('button')
var $watchNumber = document.querySelector('h3')
var currentTime = false
var intervalID;
function changeDigit() {
var elapsedTime = parseInt($watchNumber.textContent, 10)
if (currentTime === true) {
elapsedTime += 1 //
$watchNumber.textContent = elapsedTime
... | true |
6aeb1aa6401f8779da1f787a8f6ddf03dc1d4fe9 | JavaScript | tolustar/user-story | /src/pages/login/Login.test.js | UTF-8 | 727 | 2.609375 | 3 | [] | no_license | import { validateInput } from "./Login";
describe("login page", () => {
test("if email is empty", () => {
expect(validateInput("", "")).toEqual("Email is empty");
});
test("if email is valid", () => {
expect(validateInput("hello", "")).toEqual("Email is invalid");
});
test("if password is empty", (... | true |
ad87f04ee7dc7a29e153558f8677e1f67f810c79 | JavaScript | reynaldysaputra/covid-app | /src/application.js | UTF-8 | 4,609 | 2.8125 | 3 | [] | no_license | import {addCommas} from './scriptAnimate.js';
const getApi = async (api) => {
try {
const response = await fetch(api);
const responseJson = await response.json()
return responseJson;
} catch (err) {
console.log(err)
}
}
const getDataAll = () => {
getApi('ht... | true |
4e052c7557ccf0f05a2c7bc1f4386f9628f1b3aa | JavaScript | Al-0/La_lista_del_super | /public/test.js | UTF-8 | 394 | 2.640625 | 3 | [
"MIT"
] | permissive | console.log(firebase);
//
var article_id = 1;
var article = {
'title': 'Conectar Firebase con tu app de JavaScript',
}
firebase.database().ref('Data/' + article_id).set(article);
firebase.database().ref('Data/' + article_id).once('value').then(
function(snapshot){
va... | true |
fd78699f0f582ae5b634d28430dd42787ee0b233 | JavaScript | the-real-izcon/adventofcode | /2020/day1/fix.js | UTF-8 | 720 | 2.609375 | 3 | [] | no_license | const EXPECTED_SUM = 2020;
module.exports = {
fix2: (report) => {
for(let i = 0; i < report.length; i++){
let item1 = report[i];
let item2 = EXPECTED_SUM - item1;
if(report.includes(item2)) return item1 * item2;
}
return 0;
},
fix3: (report) ... | true |
4c97599de9ed39d20d527456bf45201897ecb775 | JavaScript | SilkRoad-DS4/server | /client/lib/local/GUI/RenderableObject.js | UTF-8 | 2,986 | 2.90625 | 3 | [] | no_license | function RenderableObject(){
//Javascript work around, silly multiple inheritence rules
this.RenderableObject = true;
//Name
this.name = "";
//Position
this.x = 0;
this.y = 0;
this.z = 0;
//Dimensions
this.height = 0;
this.width = 0;
//Visual Options
this.opacity = 1; //Unsupported
this.visible = ... | true |
096ad0d83139be06b4625d1e3e85cb39c2b7e77d | JavaScript | deakin-launchpad/memories-that-make-us-archive-fe | /src/helpers/data/TextHelper.js | UTF-8 | 751 | 3.171875 | 3 | [] | no_license | class TextHelper {
/**
*
* @param {String} str String to Translate
*/
sentenceCase = str => {
str = String(str);
str = str.toLowerCase();
return str.replace(/[a-z]/i, (letter) => letter.toUpperCase()).trim();
}
titleCase = (str) => {
str = String(str);
str = str.toLowerCase().s... | true |
0dfbe792d13592dd82202ab0333b7166946114e3 | JavaScript | chenmengyang/learning_dairy | /Web_Spider/nodejs_scraper_houses/test.js | UTF-8 | 1,342 | 2.609375 | 3 | [] | no_license | let http = require('http');
let url = 'http://www.etuovi.com/homes-for-sale?rd=50&page=1';
let cheerio = require('cheerio');
http.get(url, (res) => {
const statusCode = res.statusCode;
let error;
if (statusCode !== 200)
{
error = new Error(`Request Failed.\n` + `Status Code: ${statusCode}`);
... | true |
97b3847050c8f9a6beff7a060a431e24db2de55b | JavaScript | gabrielmonteiro00/cadastro-itens | /functions.js | UTF-8 | 4,293 | 2.703125 | 3 | [] | no_license | $(function () {
var tableItens = localStorage.getItem("tableItens");
tableItens = JSON.parse(tableItens);
if (tableItens === null)
tableItens = [];
function Create() {
var item = JSON.stringify({
Desc: $("#txtDesc").val(),
Medida: $("#txtMedida").val(),
Quantidade: $("#txtQ... | true |
75c7b27e18cc2b123d2dec0f27b508ea47046fb1 | JavaScript | AndresRojas0/gravity3d | /gravity3d_files/universe.js | UTF-8 | 2,889 | 3 | 3 | [] | no_license | const EPS2 = 1.0; // Originalmente: 1.0
const one_256 = 0.001953125 // Originalmente es el cociente: 1/256 = 0.00390625
// Función rápida para inversa de raíz cuadrada ("Fast inverse square root")
var y = new Float32Array(1);
var i = new Int32Array(y.buffer);
function invSqrt(x) {
var x_2 = x * 0.5;
y[0] = x;
i[... | true |
3b3baeaf3ab98d3e34e07174b861c658b9de8891 | JavaScript | jaronbarends/employee-stats | /js/employee-nodes.js | UTF-8 | 8,581 | 2.78125 | 3 | [] | no_license | window.app = window.app || {};
window.app.nodes = (function($) {
'use strict';
let app = window.app;
// vars for employee nodes
let elements = {
nodes: null,// d3 selection of all employee nodes
defaultNodeSize: 8,
nodeSize: 8,
defaultNodeSpacing: 3,
nodeSpacing: 3,
infoProp: '',// property to be sh... | true |
bdab8e68530fe6c213795d03d2a8a2f504096602 | JavaScript | kmamun/Pigging-Out-All-The-Way-Catering-Services | /scripts/imageRotation.js | UTF-8 | 621 | 3.671875 | 4 | [] | no_license | //rotate.js
var prefix = "images/pigging";
//Use that prefix to put the proper sequence of image filenames into an array
var imageArray = new Array(18);
for (i=0; i<imageArray.length; i++)
imageArray[i] = prefix + (i+1) + ".png";
//Rotate the images in the array
var imageCounter = 0;
function rotate()
{
... | true |
9b66224ad36526570e99837f55791c073135787a | JavaScript | masteribro/Converter | /review/converter.js | UTF-8 | 187 | 2.6875 | 3 | [] | no_license | function displayDate(){
document.getElementById("demo").innerHTML = toCelsius();
function toCelsius(f) {
var f = parseInt(myform.quantity.value);
return f*380;
}
} | true |
2e2dde7cabc7b4dc164dc901f24e922e47b87cb0 | JavaScript | Arbiter-glitch/libraryapp | /src/routes/bookRoutes.js | UTF-8 | 1,136 | 2.53125 | 3 | [] | no_license |
const express=require("express");
const booksRouter=express.Router();//new Route handler
function router(nav){
var books=[
{
title:'Tom & Jerry',
author:'Joseph Barbara',
genre:'Cartoon',
img:"tom.jpg"
},
{
title:'Harry Potter',
author:'JK Rowl... | true |
39c3e645aa84cb9cf18a7e95086b54b1828f6870 | JavaScript | tober65/Weather-Dashboard | /script.js | UTF-8 | 5,734 | 3.375 | 3 | [
"MIT"
] | permissive | var APIKey = "4c2e4d333c6901d5121a0e53238cf3ea";
var cityList = [];
var cityListString = localStorage.getItem("cityList");
if (cityListString !== null) {
cityList = JSON.parse(cityListString);
}
$("#history-buttons-div").empty();
for (var i = 0; i < cityList.length; i++) {
var newBtn = $("<button>");
ne... | true |
173b3ad4397a2da619d030d3123f6403978610e4 | JavaScript | alexpunky/erzatz-website | /src/js/Game.js | UTF-8 | 12,165 | 2.65625 | 3 | [] | no_license | /**
* Created by alex on 22/02/2015.
*/
this.erzatz = this.erzatz||{};
(function(Erzatz)
{
"use strict";
/**
* @param width
* @param height
* @param canvas_name
* @constructor
*/
Erzatz.Game = function (width, height, canvas_name) {
this.width = width;
this.heig... | true |
64d6fcd283426591727c0fbe31a3e4cb13b7522e | JavaScript | addedjacky/logality | /test/spec/pipe.test.js | UTF-8 | 5,728 | 2.609375 | 3 | [
"ISC"
] | permissive | /**
* @fileoverview Test the pipe interface.
*/
const Logality = require('../..');
const { stubLogality, cooldown } = require('../lib/tester.lib');
describe('pipe interface', () => {
stubLogality();
test('Will pipe one logality instance to another', () => {
const output = jest.fn();
const logalityChild ... | true |
f5c196ad2fb6bc62959131461dd4b5750c75f3f4 | JavaScript | LawrenceLeitgib/VideoGame | /Video Game 3/src/basicEnemy.js | UTF-8 | 2,340 | 3.046875 | 3 | [] | no_license | class BasicEnemy {
constructor(game, position, speed, live, color, money = 1) {
this.game = game;
this.width = 50;
this.height = 50;
this.position = {
x: position.x,
y: position.y
};
this.speed = {
x: speed.x,
y: speed.y
};
this.markedForDeletion = false;
th... | true |
6b12ba48332df3f924b5792aa2c3975846dc0867 | JavaScript | ihmeuw/ihme-ui | /src/utils/animate.js | UTF-8 | 2,503 | 2.703125 | 3 | [
"MIT"
] | permissive | import {
get,
includes,
map,
reduce,
} from 'lodash';
export function animationStartFactory(animate, processor) {
// Upon initialization, `start` cannot animate, but is required by `react-move`
const PHASE = 'start';
return (data, index) => reduce(
processor(data),
(accum, value, key) => {
... | true |
a440bd3156f75c853caef34ac28a93b98e7d4edf | JavaScript | TheSleepingAssassin/CodeFolder | /Discord/PokeBot/bot.js | UTF-8 | 605 | 2.78125 | 3 | [] | no_license | const Discord = require('discord.js');
const client = new Discord.Client();
client.login('Nzc1Mzk5ODQzODQ0NzE4NjIz.X6lxYQ.akcPowk-4eQ7z1fB-4rIkj9N5-s');
client.on('ready', () => {
console.log("working");
});
client.on('message', (msg) => {
if (msg.content == 'Ping') {
msg.reply("Pong");
}
if (msg.content == "H... | true |
6bd83215c90383327b9d852674bd7e99109b8e5b | JavaScript | cephalopodMD/whos-a-good-dog | /src/edu/virginia/engine/display/DisplayObjectContainer.js | UTF-8 | 2,370 | 2.84375 | 3 | [] | no_license | "use strict";
/**
* A very basic display object for a javascript based gaming engine
*
* */
class DisplayObjectContainer extends DisplayObject{
constructor(id, filename){
super(id, filename);
this.children = new ArrayList();
this.hidden;
}
/**
* Manage children
*/
addChi... | true |
71bb656648c9e1fbbc3c9337287dfd90bd217ad7 | JavaScript | krzycho2/psychotest-web2 | /psychotest-web/wwwroot/js/site.js | UTF-8 | 1,864 | 2.765625 | 3 | [] | no_license | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
function check_survey_enable() {
if (
document.querySelector('input[title=q2]:check... | true |
2e3ff0c4c0808575888ad29c975fc1167977079b | JavaScript | jerrywdlee/youtube-mp3-getter | /utils/url_helper.js | UTF-8 | 2,073 | 2.515625 | 3 | [] | no_license | 'use strict'
const cheerio = require('cheerio')
const r2 = require('r2')
const fetch = require('node-fetch') // installed by r2
const _ = require('lodash')
const getVideoId = (youtubeUrl) => {
// youtubeUrl likes https://www.youtube.com/watch?v=i62Zjga8JOM
// OR like https://youtu.be/30Ef7i3qq-U
let videoId = '... | true |
d42ccf4b953530c75513151490f952ef990286ca | JavaScript | kylepw/m121 | /chapter4/bucket_stage.js | UTF-8 | 1,074 | 2.75 | 3 | [
"MIT"
] | permissive | // showing that without a default, this can error if values can't be resolved
db.movies.aggregate([
{
"$bucket": {
"groupBy": "$imdb.rating",
"boundaries": [0, 5, 8, Infinity]
}
}
])
// protecting against the error
db.movies.aggregate([
{
"$bucket": {
"groupBy": "$imdb.rating",
... | true |
dcd4944cda6b1f9dec76b83a1db5f79bb6ed506b | JavaScript | RichardMarkRoss/bootcamp-tests | /findItemOver20.js | UTF-8 | 340 | 2.953125 | 3 | [] | no_license | function findItemsOver20(item){
//console.log(item)
// var num = 0;
var man = [];
//var name = '';
for(var i = 0; i < item.length; i++){
var theitem = item[i];
//console.log(theItem);
if(theitem.qty > 20){
man.push(theitem)// = theitem.length;
//name = theitem;
console.log(man)
}
... | true |
8e671799bacd8ecb2893762357f51852d4de6157 | JavaScript | ArthurRougier/soundpark2 | /js/components/SongList.js | UTF-8 | 5,727 | 2.578125 | 3 | [] | no_license | // React
import React from 'react';
import ReactDOM from 'react-dom';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import Song from './Song';
export default class SongList extends React.Component {
render() {
var genreData = this.props.genreData;
var occasionData = this.pr... | true |
ab403fd8201a72b8564f4849e6f423a34df672b9 | JavaScript | vanderson-henrique/trybe-exercises | /BACK-END/BLOCO_27/27_1/exercises/user_register_mysql/router/userRouter.js | UTF-8 | 1,670 | 2.703125 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const User = require('../model/User');
router.post('/', async (req, res) => {
const { first_name, last_name, email, password } = req.body;
if (!User.isValid(first_name, last_name, email, password))
return res.status(200).json({ message: 'Da... | true |
5cb2a866666bdbbcaea5b0124f98326883b7c608 | JavaScript | AguzzTN54/buffetary | /src/scripts/Views/Components/StarRating.js | UTF-8 | 609 | 2.671875 | 3 | [] | no_license | import '../../../styles/Star-Rating.scss';
class StarRating extends HTMLElement {
connectedCallback() {
const rating = this.getAttribute('data-rating');
const persenRate = (rating / 5) * 100;
this.innerHTML = `<span class="star">
<i class="bi bi-star"></i>
<i class="bi bi-star"></i>
<i ... | true |
1f5c21712576851c37dc73b063a82d79450ee08a | JavaScript | gallasha/web-dev | /week2/sum.js | UTF-8 | 649 | 3.921875 | 4 | [] | no_license | function range(start, end, inc=(end < start) ? -1: 1) { //inc is default 1, -1
let r = []; //initialize an empty array
if(inc >= 1) {
//positive inc loop
for (let i = start; i <= end; i += inc) {
r.push(i); //add the value to the back
//r[i - start] = i; //this works too
}
} else {
//negative inc ... | true |
fa653a2f24bdec93ba1f52eedd658e42552932b1 | JavaScript | javatarz/the-eod-machine | /app/assets/javascripts/team_locations_view_model.js | UTF-8 | 606 | 2.625 | 3 | [] | no_license | function TeamLocationsViewModel(rawTeamLocations, time, sliderBuilder) {
var self = this;
self.teamLocations = initializeTeamLocationsFrom(rawTeamLocations);
self.timeZoneChanged = function () {
var firstTeamLocationFriendlyTimeZone = self.teamLocations[0].timeZone();
self.teamLocations.forEach(functio... | true |
17d2db6ecbb14a0d9d92fe74a07b7f63c995b830 | JavaScript | nancybarea/codoAcodoFSJ | /E07_javascript.js | UTF-8 | 166 | 3.046875 | 3 | [] | no_license | var primera=40
var segunda=16
var sumaTotal = primera + segunda
document.write ("<h1>El resultado de la suma de las dos variables es: </h1> <p>" + sumaTotal + "</p>") | true |
a62e9eb53d4868cc6dcf2bc1ec130c37885b9a2f | JavaScript | IG-Kim2511/practice-me_2021-0903_note_taking-js-folder | /script.js | UTF-8 | 3,144 | 3.1875 | 3 | [] | no_license | "use stirct"
//🍀
const titleInput = document.querySelector('.title_input');
const noteInput = document.querySelector('.note_input');
const noteAlert = document.querySelector('.note_alert');
const submitBtn = document.querySelector('.submit');
const clearAllBtn = document.querySelector('.clear_all');
const noteNew =... | true |
a0b27d18657191e781be56a00b87e973363d4757 | JavaScript | slanaghen/AspenRental | /public/controllers/unitFactory.js | UTF-8 | 2,507 | 2.6875 | 3 | [] | no_license | angular.module('AspenRental')
.factory('arUnitFactory', arUnitFactory);
arUnitFactory.$inject = ['$http'];
function arUnitFactory($http) {
console.debug('arUnitFactory loaded');
var UnitFactory = {
units : [],
unitTypes : [],
availableUnitTypes : [],
getUnits : getUnits,
... | true |
073faa9f22ba77f03585c81ade37bd9b27a53227 | JavaScript | thinkful-ei26/trisha-HotCold-v1 | /src/GuessSection.js | UTF-8 | 846 | 2.59375 | 3 | [] | no_license | import React from 'react';
import GuessCount from './GuessCount'
import Feedback from './Feedback';
export default function GuessSection(props) {
const guesses = [
{ userGuess: '9', history: "['23', '32', '50']" },
{ userGuess: '25', history: "['1', '5', '9']" }
];
const guess = guesses.map( (guess, i... | true |
1d8208304aab84053f0ba3fd3f11fc6d46b3eac3 | JavaScript | andyfusniak/jobboard-js-sdk | /lib/jobs.js | UTF-8 | 1,600 | 2.640625 | 3 | [] | no_license | const Jobs = function (raw) {
Jobs.raw = raw;
};
/**
* Create a new job post.
* @param {object} params - The job post listing.
* @param {string|null} [jobId] - (optional) job identifier if this post is to be associated with a particular advertiser.
* @param {string} params.uri - The job URI e.g. 'senior-dev-gola... | true |
92dd05f0af5b42d970b3f86dc0f57246c70e3858 | JavaScript | priyeshbhawsar15/tara | /tara/templates/logic.js | UTF-8 | 358 | 3.140625 | 3 | [] | no_license |
var walkieTalkieButton = document.querySelector('.walkie-talkie');
walkieTalkieButton.addEventListener('mousedown', buttonDown, false);
walkieTalkieButton.addEventListener('mouseup', buttonUp, false);
function buttonDown() {
walkieTalkieButton.classList.add('down-state');
}
function buttonUp() {
walkieTalkieBu... | true |
2967924cdbdf5afa1976970ee9f14a9f53617613 | JavaScript | Wespx/registration-authorization | /script.js | UTF-8 | 3,909 | 3.296875 | 3 | [] | no_license | 'use strict';
const username = document.getElementById('username');
const registerUser = document.getElementById('registerUser');
const login = document.getElementById('login');
const list = document.getElementById('list');
let users = [];
const validName = function(str) {
const nameReg = /^[-а-яА-ЯёЁ\s]+$/;
retu... | true |
a17b14c57603340194b603ea456967518cd228de | JavaScript | jedpimentel/stuff | /practice/04_heap.js | UTF-8 | 2,720 | 3.890625 | 4 | [] | no_license | // Implement a Heap including its helper methods: Get Min, Insert, and Remove
// const zeroIndexed = {
// parent:
// left:
// right:
// }
// const oneIndexed = {
// parent:
// left:
// right:
// }
// {
// class minHeap {
// constructor(value = null) {
// this.value = value;
// this.size = value === null ... | true |
8cee804d11c959e9eb473185f222b0b1dc93494e | JavaScript | baarath9829/Detail_Display | /src/component/Signin.js | UTF-8 | 1,900 | 2.625 | 3 | [] | no_license | import {useState} from 'react';
import {Button, Form, FormFeedback, FormGroup, FormText, Input, Label} from 'reactstrap';
import './Signin.css';
const Signin = ({setLogin}) => {
const [email, setEmail] = useState("")
const [password, setPassword] = useState("")
const login = async () => {
const dat... | true |
7866077cde48aa4d88bfe36bdc795bcbe859f72c | JavaScript | Andylaugh1/hw_pubsub_requests_countries | /src/views/country_select_view.js | UTF-8 | 842 | 2.796875 | 3 | [] | no_license | const PubSub = require('../helpers/pub_sub');
const Country = require('../models/country')
const CountrySelectView = function(element) {
this.element = element;
};
CountrySelectView.prototype.bindEvents = function () {
PubSub.subscribe('Country:country-loaded', (event) => {
const allCountries = event.detail;
... | true |
321ad1df44fabf4be04b71e57acc663a40912cfd | JavaScript | shansen5/Javascript-todo | /todo-app.js | UTF-8 | 1,265 | 2.828125 | 3 | [] | no_license | 'use strict'
let todos = getStoredTodos()
document.querySelector( '#show-completed' ).checked = false
const filters = {
search: '',
sortBy: 'byEdited',
showCompleted: false
}
const summary = document.createElement( 'h3' )
document.querySelector( '#selected-todos' ).appendChild( summary )
render( todos, f... | true |
39af30e4269e13f73adab6c2b5b83ea5d6aeb2c7 | JavaScript | Lyapunov/html5-canvas-fun | /test/item-20-game-of-life-lib-test.js | UTF-8 | 1,312 | 2.546875 | 3 | [
"MIT"
] | permissive | var buster = require("buster");
var assert = buster.referee.assert;
var subj = require("../item-20-game-of-life-lib");
buster.testCase("Game of life lib", {
setUp: function() {
this.game = new subj.GameBoard();
},
"lonely cell dies" : function() {
this.game.addCell(1,1);
this.game.tick();
... | true |
6f94b2956d77858c35aee4a1e10ef9b95773cfd8 | JavaScript | shifu13/BachelorProjectImprovements | /client/src/View/ProfileInformation.js | UTF-8 | 3,064 | 2.546875 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import Axios from "axios";
import { TokenContext } from "../Component/TokenProvider";
import { Col } from "react-bootstrap";
import axios from "../AxiosConfig";
function ProfileInformation() {
const {
token,
userID,
handleRemoveToken,
userFirstName,... | true |
9bf5952527471f78f30bd02da307285cdf4cd5dc | JavaScript | Tonypdesigns/flycatcha | /js/core/login.js | UTF-8 | 1,430 | 2.78125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | $( document ).ready(function() {
// Handler for .ready() called.
var auth_user = "flycatch";
var auth_pass = "Catcha123";
$('.login-btn').click(function(){
var username = $("#username").val();
var password = $('#password').val();
//Check if user filled out username
if(!username){alert('Please ... | true |