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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d11c9a03db21a9434fe1ecbc05b2336aa6b643f7 | JavaScript | 7carlinger/Reactfromreact | /clase 84 useEffect/useeffect/src/App.js | UTF-8 | 1,039 | 2.734375 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import Cat from './Components/Cat/Cat';
import axios from 'axios';
import './App.scss';
const App = () => {
const [cats, setCats] = useState ([]);
/*const [id, setId] = useState ([]);*/
const cargarCat = () => {
axios.get("https://api.thecatapi.com/v1/ima... | true |
4178794f805134b9019dd67481177a434ec56f60 | JavaScript | AndreyUytov/punk-react | /src/components/catalog/catalog-links.js | UTF-8 | 1,630 | 2.65625 | 3 | [] | no_license | import React, {useState} from 'react'
import {
NavLink
} from 'react-router-dom'
import PropTypes from 'prop-types'
function createPageArr (page) {
page = +page
if (page <= 2) {
return [1, 2, 3]
} else return [page - 1, page, page + 1]
}
function createPageList (arr, url) {
return arr.map((ele... | true |
4d539254c55df4a60387093e906badba2b5923c5 | JavaScript | KevinMarin/homework1_DPI_UCV | /js/script.js | UTF-8 | 8,854 | 2.890625 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
var inputElement = document.getElementById("input");
inputElement.addEventListener("change", handleFiles, false);
$( "#negative" ).click(function() {
var ctx = cargaContextoCanvas('mycanvas');
var imgData = ctx.getImageData(0, 0, ctx.canvas.width, ctx.canvas.height);
... | true |
a68cd7f838c62b6de047140715f801ed93f53a83 | JavaScript | aaronsantiago/aaron.work | /kinectron/examples/azure_examples/p5_examples/record/sketch.js | UTF-8 | 2,687 | 3.125 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2020 Kinectron
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
// example name:
// azure record
// description:
// example to show how to record azure data on client in browser
//
let kinectron = null;
function setup() {
// create p5 canv... | true |
f690e5c42e87536351d8b5364960c30e09fc5db8 | JavaScript | EthanLawr/Timer | /Timer_JS.js | UTF-8 | 6,348 | 2.859375 | 3 | [] | no_license | let hours = document.getElementById('Hours'),
minutes = document.getElementById('Minutes'),
seconds = document.getElementById('Seconds'),
startBtn = document.getElementById('start'),
pauseBtn = document.getElementById('pause'),
resetBtn = document.getElementById('reset'),
lblTime = document.getElement... | true |
151b056033a7d106a6481f3c0ad67cda94f059b1 | JavaScript | Wrangler416/fsw130 | /bryanu/fsw130/week3/pnp/app/src/Timer.js | UTF-8 | 1,491 | 2.671875 | 3 | [] | no_license | import React from "react"
function Timer() {
function startTimer(baseTime = 0) {
return {
type: "START_TIMER",
baseTime: baseTime,
now: new Date().getTime()
};
}
function stopTimer() {
return {
type: "STOP_TIMER",
n... | true |
2ace89e1df0382bed42f87ce4cf9023794b91f1e | JavaScript | JStein92/pig-dice-karma | /js/player.js | UTF-8 | 630 | 2.765625 | 3 | [] | no_license | var Dice = require('./../js/dice.js').diceModule;
var Manager = require('./../js/manager.js').managerModule;
var Player = function(name, score, totalScore){
this.score = score;
this.name = name;
this.totalScore = totalScore;
};
Player.prototype.rollDice = function(){
var newDice = new Dice();
var rollVal = new... | true |
f5e754d01f200633a9f2ab88a8e9964acb3109ce | JavaScript | radhikachhibber/MVCProject--Visualization-and-Analysis | /NewYorkDeaths/obj/Release/Package/PackageTmp/Scripts/chart.js | UTF-8 | 3,217 | 2.84375 | 3 | [
"MIT"
] | permissive | var paramType = "";
function drawBasic() {
// Create the data table.
var data = new google.visualization.DataTable();
// Set chart options
if (paramType == "gender") {
data.addColumn('string', 'Gender');
} else if (paramType == "year") {
data.addColumn('number', 'Year');
}
... | true |
1a7a313d2b0ed625f828450ee58b4068028891b6 | JavaScript | soarersiuhc/soarersiuhc.github.io | /cryptography/spcs/script/dh.js | UTF-8 | 6,678 | 3.34375 | 3 | [] | no_license | /* Color variables */
var OurSharedColor;
var AliceSecretColor;
var AliceMixedColor;
var BobSecretColor = "#ffcccc";
var BobMixedColor;
var BobSharedSecretColor;
var AliceSharedSecretColor;
var Color1;
var Color2;
/* Number variables */
var PublicPrime = 541;
var PublicPrimitiveRoot = 10;
var AliceSecretKe... | true |
f5be861cb863040054780b758472b24bce9ea0fb | JavaScript | Farrowlia/sortir | /public/js/app.js | UTF-8 | 2,565 | 2.703125 | 3 | [] | no_license | function afficherLieuForm()
{
$('#lieuForm').show();
// $('#sortie_form_lieuForm_nom').attr("required", "true");
// $('#sortie_form_lieuForm_rue').attr("required", "true");
// $('#sortie_form_lieuForm_ville').attr("required", "true");
/*let formLieu = document.getElementById("sor... | true |
5f60a1bbf003693c25a8c7fca7007606bf622015 | JavaScript | atomikolex/basic-web-components | /packages/basic-sliding-viewport/src/SlidingViewport.js | UTF-8 | 5,217 | 2.78125 | 3 | [
"MIT"
] | permissive | import ElementBase from '../../basic-element-base/src/ElementBase';
import SpreadItems from '../../basic-spread-items/src/SpreadItems'; // jshint ignore:line
import toggleClass from '../../basic-component-mixins/src/toggleClass';
let base = ElementBase;
/**
* Presents list items in a viewport such that only a singl... | true |
d16bea130e01f38154b87d59cae9069732168b90 | JavaScript | Jomers01/la_tiendita | /src/Components/Products/Product.jsx | UTF-8 | 648 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import Cards from "../Cards/Cards.jsx";
const Product = () => {
const url = "https://latienditaworkshop.herokuapp.com/products";
const [product, setProduct] = useState([]);
const [carrito, setCarrito] = useState([])
useEffect(() => {
fetch(url)
.t... | true |
3f83adb58add0b57ffbd8279ff5a1864ff29b263 | JavaScript | abcolor/nft-minter | /metadata.js | UTF-8 | 1,654 | 2.515625 | 3 | [] | no_license | const ipfsUploader = require('./ipfs-uploader')
const metadata_file = './metadata.json';
exports.upload = async function(req, res) {
const title = req.body.title
const name = req.body.name
const description = req.body.description
const creator = req.body.creator
if (!req.files || O... | true |
38876b9cf3cf01f5232deb61353c3192d5304f92 | JavaScript | rsumner31/Transcrypt | /Transcrypt/development/automated_tests/transcrypt/javascript/autotest.js | UTF-8 | 9,108 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
// Transcrypt'ed from Python, 2016-01-12 19:30:37
function autotest () {
var __all__ = {};
var __world__ = __all__;
// Nested object creator, part of the nesting may already exist and have attributes
var __nest__ = function (headObject, tailNames, value) {
// In some cases this will be a g... | true |
bc03ff6e1029e44ce17ec6836e1064dd87eb3629 | JavaScript | fibonacciXu/rollupjs-note | /demo/chapter-02-03/build/compile_task.js | UTF-8 | 1,480 | 2.59375 | 3 | [
"MIT"
] | permissive | const path = require("path");
const rollup = require("rollup");
const chalk = require("chalk");
const compose = require("koa-compose");
module.exports = compileTask;
function logger(text = "", opts = { status: "INFO" }) {
let logText = "";
switch (opts.status) {
case "SUCCESS":
logText = `${chalk.bgGree... | true |
6d82467ea3b5cf09d31d157869b4b417549cadf5 | JavaScript | sitaramaraju123/React | /practice/src/classComponent.js | UTF-8 | 988 | 2.875 | 3 | [] | no_license | import React, { Component } from "react";
class ClassComponent extends Component {
constructor(props) {
super(props);
this.state = {
inputdata: "",
arr: []
};
}
input(value) {
this.setState(() => ({
inputdata: value
}));
}
additem() {
if (this.state.inputdata != ""... | true |
860a68d7ecfc2d7b110aba7b29878da65076e7de | JavaScript | PhyllisFei/Communications-Lab-2018Spring | /week7/audio_01/js/script.js | UTF-8 | 1,080 | 3.65625 | 4 | [] | no_license | window.onload = init;
var vol = 1.0;
function init() {
console.log("Window Loaded!");
}
function volumeUp(){
// increase the volume
vol = vol + 0.1;
// limit the volume
if (vol>1.0) {vol = 1.0;}
var audio = document.getElementById("myAudio");
audio.volume = vol;
console.log("Volume Increased!");
}
functio... | true |
00fd89171d6de37b834f23cd8524a6a3d0e02076 | JavaScript | meanstack68/BasicAPI | /Server.js | UTF-8 | 2,445 | 2.875 | 3 | [] | no_license | // Server.js
var express = require('express'),
app = express(),
port = process.env.PORT || 3001;
app.listen(port);
console.log('Basic Sample RESTful API server started on: ' + port);
app.post('/stringParse/:data', function(req, res) {
const str2=req.params.data;
let Strparams = [];
const s... | true |
3041cf964e1d1736153c546c8cfe2bd3cfbef9c3 | JavaScript | UnderBlox/DogeCoin | /commands/items/inventory.js | UTF-8 | 3,128 | 2.671875 | 3 | [] | no_license | const { Client, Message, MessageEmbed } = require('discord.js');
const profileSchema = require("../../models/profile");
const invSchema = require("../../models/inventory");
const items = require("../../items/items");
function read_prop(obj, prop) {
return obj[prop];
}
module.exports = {
name : 'inventory',
... | true |
34e308db9d5c54def71031d3b4368c11041bd0ae | JavaScript | baodieppro/upload1 | /MyBrowser/html/JSTools.js | UTF-8 | 6,469 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | function SeMobGetPageDescription(){
var elements = document.getElementsByName('description');
if (elements){
for (var i=0; i < elements.length; i++){
if(elements[i].tagName.toLowerCase() === 'meta'){
return elements[i].content;
}
}
}
}
function docume... | true |
592c3967d71c06e46bc1c6c1a43f477ed615f624 | JavaScript | skylarbeese/pokemon_api | /app.js | UTF-8 | 5,819 | 3.0625 | 3 | [] | no_license | const pokenDiv = document.querySelector('.poke-div')
//const first1 = document.querySelector('.first')
let frontt = document.querySelector('.front')
let con = document.querySelector('.con')
const searchBar = document.querySelector('.search')
const colors = {
fire: '#F55447',
grass: '#43F040',
water: '#5038F5',... | true |
cc0d8c94d0bade41d06f9e9e7a42d55f5a814dac | JavaScript | shanushka/js-projects | /assignment-3/scripts/flappy.js | UTF-8 | 5,987 | 2.875 | 3 | [] | no_license | function Flappy(cont){
var element=document.getElementsByClassName(cont)[0];
element.style.width='500px';
var scoreCard=document.createElement('div')
var num=document.createElement('span');
scoreCard.setAttribute('class','scoreCard')
scoreCard.innerHTML="Score"
scoreCard.appendChild(num)
num.innerHTML="... | true |
8a00df987cb8c039fe0d408e801bd96b2472f52c | JavaScript | fadyibrahimdev/MCQ-App | /client/src/components/Result.js | UTF-8 | 1,406 | 2.53125 | 3 | [] | no_license | import React, { useContext, useEffect } from "react";
import { useHistory } from "react-router-dom";
import "../styles.css";
import NameApi from "../context/NameApi";
import QuestionsApi from "../context/QuestionsApi";
import CurrentQuesCountApi from "../context/CurrentQuesCountApi";
import TrueAnswersApi from "../cont... | true |
19f6e1d6b406bb8a96c8f29ea5c3fe026d7aebf0 | JavaScript | T7FrameData/tekken-frame-data | /events/message.js | UTF-8 | 1,448 | 2.609375 | 3 | [] | no_license | const config = require('../storage/config.json');
const code = '```';
exports.run = ((client, message) => {
const args = message.content.split(' ');
const command = args.shift().slice(config.prefix.length);
const only_other_commands = ['ping', 'reload', 'destroy'];
const command_path = `../commands/${only_othe... | true |
d506b9c848e06b2f03574dfa2ae3a6fed1b91603 | JavaScript | archerstack/Datagrokr | /app.js | UTF-8 | 1,373 | 2.625 | 3 | [] | no_license | const express = require('express');
const app = express();
const localFilesHandler = require('./controllers/local-fs-handler.js');
const helperFunctions = require('./controllers/helper-functions.js');
const database = require('./controllers/database');
app.listen(80, ()=>{
console.log("Server is running on port 80... | true |
c3fe9be77fcc24ace357c1bf113702a63ab60367 | JavaScript | tariqwest/data-structures | /sprint-two/src/doubleLinkedListFAILED.js | UTF-8 | 4,517 | 3.609375 | 4 | [] | no_license | var DoubleLinkedList = function() {
var list = {};
list.head = null;
list.tail = null;
var key = 1;
var count = 1;
//{ tail: {value: 44, next: null}}
list.addToTail = function(value) {
// 1st ListNode
if (list.tail === null) {
list.tail = ListNode(value);
... | true |
95d466d939333e2aa25cec763dfda4f888815060 | JavaScript | devyonghee/movieql | /graphql/db.js | UTF-8 | 2,063 | 3.046875 | 3 | [] | no_license | import fetch from 'node-fetch';
export const people = [
{
id: "0",
name: 'yonghee',
age: 28,
gender: 'male'
},
{
id: "1",
name: '1',
age: 28,
gender: 'male'
},
{
id: "2",
name: '2',
age: 28,
gender: 'mal... | true |
f2538e1799a667c0554353ebed56da5dcf25f9d1 | JavaScript | amandavalverde/amandavalverde.github.com | /des157/madlib/script.js | UTF-8 | 2,800 | 3.0625 | 3 | [] | no_license | (function(){
'use strict';
console.log("reading js");
var quotes = ["DEAR FROZEN YOGURT, YOU ARE THE CELERY OF DESSERTS. BE ICE CREAM OR BE NOTHING. ZERO STARS.",
"THERE’S ONLY ONE THING I HATE MORE THAN LYING: SKIM MILK. WHICH IS WATER THAT IS LYING ABOUT BEING MILK.",
"JUS... | true |
631540c169b3e193f78f3d984b783acd183ed919 | JavaScript | BichHoang/itjob_reactjs | /src/helpers/checkRemember.js | UTF-8 | 807 | 2.53125 | 3 | [] | no_license | import {getCurrentAccount} from './getCurrentAccount';
import {refreshAccessToken} from './refreshAccessToken';
export function checkRemember() {
const current_account = getCurrentAccount();
console.log(current_account);
let remember = false;
if(current_account) {
const remember_token = current... | true |
5d55e10051f6e74bd8852074de3035d848377c54 | JavaScript | ebatraining/ntpetservice | /js/map.js | UTF-8 | 1,445 | 2.5625 | 3 | [] | no_license | jQuery(document).ready(function($){
// 地図表示用メソッド
function map_initialize() {
// 地図の座標を設定
var latlng = new google.maps.LatLng(35.7313409,140.0153023,);
// 地図の設定
var map = new google.maps.Map(
document.getElementById("g_map"),
{
zoom: 17, // 地図の拡大率
center: latlng, // 地図の中心... | true |
d269908c54fefa05c4191692b9e696eba3e07a78 | JavaScript | devDreaming/JAVASCRIPT-course | /Javascript-MORE/advanced-functions/functions-as-arguments/app.js | UTF-8 | 1,063 | 4.4375 | 4 | [] | no_license | var years = [2000, 1990, 1959, 1902, 1783];
function arrayCalc(arr, fn) {
//empty array for the ages associated with the birth years in the "years" array
var ageArr = [];
//Loop to loop through the array passed into the function as an argument
for (var i = 0; i < arr.length; i++) {
//pushing the items from... | true |
195c19e74edf808f4141ad140caba40f8d4b00ab | JavaScript | RenanGreca/zuzekbot | /modules/getprice.js | UTF-8 | 2,800 | 3.03125 | 3 | [] | no_license | const https = require("https");
function findGame(query, curr, callback) {
const url =
"https://api-savecoins.nznweb.com.br/v1/games?" +
"currency=" + curr + "&" +
"locale=en&" +
"filter[platform]=nintendo&" +
"order=popularity_desc&" +
"filter[title]=" + query;
https
.get(url, res => {
let da... | true |
3bb08ec53b2260c35cbb0c9403fc743ae3e05916 | JavaScript | RubDuck/xl-component | /packages/utils/event/index.js | UTF-8 | 678 | 2.703125 | 3 | [
"MIT"
] | permissive | // is element
function isElement(el) {
if (el && el.nodeType === 1) {
return true;
}
return false;
}
// set touchValue
function getTouch(el, x = 0, y = 0) {
return {
identifier: Date.now(),
target: el,
pageX: x,
pageY: y,
clientX: x,
clientY: y,
};
}
// mine trigger event
function ... | true |
3929e3e0c9514a87320d22336ff5488c829263ba | JavaScript | markpytel/stackstore | /tests/server/models/review-test.js | UTF-8 | 4,854 | 2.515625 | 3 | [] | no_license | var dbURI = 'mongodb://localhost:27017/testingDB';
var clearDB = require('mocha-mongoose')(dbURI);
var sinon = require('sinon');
var expect = require('chai').expect;
var mongoose = require('mongoose');
var Promise = require('bluebird');
// Require in all models.
require('../../../server/db/models');
var Review = mon... | true |
80f460a84fd12c1d00029b82c67ed0ee508eec63 | JavaScript | r-andy79/homepage_kurs | /main.js | UTF-8 | 516 | 3.5 | 4 | [] | no_license | const name = "Andrzej";
let age = 40;
console.log('Siema! Witaj na mojej stronie :). Umiemy korzystać z konsoli, co? ;)')
const about = document.querySelector('.about__paragraph--js')
console.log(about.innerHTML);
about.innerHTML = `<strong>Nazywam się</strong> ${name} i mam ${age} lat`
const paragraphs = document.... | true |
f6ba1e7c4b9e54a4c5cbaecbba46cbf26f333758 | JavaScript | theusguy/FrontEndPractice | /HTML Lab/bootstrap-3.3.6-dist/css/AnnoyMatic.js | UTF-8 | 154 | 3.171875 | 3 | [
"MIT"
] | permissive | var yes = prompt("Are we there yet");
while (!(yes == "yes" || yes == "yeah")) {
yes = prompt("Are we there yet");
}
alert("Yay, we finally made it!"); | true |
df1b53882f76b4a7ddbad3f6e3a112a8f4f54998 | JavaScript | piyushpawar26/React-Redux-ToDo | /src/components/TodoList.js | UTF-8 | 472 | 2.515625 | 3 | [] | no_license | import React from 'react';
const TodoList = ({ todos, deleteTodo }) => {
const list = todos.map(todo => {
return (
<li className="collection-item" key={ todo.id } onClick={ () => { deleteTodo(todo.id) } } >{ todo.todo }</li>
);
});
return list.length > 0 ? (
<ul classN... | true |
b90abb9c947efaee0a6842835b6d7f25b99339da | JavaScript | ouracademy/essboard-demo | /src/project.js | UTF-8 | 786 | 2.96875 | 3 | [] | no_license | import { WithName } from "./with-name";
import { Session } from "./session";
export class Project extends WithName {
members = [];
sessions = [];
join(member) {
if (this.hasMember(member)) throw "Sorry that person is already a member";
this.members.push(member);
}
hasMember(member) {
return thi... | true |
c66a6b01caac70964bbda12054b1f092d4fa6a81 | JavaScript | nat-nat33/PixelPainter | /js/quadratic-function.js | UTF-8 | 2,061 | 3.328125 | 3 | [] | no_license | function drawCurve(coord1, coord2, coord3){
var p1 = JSON.parse(coord1);
var p2 = JSON.parse(coord2);
var p3 = JSON.parse(coord3);
var x1 = p1[0];
var y1 = p1[1];
var x2 = p2[0];
var y2 = p2[1];
var x3 = p3[0];
var y3 = p3[1];
var a;
var b;
var c;
var A = (x3 * x3) - (x1 * x1);
var B = y2... | true |
30cd1b886de0f1ef21284d0e35cd473a4bedf9a5 | JavaScript | duongld2503/oop-xay-dung-lop-mo-ta-dien-thoai | /mobile.js | UTF-8 | 1,846 | 2.609375 | 3 | [] | no_license | function mobile(b,sm,rm,m) {
this.b = b;
this.sm = sm;
this.rm = rm;
this.m = m;
let dem = 0;
this.getB = function () {
return this.b;
}
this.getSm = function () {
return this.sm;
}
this.getRm = function () {
return this.rm;
}
this.getM = function... | true |
d7ddccacb612719fb39f336667285e96f6b4b810 | JavaScript | carllang/itch | /src/webMIDI/webMIDI.js | UTF-8 | 1,173 | 2.84375 | 3 | [
"MIT"
] | permissive | // class WebMIDI {
//
// constructor () {
// navigator.requestMIDIAccess({
// sysex: false
// }).then(onMIDISuccess, onMIDIFailure);
// }
//
// onMIDISuccess (midiAccess) {
// // when we get a succesful response, run this code
// midi = midiAccess; // this is our raw MIDI data, inputs, outputs, and sysex ... | true |
ad39185807037bb27e72c4a2fdcb35fc522772ef | JavaScript | rhopensourcecontest/osc-app | /backend/src/tests/admin.test.js | UTF-8 | 5,055 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | require('./db-handler');
const mongoose = require('mongoose');
const adminService = require('../graphql/resolvers/admins');
const Task = require('../models/task');
const Student = require('../models/student');
const Mentor = require('../models/mentor');
const { STUDENTS } = require('./test-data/student');
const { TAS... | true |
b920e3073873a73656b33620727e9e7b9907be02 | JavaScript | AmruthPillai/Reactive-IRC | /src/components/messages/MessageForm.js | UTF-8 | 772 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
const propTypes = {
addMessage: PropTypes.func.isRequired
};
class MessageForm extends Component {
onSubmit(e) {
e.preventDefault();
const node = this.refs.message;
const message = node.value;
this.p... | true |
00ee74a4458177873a9d2a276552738b21635c9a | JavaScript | IliyaBrook/Todo-List | /src/components/app-save/app-save.js | UTF-8 | 3,913 | 2.578125 | 3 | [] | no_license | import React, {Component} from "react";
import './app.save.css'
import {Button, Modal} from 'react-bootstrap';
export default class AppSave extends Component {
state = {
modalSave: false,
modalLoad: false,
modalSaveValue: '',
allLists: []
}
onSave = (listName) => {
... | true |
5f4a3c6a746cb2b04b2fe7336f6135d36235f8a8 | JavaScript | HenriqueMotton/nodeJS | /nodejs - Curso/AULA 06 - WEBSERVER/Exemplo3/src/services/clientesService.js | UTF-8 | 773 | 2.515625 | 3 | [] | no_license | module.exports = {
getClientes: function() {
return global.clientes
},
getClienteById: function(id) {
global.clientes.forEach(c => {
if(c.id == id){
cliente = c
}
});
return cliente
},
insertCliente: function(cliente){
... | true |
e3c810a2e4e4d4be780e89a5d2d912fbb32dea42 | JavaScript | aayushmaan/React | /Voting App - REACT_REDUX/voting-server/src/server.js | UTF-8 | 986 | 3 | 3 | [] | no_license | import Server from 'socket.io';
export default function startServer() {
const io = new Server().attach(8090);
//send subset or diffs instead of entire state
store.subscribe(
() => io.emit('state', store.getState().toJS())
);
//emit state to clients and recieve action objects from ... | true |
a9a3bbae5fc76f6a87dd74d230459f217d1924a6 | JavaScript | hao-wang/Montage | /js-test-suite/testsuite/6d1472fcf58b9385b1a91b6e45a69773.js | UTF-8 | 3,684 | 2.875 | 3 | [
"MIT"
] | permissive | load("201224b0d1c296b45befd2285e95dd42.js");
// Based on tests/ion/typed-arrays-1.js, but with string indexes
function testInt8() {
var arr1 = new Int8Array(50);
var arr2 = new Uint8Array(50);
var arr3 = new Uint8ClampedArray(50);
for (var i=0; i<arr1.length; i++) {
arr1[i] = arr2[i] = arr3[i] ... | true |
902a248e335c3b530a11a01815f74e6d464971a7 | JavaScript | jhaip/lovelace | /test_syntax2.js | UTF-8 | 6,340 | 2.59375 | 3 | [] | no_license | function parseWithStates(x) {
const STATES = { "GLOBAL": "GLOBAL", "WHEN_QUERY_PARAMS": "WHEN_QUERY_PARAMS", "WHEN_TRUE": "WHEN_TRUE", "WHEN_OTHERWISE": "WHEN_OTHERWISE", "WHEN_NEW_RESULTS_QUERY_PARAMS": "WHEN_NEW_RESULTS_QUERY_PARAMS", "WHEN_NEW_RESULTS": "WHEN_NEW_RESULTS" }
let STATE = STATES.GLOBAL;
let... | true |
2fdd83ad7c9940ef921785c05996077da481b802 | JavaScript | CesarGonzAndres/suscribersBackend | /routes/index.js | UTF-8 | 3,120 | 2.609375 | 3 | [] | no_license | 'use strict';
const express = require('express');
const router = express.Router();
const request = require('request');
const sqlite3 = require('sqlite3').verbose();
const fs = require('fs');
router.get('/', (req, res) => {
fs.stat('./config/suscribers.db', function(err, stat) {
if(err == null) {
... | true |
672c1bf191711fcbe2454086cf06063353b8ee93 | JavaScript | archana-nagaraj/Team-Profile-Generator | /index.js | UTF-8 | 10,578 | 2.9375 | 3 | [
"MIT"
] | permissive | // Include packages needed for this application
const inquirer = require('inquirer');
const fs = require('fs');
const Employee = require('./lib/Employee');
const Manager = require('./lib/Manager');
const Engineer = require('./lib/Engineer');
const Intern = require('./lib/Intern');
const { Console } = require('console'... | true |
734e5eff3cf9ad3b8727256d76b4b621b3e3a564 | JavaScript | AbhishekM117/Web_Developement | /Assignments/assignment 9/app.js | UTF-8 | 1,101 | 2.96875 | 3 | [] | no_license | class EasyHTTP {
getData(url) {
fetch(url)
.then(res => res.json())
.then(function(data) {
console.log(data);
let output = '';
data.sports.forEach((element) => {
output += ` <div class="row">
<div... | true |
70984f0ef6dfa3fffb74c27e001387dbee1d58f3 | JavaScript | Antcliffr12/IPE | /assets/template-parts/bottom-nav/bottom-nav.js | UTF-8 | 261 | 2.75 | 3 | [] | no_license | if ( window.location.pathname == '/' ){
// Index (home) page
console.log('home');
} else {
// Other page
console.log(window.location.pathname);
var element = document.getElementById("home_icon");
element.classList.remove("active");
} | true |
016dbe16e3522bc1bba33fc3a1b98582c28218f0 | JavaScript | ChelesteWang/js-leetcode | /字符串/917-仅仅反转字母.js | UTF-8 | 1,227 | 3.796875 | 4 | [] | no_license | // 917 easy 仅仅反转字母
//
// 给定一个字符串 S,返回 “反转后的” 字符串,其中不是字母的字符都保留在原地,而所有字母的位置发生反转。
//
// 示例 1:
// 输入:"ab-cd"
// 输出:"dc-ba"
// 示例 2:
// 输入:"a-bC-dEf-ghIj"
// 输出:"j-Ih-gfE-dCba"
// 示例 3:
// 输入:"Test1ng-Leet=code-Q!"
// 输出:"Qedo1ct-eeLg=ntse-T!"
/**
* @param {string} S
* @return {string}
*/
var reverseOnlyLetters = func... | true |
d5391a1f5490b82714d3dd0a4c94b5b52abc24d1 | JavaScript | thamiresoliveiragomes/SAP003-burger-queen | /src/components/menu.js | UTF-8 | 2,017 | 2.609375 | 3 | [] | no_license | import React, {useState} from 'react';
import Button from './button';
import { StyleSheet, css } from 'aphrodite';
function Menu (props) {
const [extras, setExtras] = useState([]);
const [options, setOptions] = useState("");
const [showItem, setShowItem] = useState(false);
const handleExtra = (extra) => {
... | true |
53b020b0db752416fa829d151ed49d2586e3507a | JavaScript | wmatthew/quickstart | /js/isPalindrome/isPalindrome.js | UTF-8 | 903 | 4 | 4 | [] | no_license | // is this a palindrome?
function isPalindrome(sentence) {
sentence = sentence.toLowerCase();
sentence = sentence.replace(/[^a-z]/g, '');
return sentence == sentence.split('').reverse().join('')
}
// Tests
assertPalindrome("racecar");
assertPalindrome("race car");
assertPalindrome("A man? a plan, a canal: ...panam... | true |
2ac5c68a5fb5c31c33738f8673effb971cec9692 | JavaScript | vladlemos/regrasJavascript | /routineDay.js | UTF-8 | 1,738 | 4.0625 | 4 | [] | no_license | /*
Criado em 01/2019
Melhorar Regra de negócio
*/
// Globais
var nomeMeses = ['Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro','Novembro', 'Dezembro'];
var nomeDiaSemana = ['Domingo','Segunda', 'Terça', 'Quarta','Quinta', 'Sexta','Sábado'];
var hoje = new Date('20... | true |
bc8928b6e89532a64ae137cb4e1f42646dc70dcc | JavaScript | Jhonata-betronic/ativa-tele | /js/script.js | UTF-8 | 1,437 | 2.84375 | 3 | [] | no_license | //Para alterar o nome do condominio, altere a string em condominio
let condominio = "ED. VISTA CONCEIÇÃO"
const phone = ['(11) 5679-8016'];
const whatsapp = '(11) 97501-1717';
let sec = true;
let month = ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'];
$(document).ready(function (... | true |
d0a7a0a131690a2e49140159a7045198665ab53f | JavaScript | adebigare/ZombieTranslAPI | /server/ZombieLang.js | UTF-8 | 2,079 | 3.015625 | 3 | [] | no_license | var ZombieLang = {};
ZombieLang.zombify = function(inputValue) {
var patterns = [
{
// 8. "r" or "R' is replaced by "RR"
match: /[rR](?!\s|$)/g,
replace: 'RR'
},
{
// 1. lower-case "r" at the end of words replaced with "rh".
match : /r\b/g,
replace : 'rh'
},
{
// 2. an "a" or "A" by i... | true |
96d75c4becc03c4267b50a70223950f1b3e2ad04 | JavaScript | aidanclemente/Eat-Da-Burger | /config/orm.js | UTF-8 | 2,406 | 3.40625 | 3 | [] | no_license | var connection = require("../config/connection.js");
// Helper function for SQL syntax, write a sting of the needed number of ?
function printQuestionMarks(num) {
var arr = [];
for (var i = 0; i < num; i++) {
arr.push("?");
}
return arr.toString();
}
// Helper function to convert obj... | true |
1f08844865089de713fe739edaacdb2100966c2d | JavaScript | valento/kab | /public/src/components/timer.js | UTF-8 | 1,451 | 2.5625 | 3 | [] | no_license | import React from 'react';
import FontAwesomeIcon from '@fortawesome/react-fontawesome';
class Timer extends React.Component {
constructor(props) {
super(props);
this.state = {
remain: props.time,
restart: props.restart
}
this.ding = this.props.onDing;
this.restart = this.restart.bind... | true |
839e47e898c89b0cc353066ba7f4014dcb584c0f | JavaScript | webcomeon/project | /javascript/src/js/home/arr.js | UTF-8 | 3,376 | 4.0625 | 4 | [] | no_license | //1、Array.from()-------------------------------------------------------
let arrayLike = {
'0': 'a',
'1': 'b',
'2': 'c',
length: 3
};
// ES5的写法
var arr1 = [].slice.call(arrayLike); // ['a', 'b', 'c']
console.log(arr1)
// ES6的写法
let arr2 = Array.from(arrayLike); // ['a', 'b', 'c']
console.log(arr2)
Ar... | true |
a9f3e49b1a78046a5a802a46011e133a2f884233 | JavaScript | Seinfeld70/zuluku | /src/reducers/currentUserReducer.js | UTF-8 | 1,283 | 2.734375 | 3 | [] | no_license | import {
USER_LOG_OUT,
AUTH_USER,
AUTH_USER_FAIL,
AUTH_USER_LOADING,
CHECK_LOG_IN
} from "../actions/actionTypes";
const initialData = {
userData: {},
loading: false,
signIn: false,
error: null
};
const removeFromLocalStorage = data => {
for (let keys in data) localStorage.removeItem(keys);
};
cons... | true |
9f2df54259a24e00b777a68fe74284c6466a31b7 | JavaScript | Tesargantarasuherman/react-context | /src/ContextPage.js | UTF-8 | 2,410 | 2.625 | 3 | [] | no_license | import React, { createContext, useState, useContext } from 'react'
import AppContext from './AppContext';
// createContext punya 1 param default value
//akan mereturn object yang di dalamnya ada 2 properti provide,consumer
// Provider
// Provider mempunyai 1 properti yakni value yang akan di baca oleh consumer
// jika... | true |
8c7e212cd8fff7d1a2a3dac812a42c242f46002f | JavaScript | kaveribhumkar/todo_app | /index.js | UTF-8 | 1,674 | 2.625 | 3 | [] | no_license | const express = require('express');
const app = express();
const fs = require('fs');
app.use(express.json()) // for parsing application/json
app.use(express.urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded
app.get('/',(req,res)=>{
res.send('Todo App');
});
app.get('/read/:id',(re... | true |
0d7b03f72dff328e6277c81eee821213450ce8d6 | JavaScript | metteschmidt/VTE | /content/js/popupWindow.js | WINDOWS-1252 | 20,935 | 2.921875 | 3 | [] | no_license | /**********************************************************
Author:
Adam Barry
Indeco
www.indeco.dk
Date: August 8 2009
2009 Adam Barry, all rights reserved
-----------------------------------------------------------
Name:
popupWindow script
-----------------------------------------------------------... | true |
c18a195dfc3611603499e3f7f7c7544279089ce0 | JavaScript | subhajit4980/CrackQuiz.github.io | /script.js | UTF-8 | 3,468 | 3.03125 | 3 | [] | no_license | const quizData=[
{ question: "What will a UPS be used for in a building?*",
a:" To provide power to essential equipment",
b:" To monitor building electricity use",
c:" To carry messages between departments",
d:" To control lighting and power systems",
correct:'a'
},
{ question: "The most com... | true |
0a91aa8c1c224922c8006e788ca74c8337ecae2a | JavaScript | amygori/todo | /app/scripts/main.js | UTF-8 | 490 | 2.71875 | 3 | [] | no_license | //(function ($) {
//instantiate collection
var tasks = new Tasks();
var appview = new AppView();
var listView = new ListView({
collection: tasks
});
//instantiate new task
$(document).ready(function (){
$('#taskList').append(listView.render().$el);
$("#todoSubmit").submit(function(e){
var task = new Task({title... | true |
fbbc59b8287155c3927046b7419e98ef0b808a0d | JavaScript | asackofwheat/assignment_js_oop | /script.js | UTF-8 | 2,214 | 2.796875 | 3 | [] | no_license | $(document).ready(function(){
var c = document.getElementById("grid");
var ctx=c.getContext("2d");
Controller.init();
})
var View = {
init: function(){
this.c = document.getElementById("grid");
this.ctx= this.c.getContext("2d");
$(document).on("keydown", function(e){
var keyCode = e.which... | true |
54f596c63d83029d967d20f303dfbcc14698f745 | JavaScript | everthis/leetcode-js | /837-new-21-game.js | UTF-8 | 551 | 3.40625 | 3 | [
"MIT"
] | permissive | /**
* @param {number} N
* @param {number} K
* @param {number} W
* @return {number}
*/
const new21Game = function(N, K, W) {
if (K === 0 || N >= K + W) {
return 1;
}
const dp = [];
let Wsum = 1;
let res = 0;
dp[0] = 1;
for (let i = 1; i <= N; i++) {
dp[i] = Wsum / W;
if (i < K) {
Wsu... | true |
88ff13c621ae7d752c8947251eddec73459a839b | JavaScript | liudan92221/tv-game | /build/src/image.js | UTF-8 | 2,454 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | /**
* Created by liudan on 15/7/9.
*
* 加载图片模块
*/
'use strict';
var deferred = require('./deferred');
var Util = require('./util');
var isFunction = Util.isFunction;
/**
*
* @param obj {object}
* - src: {string}, 声音地址
* - callback: {function}, 加载成功之后回调函数
*
*/
function Img(obj) {
this.src = obj.src... | true |
2ff2f68cd5db9408512dea199f8fb2185381a244 | JavaScript | Tote/MapsOff | /engine/KeyboardInput.js | UTF-8 | 1,132 | 3.15625 | 3 | [] | no_license | class KeyboardInput {
constructor(){
this.downActions = {}
this.upActions = {}
this.pressedKeys = {}
document.addEventListener('keydown', (e => {
if(e.repeat) return
this.pressedKeys[e.key] = true
if( !! this.downActions[e.key] ){
... | true |
2d69e71f667c4817a74adc2c773f55d8d96a0f15 | JavaScript | hayman42/ios_server | /src/services/userservice.js | UTF-8 | 4,827 | 2.53125 | 3 | [] | no_license | import userModel from "../models/usermodel.js";
import { promises as fs } from "fs";
export default class UserService {
create(data) {
return new userModel(data);
}
point(longitude, latitude) {
return { type: "Point", coordinates: [longitude, latitude] };
}
async checkAndCreate(em... | true |
5398f2511ee98fabd6caa79fda0814848b79dedd | JavaScript | EdithOrt/CDMX009-cipher | /src/cipher.js | UTF-8 | 888 | 2.921875 | 3 | [] | no_license | const cipher = {
encode (texto, desplazamiento){
let resultado= '';
let codificando;
for (let i=0; i < texto.length; i++){
let mayusculas= texto.toUpperCase();
let ascii= mayusculas.charCodeAt(i);
if (ascii==32) {
codificando= 32;
} else {
codificando=((ascii ... | true |
19bb5fcca7527eeb4474fdb3e2963fd92324a652 | JavaScript | DriftMind/js-tracker | /test/lib/EsprimaParser-unit/parsers/BinaryExpression-test.js | UTF-8 | 1,408 | 2.734375 | 3 | [
"MIT"
] | permissive | // spec: https://github.com/estree/estree/blob/master/spec.md#binaryexpression
describe('BinaryExpression tests', () => {
let binaryExpression
beforeEach(() => {
binaryExpression = createAstNode('BinaryExpression', {
operator: 'binaryOperator',
left: createAstNode('ExpressionLeft'),
right: c... | true |
0daad53dbacc719bced0817c609978e880b07534 | JavaScript | vinarius/algorithm-practice | /javascript/differentSymbolsNaive.js | UTF-8 | 426 | 4.25 | 4 | [] | no_license | // Given a string, find the number of different characters in it.
// Example
// For s = "cabca", the output should be
// differentSymbolsNaive(s) = 3.
// There are 3 different characters a, b and c.
function differentSymbolsNaive(s) {
const uniqueChars = [];
s = s.split('');
s.forEach(el => {
... | true |
17149689854eec266ac834a01d7ed86c2b7e2ebe | JavaScript | alexanderluchs/Ruby | /assets/js/ghostHunterConfig.js | UTF-8 | 1,700 | 2.703125 | 3 | [
"MIT"
] | permissive | function itemHasCurrentTag(item) {
var hasCurrentTag = false;
var currentTag = getCurrentTag();
if (currentTag != "") {
item.tags.forEach(tag => {
if (tag.name == currentTag) {
hasCurrentTag = true;
}
});
} else {
hasCurrentTag = true;
... | true |
4dd8cd7fa18f20491f65edb45bb7967469e3981d | JavaScript | SofthouseVxo/Education | /courses/javascript/exercises/solutions-exercises/javascript-7-decisions/index.js | UTF-8 | 1,650 | 4 | 4 | [] | no_license | var height = 190;
if(height > 100){
console.log('higher than 100')
}
if(height < 180){
console.log('lower than 180')
}
if(height == 190){
console.log('exactly 190')
}
if(height === 190){
console.log('exactly 190 and same type')
}
// ---------------------------------
if(height > 100){
console.log('higher th... | true |
daab6762193125cfa391d4bddc5dc27dbfcf5f1b | JavaScript | FHtengjiao/Exercise | /jsfile/asktion.js | UTF-8 | 991 | 3.109375 | 3 | [] | no_license | function showContent(node) {
var oContent = document.getElementById("content");
if(node.value === "yes"){
oContent.className = "open";
}
else
oContent.className = "close";
}
function showResult() {
var flag = false;
var oLiNodes = document.getElementsByName("no1");
var oRes1... | true |
d118105edf21abc59212909eef660a10ebd707ac | JavaScript | SieLieDie/SushiShop-v2.0 | /SushiShop/Script/buyLogick.js | UTF-8 | 9,823 | 3.265625 | 3 | [] | no_license | var totalPrice = 0;
var basket = new Set();
function Item(name, imgPath, description, price) {
this.name = name;
this.plusId = name.toLowerCase() + "Plus";
this.minusId = name.toLowerCase() + "Minus";
this.counterId = name.toLowerCase() + "Counter";
this.counter = 0;
this.imgPath = img... | true |
b1ca0f4b92cf103fde3afb0640276934793064cd | JavaScript | danscan/fractal | /app/vendor/pro-inputs/src/components/NumberIncrementField/index.js | UTF-8 | 2,830 | 2.59375 | 3 | [
"MIT"
] | permissive | import React, { Component, PropTypes } from 'react';
import { Image, Text, TextInput, TouchableOpacity, View } from 'react-native';
import incrementButtonImage from '../../../assets/img/incrementButton.png';
import decrementButtonImage from '../../../assets/img/decrementButton.png';
import styles from './styles';
expo... | true |
c33512d638f6d642754a082f8eeda84320ad1cf5 | JavaScript | stayhungry/pt | /node/request_handler.js | UTF-8 | 2,462 | 2.546875 | 3 | [] | no_license | var url = require("url"),
fs = require("fs"),
formidable = require("formidable");
// api for introspecting server methods
// TODO: read up methods & annotations from the handler object
function index(req, res) {
console.log("upload path: "+this.doc_root);
res.writeHead(200, {"Content-Type": "text/html"});
... | true |
a128db06acb71f5f96b9e8fc85a7c3c60f4e9f43 | JavaScript | 2097934471/1922A_node | /day1/global.js | UTF-8 | 777 | 3.015625 | 3 | [] | no_license | // 系统提供 处理 路径 的模块
const path = require('path');
// 当前 js 文件所在的路径地址
console.log(__dirname)
// 当前js 文件 的 完整路径
console.log(__filename)
console.log('----------------')
let currentPath = path.resolve('.');
console.log(currentPath);
console.log('==================')
// path 模块 的 join 方法用来 拼接路径, 他会自动根据操作系统来 觉得用什么路径分隔符 / 或... | true |
6779795140da09c101845ee0cdcddece051f3a07 | JavaScript | e1em/e1em.github.io | /Script.js | UTF-8 | 5,810 | 2.75 | 3 | [] | no_license | var People = 7000000000
var Money = 2000;
var VaccinesMade = 0;
var VaccinesGiven = 0;
var TotalVaccines = 0;
var AutoVaccine = 0;
var endGame = 0;
//Support
var VMachineBought = 0;
var VFacBought = 0;
var VDisBought = 0;
var VMassBought = 0;
var VCompanyBought = 0;
var Ve1emBought = 0;
var VPortalBought = 0;
/////... | true |
8ef836d9a2871019b6c2db1e70f106aef3bfdbf7 | JavaScript | infoshareacademy/jfdzl2-frontendex | /js/game-player.js | UTF-8 | 3,477 | 3.234375 | 3 | [] | no_license | class Player {
constructor(walls, lifeDown, scoreUp, scoreRender, opponent, gamepoint) {
this.walls = walls;
this.opponent = opponent;
this.handleLifeDown = lifeDown;
this.handleScoreUp = scoreUp;
this.handleScoreRender = scoreRender;
this.size = 20;
this.playerCords = {
x: 0,
... | true |
15d569851d628a95ee6bec39fe56e8e92e6aed42 | JavaScript | Woohaik/github-actions-test | /arrayConcatenator.spec.js | UTF-8 | 619 | 3.28125 | 3 | [] | no_license | const arrayConcatenator = require("./arraysConcatenator");
describe("Return a values in a array", () => {
it("Number", () => {
expect(arrayConcatenator(5)).toEqual([5]);
})
it("String", () => {
expect(arrayConcatenator("5")).toEqual(["5"]);
})
})
describe("Return arrays concateneted",... | true |
3d414d6f362f488391bc4acba470ecf2ad99956d | JavaScript | SoftX-GR/hypermoto | /app/utils/Crypto.js | UTF-8 | 3,556 | 2.640625 | 3 | [] | no_license | import { NativeModules } from 'react-native';
let AES = NativeModules.Aes;
let _crypto = {
generateKey: async (password, salt) => {
return await AES.pbkdf2(password, salt);
},
encrypt: async (textOrObject, password = null) => {
//const iv = 'base 64 random 16 bytes string';
try {
... | true |
70db0b1be9d606cb2afa67b2b3d3011f7f85ba03 | JavaScript | willqin3/papasquat | /melonJS/examples/isometric_rpg/js/entities/Mom.js | UTF-8 | 7,128 | 2.765625 | 3 | [
"MIT"
] | permissive |
/************************************************************************************/
/* */
/* a mom entity */
/* ... | true |
c609256b49de99e490cf859ffb361839ef32fa53 | JavaScript | Shivam7/node-chat-App | /public/js/index.js | UTF-8 | 350 | 2.90625 | 3 | [] | no_license | var socket=io();
socket.on('connect',function(){
console.log('connected to server');
/*socket.emit('createMessage',{
from:'Shivam Sharma',
text:'Yes socket IO is working'
})*/
});
socket.on('disconnect',function(){
console.log('Disconnected from server');
});
socket.on('newMessage',function(message){
console.log... | true |
cc799c444e292d255bcb7d2399eea3fceb15366e | JavaScript | katherin26/Mumbling | /app.js | UTF-8 | 387 | 3.484375 | 3 | [] | no_license | function accum(text) {
let repeat = 0;
let output = [];
for(let i = 0; i< text.length; i++) {
let letra = text[i];
if ((letra >= "a" && letra <= "z") || (letra >= "A" && letra <= "Z")) {
output.push(`${letra.toUpperCase()}${letra.toLowerCase().repeat(repeat)}`) ;
... | true |
0af4e3be8555337339526cc45b41dbd369a07c1c | JavaScript | cursoip2015/HolaMundoJorge | /WebContent/js/tests/test.js | UTF-8 | 1,786 | 3.296875 | 3 | [
"MIT"
] | permissive | /*
TEST
*/
QUnit.test("Funciones predefinidas", function (assert)
{
assert.ok(escape("Hola Mundo" == 'Hola%20Mundo', "'Hola mundo' escapado"));
assert.ok((10 + "1" ) == "101", "Sin parseInt 10 + \"1\" = 101");
assert.ok((10 + parseInt("1") ) == 11, "Con parseInt 10 + \"1\" = 101");
assert.ok( isNaN("1... | true |
9262b3f3ae04bec868bade4376aeeb0b4fd15366 | JavaScript | piedrucci/invu.reports | /src/components/toolbar/calculateData.js | UTF-8 | 6,888 | 2.6875 | 3 | [] | no_license | import _ from 'lodash'
import {utils} from '../../utils/utils'
export const ProcessSales = (groupName, data) => {
// agrupar por el campo seleccionado (groupName)
let grouped = _.groupBy(data, (row)=> {
return row.item[groupName]
})
const arrayItems = _.map( grouped, (row) => {
let rowInfo = row[0]
... | true |
34fb8ddec5efe296c52eea7ef6b10486efda5e44 | JavaScript | drbernal47/covid-vaccination-dashboard | /static/js/barChartRace.js | UTF-8 | 9,947 | 2.59375 | 3 | [] | no_license | console.log('barChartRace.js loaded');
var sampleData = [
{
date: Date.parse('2000-01-01'),
name: 'Coca-Cola',
category: 'Beverages',
value: 72537
},
{
date: Date.parse('2000-01-01'),
name: 'Pepsi',
category: 'Beverages',
value: 63723
},
{
date: Date.parse('2000-01-01'),
... | true |
7f899c5578ed91460c80722905eba777408fac52 | JavaScript | SherriW/Password-Generator | /assets/scripts/js/script.js | UTF-8 | 4,099 | 4.15625 | 4 | [] | no_license | // Steps for password generator project
// 1. handle button click, you need to create a click event using the addEventListener for this generate button
// 2. display - window.prompt() to ask the user for size of the password
// 3. validate - only numbers and size of password, the range >8 and <128
// 4. prompt- window... | true |
dbd5e34c975c1a50979c612c9602fd90075bbb66 | JavaScript | seanders/groove_cards | /src/services/ai.test.js | UTF-8 | 2,616 | 2.859375 | 3 | [] | no_license | import ai, { findFirstPair, findKnownPairs } from './ai';
describe('findFirstPair', function() {
describe('when it finds a match', function() {
var testCards = [
{
id: 1,
value: 7,
userId: null,
},
{
id: 2,
value: 7,
userId: null,
},
{... | true |
ccd7611c18acc4022345e0729f58fb68a35c94c3 | JavaScript | samuraicarm/gg-client | /src/components/GameList.js | UTF-8 | 555 | 2.515625 | 3 | [] | no_license | import React from "react";
const GameList = (props) => {
//looking for specific properties
const { img, name, platform } = props;
//run only when I click it
const addToPlaylist = (name) => {
console.log(name);
};
return (
<article className="game">
<img src={img} alt="" />
<h4 onClick... | true |
8e79492f99e666073d4928f31df10fedc62e5830 | JavaScript | jelugbo/cypress-challenge | /cypress/integration/examples/touchbistro.spec.js | UTF-8 | 1,827 | 2.6875 | 3 | [] | no_license | "use strict";
describe("Verifying Valid Scenarios", function () {
it("Opens the application URL", function () {
cy.visit('http://localhost:3000');
});
it("Input a valid value into the text input box and submit", function () {
cy.fixture('sample_data').then(function (dataJson) {
/... | true |
6e72eabae345b588749145670891da6705008613 | JavaScript | abhigun1234/react-router-demo | /src/ComponentLifeNew.js | UTF-8 | 691 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
class ComponentLifeNew extends Component {
constructor(props){
super(props)
this.state={
name:'abhhishek'
}
console.log(" ComponentLifeNew constructor called")
}
static getDerivedStateFromProps(props,state){
conso... | true |
08be61dfd54fcd767a54464dd6bb513b16d06663 | JavaScript | meuppt/Chemistry-animation-framework | /web/js/animations.js | UTF-8 | 4,441 | 2.71875 | 3 | [] | no_license | var scene = new THREE.Scene();
var objectCount = 0 ;
function init() {
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
var canvas=document.getElementById("an... | true |
7cd9ae6ee84d066a7b15ece270356944234ec574 | JavaScript | skillnett/timer-react-app | /src/App.js | UTF-8 | 2,180 | 2.796875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
import { Button, Input, Clock, HintMessage } from './components'
import './App.scss'
const NORMAL_SPEED = 1000;
const ONE_AND_HALF_SPEED = 750;
const DOUBLE_SPEED = 500;
const MAX_SPEED = 100;
const App = () => {
const [initialValue, setInitialValue] = useState(n... | true |
abba917e84ea2907ae2ea92dec753ea75698e2fe | JavaScript | AngelCobian/whprojects | /apr06/js/script.js | UTF-8 | 3,552 | 2.953125 | 3 | [] | no_license | var wha =.1 * .2;
var round = Math.round(wha);
var roundUp = Math.ceil(0.000000000001);
var roundDown = Math.floor(0.9999999999)
var pi = Math.PI;
// console.log(Math.pow(8,2));
// console.log(Math.sqrt(64));
// console.log(Math.random()* 100);
// console.log('.round():'+round, '.roundup():'+round... | true |