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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a478a2e8826fdabbe4cf5654e2ee423d01d0d5de | JavaScript | fan1992619/bookhtml | /Debug/17/02/js/js.js | UTF-8 | 304 | 2.796875 | 3 | [] | no_license | // JavaScript Document
var question=document.getElementById("question");
var answer=document.getElementById("answer");
var result=document.getElementById("resultA");
function save(){
localStorage.setItem(question.value,answer.value);
}
function see(){
alert(sessionStorage.getItem(question.value));
}
| true |
6f1114255eb3cd3d7c17d4b5b1b79ddbb4f8dcd1 | JavaScript | dejakob/node-alegrify-server | /api/day-in-review.js | UTF-8 | 1,623 | 2.578125 | 3 | [
"MIT"
] | permissive | const { findInDatabase, findMultipleInDatabase, saveToDatabase } = require('../services/database');
const { logError } = require('../services/logger');
/**
* Day in Review API
* @param {Express} app
*/
function DayInReviewApi(app) {
app.post('/api/day-in-review', postDayInReview);
/**
* Create new Da... | true |
85d3e96ba7b684d6be6effd0bddd2e8256262b83 | JavaScript | tsharon-byte/client-side-form-updated | /src/components/EmployeeListProvider.js | UTF-8 | 2,367 | 2.859375 | 3 | [] | no_license | import React, {useEffect, useState} from "react";
import PersonList from "./PersonList";
const EmployeeListProvider = () => {
const [employeeList, setEmployeeList] = useState([]);
const [deleted, setDeleted] = useState(false);
useEffect(() => {
rest();
}, [deleted]);
async function handleD... | true |
2ff078e1991d03d4d5bbc8532e67e4a942a61484 | JavaScript | sayakura/code_snippet | /app.js | UTF-8 | 5,912 | 2.6875 | 3 | [] | no_license | /**
* ================== README ==================
* This is a simple endpoint that takes in a userId token(jwt token) and
* a profileImage(base64 string), it will generate 2 smaller
* version of the original image and store them on Amazon S3(distributed blob store)
* unnecessary code was removed to make it simp... | true |
a21fdc363301a4c82f4bbf45f31822a9674225a3 | JavaScript | monicamarroyo/Robots2 | /src/components/Card.js | UTF-8 | 647 | 2.65625 | 3 | [] | no_license | import React from 'react';
//templating string, we can randomize the robots we get using this url `https://robohash.org/test?200x200` we use test bcs it give us radom robot but if we use robots.id it gives us a new robot all the time
//(props) = props.name , props,email but we destructred it before
const Card = ({name... | true |
22e07b9b42f0ed9ce1a1bff9b326b8dacb123290 | JavaScript | dzheng24/warmup-daily | /feb-2020/2-25/array.js | UTF-8 | 593 | 4.625 | 5 | [] | no_license | const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
function forLoop(arr) {
for (let i = 0; i < arr.length; i++) {
console.log(arr[i]);
}
}
function whileLoop(arr) {
let counter = 0;
while (counter < arr.length) {
console.log(arr[counter]);
counter++;
}
}
function plusSeven(arr) {
let result = a... | true |
9778defea6d093d054ce6f5cce88f7601460bfdc | JavaScript | weiketa/numbers_game_of_TDD | /practice_template/src/CompareNumber.js | UTF-8 | 591 | 3.046875 | 3 | [] | no_license | /**
* Created by voctor on 14-7-29.
*/
function CompareNumber() {
}
CompareNumber.prototype.compare_number=function (answer_number,input_number) {
var a_count=0,b_count=0;
console.log(answer_number)
for(var i=0;i<answer_number.length;i++){
if(answer_number[i]==input_number[i]){
a_coun... | true |
37fc1811cc110a1669620b9628aab81af4149093 | JavaScript | user24/jqlite | /jqlite.js | UTF-8 | 10,596 | 3.015625 | 3 | [
"MIT"
] | permissive | var $$ = function jqueryLite(arg) {
var displayDefaults = {};
function hyphenatedToCamelCase(ruleName) {
// from https://stackoverflow.com/a/6661012
return ruleName.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); });
}
// Takes a DOM element and adds some methods to it
// Setters retu... | true |
6159704be9696d50d35cb2b3e71817b2845e4927 | JavaScript | coderdba-coding-org/reactjs | /various/various01/src/ReactChart01/components/AxiosGraph01-v00-working.js | UTF-8 | 5,828 | 3.609375 | 4 | [] | no_license | //https://www.digitalocean.com/community/tutorials/react-axios-react
import React from 'react';
import axios from 'axios';
import { Line } from "react-chartjs-2"
export default class AxiosGraph01 extends React.Component {
state = {
persons: [],
personNames: []
}
componentDidMount() {
axios.get(`h... | true |
60c3566767b403bf2c6d471f309eb2fbcebdc43f | JavaScript | HairyCap/JSFunctional | /JsFunFundamental/unless.js | UTF-8 | 134 | 2.671875 | 3 | [] | no_license | //if predicate is false, run fun
const unless = (fun, predicate) => {
if (!predicate) {
fun();
}
};
module.exports = unless;
| true |
a86efe386619d11730ecbe205b0d4e1d7480d062 | JavaScript | JessicamHenderson/JessicamHenderson.github.io | /JSEvent.js | UTF-8 | 1,359 | 2.921875 | 3 | [] | no_license | document.getElementById("makeBigger").addEventListener("mouseenter", bigImg);
document.getElementById("makeBigger").addEventListener("mouseleave", smallImg);
function bigImg() {
document.getElementById("makeBigger").style.height = "600px";
document.getElementById("makeBigger").style.width = "800px";
}
functio... | true |
c22e2164e248c57d4d972411a6c0b40159f30183 | JavaScript | Lomelve/chatPart | /index.js | UTF-8 | 1,574 | 2.53125 | 3 | [] | no_license | var app = require("express")();
var http = require("http").Server(app);
var io = require("socket.io")(http);
mongoose = require('mongoose')
var onlineuser ={};
app.get("/",function(req,res){
res.sendFile(__dirname+"/index.html");
});
io.sockets.on("connection",function(socket){
//users.push(socket);
// console.log... | true |
871c78dd738d85a22a87bdd720b639bb7f7e05d1 | JavaScript | fizdalf/javascript-teachings | /Avismis/while/while.exercise3.solutions(shows.longest.word).js | UTF-8 | 481 | 4.625 | 5 | [] | no_license | // Crea un programa que recibe una lista de palabras, imprime la más larga, sabiendo que los strings son también listas! ("hola".length -> 4)
const arguments = process.argv;
let index = 3;
const lastIndex = arguments.length - 1;
let longestWord = arguments[2];
while (index <= lastIndex) {
let word = arguments[ind... | true |
4d36006f86d8ad8fe6b8142a173d5bad8a9076b5 | JavaScript | kosiokarchev/libcat | /scripts/locs.js | UTF-8 | 3,755 | 2.578125 | 3 | [] | no_license | var lastUpdate = 1471002010778;
var locdivs;
if (typeof(Storage)=="undefined") {
locdivs = JSON.parse(loadLocs());
console.log("Getting locs");
} else {
if (!window.localStorage.locLoadDate || parseInt(window.localStorage.locLoadDate) < lastUpdate) {
window.localStorage.locdivs = loadLocs();
... | true |
686767d8bd0de211b85efe3846cabdee86dec534 | JavaScript | YeatsMar/Blog | /WebContent/blog.js | UTF-8 | 2,876 | 2.78125 | 3 | [] | no_license | //like
function like(isLike, userId, articleId) {
var like = document.getElementById("like");// component to use its
// innerHTML
// AJAX
var xhr = new XMLHttpRequest();
xhr.open("post", "Blog", false);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("isLike=" + en... | true |
8efbd242d7f9eb44c3af56a9fadc4f3cf630a3fc | JavaScript | yywwone/js-jq-chajian | /模版/360/JS/shop-slider.js | UTF-8 | 1,380 | 2.515625 | 3 | [] | no_license | // JavaScript Document
//360商城轮播
$(function(){
var len2=$('.shop-slider li').length;//获取焦点图个数
var index2=0;
var picTimer2;
$('.shop-slider_nav li').mouseover(function(){
index2=$('.shop-slider_nav li').index(this);
showPics2(index2);
});
//上一页按钮
$('.pre1').click(function(){
index2-=1;
if(index2==-1... | true |
dbd02b102bb95923aac281dd748299b0bd85cf8f | JavaScript | Brant-Liang/javascript_fullstack | /interview/baidu/3.promise.js | UTF-8 | 857 | 3.734375 | 4 | [] | no_license | function divide(numerator, denominator) {
return new Promise((resolve, reject) => {
if (typeof numerator !== 'number' || typeof denominator !== 'number') {
reject(new Error('Must be number!'));
}
console.log('After validating type...');
if (denominator === 0) {
reject(new Error("Cannot div... | true |
af62a122b32513e85513e2b62cff81c37a5efeca | JavaScript | yanbxice/robot-race | /Sachit/Assets/Scripts/UI/controlsMenu_btn_scr.js | UTF-8 | 892 | 2.53125 | 3 | [] | no_license | // Single Race Button handling
var inputScript : pInput; // the animation node (CamAnim)
var buttonScript : UI_SlicedButton; // race type selector
var isOver : boolean = false;
function Start()
{
// get our settings holder
var playerConstruct = GameObject.Find("Player_Construct");
inputScript = (player... | true |
143e28d3c134b0e06a49a20116f4b47a44135d73 | JavaScript | benhalverson/okta-signin-widget | /packages/@okta/courage/src/framework/Backbone.Docs.Only.js | UTF-8 | 36,110 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | /**
* @class Backbone.Model
*
* See: [Backbone.Model](http://backbonejs.org/#Model-constructor)
*/
/**
* @method parse
* `parse` is called whenever a model's data is returned by the server, in {@link #fetch}, and {@link #save}.
* The function is passed the raw `response` object, and should return the attributes has... | true |
2fdc4c05b09fa9a35e6f98d6e898dbd87d1f2412 | JavaScript | jujerez/dwec | /tema3/ejerrcicios-window/e1-2.js | UTF-8 | 398 | 2.8125 | 3 | [] | no_license | var v;
abrir.onclick = function() {
v = open("auxiliar.html","New window","width=300, height=300");
}
moveto.onclick = function() {
v.window.moveTo(500,150);
}
moveby.onclick = function() {
v.window.moveBy(0,50);
}
resizeto.onclick = function() {
v.resizeTo(500,500)
}
resizeby.onclick = function()... | true |
6ac60edb0924868c146e3f21387fe4cfb9ffc136 | JavaScript | aprilw00t/nc_news_api | /spec/utils.spec.js | UTF-8 | 3,204 | 2.65625 | 3 | [] | no_license | const { expect } = require("chai");
const request = require("supertest");
const app = require("../app");
const { formatArticle, formatComment } = require("../db/utils/utils");
describe("formatArticle", () => {
it("returns empty array when passed an empty array", () => {
const returnedUserData = [];
const art... | true |
29735d8f9d529dce40d2d1f44d50eeb94134acfe | JavaScript | mahbubevan/shopping-list-frontend | /src/component/MainPage.js | UTF-8 | 6,058 | 2.640625 | 3 | [] | no_license | import React,{ Component } from 'react'
import { Table,Container,Button,Modal, ModalHeader, ModalBody, ModalFooter,
Form, FormGroup, Label, Input
} from 'reactstrap'
import axios from 'axios';
class MainPage extends Component{
constructor(props){
super(props)
this.state={
... | true |
2f8d28a3b953d85723be7ce7ec36c50505d3c7d4 | JavaScript | KrishnaTheCoder1602/CycleRaceGame | /sketch.js | UTF-8 | 8,480 | 3.0625 | 3 | [] | no_license | var START=0;
var PLAY=1;
var OVER=2;
var gameState=START;
var path,mainCyclist,gameOver,restart;
var pathImg,mainCyclist_cycling,mainCyclist_collided,gameOverImg,restartImg;
var obstacle1,obstacle2,obstacle3;
var obstacle1Img,obstacle2Img,obstacle3Img;
var opponent1,opponent2,opponent3;
var opponent1_cycling,opponent2... | true |
89ec8b301913b06bd721e8815d74a5c564687641 | JavaScript | Caxvalencia/Atlax | /public/js/Atlax.js | UTF-8 | 3,165 | 2.59375 | 3 | [] | no_license | /*
* @description - Clase nucleo del proyecto
*/
!function( window, exports, require ) {
/**
* Imports
*/
var Cache = require( "Cache" );
var $ = require( "Utils" );
/**
* @Constructor
*/
function Atlax( config ) {
var _self = this;
this.CacheAtlax = new Cache();
this.CacheFile = new Cache();
... | true |
c32b66546e4e05eb17a72f431ffb05ed6809acf7 | JavaScript | rhhaynes/js-data-structures-objects-lab-v-000 | /index.js | UTF-8 | 412 | 2.765625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | const driver = {};
function updateDriverWithKeyAndValue(obj, key, val){
return Object.assign({}, obj, {[key]: val});
}
function destructivelyUpdateDriverWithKeyAndValue(obj, key, val){
return Object.assign(obj, {[key]: val});
}
function deleteFromDriverByKey(obj, key){
return delete( Object.assign({}, obj)[key... | true |
2ac144a1478e58df2376e817b70f8299245d6082 | JavaScript | Pratikdomadiya/androidapp | /Web_App(AdminSide)/js/Add_Tile.js | UTF-8 | 1,535 | 3.1875 | 3 | [] | no_license | var selectedFile;
$("#files-upload").on("change", function(event){
selectedFile = event.target.files[0];
});
var name,size,Category,finish,price,App,image,number;
function callTile()
{
//Take Data from User
name = document.getElementById('name').value;
size = document.getElementById('size').value;
Category = doc... | true |
11ec4418912c5fb959f1e12f8e4c8a6ee7535a8a | JavaScript | ChanceHarmon/InsertionSort | /__tests__/index.test.js | UTF-8 | 707 | 2.953125 | 3 | [] | no_license | const insertionSort = require('../index');
describe('#insertionSort', () => {
test('returns a sorted array', () => {
const array = [3, 4, 6, 5, 8, 7];
expect(insertionSort(array)).toEqual([3, 4, 5, 6, 7, 8])
});
test('should make no changes to the array', () => {
const array = [3, 3, 3, 3, 3, 3];
... | true |
c81e819647318d0d6fc8f6b6475139a7572ffc50 | JavaScript | hao-wang/Montage | /js-test-suite/testsuite/1868ca9038e5c9cf57be0b80d6fb6a13.js | UTF-8 | 388 | 2.984375 | 3 | [
"MIT"
] | permissive | load("201224b0d1c296b45befd2285e95dd42.js");
// Latin1
function f(someName) {
someName();
}
try {
f(3);
} catch(e) {
assertEq(e.message.includes("someName"), true);
}
// TwoByte
function g(someName\u1200) {
someName\u1200();
}
try {
g(3);
} catch(e) {
// Note: string is deflated; don't check fo... | true |
74a62501b36889f4e5ff93dadb1e7ea798b15d3c | JavaScript | rajuch/CPU_USAGE | /cpu_usage/static/client.js | UTF-8 | 1,616 | 2.65625 | 3 | [] | no_license | /*
* Script component for the webapp client.
* @created: 21 Mar, 2014
* @author: Anshu Kumar, <anshu.choubey@imaginea.com>
*/
/*global window*/
/*global document: false */
function InvokeXHR() {
'use strict';
var objectData, xmlhttp;
if (window.XMLHttpRequest) {
// Code for other browsers
... | true |
673d400895581b0d77a06b8e8eb8edfb5fb6e535 | JavaScript | CreativeSpaceInc/CreativeSpace | /_Becca/editprofile.js | UTF-8 | 10,035 | 3.1875 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
// declare array of creations
var creations = [];
// declare ingredientCount
var creationsCount = 0;
var creationIndex = 0;
// when save featured creation url button is clicked
$("#save-featured-creation-url").on("click", function(event) {
event.preven... | true |
0b5448176b85341c5bb8e958ccc5ebc04985b60f | JavaScript | xenia11/javascript-algorithms | /linked-list-insert-at-index.js | UTF-8 | 382 | 3.125 | 3 | [] | no_license |
function insertAt(data, index){
const node=new Node(data);
let current, previous;
let count=0;
curent=this.head;
if(index ===0 ){
this.head = new Node(data);
return;
}
while(count < index){
previous = current;
count++;
current= current.next;
}
node.next = current;
previous.next = node;
... | true |
4b8fde250a8cbd665597f9344644e34920677679 | JavaScript | Shaaniaa/JS-Assignment-2 | /app2.js | UTF-8 | 1,637 | 4.3125 | 4 | [] | no_license |
//Chapter 21-25 Strings
//Question 1
/*
var firstname = prompt("Enter your fir name: ")
var lastname = prompt("Enter your last name: ")
var fullname = firstname+" "+lastname
alert("Welcome "+fullname)*/
//Question 2
/*
var phone = prompt("My favorite phone is: ")
var a = phone.length
alert("Length of string: "+a)... | true |
e6c7a5b4a4a42c5780194c9ca1c11ce9ce927271 | JavaScript | 0r20/canvas-chart | /src/chart.js | UTF-8 | 4,279 | 2.640625 | 3 | [] | no_license | import {
isOver,
toDate,
circle,
computeBoundaries,
line,
toCoords,
css,
computeXRatio,
computeYRatio
} from './utils'
import { tooltip } from './tooltip'
import { sliderChart } from './slider'
const WIDTH = 600
const HEIGHT = 200
const PADDING = 40
const DPI_HEIGHT = HEIGHT * 2
const DPI_WIDTH = WIDTH * 2
co... | true |
787e6b47508aa9f903c75e865755f9959b8eabc6 | JavaScript | sssssuper1/react-dva-ts | /src/utls/rem.js | UTF-8 | 819 | 2.859375 | 3 | [] | no_license | (function(doc, win) {
const docEl = doc.documentElement;
const resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
const recalc = function() {
// const { innerWidth } = docEl;
const { innerWidth } = win
if (!innerWidth) return;
// docEl.style.fontSize = 16 * (innerWidth / 3... | true |
8bb6aecc4f2a7f83adadc31fb1d7ab7b1ac5c080 | JavaScript | deepak300811/World- | /src/components/RightDetails.js | UTF-8 | 4,050 | 2.703125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import axios from "axios";
import { convertPopulation } from "../utility/convertPopulation";
import { base_endpoint } from "../utility/constants";
function RightDetails({ singleCountry }) {
const [neighbours, setNeighbours] = useState([]);
const [error, setError]... | true |
0446f4d4e787c2906665c3b43e55109c1064b59e | JavaScript | booyouon/codewars | /creditCartMask.js | UTF-8 | 174 | 2.8125 | 3 | [] | no_license | function maskify(cc) {
let array = cc.split('');
const counter = array.length - 4;
for (let i = 0; i < counter; i++){
array[i] = "#";
}
return array.join('');
} | true |
76ba0afc32d1a62b59030ed39ce65a552b537a7a | JavaScript | Ghaith00/maze-solver | /maze-interface.js | UTF-8 | 5,074 | 3.671875 | 4 | [
"Apache-2.0"
] | permissive | // A base class is defined using the new reserved 'class' keyword
class Maze {
// ..and an (optional) custom class constructor. If one is
// not supplied, a default constructor is used instead:
// constructor() { }
constructor(height, width, rectangleSize) {
this.maze = [];
this.tileSize = 10;
this.... | true |
3ecba47b12fbb8b336fd3b1e3aa154d40c0e52b3 | JavaScript | MaxIvashchenko/REACT_neto | /test/src/components/les_4_forms/Feedback.jsx | UTF-8 | 1,675 | 2.625 | 3 | [] | no_license | import React, { useState } from 'react'
import './button.css'
export default function Feedback(props) {
const [form, setForm] = useState({
name: '',
score: 'good',
agreement: false
})
const handleSubmit = (evt) => {
evt.preventDefault()
console.log(evt.type)
... | true |
1075125699b14343909dd80e0d3c2359f2cf4bee | JavaScript | ryanbenvillanueva/fcc-js-algorithms-and-data-structures-certification | /intermediate-algorithm-scripting/makek-a-person.js | UTF-8 | 1,860 | 4.6875 | 5 | [] | no_license | // Intermediate Algorithm Scripting: Make a Person
// Fill in the object constructor with the following methods below:
// getFirstName() getLastName() getFullName() setFirstName(first) setLastName(last) setFullName(firstAndLast)
// Run the tests to see the expected output for each method.
// The methods that take an ... | true |
26fdcc81ac8dcbad1700450f80577488beae45aa | JavaScript | Jimmant91/Note_Taker | /server.js | UTF-8 | 471 | 2.625 | 3 | [
"ISC"
] | permissive | // Setting up Express
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
// Sets up the Express app to handle data parsing
app.use(express.urlencoded({extended:true}));
// Using middleware to make folder static
app.use(express.static('public'));
app.use(express.json());
... | true |
9e55a7494f964802e0629ccc6ddff13f81343b7d | JavaScript | iyang519/simpleServer | /expressRoute/header.js | UTF-8 | 425 | 2.578125 | 3 | [] | no_license | var express=require("express");
var app=express();
app.set("port",process.env.PORT||3000);
app.get("/headers",function(req,res){
res.set("Content-Type","text/plain");
var s="";
for(var name in req.headers){
s+=name+":"+req.headers[name]+"\n";
}
res.send(s);
console.log()
})
app.listen(app.get("port"),function(... | true |
3cd073e0c334ece3a3d3c2c863a30532c0f1281a | JavaScript | Aadit17/DataStructures | /leet code practice/1816. Truncate Sentence.js | UTF-8 | 508 | 3.421875 | 3 | [] | no_license | /**
* @param {string} s
* @param {number} k
* @return {string}
*/
var truncateSentence = function(s, k) {
var arr=[]
str=""
for(let i=0;i<s.length;i++){
if(s[i]===" "){
arr.push(str)
str=" "
continue
}
str+=s[i]
}
arr.push(str... | true |
b7f8cf9f96d71d4f44dcbdd853ccfe853206b621 | JavaScript | Kujo-Jotaro-AAAAA/study-ts-geek | /demo/src/chain-this.js | UTF-8 | 1,373 | 2.53125 | 3 | [] | no_license | var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] =... | true |
c9168d9d38ed636fab672b3c92a85c34f7a2daab | JavaScript | drapperr/JS-Applications | /REMOTE DATABASES/authentication.js | UTF-8 | 2,701 | 2.6875 | 3 | [
"MIT"
] | permissive | function solve() {
const email = document.querySelector('#email');
const password = document.querySelector('#password');
const regBtn = document.querySelector('#registerBUtton');
const loginBtn = document.querySelector('#loginButton');
const logoutBtn = document.querySelector('#logoutButton');
c... | true |
77d873111b1b1fb6ba6e028eeb4fc25e307314e5 | JavaScript | GeorgeRXia/practiceAngular1.X | /Section1_6/api/controllers/hotels.controllers.js | UTF-8 | 6,966 | 2.9375 | 3 | [] | no_license |
//hard coded version
// var hotelData = require('../data/hotel-data.json');
//using the mongodb driver
// var dbconn = require('../data/dbconnection.js');
// var ObjectId = require('mongodb').ObjectId;
var mongoose = require('mongoose');
var Hotel = mongoose.model('Hotel');
var runGeoQuery = function(req, res) {
... | true |
1b2a8e0066d024ae62b8ea79d7558b6791e249f3 | JavaScript | koajs/router | /lib/layer.js | UTF-8 | 5,937 | 2.65625 | 3 | [
"MIT"
] | permissive | const { parse: parseUrl, format: formatUrl } = require('url');
const { pathToRegexp, compile, parse } = require('path-to-regexp');
module.exports = Layer;
/**
* Initialize a new routing Layer with given `method`, `path`, and `middleware`.
*
* @param {String|RegExp} path Path string or regular expression.
* @param... | true |
3e278840740a2f033b9a6df767bd727dbc4cf9e8 | JavaScript | gmamar/The-web-developer | /Exercises/Color game/script.js | UTF-8 | 2,512 | 3.546875 | 4 | [] | no_license |
var squares = document.querySelectorAll('.square');
var colorDis = document.getElementById('colorDis');
var message = document.getElementById('message');
var reset = document.getElementById('reset');
var hard = document.getElementById('hard');
var easy = document.getElementById('easy');
var nums = 6;
var color = gener... | true |
13cdf1179cb1d1c53274efe3241a0eb6c33538d8 | JavaScript | AlexTiTanium/shop-engine | /public_html/skins/lotos/js/ajaxSendData.js | UTF-8 | 1,474 | 2.640625 | 3 | [] | no_license | (function($) {
function AjaxSendData(placeholder, options_) {
var config = {
url: '',
dataType: 'json',
type: 'POST',
onSuccess:function(data){},
onError:function(message){},
onStartSend: function(){},
onGetResult: function(){}
};
var data = {};
init(optio... | true |
0c26e9e89a2ce90c4f1322ad07859ff0622f2f71 | JavaScript | marcosihe/registro-inicio-de-sesion | /src/components/Login.jsx | UTF-8 | 3,482 | 2.53125 | 3 | [] | no_license | import React, { Fragment, useState } from "react";
import { Form, Button, Container } from "react-bootstrap";
import { auth } from "../firebaseConfig";
import { useHistory } from "react-router";
const Login = () => {
const historial = useHistory();
const [email, setEmail] = useState("");
const [password, setPass... | true |
508fd1ec8ff713f172ac03c7f533b6c3460eebd1 | JavaScript | srinivasakumar-a/spreadsheet-stock-trading | /analytics.js | UTF-8 | 778 | 2.5625 | 3 | [] | no_license | function _request(path) {
var endpoint = "https://api.iextrading.com/1.0";
var options = {
"method": "GET",
"muteHttpExceptions": true
};
var url = endpoint + path;
var response = UrlFetchApp.fetch(url, options);
var json = response.getContentText();
var data = JSON.parse(json);
return data... | true |
75cd7c0a42955de54519fb78b7dd532555fe1cdc | JavaScript | carriexu/d3_playground | /project_three/welcome/bar_graph.js | UTF-8 | 1,411 | 2.890625 | 3 | [] | no_license | var w = 300;
var h = 120;
var padding = 2;
// image if in a hash.
// just create click events to access different parts of the data structure
var dataset = [5, 10, 14, 20, 25, 11, 25, 22, 18, 7];
var dataset_2 = [7, 18, 22, 25, 11, 25, 20, 14, 10, 5];
var svg = d3.select("body").append("svg")
.attr("width", w)
.at... | true |
b4dc5d8d6db299ab0f45692dfaf4f80efa7734bf | JavaScript | dankreiger/react-electron-firebase | /src/App.js | UTF-8 | 3,361 | 2.78125 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import classnames from 'classnames';
import * as firebase from 'firebase';
import Todo from './Todo';
class App extends Component {
constructor() {
super();
this.state = {counter: 10, todos: [], inputValue: ''};
this.addCounter = this.addC... | true |
7b0b5bd9422300e9d46649e8aec048423f7683bd | JavaScript | dodinhnhan95/reactfe51 | /src/Components/BaiTapGioHang/index.js | UTF-8 | 6,450 | 2.671875 | 3 | [] | no_license | /**
* Các bước thực hiện :
* 1. dàn layout(html css) - done
* 2. xác định dữ liệu thay đổi và lưu vào state
* 3. lấy data trong state đi binding ra jsx
* 4. render danh sách sản phầm
* 5. xây dựng chức năng thêm vào giỏ hàng
* 6. xây dựng chức năng chi tiết
* 7. xây dựng chức năng tăng giảm số lượng
* 8. xây d... | true |
97b7796d5c0c53e196f568f5d08dbb85a14c605f | JavaScript | loverxp/LeetCode | /JavaScript/src/Solved/FreedomTrail.V2.js | UTF-8 | 1,284 | 2.6875 | 3 | [] | no_license | // https://leetcode-cn.com/problems/freedom-trail/
var Test = require('./Common/Test');
var { Matrix } = require('./Common/Matrix');
var findRotateSteps = function (ring, key) {
const m = key.length;
const n = ring.length;
const charIndexes = new Map();
for (let i = 0; i < ring.length; i++) {
c... | true |
a8cfdbeaa4bf1b9a5398597687ae4b4138036517 | JavaScript | Mambli-Joe/creditCard | /js/common.js | UTF-8 | 2,814 | 3.484375 | 3 | [] | no_license | //--Adaptive Menu
var showBtn = document.getElementById("showMenu");
showBtn.addEventListener("click", showMenu);
function showMenu() {
document.getElementById("showHide").style.display = "block";
showBtn.removeEventListener("click", showMenu);
showBtn.addEventListener("click", hideMenu);
}
function hideMenu() ... | true |
c6198c45fb1af71f1e7d119543c90a35f4a6e730 | JavaScript | patbrennan/learning-front-end | /js/ls/210/lesson5/11_changeDate.js | UTF-8 | 545 | 3.453125 | 3 | [] | no_license | today = new Date();
var tomorrow = new Date(today);
tomorrow.setDate(today.getDate() + 1);
// Date objects are objects, and cannot be directly compared
test = new Date(today); // 2016-10-18T16:26:29.666Z
today === test; // false
today.getDate() === test.getDate(); // true
function f... | true |
c139edf55b788e4bd87c3b7767f4d977d56103fa | JavaScript | amarcomon/v-tracker-vue | /src/components/__tests__/DoughnutChartRemainingOnBoard.spec.js | UTF-8 | 2,403 | 2.578125 | 3 | [] | no_license | import { shallow } from 'vue-test-utils'
import DoughnutChartRemainingOnBoard from '@/components/DoughnutChartRemainingOnBoard'
import DoughnutChart from '@/components/DoughnutChart'
import colorPalette from '@/constants/colorPalette'
const {
COLOR_BLACK,
COLOR_BROWN,
COLOR_LIGHT_BLUE,
COLOR_GREEN,
COLOR_TOM... | true |
508ff0b89e21a7cb986f6120fb78cf2f301230ef | JavaScript | dray-snmln/fizz-buzz-js | /app.js | UTF-8 | 476 | 3.734375 | 4 | [] | no_license | const make = (word, color) => {
const newItem = document.createElement('li');
const getOl = document.querySelector('#list')
newItem.classList.add(color);
newItem.innerHTML = word;
getOl.appendChild(newItem);
}
for (let counter = 1; counter <= 100; counter++) {
if (counter % 15 === 0) make(... | true |
1c046849c8712be43022b9782ae379fde6729475 | JavaScript | callahanchris/rocket-science | /noderocket/driver/servo.js | UTF-8 | 1,308 | 2.546875 | 3 | [] | no_license | /**
* Created by validity on 5/18/15.
*/
var servoblaster = require('./servoblaster.js');
var _ = require('underscore');
/**
* Servo number GPIO number Pin in P1 header
* 0 4 P1-7
* 1 17 P1-11
* 2 18 P1-12
* ... | true |
c3443658dd369063d43262c34bc32d6f77eb2824 | JavaScript | kalewill88/API-Project-02 | /public/script.js | UTF-8 | 721 | 2.6875 | 3 | [] | no_license |
const URL = 'https://api.giphy.com/v1/gifs/search?api_key=lNY8O9BNw8rneCznqIenVs5AThyTyWfd&q=funny&limit=50&offset=0&rating=pg&lang=en';
const key = 'lNY8O9BNw8rneCznqIenVs5AThyTyWfd';
//GIF-GRID
import { Gif } from '@giphy/react-components'
import { GiphyFetch } from '@giphy/js-fetch-api'
// use @giphy/js-fetch-ap... | true |
0568e453cd325f5766dd51192f6d9dd0b83341c5 | JavaScript | choclo/yfl_app | /public/REV_5a7933e6300658af06e102686b30dc3b/javascripts/linkTableRows.js | UTF-8 | 1,269 | 2.71875 | 3 | [] | no_license | /**
* @type jQuery
* @param Hash settings settings
* @param String settings[selector] selector to use
* @param String settings[hoverClass] class to apply to items that the mouse is over an item
* @param String settings[cursorType] cursor type to change to when the mouse is over an item
... | true |
0f56e2cd923b30e9ecccd2077dbf496da7d79424 | JavaScript | Elmeri-H/COMP.SE.200_Assignment | /test/eq.test.js | UTF-8 | 1,573 | 2.875 | 3 | [
"MIT"
] | permissive | import chai from "chai"
import eq from "../src/eq.js"
const expect = chai.expect
describe("Eq", () => {
it("returns the example outputs when called with the example inputs", () => {
const object = { 'a': 1 };
const other = { 'a': 1 };
expect(eq(object, object)).to.equal(true);
expec... | true |
4e247e7e7537d781ff703e33ba943858dae683d4 | JavaScript | OGBuilders/ogb-platform-webapp | /Partner/client/src/reducer/languageReducer.js | UTF-8 | 351 | 2.640625 | 3 | [] | no_license | import { SET_LANGUAGE } from "../actions/types";
const initialState = {
language: "",
islanguage: false,
};
export default function (state = initialState, action) {
switch (action.type) {
case SET_LANGUAGE: {
return {
language: action.payload,
islanguage: true,
};
}
defa... | true |
9ee50bc32a37d6e7c713340394663cc6e74c1c5a | JavaScript | mxcmxc/twitter-clone | /public/scripts/timestamp-calc.js | UTF-8 | 964 | 3.28125 | 3 | [] | no_license | function postTime(timestamp) {
let currentDate = Date.now(); // returns date now in ms
let timeDiff = currentDate - timestamp;
if (Math.floor(timeDiff / (1000 * 60 * 60 * 24 * 365)) > 0) {
return Math.floor(timeDiff / (1000 * 60 * 60 * 24 * 365)) + " years ago";
} else if (Math.floor(timeDiff / (1000 * 6... | true |
5ce3b384fececb04294b97dd2f1b4d066240262f | JavaScript | AlanLozz/FancyRecipes | /src/components/User/Forgot/Fragments/StepThree.jsx | UTF-8 | 3,509 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { changePassword } from '../../../../helpers/User';
import { useHistory } from 'react-router-dom'
import Swal from 'sweetalert2';
const StepThree = ({email}) => {
const history = useHistory();
const [passwordValue, setPasswordValue] = useState("");
... | true |
a7a3b5101fe6d5a48aa556069893f43d06faf79d | JavaScript | devLevi/javascript-exercises | /calculator/calculator.js | UTF-8 | 698 | 3.515625 | 4 | [] | no_license | function add(x, y) {
return x + y
}
function subtract(x, y) {
return x - y
}
function sum(x) {
if (x.length === 0) return 0
else {
let sum = x.reduce(function (a, b) {
return a + b
})
return sum
}
}
function multiply(array) {
return array.length ? array.reduce((acc, nextItem) => acc * n... | true |
71eec671696643ea8af63d3670f74fa1837ba2ab | JavaScript | ArtemBurko/js4b-loops | /while-loop/task.js | UTF-8 | 549 | 2.828125 | 3 | [] | no_license | // use: while loop
// don't use: *, / and %
function getReminder(dividend, divider) {
while ( dividend >= divider) {
dividend = dividend - divider;
}
return dividend;
}
function integerDivision(dividend, divider) {
var chek = 0;
while ( dividend >= divider) {
dividend = dividend - divider;
chek++;
... | true |
f9b992c8f0703e1d56f61ad1471c21116b4522ca | JavaScript | pdh999/eduonix | /tictactoe/index.js | UTF-8 | 3,004 | 3.984375 | 4 | [] | no_license | const statusDisplay = document.querySelector('.gameStatus');
let gameInProgress = true;
let currentPlayer = "X";
let gameState = ["", "", "", "", "", "", "", "", ""];
const winMessage = () => `Player ${currentPlayer} has won!`;
const drawMessage = () => `No winner - it's a draw!`;
const currentPlayerUpNext = ()... | true |
51c7b911713dccaf7201c62afee35d2303b5f6c3 | JavaScript | Ghassen-kh/productClientReact | /src/Create.js | UTF-8 | 1,292 | 2.578125 | 3 | [] | no_license | import logo from './logo.svg';
import './App.css';
import { Component } from 'react';
class Create extends Component {
constructor(props){
super(props);
this.state = {product: {}};
}
onIdChange = (e) => {
this.setState({id:e.target.value});
}
onNameChange = (e) => {
this.setState({name:e... | true |
f8008991042d02243ac1c7fcd6ce0d2f1465a920 | JavaScript | sarmentof/NodeBR | /NodeJS/modulo-02/01-lists/for-forin/1.for-forin-forof.js | UTF-8 | 1,085 | 3.8125 | 4 | [] | no_license | /*
Exemplos de uso dos tipos de For: For/ForIn/ForOf
Usamos o console.time e console.timeEnd para marcar o tempo de execução de cada "For"
*/
const service = require('./service')
async function main() {
try {
const result = await service.obterPessoas('a')
const names = []
// Ex... | true |
81a072c916eb75dbcf89aa9566c74f6eb82e4fdb | JavaScript | DepressedEVO/jimmy-overlord | /index.js | UTF-8 | 2,068 | 2.53125 | 3 | [] | no_license | const botconfig = require("./botconfig.json");
const Discord = require("discord.js");
const fs = require("fs");
const bot = new Discord.Client({disableEveryone: true});
bot.commands = new Discord.Collection();
fs.readdir("./commands/", (err, files) =>{
if(err) console.log(err);
let jsfile = files.filter(f => f.... | true |
1ca5d2cb46f9acdfc5f920e87ac2759a59f3910d | JavaScript | qudgus21/learn-redux | /1.redux/index2.js | UTF-8 | 695 | 2.890625 | 3 | [] | no_license | import { createStore } from "redux";
const reducer = (prevState, action) => {
switch (action.type) {
case "LOGIN":
return {
...prevState,
user: action.user,
};
case "LOGOUT":
return {
...prevState,
user: null,
};
default:
return prevState;
}... | true |
8740d226bf3821e0142935398e7057d0510a740f | JavaScript | sohel845/Weather | /src/redux/reducer/index.js | UTF-8 | 642 | 2.625 | 3 | [] | no_license | import {CURRENT_WEATHER, ERROR, LOADING, WEATHERDATA} from '../actions/types';
const initialState = {
weatherData: {},
currentCityData: {},
loading: false,
error: null,
};
export const weatherReducer = (state = initialState, action) => {
switch (action.type) {
case WEATHERDATA:
return {...state, we... | true |
218372976f742a74a9acf90dc3f6671cf91bea10 | JavaScript | musarratChowdhury/jqueryAndAsyncJsPractice | /js/async.js | UTF-8 | 1,372 | 3.625 | 4 | [] | no_license | //Asynchronous Javascript And XML
//lets create a object to send XMLHttpRequest
const weatherDiv = document.querySelector(".weather");
//
function get(url) {
return new Promise((resolve, reject) => {
let httpRequest = new XMLHttpRequest();
httpRequest.open("GET", url);
httpRequest.onload = () => {
... | true |
023465fd7319a40d42ff2e5c505640308ecff7ee | JavaScript | st234pa/svg-interactive | /svg-interactive.js | UTF-8 | 2,907 | 2.921875 | 3 | [] | no_license | var vimage = document.getElementById("vimage");
var mv = document.getElementById("mv");
var clr = document.getElementById("clr");
var stp = document.getElementById("stp");
var requestID;
var circleClick = function(e){
if (this.getAttribute("fill") == "red"){
this.parentNode.removeChild(this);
var r... | true |
a11187410628ccd8e3cb44ce78d686805d334ebd | JavaScript | brizenrai19/DOM-1 | /js/index.js | UTF-8 | 3,894 | 2.625 | 3 | [] | no_license | const siteContent = {
"nav": {
"nav-item-1": "Services",
"nav-item-2": "Product",
"nav-item-3": "Vision",
"nav-item-4": "Features",
"nav-item-5": "About",
"nav-item-6": "Contact",
"img-src": "img/logo.png"
},
"cta": {
"h1": "DOM Is Awesome",
"button": "Get Started",
"img-sr... | true |
f0cffd4802cd180e2e172ceb8c3d4b6e8147047f | JavaScript | tordskif/tordskif.github.io | /OldProjects/oppsummering/oppsummering.js | UTF-8 | 1,573 | 3.234375 | 3 | [] | no_license | // @ts-check
function setup() {
let divMain = document.querySelector("#main");
let btnBeregn = document.querySelector("#beregn");
let inpForbruk = document.querySelector("#forbruk");
let inpTank = document.querySelector("#tank");
let divOutput = document.querySelector("#output");
btnBeregn.add... | true |
88fd04dc915c42e6269889da2fa9d1620f15c20b | JavaScript | leilei1214/li | /src/containers/Home/index.js | UTF-8 | 4,937 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import ReactDOM from 'react-dom';
import './css/style.css';
import list from './list.json'
import list1 from './list1.json'
import list2 from './list2.json'
import list3 from './list3.json'
export default class Home extends Component{
state = {
listdata:"123"
};
onKeyUp = (e... | true |
2a2bc30c23776f8591201ab6eb0c79c124a47318 | JavaScript | Afroprogrammer/Freecodecamp-basic-Javascrpt-challenges | /declare-javascript-variables.js | UTF-8 | 86 | 3.140625 | 3 | [] | no_license | //You should declare myName with the var keyword, ending with a semicolon
var myName; | true |
ad090a30983eba601185696faa250b9373170143 | JavaScript | shihori-23/html | /js/main.js | UTF-8 | 1,308 | 2.59375 | 3 | [] | no_license | // jsを記述する際はここに記載していく
jQuery(function() {
var appear = false;
var pagetop = $("#page_top");
$(window).scroll(function() {
if ($(this).scrollTop() > 100) {
//100pxスクロールしたら
if (appear == false) {
appear = true;
pagetop.stop().animate(
{
bottom: "30px" //下から50pxの... | true |
b1f8b20c2538d3d069cc561042a8c9984e83a875 | JavaScript | vitalik495/Homework | /12/code12.js | UTF-8 | 332 | 3.453125 | 3 | [] | no_license | async function getRandomChinese(length){
let i = 0;
let time = "";
while(i < length){
await new Promise( (resolve) => {
time += String.fromCharCode( Date.now() ).slice(-5)
i++;
setTimeout( () => {
resolve(time)
}, 50);
});
};
console.log(time);
};
getRando... | true |
1f6747f148d8f2f25e73245895405ad99df8e6a0 | JavaScript | dmijatovic/nextjs-playwright-jest-rtl | /e2e/posts.spec.js | UTF-8 | 883 | 2.609375 | 3 | [] | no_license |
const dummyData = require('./playwright/posts.page')
async function mockResponse(route,request){
console.log("mockResponse...", dummyData)
await route.fulfill({
status:200,
contentType:'application/json',
body: JSON.stringify(dummyData)
})
}
describe('Posts page',()=>{
beforeAll(async()=>{
aw... | true |
17b997d5d21532dae810cba688030dd1aaef818d | JavaScript | bellaroyle/Student-Tracker | /student-tracker/src/components/Grad/Grad.js | UTF-8 | 1,608 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import PopUp from "./PopUp";
class Grad extends Component {
state = { grad: {}, isLoading: true }
componentDidMount = () => {
this.fetchGrad().then(grad => {
this.setState({ grad, isLoading: false })
})
}
... | true |
addb39f999163ed82c34cb0d6b5513dbf55574d7 | JavaScript | mct-dev/mindfulness-tiny-app | /public/modules/ui.mjs | UTF-8 | 773 | 2.890625 | 3 | [] | no_license | import {db} from './db.mjs';
export const ui = {
/**
* Create a new entry, pulling value
* from the DOM.
*/
createEntry() {
const entryInput = document.getElementById('entry-input');
console.log(entryInput.value);
db.createEntry(entryInput.value);
entryInput.value = '';
},
hydrateEn... | true |
d38e7f2c435200bdb104c28b3139def604f8afbd | JavaScript | alejandromoises02/ReactCoderHouse | /src/components/Form.js | UTF-8 | 3,305 | 2.59375 | 3 | [] | no_license | import React, { useContext, useState } from "react";
import {CartContext} from "../context/CartContext";
import { getFirestore } from '../firebase/index';
const Form =()=>{
const [name, setName] = useState("");
const [phone, setPhone] = useState("");
const [email , setEmail] = useState("");
const [... | true |
c10d0b2580c58f82c589a6ad08d3d32773fd5ddc | JavaScript | Ajitha03/freecode-camp-js | /53.js | UTF-8 | 229 | 3.453125 | 3 | [] | no_license | var myArr = [1,2,3,4,5];
function queue(arr, item) {
arr.push(item);
return arr.shift();
}
console.log("Before: " + JSON.stringify(myArr));
console.log(queue(myArr, 6));
console.log("After: " + JSON.stringify(myArr)); | true |
bd5293c5d2c70804555901edde07b41d91e244d4 | JavaScript | reesekunz/Sprint-Challenge-State-Management-Smurfs | /smurfs/src/actions/index.js | UTF-8 | 1,478 | 2.546875 | 3 | [] | no_license | import axios from "axios"
// FETCHING SMURFS
export const FETCHING_SMURFS_START = "FETCHING_SMURFS_START";
export const FETCHING_SMURFS_SUCCESS = "FETCHING_SMURFS_SUCCESS";
export const FETCHING_SMURFS_FAILURE = "FETCHING_SMURFS_FAILURE";
// ADDING SMURFS
export const ADDING_SMURFS_START = "ADDING_SMURFS_START";
ex... | true |
c2cfb570a4841ad337c27dfd287bb5f6ba47f739 | JavaScript | youhaowei/react-form-frame | /src/Components/Provider/slice.js | UTF-8 | 5,293 | 2.609375 | 3 | [
"MIT"
] | permissive | import { createSlice } from '@reduxjs/toolkit';
import validationCallbacks from '../../callbacks/validations';
const INITIAL_STATE = {
meta: {},
data: {},
fields: {},
errors: [],
inited: false
};
const formSlice = createSlice({
name: 'form',
reducers: {
init: (state, action) => {
const { meta = {}, defaul... | true |
0b13a268cd612a6355ca4f6ec6208e001ead69db | JavaScript | alexdostew/MART120-Homework10 | /sketch.js | UTF-8 | 3,065 | 3.359375 | 3 | [] | no_license | var movementFirst;
var movementSecond;
var movementThird;
var movementFourth;
var movementFifth;
var movementSixth;
var hatPosStartx = 200;
var hatPosStarty = 130;
var hatPosx = hatPosStartx;
var hatPosy = hatPosStarty;
var headPosStartx = 200;
var headPosStarty = 200;
var headPosx = headPosStartx;
var... | true |
4ffc5db1ce48dfd26ee60315870f0b731946320e | JavaScript | arthur607/curso-web | /curso web/exerciciosJS/ex03.js | UTF-8 | 95 | 3.3125 | 3 | [] | no_license | function elevacao(a,b) {
let a1 = Math.pow(a,b)
console.log(a1)
}
elevacao(5,5) | true |
87435ee496d5c14f63af3f439f0a422485fd8eb5 | JavaScript | IrinaLysenko21/goit-fe-course | /javascript/module-12/src/js/utils/view.js | UTF-8 | 1,451 | 2.578125 | 3 | [
"MIT"
] | permissive | import noteTemplate from '../../templates/note.hbs';
import storage from './storage';
const createListItemMarkup = note => {
return noteTemplate(note);
};
const createItemsListMarkup = notes => {
return notes.map(note => createListItemMarkup(note)).join('');
};
const renderNotesList = (listRef, notes) => {
list... | true |
cb46c80177507e7e702c40ace2b296306ce9fc47 | JavaScript | yansntss/FullStack-js | /array/foreach.js | UTF-8 | 1,318 | 2.984375 | 3 | [] | no_license | const aprovados = ["Agatha", "Aldo", "Daniel", "Raquel"];
aprovados.forEach(function (name, indice) {
console.log(`${indice + 1}) ${name}`);
});
aprovados.forEach((name) => console.log(name));
const exibirAprovados = aprovados.forEach((name) => console.log(name));
aprovados.forEach(exibirAprovados);
//... | true |
011e82a3ca9183563a1279275e6388f0185320fa | JavaScript | vaskulikov1983/beats | /src/js/form_submit.js | UTF-8 | 2,490 | 3 | 3 | [] | no_license | (function () {
const form = document.querySelector('.form');
const submitButton = form.querySelector('.form__submit-button');
const name = form.elements.name;
const phone = form.elements.phone;
const comment = form.elements.comment;
const submitOverlay = document.querySelector('.submit-overlay')... | true |
271157b0691406512506b9cf52f9fe5965aa2802 | JavaScript | slcsas/p4d | /PEEvents/sketch.js | UTF-8 | 2,242 | 3.9375 | 4 | [] | no_license | // PE – Events
// IGME-609
// Shauna Cross
// Global variables that the program will need
var bg;
var score = 0;
var ballX;
var ballY;
var ballSize;
var ballColor;
var xspeed;
var yspeed;
// Create the canvas and setup the game
function setup() {
createCanvas(400, 400);
reset();
}
// In each frame, paint the backgr... | true |
fdbda2df04a3d820e3ca078ae2fe8ee73b6eaf6a | JavaScript | Srickert12/OpenLearningStatics | /js/4.09.js | UTF-8 | 5,043 | 2.796875 | 3 | [] | no_license | var instructions = document.getElementById('instructions');
var leftWheel = document.getElementById('leftWheel');
var rightWheel = document.getElementById('rightWheel');
var leftBlueArrow1 = document.getElementById('leftBlueArrow1');
var leftBLueArrow2 = document.getElementById('leftBlueArrow2');
var applied2 = false... | true |
6d1d544abbe24daf4b19a69de81f879e0f2f5a0a | JavaScript | cartometricsteam/recomendadorRutas | /assets/js/login.js | UTF-8 | 1,507 | 3.125 | 3 | [
"MIT"
] | permissive | function registrar(){
var email = document.getElementById('email').value;
var password = document.getElementById('password').value;
firebase.auth().createUserWithEmailAndPassword(email, password)
.catch(function(error){
var errorCode = error.code;
var errorMessage = error.message;
console.log(error... | true |
89a1d1bfd873a3b908f3122c5685f92bd21bdd34 | JavaScript | jacobemerick/advent-of-code-2016 | /22/index.js | UTF-8 | 964 | 2.671875 | 3 | [] | no_license | const Puzzle = require('@thefotios/advent_puzzle');
const p = new Puzzle();
p.before = lines => lines
.filter(line => line[0].substr(0, 4) === '/dev')
.map(line => ({
position: line[0].match(/-x(\d+)-y(\d+)$/).slice(1, 3),
used: +(line[2].substr(0, line[2].length - 1)),
available: +(line[3].substring(... | true |
bda5d3d38b98f22b8a00ba3a474df35623cb06a4 | JavaScript | q-apps/nim | /src/Nim.js | UTF-8 | 1,320 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
class Nim extends Component {
constructor (props) {
super(props)
this.state = {
barsCount: this.props.count,
currentPlayer : 1
}
}
removeBars (amount) {
this.setState({
barsCount: this.state.barsCount - amount,
currentPlayer: 3 - ... | true |
b8d66b8bb52e3fe9cb52e1d20e860277c56969b5 | JavaScript | ppolasek/Recipes4 | /recipe-server/modules/recipes4/archives/recipe_module.js | UTF-8 | 6,552 | 2.546875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | "use strict";
// Copyright (c) 2017, Philip Polasek. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.
var logger = require('../../logger');
/**
* recipe_module.js
*
* Manages all incoming requests for Recipe-related data.
*/
// TODO imple... | true |
6b10005d39f7d7f967fb24fd06b5e154ee1e9334 | JavaScript | 1Krayspher/Self-1 | /index.js | UTF-8 | 2,131 | 2.8125 | 3 | [] | no_license | const { error } = require("console");
const Discord = require("discord.js");
const config = require ("./config.json");
const client = new Discord.Client();
let tokenList = config.token;
let next = 0;
async function main(){
const token = tokenList.shift();
if (!token){
console.log("Unknown token!");
client.dest... | true |