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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
80a225940a8a4ef46125e5a91e4be8e0b589a97b | JavaScript | alphonseb/practical-react | /src/components/Counter.js | UTF-8 | 781 | 2.984375 | 3 | [] | no_license | import React, { Component } from 'react';
export class Counter extends Component {
constructor(props) {
super(props);
this.state = {
count: props.initialCount
};
}
handleIncrementClick = () => {
this.setState({
count: this.state.count + 1
})... | true |
ee28cb24a3326418c1ec12908f0c3cc203a9e2e2 | JavaScript | AnaisRojas/CFL2021.FullStack | /Programacion basica/Borradores/FinvertirArray.js | UTF-8 | 488 | 3.59375 | 4 | [] | no_license | //ESTO ES UNA PLANTILLA
function mostrarVectorInvertido(v, cantidad) {
let indice;
for (indice = cantidad - 1; indice >= 0; indice--) {
console.log(v[indice], " ");
}
};
function invertirVector(v, cantidad) {
let indiceIzq = 0;
let indiceDer = cantidad - 1;
let aux;
while (ind... | true |
5ee79992c55a3d5c943be0f735d6a5de63e7c1b9 | JavaScript | dz261818/Derek_Zemper_MapData | /sketch.js | UTF-8 | 1,516 | 2.734375 | 3 | [] | no_license | // 2021 Best Suburbs to Live in America
const key = 'pk.eyJ1IjoiZHoyNjE4MTgiLCJhIjoiY2ttMHN2dnZhMThueTJvcGtsODh4NW91bCJ9.3aoTEefj1wucdskSB7_NtQ';
const options = {
lat: 38.822591,
lng: -97.350418,
zoom: 2.9,
style: 'mapbox://styles/dz261818/ckmb5pgs15ukg17m8vz6uhufi',
pitch: 0,
}
const mappa = new Mapp... | true |
dfa0e7e39425c1481606b50d55f63789b6efa346 | JavaScript | Das-Abhi/Das-Abhi.github.io | /Calculator.js | UTF-8 | 1,352 | 3.625 | 4 | [] | no_license | function sqrt(){
var x,y;
x=Number(document.MyCal.input.value);
if(!(x<0)){
y=Math.sqrt(x);
document.MyCal.input.value=y;
}
else
swal("Imaginary", "There is no real root of a negative number.", "warning");
}
function ln(){
var x,y;
x=Number(document.MyCal.input.value);
if(!... | true |
858d8143990ff8ade2635ae17751b100b77abdcd | JavaScript | Joany2185/javascript | /js_eighth_day/merge.js | UTF-8 | 405 | 3.40625 | 3 | [] | no_license | let target = {a:3, b:2}
let source1 = {a:2, b:4}
let source2 = {e:8, c:5}
function merge(...arg) {
if(arg.length >= 2) {
var result = {};
arg.forEach(function(element){
Object.assign(result, element);
})
return result;
}else{
console.log('Please, we ... | true |
9c0eeac2f51ed317d589481dc7d0e98e90a2c44b | JavaScript | winkduo/letterboxd-sources | /content.js | UTF-8 | 2,410 | 2.96875 | 3 | [
"MIT"
] | permissive | const PUTIO_SERVICE_NODE_CLASS = "putio-extension-link";
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
console.log(sender.tab ?
"from a content script:" + sender.tab.url :
"from the extension");
if (request.type == "addService") {
addService(reque... | true |
018431475fa9d8ab1650893c6cd63f13fa3f3248 | JavaScript | andyhansen/magnet-board | /js/scripts.js | UTF-8 | 1,936 | 2.625 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
// words come from api/words.js - to get around .json loading issues
var magnetArea = $("#MagnetSidebar");
$.each(words.categories, function (categoryName, categoryFields) {
var magnetRow = $("<div/>").addClass("magnet-row");
magnetRow.append($("<h3/>").text(... | true |
b2702e619e21d9d50c443e2ee9a4c0dfa6deb3c1 | JavaScript | d-mon-/typeof-- | /getConstructor.js | UTF-8 | 2,172 | 2.8125 | 3 | [
"MIT"
] | permissive | /**
* Created by GUERIN Olivier, on 05/10/2015.
* Twitter: @MisterRaton
*/
;
(function (factory) {
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = factory();
}
exports.getOwnConstructor... | true |
2069cfc68875e9c106f2d77750cf5d8fe9b9cf1b | JavaScript | ZoomIsland/nonogram | /src/components/Pagination.js | UTF-8 | 1,124 | 2.71875 | 3 | [] | no_license | import './Pagination.css';
function Pagination(props) {
const pages = Math.floor(props.totalNonograms / 10);
let pageDivs = [];
for (let i = 0; i <= pages; i++) {
pageDivs.push(i);
}
const pageMaker = pageDivs.map(page => {
if (page === props.currentPage) {
return (
<div className="curr... | true |
554708c0a529535cfb11f04e91b9bb8d945e6341 | JavaScript | Bueribrian/Designs-petters | /builder/course.js | UTF-8 | 313 | 2.546875 | 3 | [] | no_license | class Course {
constructor(builder) {
this.name = builder.name;
this.ceo = builder.ceo;
this.cotization = builder.cotization;
this.bankruptcy = builder.bankruptcy;
this.employees = builder.employees;
}
toString() {
console.log(JSON.stringify(this));
}
}
module.exports = Course;
| true |
a8354f7a617416f3fee7964a59081149934a1e86 | JavaScript | alexandresimardforbes/exercism.io | /javascript/pangram/pangram.js | UTF-8 | 246 | 3.0625 | 3 | [] | no_license | //
// This is only a SKELETON file for the 'Pangram' exercise. It's been provided as a
// convenience to get you started writing code faster.
//
export const isPangram = (word) => new Set(word.toLowerCase().replace(/[^a-z]/g, "") ).size === 26; | true |
c680eeb1b9574abefcc854da2d1bdfa346ab5ab4 | JavaScript | Ivancolm/phase-0-intro-to-js-2-looping-code-along | /index.js | UTF-8 | 329 | 3.1875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Code your solutions in this file
const name = ["Lisa", "Kaitlin", "Jan"];
const event = "surprise";
function writeCards (names,events){
let newArr=[];
for (let i=0; i<names.length; i++)
{
newArr.push("Thank you, ${names[i]}, for the wonderful ${event} gift!");
debugger
return newA... | true |
f9bc382527f644b13747b9a3aeaf3a0d2725ff6c | JavaScript | Debjit08/my_weather_app | /src/Components/FeatchTempData.js | UTF-8 | 2,270 | 2.875 | 3 | [] | no_license | import React from "react";
class FeatchTempData extends React.Component{
constructor(props) {
super(props);
this.state = {
city: "Indore",
country:"India",
ApiKey:"7d522c0a8e7523599a797fd256d1cbaa",
temp:0,
Icon:"",
Des:""
... | true |
07d6a93dd02323033b753b74a43908cbb5478771 | JavaScript | Labibstar/Bus-Booking-System | /js/bookingScript.js | UTF-8 | 1,215 | 2.703125 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function(){
document.querySelector("#date").valueAsDate = new Date();
//Showing Fares//
document.getElementById("loadFare").onclick=function(){
var ajax = new XMLHttpRequest();
var method= "GET";
var url="../php/fares.php";
var asynchronous = true ;
... | true |
6f89594899f1b53f72b379b065897243c70ccb7a | JavaScript | hadisaputra26/jquery | /4. jQuery Traversing/3. jQuery Traversing - Siblings/main.js | UTF-8 | 789 | 2.609375 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
// Pengguanan Siblings()
// $("h2").siblings().css({"color": "red", "border": "2px solid red"});
// Pengggunaan Sibling() lebih dari satu
// $("h2").siblings("p, h6, h5").css({"color": "red", "border": "2px solid red"});
//Penggunaan Siblings() menggunakan ID
$("#h3"... | true |
3277cc9867480a88bf59e36ffa0528f5de244922 | JavaScript | karan301/CS-591 | /Project/Code/routes/tmdb.js | UTF-8 | 1,550 | 2.515625 | 3 | [] | no_license | // Used to talk to the TMDB API
var express = require('express');
var router = express.Router();
// Grab config for TMDB
// See installation section of GitHub documentation for more
const tmdbConfig = require('../config/tmdb')
var api_key = tmdbConfig.API_KEY
// Lots of code from `./amazon.js` repeated here
// See t... | true |
295410776fbb572d4353347bbd04380f78fa1991 | JavaScript | KP1976/BAKERY_SHOP | /js/test.js | UTF-8 | 372 | 3.203125 | 3 | [] | no_license | // const tab1 = [0, 0, 0, 0];
// let { 0: a, 1: b, 2: c, 3: d } = tab1;
// let string = '';
// const text = 'd';
// switch (text) {
// case 'a':
// a++;
// break;
// case 'b':
// b++;
// break;
// case 'c':
// c++;
// break;
// case 'd':
// d++;
// tab1[3]++;
// [string] = tab1.toString();
// ... | true |
593f5032984e79be39c68f773e3c039cc3f47bd0 | JavaScript | alexandrobin/gestaponline | /client/src/components/createsession.js | UTF-8 | 1,861 | 2.609375 | 3 | [
"MIT"
] | permissive | import { Link } from "gatsby"
import PropTypes from "prop-types"
import React from "react"
import axios from "axios"
class CreateSession extends React.Component {
state = {
name : "",
pseudo : "",
}
updateForm = (e) => {
let {name, pseudo} = this.state
if (e.target.id === "... | true |
457bf7179f8d426fc91af29beaaf074df2b247be | JavaScript | saksham-shah/cool | /src/interpreter/std/console.js | UTF-8 | 1,818 | 3.171875 | 3 | [] | no_license | const Class = require('../../ast/class');
const Types = require('../../types/types');
const Evaluator = require('../../interpreter/evaluator');
const Func = require('../../ast/func');
const FunctionCall = require('../../ast/functioncall');
const NativeExpression = require('../../ast/nativeexpression');
const NumberL... | true |
26e90c6ff0a4f832fdc8a658e8a5d48be25d9b40 | JavaScript | HildoBijl/scores | /src/util.js | UTF-8 | 569 | 3.5 | 4 | [] | no_license | const roundTo = (num, digits = 0) => {
const f = Math.pow(10, digits)
return Math.round(num * f) / f
}
// Return (a above b) = a!/(b! * (a-b)!).
const permutation = (a, b) => {
// Check input.
if (a < b)
throw new Error(`Permutation error: cannot take a permutation of ${a} above ${b}. The first nu... | true |
dae0a5f45f8b0e1d219d9d95f0b67bbfbd1d6a3f | JavaScript | edotassi/edotassi.github.io | /win.state.js | UTF-8 | 1,419 | 2.921875 | 3 | [] | no_license | (function() {
function preloadWin() {
game.load.image("background", "assets/background.jpg");
}
function createWin() {
game.add.tileSprite(0, 0, 800, 600, "background");
game.add.text(80, 80, "Complimenti hai vinto!", {
font: "50px Arial",
fill: "#FFFFFF"
});
var ranking = JSON.... | true |
19aaa6b78aba738762cbd1449650557246b9fb7e | JavaScript | eddiemarovich/checkerboard-exercise | /script.js | UTF-8 | 384 | 3.140625 | 3 | [] | no_license | for(var i = 0; i <81; i++){
var tile = document.createElement('div');
var body = document.getElementsByTagName('body')[0];
document.body.prepend(tile);
tile.style.width = '11.1%'
tile.style.paddingBottom = '11.1%'
tile.display = "float"
tile.style.float = "left"
if(i%2 === 0){
tile.style.backgroundColor = "red";
}els... | true |
8c6d921cb3e1f89beab401a3730ada4d6a5f455e | JavaScript | Slim-Saidi/Mongoose-Checkpoint | /server.js | UTF-8 | 2,674 | 2.875 | 3 | [] | no_license | // requiring
const express = require("express");
const mongoose = require("mongoose");
const PORT = 5001;
const app = express();
const url = process.env.MONGO_URI;
require("dotenv").config();
// connecting database
mongoose.connect(
url,
{ useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false },... | true |
d002608fe10edfc5f5eb751ef2c2d48f3a8da732 | JavaScript | 1ah-mtx/todo-task | /client/templates/displayTasks.js | UTF-8 | 1,594 | 2.890625 | 3 | [] | no_license | /*
displayTasks scripts
*/
const TASK_CLASS_DONE = 'task-done';
const TASK_CLASS_LATE = 'task-late';
const TASK_CLASS_PENDING = 'task-pending';
// task list helpers
Template.displayTasks.helpers({
// gets the task list from the collection
tasks: () => { return TaskList.find({ userId: Meteor.userId() }) }... | true |
a206003be9496f6c2e4bdb07836f559bf28f61ae | JavaScript | htwright/4-4-drills | /higher-order/higher-order.js | UTF-8 | 1,740 | 4.0625 | 4 | [] | no_license | // function repeat(fn, n) {
// let i = 0;
// while (i < n) {
// fn();
// i++;
// }
// }
// function hello() {
// console.log('hello world');
// }
// function goodbye() {
// console.log('goodbye world');
// }
//
// repeat(hello, 5);
// repeat(goodbye, 5);
//
// function filter(arr, fn){
// let newArray... | true |
c002e65b6cfb107c891d88b29b669c7903d7d153 | JavaScript | arushxharma/User-Login-Program | /main.js | UTF-8 | 247 | 2.890625 | 3 | [] | no_license |
const form = document.getElementById('signUp-form');
form.addEventListener('submit', createUser);
function createUser(e){
e.preventDefault();
let formdata = new FormData(form);
console.log(formdata.get('fullname'));
}
| true |
1000c1ff2a421edba1a9ee3039b6099d5e42625a | JavaScript | mfakhrusy/codeforces-awesome | /javascript/problemset/problem_set_339A.js | UTF-8 | 1,173 | 4.4375 | 4 | [] | no_license | // Xenia the beginner mathematician is a third year student at elementary school. She is now learning the addition operation.
// The teacher has written down the sum of multiple numbers. Pupils should calculate the sum. To make the calculation easier, the sum only contains numbers 1, 2 and 3. Still, that isn't enough ... | true |
3500677502b8f1a436a04ae151ca1b805d162e98 | JavaScript | ManulMax/Backend-API | /models/User.js | UTF-8 | 1,345 | 2.578125 | 3 | [
"MIT"
] | permissive | const pool = require('../models/db');
const bcrypt = require('bcrypt');
const catchAsync = require('../utils/catchAsync');
const AppError = require('../utils/appError');
const hashPassword = async (pwd) => {
const password = pwd;
const saltRounds = 10;
const hashedPassword = await new Promise((resolve, reject) ... | true |
d9d8895a58f4148bff8550790e2c98babb473e89 | JavaScript | ssull90/pokedex | /src/helpers/GetTypeString.js | UTF-8 | 351 | 3.265625 | 3 | [] | no_license | const getTypeString = (type) => {
let typeString = ''
let typeLength = type.length;
type.forEach((type, i) => {
if (i + 1 === typeLength) {
typeString = `${typeString} ${type}`;
} else {
typeString = `${typeString} ${type}, `;
}
})
return typeString;
}... | true |
bd9eec430b1a38dde36c91be89980c21992eccef | JavaScript | hikeislife/testing-ground | /reshuffler.work/reshuffler.js | UTF-8 | 2,406 | 2.6875 | 3 | [] | no_license | document.getElementById("drnda").addEventListener('submit', dvdnk);
var fileName,
regEntry,
anex = document.getElementById("anexes");
function dvdnk() {
event.preventDefault();
var comName = document.getElementById("firma").value.toUpperCase(),
conNum = document.getElementById("ugovor").value,
hasCon = docu... | true |
5ddb91f853da26b4560f3f5e75c6e0ca48ae448d | JavaScript | Anthony-g2/spotify-search-lab | /js/app.js | UTF-8 | 2,487 | 3.015625 | 3 | [] | no_license | // wait for DOM to load before running JS
$(document).ready( function() {
// check to make sure JS is loaded
console.log('JS is loaded!');
// your code here
// Commented out lines were plans that I couldn't get working,
// So i'm going to come back to them.
// function tempTrack (tracks){
// return... | true |
d22d89afadb15975ad39ca5915cd35f6d3d1d8a9 | JavaScript | YaStasya/generallProject | /server/models/User.js | UTF-8 | 1,422 | 2.671875 | 3 | [] | no_license | import mongoose from 'mongoose';
import md5 from 'md5';
const Schema = mongoose.Schema;
const UserSchema = new Schema({
userName : { type: String, required: true },
email : { type: String, required: true },
password : { type: String, required: true }
});
UserSchema.statics.authenticat... | true |
b0feceee671a73ab96e1b39bd5b0c6ea7f1a69c4 | JavaScript | Ryan180798/DOM_finish | /public/js/ex4.js | UTF-8 | 4,625 | 2.859375 | 3 | [] | no_license | /*
var x = document.getElementById('carrer');
var z = document.getElementById('carrer2');
var nbclick = 0;
btnj.onclick = function myFonction() {
if (x.style.display == 'block') {
x.style.display = 'none';
z.style.display = 'block';
}
else{
x.style.display = 'block';
z.style.display = 'none'... | true |
a054de36ffda16b85984727e162612f4ff2a2f17 | JavaScript | viktorovaleksandr/if_else--HillelPro | /js/task1.js | UTF-8 | 546 | 3.875 | 4 | [] | no_license | // Дано число. Определить, заканчивается оно четной цифрой или нечетной? Вывести последнюю цифру и информацию о том чётная она, или нет.
const fullNumber = +prompt('Enter any number',12345);
if (isNaN(fullNumber)) {
alert('Incorrect input');
} else {
const lastNamber = fullNumber % 10;
const evenOrOdd = lastNamber... | true |
6036316e5def2c389a65f042a2d6861abfca4090 | JavaScript | Lisenish/time-tracker-app | /client/src/services/date-service.test.js | UTF-8 | 1,274 | 2.96875 | 3 | [] | no_license | import {
toDayStart,
toDayEnd,
getMonday,
getSunday,
getFirstDayOfMonth,
getLastDayOfMonth
} from "./date-service";
test("toDayStart resets date time to 00:00:00)", () => {
expect(toDayStart(new Date("2020-01-01T12:33:44")).getTime()).toBe(
new Date("2020-01-01T00:00:00").getTime()
);
});
test("to... | true |
4708e6960b106b7e742f6f935e21f85aba2e56d4 | JavaScript | RBin1630/202001 | /react/day3/src/views/vote.jsx | UTF-8 | 1,205 | 3.046875 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
export default class Vote extends React.Component {
constructor(props) {
super(props);
// 初始化状态
this.state = {
n: 0,
m: 0
};
}
render() {
let { title } = this.props;
return <div className="voteBox">
{title}
</div>;
}
};
/* e... | true |
df8c17ffa6fc67a6d69f93e34cfb52939c19a725 | JavaScript | Patgit-design/algo-js | /exe4-1.js | UTF-8 | 314 | 3.265625 | 3 | [] | no_license | const readlineSync = require("readline-sync");
let rectwi = readlineSync.question("Enter the width of the rectangle: ");
let recthe = readlineSync.question("Enter the height of the rectangle: ");
function calcSurface(width, height) {
return width * height;
}
console.log(calcSurface(rectwi, recthe));
| true |
ccf5a169cdf9b5626176db4cbcedf736a9ffcdac | JavaScript | gitsweets/LC-Project20201127 | /src/vendors/tools/Type/type.js | UTF-8 | 1,435 | 3.796875 | 4 | [] | no_license | /**
* 判断对象是否为空
* @param obj
* @returns {boolean}
*/
var isEmptyObj = function (obj) {
if (JSON.stringify(obj) === "{}"){
return true;
}
return false;
};
/**
* 判断数据类型
* @param type 数据类型
* @returns {function(): boolean}
*/
var isObjFunc = function(type) {
var _toString = Object.prototype.toString;
return ... | true |
b041768765953399ca067f6748a4c85ba8209831 | JavaScript | abhinavg/ttt-slack | /test/grid_test.js | UTF-8 | 2,312 | 2.578125 | 3 | [] | no_license | const assert = require('assert');
const grid = require('../grid');
const models = require('../models');
const gridWithHorizontalLine = {
1: 'O', 2: ' ', 3: 'O',
4: 'X', 5: 'X', 6: 'X',
7: ' ', 8: ' ', 9: ' ',
};
const renderedGridWithHorizontalLine = `
| O | | O |
|---+---+---|
| X | X | X |
|---+---+---|
| ... | true |
8580bbaca66527e25568c7f0d89e9289c17d9d04 | JavaScript | HardingRU/MTG-Collection-CRUD | /models/decksDB.js | UTF-8 | 1,976 | 2.625 | 3 | [] | no_license | const pgp = require('pg-promise')();
const dbConfig = require('../config/dbConfig');
const db = pgp(dbConfig);
module.exports = {
// return all decks
findAll() {
return db.any(`SELECT * from decks`);
},
//return a single deck, but also look to the cards and cards/decks reference tables and pull out all c... | true |
80d398f73cb5d490550431566d8b6b2576760dbd | JavaScript | hoanganh25991/node-tong-hop-don-hang | /product-range.js | UTF-8 | 4,067 | 2.90625 | 3 | [] | no_license | /*
give me a worksheet ~ just an object of
{
A1: "abc",
A2: "def",
...move on...
}
then i try on each column
(0,0), (0,1), (0,2), (0,3),...
>A1, A2, A3,...
>when i find out the signal
>track it
>then get it back
>done
*/
/*
dependencies
*/
var natural = require('natural');
natural._check = function(term, origin){... | true |
47338390e3fd4567227fd541e1fabb607fe46d52 | JavaScript | Nastena-na/First-React | /src/components/Card.js | UTF-8 | 1,961 | 2.546875 | 3 | [] | no_license | import React from 'react';
import CurrentUserContext from '../contexts/CurrentUserContext';
function Card(props) {
const currentUser = React.useContext(CurrentUserContext);
function click() {
props.onClick(props.card); // ложим определённую карточку, по картинке которой кликнули,
//чтобы пробросить её в A... | true |
da9aaf9966fe40dd5ce395d38d297d7456ff151c | JavaScript | seanpm2001/GoogleChromeLabs_Web-AIS-Viewer | /modules/formatter.js | UTF-8 | 3,726 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | true |
58bd55da10261f3b9b2978914ff15687bc6355a5 | JavaScript | YuriRFlp/food-order-app | /src/components/FoodList/FoodItem/FoodItem.js | UTF-8 | 1,638 | 2.546875 | 3 | [] | no_license | import styles from './FoodItem.module.css';
import ButtonRed from '../../UI/Button/ButtonRed';
import { useState } from 'react';
const FoodItem = (props) => {
const [amount, setAmount] = useState(0);
const amountChangeHandler = (event) => {
setAmount(event.target.value);
};
const submitHandle... | true |
25e67c3d340b70b66d61119288f64d92ecb409a9 | JavaScript | taoshao/nodejs | /express/express-tweet/search.js | UTF-8 | 336 | 2.609375 | 3 | [] | no_license | var request = require('superagent');
module.exports = function search(query,fn){
request.get('http://search.twitter.com/search.json',{q:query}) //接口已经修改了。
.end(function(res){
if (res.body && Array.isArray(res.body.results)) {
return fn(null,res.body.results);
}
fn(new Error('Bad twitter response'));
});
}; | true |
765cd6c9bc37f273519279bbd2992bee70315f63 | JavaScript | Matias2484/PG-ECommerce | /client/src/components/recoverPass/recoverPopUp.jsx | UTF-8 | 7,133 | 2.5625 | 3 | [] | no_license | import React, { useState } from 'react'
import ReactCircleModal from 'react-circle-modal'
import './recoverPopUp.css'
import {passModifi, sendMail, changePass} from '../../funciones/login/recoverPass'
export default function RecoverPopUp (){
const [aprove, setAprove] = useState(false)
const [aprovePass, set... | true |
e8e7a85656de785f1d9c99fcec0bbee61d636b52 | JavaScript | jiangchengxu/30DaysOfReact | /Code/10th_challenge/src/App.js | UTF-8 | 777 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import PureComp from './components/PureComponent'
import StatefullComponent from './components/StatefullComponent'
import StatelessComponent from './components/StatelessComponent'
class App extends Component {
state = {
date: ''
}
componentWillMount = () => {
... | true |
257018754ccc14eeef8a6841bdbcf4f06fd4c93d | JavaScript | yoshinbo/FLOC | /vol2/vol2-1.js | UTF-8 | 443 | 2.640625 | 3 | [] | no_license | const crypto = require('crypto');
function hash (algorithm, data) {
return crypto.createHash(algorithm).update(data).digest('hex');
}
console.log(' md5: ' + hash('md5', 'Hello World!'));
console.log(' sha1: ' + hash('sha1', 'Hello World!'));
console.log(' sha256: ' + hash('sha256', 'Hello World!'));
co... | true |
e4f28c9cd1077572142b14fb7127ef90b3fedec2 | JavaScript | yuanworks/bento-money | /src/components/Transactions/TransactionRow.js | UTF-8 | 1,843 | 2.59375 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { View, Text, TextInput, StyleSheet } from 'react-native';
import moment from 'moment';
export function TransactionRow({ transaction, even }) {
const { amount, date, payee, currency } = transaction;
const momentDate = moment(date);
const formattedDate = momentDate.isValid() ... | true |
07ce7b938ca86ea60d2a150a66ae2906701bc9cc | JavaScript | rafaelgrohl222/JavaScript_BasicoAvancado-ES6- | /cursoUdemy_javascript/Aula18_Js-condicoes-if_ElseIf_Else-Ex2/script.js | UTF-8 | 646 | 3.765625 | 4 | [] | no_license | /**CONDIÇÕES IF, ELSE IF, ELSE + OPÇÕES
* IF
* ELSE IF
* ELSE
* O IF QUANDO ENCONTRA UMA VERDADE ELE IMPRIME ELA,
* MAS SE EXISTIR OUTRA VERDADE NÃO VERIFICA E NÃO IMPRIME.
*/
console.log('ALICAÇÃO 2: CONDIÇÕES IF, ELSE IF, ELSE + OPÇÕES');
const numero = 5;
if (1 === 1) {
console.log('***LITERAL***, VERIFI... | true |
de559349b30aaae6612868cf640770b30df1005d | JavaScript | 2020wmurillo/stock | /Stock-Group-Object-master/market.js | UTF-8 | 891 | 2.796875 | 3 | [] | no_license | //imports your code to be tested
const Stock = require("./stock.js");
const Portfolio = require("./portfolio.js");
//Imports my code to run your examples against the economic forcast
//const Forecast = require("./forcast");
function main(){
//create all of your stocks
let stk1 = new Stock("Yum Food... | true |
39e6033705e2d37651366a85f8c393c1b643b15c | JavaScript | Biswajeet11/Mern-stack-practice | /javascript/output-based-basic/settimeout-2.js | UTF-8 | 846 | 3.765625 | 4 | [] | no_license | //1.
console.log("a");
setTimeout(()=>console.log("set"),0);
Promise.resolve(()=>console.log("pro")).then((res)=>res()); // this is a micro task which
// has higher priority so it will print before settimeout
console.log("b")
console.log("------------")
... | true |
7ea19023db53018625885b26a566bb777909156a | JavaScript | imclab/bowser-engine | /src/mouse.js | UTF-8 | 3,374 | 2.78125 | 3 | [] | no_license | // Imports.
var THREE = require('three');
/**
* Initializes the keyboard object in order to control the keyboard.
* @constructor
* @returns {Mouse} A keyboard instance.
*/
var Mouse = function(game) {
"use strict";
this.game = game;
// Initializing buttons.
this.buttons = {};
this.buttons.left... | true |
e70b86a2982ff717f76b74887558adc5be5f236b | JavaScript | kolokolcev2015/Redux-app | /src/redux/postsReduser.js | UTF-8 | 738 | 2.84375 | 3 | [] | no_license | import {CHANGE_POST, CREATE_POST, DELETE_POST} from "./Types";
const initialState ={
posts: [{ id: '1',title: '1'},
{ id: '2',title: '2'},
{ id: '3',title: '3'}
]
}
export const postsReducer = (state = initialState,action) => {
switch (action.type) {
case CREATE_POST:
r... | true |
a6b4e633702b78a36c9ace300d9aee9306355558 | JavaScript | pataruco/mars-rover | /javascript/src/mission-control.js | UTF-8 | 2,586 | 2.953125 | 3 | [] | no_license | module.exports = class MissionControl {
constructor() {
this.data = {
coordinates: {
x: 0,
y: 0
},
robotPosition: {
x: 0,
y: 0,
orientation: "n"
},
robotDirection: false,
lostContactCoordinates: []
};
}
set coordinates(string) {
... | true |
53eb3d858ea84c7e7b86386bf109d768e91a1a41 | JavaScript | Waiting4Tea/verkefni7 | /script.js | UTF-8 | 6,064 | 3.09375 | 3 | [] | no_license | /**
* Verkefni 7 – Reikniæfingarforrit
*
* Forrit sem æfir hraða í að reikna einföld dæmi
*/
// fasti sem segir til um hve marga leiki eigi að spila
const GAMES_TO_PLAY = 10;
/**
* Birtir upplýsingar um leik og eftir að notandi samþykkir spilar fyrsta leik
* með kalli í play().
* Eftir leik er notanda boðið að... | true |
b3d9df4c1d69e4a19094fd26280d6ae2b64600c9 | JavaScript | Queenshiba/freeCodeCamp-project | /Algorithm_Scripting_Projects/Intermediate_Algorithm_Scripting/Diff_Two_Arrays.js | UTF-8 | 1,624 | 3.796875 | 4 | [] | no_license | function diffArray(arr1, arr2) {
// var newArr = [];
// // keep itorating the length of arr1
// for (var i = 0; i < arr1.length; i++) {
// // if arr2 doesn't have(-1) the same item in arr1
// if (arr2.indexOf(arr1[i]) === -1) {
// // push the diff item to newArr
// ne... | true |
55bd84840d6807ba9d9da15cab1f344cf8a7404b | JavaScript | aranibar28/proyecto-react | /src/modules/users/containers/users.js | UTF-8 | 767 | 2.625 | 3 | [] | no_license | import { useEffect, useState } from "react";
import { Card } from "../components";
export function Users() {
//const [count, setCount] = useState(0);
const [users, setUser] = useState([]);
useEffect(() => {
fetch("http://localhost:3000/users/")
.then((response) => response.json())
.then((users) =>... | true |
2def3168021e9056c4e71a7223b168c5b63a1623 | JavaScript | saralk1995/nodepractise | /src/routers/user.js | UTF-8 | 3,686 | 2.71875 | 3 | [] | no_license | const express = require('express') //because all routes using that server
const User = require('../models/user') //because routes k andar hamne user model use kiya hy
const router = new express.Router()
//ek router create kiya aur usey fir export kar diya aur index.js me load kara liya.
//is se jab bhi ham inde... | true |
101b091f0280e0dd7a0696e50228d449047eb3f2 | JavaScript | wei2lee/TestTempleRun | /Assets/FollowPath.js | UTF-8 | 3,420 | 2.578125 | 3 | [] | no_license | #pragma strict
import System.Collections.Generic;
var waypoints:List.<Transform> = new List.<Transform>();
var waypointRadius : float = 0.1;
var damping : float = 100;
var loop : boolean = false;
var speed : float = 6;
var faceHeading : boolean = true;
var jumpSpeed : float = 8;
var useQueue : boolean = false;
priv... | true |
110b4bfba1df5ec487fb2d741756fb8653c8de45 | JavaScript | francisgauthier93/meteoVis_v10 | /public/js/JSreal-2.0.js | UTF-8 | 6,331 | 2.796875 | 3 | [
"MIT"
] | permissive | /*
* JSreal Version 2
*/
var JSrealV2 = (function() {
//// Default this.configuration
// this.config = {
// language: 'en',
// lexicon: {},
// rule: {},
// isInit: false,
// isDevEnv: false
// };
return {
init: function(language, lexicon, rule) {
... | true |
05339c613357f3d376caec97903bea318ab9e9cd | JavaScript | ttreme/vschool-assignments | /exercises/exercise-loops/main.js | UTF-8 | 1,298 | 3.890625 | 4 | [] | no_license |
function myString (str){
for(i = 0; i < str.length; i++){
console.log (str[i]);
}
}
//myString("hello");
//function myCharacter (str, singleChar){
// for (var i = 0; i < str.length; i++){
// if(str[i] === singleChar){
// console.log(str.indexOf(str[i]));
// }
// els... | true |
9eb84051a817ad33f271e02e896d45a33a0f7f03 | JavaScript | ivicmirko/WebProgramiranje-projekat-2019 | /WebOglasi/WebContent/JavaScriptFiles/Admin.js | UTF-8 | 2,359 | 2.515625 | 3 | [
"MIT"
] | permissive | /**
*
*/
function getAllUsers(){
$.ajax({
url:"rest/auth/getAllUsers",
type:"GET",
contentType: "application/json",
success: function(users) {
$("#registrationForm").hide();
$("#allUsersDiv").show();
$("#addCategoryForm").hide();
$("#allCategoriesDiv").hide();
$("#addAdForm").hide();
$(... | true |
4d7dc83c80713cb4237286903cbb9ffd9ce688ba | JavaScript | MangoNiki/learning-es6 | /Array/toLocalString.js | UTF-8 | 356 | 4.21875 | 4 | [] | no_license | /**
* 返回一个字符串表示数组中的元素。数组中的元素将使用各自的 toLocaleString
* 方法转成字符串,这些字符串将使用一个特定语言环境的字符串(例如一个逗号 ",")隔开。
*
* arr.toLocaleString();
*/
var arr = [1, 2, 3, 4, 5, 6, 7, 8];
console.info(arr.toLocaleString()); //1,2,3,4,5,6,7,8
| true |
bd8d618cb810834d110d85a0c4c0fe6ee6e19d2b | JavaScript | renecrapaud/curso_react | /src/App-props.js | UTF-8 | 1,431 | 2.953125 | 3 | [] | no_license | import React, {Component} from 'react';
import logo from './logo.svg';
import './App.css';
function Liga (props){
return <a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
{props.titulo}
</a>
}
Liga.defaultProps = {titulo : <span>Titulo por defecto... | true |
166719a469b22ac72055ab5ce4c8efda430d0f99 | JavaScript | gitter-badger/faxios | /lib/test.mocha.js | UTF-8 | 4,111 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict';
// testing...
var faxios = require('../lib/faxios');
describe('Basics', function () {
this.timeout(10000);
describe('#get', function () {
it('.get(full_url_)', function (done) {
faxios().get('https://jsonplaceholder.typicode.com/posts/1/comments').then(function (res) {
... | true |
523e94ea1b1df27bb2a26d2b5198aa56dea5a6ea | JavaScript | Cantem/react-quizmachine | /src/components/Question.js | UTF-8 | 2,262 | 2.609375 | 3 | [] | no_license | import React from "react";
class Question extends React.Component {
componentDidMount() {
this.props.handleFetch();
}
render() {
console.log(this.props.question);
if (!this.props.question.category) return null;
return (
<div className="app">
<header className="header">
<... | true |
62b03ee7402be33a162894242e3f33d0fd7b25ab | JavaScript | mrVGM/ElectronEditor | /api.js | UTF-8 | 6,201 | 2.578125 | 3 | [] | no_license | function merge(param, base, ext) {
let childParam = ext[param];
if (!childParam) {
return;
}
let baseParam = base[param];
if (!baseParam) {
return;
}
for (let key in childParam) {
baseParam[key] = childParam[key];
}
}
function instantiateScript(id) {
let lib... | true |
466f3ae5f9e2cad5552673b921084d3c8d29737d | JavaScript | rtivital/nier | /src/findLastIndex/findLastIndex.test.js | UTF-8 | 625 | 2.671875 | 3 | [
"MIT"
] | permissive | const test = require('tape-catch');
const findLastIndex = require('./findLastIndex');
const testUtils = require('../../testUtils');
test('N.findLastIndex', (t) => {
testUtils.isCurried(t, findLastIndex(val => val > 2));
testUtils.noIndex(t, { fn: findLastIndex, data: [0, 1, 2, 2], result: 3 });
testUtils.withInd... | true |
0133d4385024eef2b64213e5aa8c96ddcb7b4b5b | JavaScript | Aravind-aravi/contact-api | /dbconnection.js | UTF-8 | 2,038 | 2.765625 | 3 | [] | no_license | const Pool = require('pg').Pool
const pool = new Pool({
user: 'postgres',
host: 'localhost',
database: 'postgres',
password: 'password',
port: 5432,
})
const getUsers = (request, response) => {
pool.query('SELECT * FROM contact', (error, results) => {
if (error) {
throw error
}
response.... | true |
7fd2dc2eb37cf0b862844fbcd7c2a44b9311d190 | JavaScript | chanderbhanu096/Java-Script-Exercises | /03_04/script.js | UTF-8 | 191 | 3.09375 | 3 | [] | no_license | var a = 5;
var b = 4;
var c = "5"
var sum = a + b;
var concat = a + c
document.body.innerHTML = `<h1> simple addition ${sum}</h1>
<h1>concatination ${concat}</h1>`
| true |
89593e2f68f7795cd870185753a2512e85d6537b | JavaScript | EricLeeN1/daily-exercise | /demo13-重拾express/demo/use.js | UTF-8 | 1,663 | 2.96875 | 3 | [] | no_license | var express = require('express');
var app = express();
//没有挂载路径的中间件,应用的每个请求都会执行该中间件
app.use(function (req, res, next) {
console.log('time:' + new Date());
next();
});
// 挂载至 /user/:id 的中间件,任何指向 /user/:id 的请求都会执行它
app.use('/user/:id', function (req, res, next) {
console.log('请求类型:', req.method);
next();... | true |
fc1bbbe64e5a637488cc5ef8e9ca3a203e6ee2df | JavaScript | dkumar1997/ChatApp | /index.js | UTF-8 | 2,926 | 2.734375 | 3 | [] | no_license | var app = require("express")();
var http = require("http").createServer(app);
var io = require("socket.io")(http);
app.get("/", (req, res) => {
res.sendFile(__dirname + "/index.html");
});
app.get("/styles.css", (req, res) => {
res.sendFile(__dirname + "/styles.css");
});
let totalPeople = 0;
let usernames = [];
... | true |
22b75db02c6feb6bb21856466bc1d5cb2ab91615 | JavaScript | Radio-RMG/Player | /src/js/player.js | UTF-8 | 1,027 | 2.640625 | 3 | [] | no_license | console.log('script player.js bien chargé')
let lecteur = $('#lecteur')[0]
let play = $('#play')
let pause = $('#pause')
let plus = $('#plus')
let moins = $('#moins')
let player = {
init: () => {
player.refresh()
player.play()
player.pause()
player.volumePlus()
player.volum... | true |
de021ecb5e859aa7428d8debf11e661f9c1de1da | JavaScript | srahat000/quizzWebsite | /dreamPet.js | UTF-8 | 2,100 | 2.6875 | 3 | [] | no_license | $(document).ready(function(){
var total=0;
var strVal;
$(".answer").click(function(){
strVal= $(this).attr("value");
total+= parseInt(strVal);
console.log(total);
$("div.questionGroup").addClass("questionGroupHideC");
$("div.questionGroup").remove();
... | true |
c57c8ba06d6b2455f251c0bc4ebc32db8a78817a | JavaScript | l2fc3s/Fetch-and-JSON-Studio | /script.js | UTF-8 | 1,429 | 3.34375 | 3 | [] | no_license | // TODO: add code here
window.addEventListener("load", function () {
let container = document.getElementById('container');
let count = document.getElementById('astronautCount');
fetch("https://handlers.education.launchcode.org/static/astronauts.json").then((response) => response.json())
.then((data) =... | true |
04212c12e2a7149326e6a6d8aeeddaec145483a7 | JavaScript | mhme2000/starterRocketseat | /JavaScriptBasic/moduleOne/ex02.js | UTF-8 | 155 | 2.78125 | 3 | [] | no_license | function pares(x, y) {
for(cont = x; cont<= y; cont++){
if(cont % 2 == 0) {
console.log(cont)
}
}}
pares(32, 321)
| true |
aedaecad0966555a00f30277e7d5f994ae187c88 | JavaScript | Erik3010/Football-Application-PWA | /js/main.js | UTF-8 | 3,445 | 2.671875 | 3 | [] | no_license | // handle detail for card click
function handleDetail(id, save = false) {
localStorage.setItem("team_id", id);
localStorage.setItem("team_save", save);
// console.log(save);
if (save === true) {
document.querySelector("body").setAttribute("data-saved", true);
} else {
document.querySelector("body")... | true |
bf15697b466fa46c99382fcc9513d8c0c298a3c3 | JavaScript | Lawrenccee/LeetCode-Problems | /128_longest_consecutive_sequence.js | UTF-8 | 465 | 3.296875 | 3 | [] | no_license | /**
* @param {number[]} nums
* @return {number}
*/
var longestConsecutive = function (nums) {
let counts = {};
let result = 0;
nums.forEach((num) => {
counts[num] = true;
});
for (let key in counts) {
key = parseInt(key);
let subCount = 1;
if (!counts[key - 1]) {
while (counts[key... | true |
44b52a0ecd6ff0e19cbac3a353663faff2cd5e9f | JavaScript | kyratna/Hands-on-with-Java-Script | /2_functions_and_hoisting_concept.js | UTF-8 | 1,181 | 4.65625 | 5 | [] | no_license | //java script
//fucntions and its concept of hoisting
function square_root(n){
console.log(Math.sqrt(n)); //gives answer sqrt(10)
return 5; //prints return type value '5' otherwise it would be undefined
// return "hello" : will also work, it will return "hello"
// return; : this can be left empty/undefined as well
}
... | true |
7bc2b51e576f42b9ed3e5f1e204854327465f5df | JavaScript | codestates/BuildUp-client | /src/reducers/dateSelectorReducer.js | UTF-8 | 515 | 2.53125 | 3 | [] | no_license | import { ACTIONS } from "../actions";
import { initialState } from "./initialState";
const dateSelectorReducer = (state = initialState, action) => {
switch (action.type) {
case ACTIONS.SET_DATESELECTOR: {
return Object.assign({}, state, {
dateSelector: {
year: Number(action.payload.year),... | true |
1158d62872cc97486d2faa099f0bf11e7ae90472 | JavaScript | hewhowearspants/Cards-Against-Your-Sanity | /client/src/components/Player.jsx | UTF-8 | 2,497 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import Card from './Card';
class Player extends Component {
renderWhiteCards() {
let showPick = false;
if (Object.keys(this.props.cardSelection) && this.props.blackCard) {
showPick = Object.keys(this.props.cardSelection).length !== this.props.blackCard.pick... | true |
6214fd2c06e11d3c40f0f5e08926003e7e8274d1 | JavaScript | felipehfs/Web-moderna-Javascript | /controle/do-while.js | UTF-8 | 443 | 3.75 | 4 | [] | no_license | // A lambda minMaxRandom retorna um inteiro de um
// respectivo intervalo. Porém, não é validado
// se o max é menor do que o min por propósitos
// didáticos
const minMaxRandom = (min, max) => Math.floor((Math.random() * (max - min) + min))
let opcao = -1
// O DO While executa o trecho de código pelo menos uma vez
/... | true |
48f738a74032129866cbf86a95598cdd2497c500 | JavaScript | ericvera/check-if | /lib/isFirestoreId.js | UTF-8 | 243 | 2.734375 | 3 | [
"MIT"
] | permissive | const _isString = require('./_isString')
/**
* Returns false if not a valid Firestore id (20 characters a-z, A-Z, and 0-9).
* @param {String} id
* @returns {Boolean}
*/
module.exports = id => _isString(id) && /^[A-Za-z0-9]{20}$/.test(id)
| true |
d53d53530a4424191fc71335a49749690f8c138c | JavaScript | rahulkumarjha21/WEB-DEVELOPMENT-PROJECT | /STUDENT DATA MANAGEMENT SYSTEM/JS/script.js | UTF-8 | 3,337 | 2.75 | 3 | [] | no_license | function validateFun1()
{
var username=document.getElementById("username").value;
var password=document.getElementById("password").value;
var regex=new RegExp(/^[0-9]{10,}$/gm);
if(regex.test(username)==false)
{
alert("INVALID USERNAME: ALL CHARACTER MUST BE IN NUMERIC");
ret... | true |
a1363ec37a43f1a32f48ef1f3efab1989e3551a7 | JavaScript | briankostar/ng2UserDiariesServer | /models/Article.js | UTF-8 | 1,154 | 2.59375 | 3 | [
"MIT"
] | permissive | var mongoose = require( 'mongoose' );
var uniqueValidator = require( 'mongoose-unique-validator' );
var slug = require( 'slug' );
var User = mongoose.model( 'User' );
//first define schema
var ArticleSchema = new mongoose.Schema( {
slug :{
type:String,
lowercase:true,
unique:true
},
title :String,
... | true |
ee68caf1fb00c4312b3834ad740d18f638beb104 | JavaScript | paulovelho/ImagesViewer | /_inc/javascript/javascript.js | UTF-8 | 514 | 2.515625 | 3 | [] | no_license | $(document).ready( function(){
var trs = $("#content tr");
var lines = trs.length;
for( var i = 2; i < (lines-1); i++ ){
var tds = $(trs[i]).find("td");
$(tds[0]).addClass("icon");
$(tds[1]).addClass("name");
$(tds[2]).addClass("last_modified");
$(tds[3]).addClass("size");
$(tds[4]).addClass("description... | true |
74053284bb459982023de485490245acde497d22 | JavaScript | i-ape/gibs | /script.js | UTF-8 | 3,535 | 2.6875 | 3 | [] | no_license | let kickstarterURL = 'https://cdn.freecodecamp.org/testable-projects-fcc/data/tree_map/kickstarter-funding-data.json'
let moneyData
let canvas = d3.select('#canvas')
let tooltip = d3.select('#tooltip')
let drawTreeMap = () => {
let hierarchy = d3.hierarchy(moneyData, (node) => {
return node['children']
}).su... | true |
5b6579147c76c476655e479f91891310c693f410 | JavaScript | stamigos/m-interface_v2.0 | /src/components/JobPost/AvailabilityList.js | UTF-8 | 3,819 | 2.953125 | 3 | [] | no_license | import React from 'react'
var monday = false,
tuesday = false,
wednesday = false,
thursday = false,
friday = false,
saturday = false,
sunday = false;
function setDays(workdays) {
var daysArr = workdays.split(',');
for (var i = 0, n = daysArr.length; i < n; i++) {
switch(daysArr[i]) {
case '0':
... | true |
1192329cc0bf294558bf53d3c884b70cf4bd702d | JavaScript | ISauve/Games | /ping_pong.js | UTF-8 | 8,104 | 3.015625 | 3 | [] | no_license | var ppTimerG;
function showPP() {
$('.play').css("display", "none");
var $PP = $('.PP');
$PP.css("display", "block");
$PP.html('Hide Ping Pong');
$PP.attr("onclick","resetPP()");
$('.ping_pong').css("display", "block");
pingPong();
}
function resetPP() {
$('.play').css("display", "bl... | true |
dd35b13fc38108f2990c54f5ced195e7e39d90ad | JavaScript | teslavargas/countries | /api/src/controllers/country.js | UTF-8 | 1,633 | 2.5625 | 3 | [] | no_license | const axios = require('axios');
const {
Country,
Activity
} = require('../../src/db');
const {
COUNTRY_URL
} = require('../../constans');
const ModelCrud = require('./index');
class CountryModel extends ModelCrud {
constructor(model) {
super(model)
}
getAll = async(req, res, next) =>... | true |
d13dba2bb4a772d48b267251f54499bf8f660472 | JavaScript | diegododero/planarity | /src/graph.js | UTF-8 | 3,944 | 3.21875 | 3 | [] | no_license | var Set = function (){
this.elements = {};
};
Set.prototype.add = function(e){
this.elements[e] = true;
};
Set.prototype.has = function(e){
return this.elements.hasOwnProperty(e);
};
Set.prototype.remove = function(e){
delete this.elements[e];
};
var Vertex = function(value)
{
this.value = value;
}
var Edge =... | true |
0428b696eea976d02fc8c2d2848f3548183e120c | JavaScript | niweshrai/Modern-Web-Application | /week1_day04/assignment02/myapp.js | UTF-8 | 673 | 2.921875 | 3 | [] | no_license | 'use strict';
const os = require('os');
async function checkSystem() {
return 'Checking your system...';
}
checkSystem()
.then((data) => {console.log(data)})
.then(() => {
let mem = parseInt((os.totalmem()*0.000001)/1024);
if(mem < 4) {
console.log("This app needs atleast 4GB of RAM.");
return false;... | true |
c91ed0d9028823d6ef9515dddc22085e9cf1cbc8 | JavaScript | bollwar/test_be_2 | /generator.js | UTF-8 | 649 | 2.671875 | 3 | [] | no_license | var client = require('redis').createClient();
var async = require('async');
function generator (callback) {
async.waterfall([
function(cb){
client.rpush('queue', getMessage(), cb)
},
function(answer,cb){
setTimeout(function(){generator(cb);},
Math.flo... | true |
770367b4d78d7d24687aa177aacf210ded5e54c1 | JavaScript | tetsu5555/gas-anime-api | /code.gs | UTF-8 | 2,385 | 3.03125 | 3 | [] | no_license | function doGet(e) {
var returnJson;
if(e.parameter.table=="anime"){
var sheetid = '1xnwINkWl-UoUGwfWNJX5DeJIfScoLtxXHDd74CxEJks';
var data;
if(e.parameter.id){
// 詳細を取ってくる
data = getOneDataFromSpreadSheet(sheetid, e.parameter.id);
var columns = ['id', 'title', 'description', 'src... | true |
48a9cc259f84c906a15e330400e59f26f9d85166 | JavaScript | titilambert/k8dash | /client/src/components/notifier.js | UTF-8 | 2,196 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | import './notifier.scss';
import _ from 'lodash';
import React from 'react';
import Base from './base';
import Button from './button';
const messages = [];
let singleton;
export function addUserNotification(message, isError) {
const item = {
id: Date.now(),
isError,
message,
button... | true |
06642f6186517a8eeea5376aaf18fb7825a93e1e | JavaScript | varinen/svm_loss | /front/src/__tests__/reducers/step.test.js | UTF-8 | 2,294 | 2.546875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | import {createStore, applyMiddleware} from 'redux'
import thunk from 'redux-thunk'
import nock from 'nock'
import {fetchStep, setAvailableIterations, toggleOptimize} from "../../actions";
import {apiUrl, pathFetchStep} from "../../api";
import stepReducer from "../../reducers/step";
const middlewares = [thunk];
let s... | true |
35c160c0baa8fd3da69e46c32dd63c1f4f2708db | JavaScript | nguyenvanluat20/Motphim123 | /navbar.js | UTF-8 | 916 | 2.890625 | 3 | [] | no_license | let search_icon = document.querySelector('#nav-bar-right i.fa-search')
let search_bar = document.querySelector('input[type=text]')
let dark_mode_icon = document.querySelector('#nav-bar-right i.fa-moon')
let container = document.querySelector('.container-md')
let color_status = 0
//console.log(container)
search_icon.ad... | true |
3071195124ddba2d089f173bc51670d6cb3ee2d7 | JavaScript | GravyTrainOfficial/TastyGravy | /client/components/addProduct.js | UTF-8 | 3,871 | 2.671875 | 3 | [
"MIT"
] | permissive | import React from 'react'
import { connect } from 'react-redux'
import { fetchProductData, addProduct } from '../store/products'
/**
* COMPONENT
*/
class AddProduct extends React.Component {
constructor() {
super()
this.state = {
name: '',
description: '',
category: '',
price: '',
... | true |
0b8d27d96945c6a314a937d5b9a0b890082dc4dc | JavaScript | kjgaetjens/DigitalCrafts-Assignments | /Week4/Thursday/stockQuotes/app.js | UTF-8 | 1,058 | 3.796875 | 4 | [] | no_license | // Create a page which allows users to search for stock quotes. The page will consist of a TextBox where users can enter the symbol of the stock they are looking for. When the presses the "Show Quotes" button the app will call the "getStockQuote" function implemented in stockQuotes.js (attached) and get the stock quote... | true |