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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
988dc41b80089c52b1c38a4e45ccac1852c847ad | JavaScript | krista-p/trekker | /trekker-app/src/components/create/MapCreate.js | UTF-8 | 3,755 | 2.609375 | 3 | [] | no_license | import React, { useRef, useEffect, useState } from 'react';
import mapboxgl from 'mapbox-gl';
import MapboxGeocoder from '@mapbox/mapbox-gl-geocoder';
import MapboxDraw from '@mapbox/mapbox-gl-draw';
import DetailCreate from './DetailCreate';
// this token is scoped only for read, so it is okay for clients to see it
m... | true |
1b3f2afb8de2d28a4c0fb6dd3a79bc81ad1b2c7a | JavaScript | eaconde/lessons.freecodecamp | /05_basic_algorithm_scripting/18_bf_where_do_i_belong.js | UTF-8 | 171 | 2.921875 | 3 | [] | no_license | // http://www.freecodecamp.com/challenges/bonfire-where-do-i-belong
function where(arr, num) {
arr.push(num);
return arr.sort().indexOf(num);
}
where([40, 60], 50);
| true |
1aec61b4f250d0c0eb097c398944d8f59ebeb1c2 | JavaScript | sThig/dial | /js/dial.js | UTF-8 | 2,203 | 3.15625 | 3 | [] | no_license | // .rotate() DEMO
$(function() {
rotate = function($element) {
$element.rotate({ count:4, duration:0.3, easing:'ease-out' });
}
$(document).ready(function() {
rotate($('.spinner'));
});
$('.spinner').click(function() {
rotate($(this));
});
});
//http://jsfiddle.net/NYJWx/4/
// var options ... | true |
7da9383ec63681117659689727c2c6387701de49 | JavaScript | tim-kilian/EaselJS | /src/createjs/events/Event.js | UTF-8 | 1,334 | 2.578125 | 3 | [
"MIT"
] | permissive | this.createjs = this.createjs || {};
(function () {
'use strict';
function Event (type, bubbles, cancelable) {
this.type = type;
this.target = null;
this.currentTarget = null;
this.eventPhase = 0;
this.bubbles = !!bubbles;
this.cancelable = !!cancel... | true |
c578919a9594c3bcccd0a98025a6d19c0677deec | JavaScript | MaxiRembrandt/custom-modules | /insultCommand/scripts/games/insult.js | UTF-8 | 1,409 | 2.546875 | 3 | [] | no_license | /**
* This module is to handles the insult game.
*/
(function() {
var responseCount = 0,
lastinsult = 0;
/**
* @function loadResponses
*/
function loadResponses() {
for (var i = 1; $.lang.exists('insultcommand.' + i); i++) {
responseCount++;
}
}
/**
... | true |
94c7315016d4f5d849973c3a8e1929f2651a3764 | JavaScript | sotomi117/proyecto | /nave.js | UTF-8 | 437 | 2.953125 | 3 | [] | no_license | var Nave=function(){
var naveTexture = new THREE.ImageUtils.loadTexture( 'nave.png' );
//crear el plano
var material = new THREE.MeshBasicMaterial( {map: naveTexture, side: THREE.DoubleSide} );
this.plane = new THREE.Mesh(new THREE.PlaneGeometry(100, 100),
material);
this.plane.rotation.y=55;
this.p... | true |
c9927efa054d00e1e61dd701ac987a0c22b00050 | JavaScript | HenriqueRyuji/HenriqueRyuji.github.io | /plugins/wt.sameheight.js | UTF-8 | 1,901 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Same Height jQuery plugin
* @author WingArt team
* @version 1.0
**/
;(function($){
'use strict';
function sameHeight(collection, options){
this.config = {
timeOut: 50,
target: null,
isIsotope: false
}
if(!options.target) throw new Error('\'target\' option should be specified in initializat... | true |
a6e27169c5bcfde06da65382407112af927ac55e | JavaScript | bojicas/learn | /javascript_pro/chapter_05/11_array_type.js | UTF-8 | 146 | 3.546875 | 4 | [] | no_license | // Array Type - adding at an index outside array length
var colors = ["red", "green", "blue"];
colors[99] = "black";
console.log(colors.length); | true |
c8e6333a148944be2e16389f7c8c550cae8d834d | JavaScript | sq271/node.school | /stream-adventure/exercise05.js | UTF-8 | 328 | 2.640625 | 3 | [] | no_license | var through = require('through');
var split = require('split');
var count = 0;
var stream = through(function (buff) {
var line = buff.toString();
this.queue(count % 2 === 0
? line.toLowerCase() + '\n'
: line.toUpperCase() + '\n'
);
count ++;
});
process.stdin.pipe(split()).pipe(stream).pipe(process.st... | true |
7ca110ad5d87243dd0e87bcba5677c1dd6e5f432 | JavaScript | dinghaichao0227/blog | /2020-10-04.js | UTF-8 | 1,208 | 2.953125 | 3 | [] | no_license | //轮播图的一小部分:
function banner() {
var banner=document.querySelector(".hm_banner");
var w=banner.offsetWidth;
var imageBox=banner.querySelector("ul:first-child");
var pointBox=banner.querySelector("ul:last-child");
var points=pointBox.querySelectorAll("li");
var addTransition=function() {
i... | true |
dce0a0b51010d48044ea0c358858731571f76ef5 | JavaScript | jfilhoGN/projeto-teste-login | /cypress/support/steps/CadastroSteps.js | UTF-8 | 1,066 | 2.859375 | 3 | [] | no_license | /* global Give, Then, When, And */
import CadastroObjects from '../pageObjects/CadastroObjects';
const cadastroObjects = new CadastroObjects();
Given('que o usuário esteja na aba de cadastro do sistema', () => {
cadastroObjects.acessarSite();
});
And('informa o {string}, {string}, {string}, {string}, {string}', ... | true |
8d4feb3d31cef671520905d7a5823c9c49f96cd9 | JavaScript | dinesh0666/my-react-githubapi | /src/App.js | UTF-8 | 1,554 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import SearchProfile from "./components/SearchProfile";
import Profile from "./components/Profile";
import "./App.css";
import githubUsernameRegex from "github-username-regex";
import toastr from "toastr";
function App() {
const API = "https://api.github.com/users"... | true |
67ae379d8c1d1b81bfa75e5344326ea5112874cd | JavaScript | rafaelalcindo/handover | /app/controllers/Usuario/UsuarioMongoController.js | UTF-8 | 2,824 | 2.8125 | 3 | [] | no_license | const mongoose = require('mongoose');
const UsuarioSchema = require('../../models/modelUsuarioMongo');
var usuarioModel = mongoose.model('Cliente', UsuarioSchema );
var usuario = new usuarioModel;
module.exports.cadastrarUsuarioMongo = (app, req, res) => {
//console.log('Body: ', req.body);
usuario._... | true |
b6c2d38e9257430ad8e3406c16663934c18c26cd | JavaScript | iac-nyc/React | /react_redux/src/reducers/player.js | UTF-8 | 1,962 | 2.9375 | 3 | [
"MIT"
] | permissive | import * as PlayerActionTypes from '../actiontypes/player';
const initialState ={
players:[{
name: 'Iftekhar A Chowdhury',
score: 79,
created: '9/6/2018',
updated: '9/6/2018'
},
{
name: 'James Bond',
score: 20,
created: '9/6/2018... | true |
447f7c485cd40b1ced4896a337d1430a143d4e29 | JavaScript | timothymorrise/screaming-at-awards-shows | /client/src/App/Landing/SignUp/index.js | UTF-8 | 1,893 | 2.578125 | 3 | [] | no_license | // SIGN UP -- COMPONENT
// ==============================
// IMPORT FROM PACKAGES
import React, { Component } from "react"
import { connect } from "react-redux";
// IMPORT FROM FILES -- CSS, COMPONENTS
import "./SignUp.css"
import SignupForm from "./SignUpForm"
import { signup } from "../../../redux/reducers/auth-re... | true |
dd286a41b7b6ab458421c14b8463f4917aeaae63 | JavaScript | juanbonoso/algorithms-datastructures | /Arrays/optionalExcercises/ContainsDuplicate.js | UTF-8 | 493 | 4.25 | 4 | [] | no_license | const nums = [1, 2, 3, 2, 5 ,5 ];
// 1. We are going to create a set
// 2. Loop array
// 3. If the value is not in the set, add it
// 4. If the values is in the set, return true and break the loop
const containsDuplicate = function (nums) {
const mySet = new Set();
for (let i = 0; i < nums.length; i++) {
... | true |
b0c8f54db373462cadd4c8a93665250580f1f1de | JavaScript | mosoriow/2020-11-30-Lexicon-.NET-uppgifter | /calendar.js | UTF-8 | 1,603 | 3.328125 | 3 | [] | no_license | const monthNames=['',
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
];
function calendar(arr) {
let year=arr[2];
let month=arr[1];
let day=arr[0];
year=2020;
month=11;
le... | true |
c4796fb0adbe0c8a3d9289af5a66be71e86e05a4 | JavaScript | Jermaniac/PracticasJavaScript | /10_reactjs/jsx/04_intro.jsx | UTF-8 | 5,155 | 3.234375 | 3 | [] | no_license |
class Formulario extends React.Component {
constructor(props){
super(props);
this.state={
nombre: "German",
apellidos : "Gonzalez",
comentarios: "Esto es un comentario",
provincia: "Roshar",
errorEnNombre: false
};
}
leer... | true |
c2f69f6c3c008c52fb5cdcccc748e53aee3d0cfd | JavaScript | paspanag/metrics | /reporting/report.js | UTF-8 | 1,644 | 2.84375 | 3 | [
"MIT"
] | permissive | var events = require( 'events' );
var util = require( 'util' );
/**
* trackedMetrics is an object with eventTypes as keys and metrics object as values.
*/
var _evtparse = function (eventName){
var namespaces = eventName.split('.')
, name = namespaces.pop()
, namespace = namespaces.join('.');
return {
... | true |
c4129a62a4ada181583cc259fe1a2919e7163d2e | JavaScript | travisldunn/course | /1-patterns/4-decrease-and-conquer/practice/1-numberOfOnes.js | UTF-8 | 587 | 4.34375 | 4 | [] | no_license | /*
* Number of Ones
*
* *Given a sorted bit array (values of either 0 or 1), determine the number of 1's in the array.*
*
* **Parameters**
* Input: arr {Array of Integers}
* Output: {Integer}
*
* **Constraints**
* Time: O(logN)
* Space: O(1)
*
* **Examples**
* `[0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] --> 8`
* ... | true |
69597a02b8cada81d73c7aa89b06e7e8389f72f5 | JavaScript | joesingo/jte | /src/static/grid/matrix.js | UTF-8 | 3,799 | 3.671875 | 4 | [
"MIT"
] | permissive | /*
* An object to represent a matrix with real entries
*/
function Matrix(entries) {
this.entries = entries;
this.rows = this.entries.length;
this.cols = this.entries[0].length;
for (var i=1; i<this.rows; i++) {
if (this.entries[i].length !== this.cols) {
throw "Invalid entries";
... | true |
6927359a109507a7ec20ff6035127376e469ad87 | JavaScript | notch8/learn-javascript | /curriculum/06-sql/sequelize/support/countries/get.js | UTF-8 | 965 | 2.796875 | 3 | [] | no_license | let connection = require('./models/sequelize-connection')
//connection.authenticate()
// .then(function(){
// console.log('success!')
// })
// .catch(function(error){
// console.log(error)
// })
let Country = require('./models/country')
//Country.findOne().then(function(country){
// console.log(country.g... | true |
3b16fa3993fdf95c86d3e4416763a2017731a9c9 | JavaScript | chadellison/beer-song | /beer-song.js | UTF-8 | 1,435 | 3.40625 | 3 | [] | no_license | function BeerSong() {}
BeerSong.prototype.sing = function(beerCount, range) {
if (beerCount === 3) {
return '3 bottles of beer on the wall, 3 bottles of beer.\nTake one down and pass it around, 2 bottles of beer on the wall.\n\n2 bottles of beer on the wall, 2 bottles of beer.\nTake one down and pass it around, ... | true |
e42ec166c4aae69efb507b4cf5229701343a6349 | JavaScript | vfreitas-/vuex-shopping-list | /src/services/product.js | UTF-8 | 858 | 2.5625 | 3 | [
"MIT"
] | permissive | import mock from './mock/products';
export default new class ProductService
{
constructor () {
this.timeout = 800
}
all () {
return this._run(mock.products)
}
search (term, list) {
let result = list.filter(p => {
return p.name.toLowerCase().includes(term.toLowe... | true |
63dac287fcfce7257eee2be7fbc9581e8d45be62 | JavaScript | a-watkin/node-js-api-course | /asynchronous-js/example-1.js | UTF-8 | 1,025 | 3.625 | 4 | [] | no_license | console.log("Before");
const user = getUser(1, function (user) {
console.log("user", user);
// Get repos
getRepositories(user.gitHubUsername, function (data) {
console.log(data["repositories"]);
});
});
// asynchronous and non-blocking
// schedules a task to performed in the future
// it's still a single ... | true |
f842fe3b7d7ae4226e2ea72979e2b92def0767b2 | JavaScript | namhla1221/the_registration-webapp | /test/reg-test.js | UTF-8 | 4,737 | 2.78125 | 3 | [] | no_license | "Use strict";
var assert = require('assert');
const pg = require('pg');
const Pool = pg.Pool;
let useSSL = false;
if (process.env.DATABASE_URL) {
useSSL = true;
}
const connectionString = process.env.DATABASE_URL || 'postgresql://codex-coder:codex123@localhost:5432/registration'
const pool = new Pool({
conne... | true |
e12095d12be28dffeaf9a2a5564f6b732e8ffc57 | JavaScript | joeldentici/monadic-js | /src/do/transformjs.js | UTF-8 | 4,084 | 3 | 3 | [
"MIT"
] | permissive | const Lexer = require('./lexer.js');
const {expr} = require('./parsedo.js');
const analyze = require('./analyzedo.js');
const transform = require('./transformdo.js');
const generate = require('./generatedo.js');
const [grammar, mappers] = require('./lexical-grammar.js');
const P = require('../parser');
const Either = r... | true |
14c43166ea111d79d0cc3cb1158882b7f2002136 | JavaScript | amir512/Hangman-Game | /assets/javascript/game_alternative.js | UTF-8 | 5,029 | 4.28125 | 4 | [] | no_license | window.addEventListener("load", hangmanStart);
function hangmanStart() {
function createHangmanSong() {
var name //user's name
var NumberofGuesses = 10; //Number of times a user can guess a letter
var lettersGuessed = []; //array to hold the letters already guessed
var wins = []; //Number of times the use... | true |
94174c2150c3c3e91e15b35d7a566e2d599b273c | JavaScript | full-stack-bcn/samples | /javascript/concepts/classes/es6/classes.js | UTF-8 | 439 | 3.46875 | 3 | [] | no_license | class Person {
constructor(name, age) {
this.name = name;
this.age = age;
}
toString() {
return `${this.name} (${this.age})`;
}
}
class Superhero extends Person {
constructor(name, age, powers) {
super(name, age);
this.powers = powers;
}
}
let mrIncredible = new Superhero("Mr. Incredi... | true |
cb94355a4aac4a6271f46940e9736d40b0196bf7 | JavaScript | TT-41-Use-My-Tech-Stuff/Front-End | /unit3/src/components/DeviceList.js | UTF-8 | 1,031 | 2.578125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | import React, { useEffect, useState } from "react";
import Device from "./Device";
import { axiosWithAuth } from "../utils/axiosWithAuth";
import { useHistory } from "react-router-dom";
const DeviceList = () => {
const [list, setList] = useState([]);
const fetchData = (ev) => {
ev.preventDefault();
axiosW... | true |
aa0abe6fe70ad09a04a24e609792c52ee3faf5cd | JavaScript | red-alphadev/Ships | /script/global_functions.js | UTF-8 | 1,239 | 3.296875 | 3 | [] | no_license | function grn(min, max)
{
if (min > max)
{
var t = min;
min = max;
max = t;
}
return Math.floor(min + Math.random() * (max - min));
}
function isEmptyObject(obj)
{
return JSON.stringify(obj) == '{}';
}
function saveData(sector, type, objArray)
{
var xml = new XMLHttpRequest... | true |
f5b62525e70f82120bbd2d0b1635ed28c1e75fc7 | JavaScript | shangayar/Practica2js | /script.js | UTF-8 | 464 | 3.734375 | 4 | [] | no_license | alert("Bienvenidos a la segunda práctica de JS");
var nombre=prompt("Ingrese el nómbre del Alumno: ");
document.write(`<h1>Calcuando Promedios con JS </h1>`);
var prom1=parseFloat(prompt("Ingrese el promedio 1"));
var prom2=parseFloat(prompt("Ingrese el promedio 2"));
var prom3=parseFloat(prompt("Ingrese el promedio 3"... | true |
096a6fc0b8adefc7a9d72ba3b238f01eb29fc5c6 | JavaScript | colonel315/TeachSite | /teach-site/grade6/ratios/comparing-and-converting/comparing-and-converting.js | UTF-8 | 10,312 | 3.84375 | 4 | [] | no_license | /**
* This program will generate questions that have to do with adding, subtracting, dividing, multiplying and converting
* units. Program will check students answers and display whether or not they got it correct or not.
*/
$(document).ready(function() {
/**
* Constructs and empty JSON structor for questions
... | true |
9505431256b4e4063aac94c550dffc46c32a407c | JavaScript | endojs/endo | /packages/test262-runner/test262/test/intl402/DateTimeFormat/constructor-options-order-dayPeriod.js | UTF-8 | 1,231 | 2.796875 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-ecma-no-patent"
] | permissive | // Copyright 2019 Googe Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializedatetimeformat
description: Checks the order of getting options of 'dayPeriod' for the DateTimeFormat constructor.
info: |
ToDateTimeOptions ( options, required, defaul... | true |
4ebb688d3f7f2bafbcc54afe075f02bd1b6ab2de | JavaScript | yw738/react-study | /src/page/views/demo3/1_useState.js | UTF-8 | 1,095 | 2.59375 | 3 | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"MulanPSL-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React, { Component, useState } from "react"
/**
* ## useState hook 组件
*/
function DemoState(props) {
const [isLogin, setLogin] = useState(false);
const [count] = useState(0);
return (
<div>
<div>
计数器{count}
</div>
{isLogin ? '已登录' : '未登录'}
... | true |
3377ff90412626e4997328722a822aa0bebc3ba3 | JavaScript | ayush000/best_cricketer | /server/aggrOperations.test.js | UTF-8 | 5,151 | 2.578125 | 3 | [] | no_license | const aggrOperations = require('./aggrOperations');
it('returns cumulative score, balls faced and match count', () => {
const csvObj = [
{
batting_score: 12,
balls_faced: 14,
}, {
batting_score: 5,
balls_faced: 11,
}, {
batting_sco... | true |
5732bc31ac4a92e0b273c2850582551b19980f2e | JavaScript | heat2002/feliz-halloween | /js/scriptjuego.js | UTF-8 | 1,874 | 3.15625 | 3 | [] | no_license | var video = document.getElementById('screamer');
var audio = document.getElementById('tema');
document.getElementById('player').addEventListener("mouseover",sumarPuntos);
puntos = 0;
tiempo = 60;
necesarios = 40;
function sumarPuntos(){
puntos++;
document.getElementById("puntos").innerHTML ="Puntos: <b>"+... | true |
9f6c2ca430650f3de11c924b48e3976a5c3e8402 | JavaScript | Rakeshkotian08/alarmclock.js | /alarm.js | UTF-8 | 1,647 | 2.96875 | 3 | [] | no_license |
var sound = new Audio("https://raw.githubusercontent.com/Xiija/TestFiles/master/Yuki%20%26%20Tako%2001.mp3");
sound.loop = true;
function addZero(time) {
return (time < 10) ? "0" + time : time;
}
var h2 = document.getElementById('clock');
var currentTime = setInterval(function(){
var date = new... | true |
ffaca14f0bdffd337ced8446493934efe039caa5 | JavaScript | frankmullen/eloquent-javascript | /05. Higher Order Functions/passActionAsFunctionValue.js | UTF-8 | 503 | 4.3125 | 4 | [] | no_license | function logEach(array) {
for (var i = 0; i < array.length; i++) {
console.log(array[i]);
}
}
function forEach(array, action) {
for (var i = 0; i < array.length; i++) {
action(array[i]);
}
}
var numbers = [1, 2, 3, 4, 5];
var sum = 0;
// in this one, a predefined function isn't passed to forEach, but a funct... | true |
f5a7c937dfa78ad4126c5d4af3dd1eccb1257839 | JavaScript | Wedjaa/LookaheadTutorial | /src/modules/es-client.js | UTF-8 | 4,065 | 2.546875 | 3 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import {
HttpClient
}
from 'aurelia-http-client';
export class ESClient {
static inject = [HttpClient];
constructor(http) {
this.http = http;
this.es = false;
}
setConnection(server, port) {
this.es = {
server: server,
port: port,
url: 'http://' + server + ':' + port + '/'
... | true |
cd00ab15a8f29e4ab9bca34ff3ec8711e9a937f7 | JavaScript | Bodal-Andrey/932123-big-trip-11 | /src/store.js | UTF-8 | 485 | 2.5625 | 3 | [] | no_license | export default class Store {
constructor() {
this._destinations = null;
this._offers = null;
}
static getDestinations() {
return Store._destinations;
}
static setDestinations(destinations) {
Store._destinations = destinations;
}
static getOffers() {
return Store._offers;
}
stat... | true |
a68681507a753998218dc1b8dc57f0b592d147ca | JavaScript | kikemadrigalr/FundamentosJavascript-PLatzi | /convertirPeso.js | UTF-8 | 387 | 3.703125 | 4 | [] | no_license | /*
convertir libras a kilogramos kg = lb/2.2046
Convertir kilogramos a libras lb = kg * 2.2046
*/
const diferencia = 2.2046;
function librasKilogramos(lib){
let kilos;
kilos = lib / diferencia;
return kilos;
};
function kilogramosLibras(kg){
let libras;
libras = kg * diferencia;
return libras;
};
kilogramo... | true |
be5548e6f3d3f3ab38987bcb667749eac0766a77 | JavaScript | fork-archive-hub/observable-prerender | /tests/basic.js | UTF-8 | 761 | 2.6875 | 3 | [] | no_license | const { load } = require("../src");
const test = require("tape");
test("basic tests", async (t) => {
let a, b, c, d;
const cells = ["a", "b", "c", "d"];
const notebook = await load("d/b6147a7172ef9c60", cells);
[a, b, c, d] = await Promise.all(cells.map((d) => notebook.value(d)));
t.equal(a, 1);
t.equals... | true |
7ef08cd75e5507591b6c818d8d08bb6e039f3e2b | JavaScript | atzmael/uncafesvp | /src/js/three/loaders/ModelLoader.js | UTF-8 | 2,119 | 2.71875 | 3 | [] | no_license | import * as THREE from "three"
import GLTFLoader from "three-gltf-loader"
import promisifyLoader from "./promisifyLoader.js"
// TODO: replace ItemLoad and ModelLoader by a single function
// (to load an object, using regexp on properties to check for "path" (modelPath, animPath, etc.))
// and use loaders accordingly
c... | true |
3d785c4b26ec0b9505508338543314576333688c | JavaScript | priyaA01/Hangman-Game | /assets/javascript/game.js | UTF-8 | 3,468 | 3.640625 | 4 | [] | no_license | /* global variables declaration */
var wins = 0;
var guessesRemaining = 10;
var lettersGuessed = [];
/* function to start game ,displays the hidden word to find , and allows user to strt entering letters*/
function wordList() {
document.getElementById("errorMsg").style.display = "none";
document.getElementBy... | true |
e19a8f0b2b7becff8c2ff2652a146e39ffe4ccb6 | JavaScript | partyzans/app | /extension/inject.js | UTF-8 | 3,179 | 2.734375 | 3 | [] | no_license | console.warn('INJECTED!');
let alreadyRun = false;
let tempNames = [];
sendMessage('RESET_COUNTER');
function handleResponse(message) {
console.log(`Response: ${message.response}`);
}
function handleError(error) {
console.error(`Error: ${error}`);
}
function sendMessage(data) {
browser.runtime.sendMessage({
... | true |
896cd4ef357b03efb83186c8d3c80d5d8c829953 | JavaScript | greenfox-zerda-lasers/bereczb | /week-07/day-04/events-2.js | UTF-8 | 404 | 4 | 4 | [] | no_license | 'use strict';
// On the click of the button,
// Count the items in the list
// And display the result in the result element.
var button = document.querySelector('button');
var listOfItems = document.querySelectorAll('li');
var resultOfCount = document.querySelector('.result');
function countList() {
resultOfCoun... | true |
ac61ef57a55e160db7ca9af4a3744b9ed5228263 | JavaScript | wsjones25/amity_living | /javascript/scripts.js | UTF-8 | 707 | 2.640625 | 3 | [] | no_license | // Tab
(function(){
function onTabClick(event){
var actives = document.querySelectorAll('.active');
// deactivate existing active tab and panel
for (var i=0; i < actives.length; i++){
actives[i].className = actives[i].className.replace('active', '');
}
// activate new tab and panel
... | true |
d48e595b800d4b63be737984fa5688cda13be57e | JavaScript | stanislavstoyanov99/SoftUni-Software-Engineering | /JavaScript-Advanced/Labs-And-Homeworks/JS Advanced/01. Syntax, Functions and Statements - Lab/01. StringLength.js | UTF-8 | 469 | 3.59375 | 4 | [
"MIT"
] | permissive | function solve(firstInput, secondInput, thirdInput) {
let sumLength = 0;
let averageLength = 0;
let firstInputLength = firstInput.length;
let secondInputLength = secondInput.length;
let thirdInputLength = thirdInput.length;
sumLength = firstInputLength + secondInputLength + thirdInputLength;
... | true |
6eac7ae2d87c6c6f2ae0528a992ddc493c76dd1b | JavaScript | ms2sato/js_namespace | /components/counter.js | UTF-8 | 1,112 | 2.859375 | 3 | [] | no_license | // ネームスペースを指定して、外に露出させない
LIMO.namespace('MYAPP.COMPONENTS')(function(ns){
function Counter(el) {
this.$el = $(el);
this.count = 0;
}
Counter.prototype.setup = function(){
var self = this;
// privateメソッドにしたければこの辺とか?
// こだわらない方は好きなようにやって良いと思います。
function update() {
self.$el.find('.c... | true |
6b90608033db8f3c270de047eff4a90d59c005c2 | JavaScript | iamlearning1/JavaScript-Algorithms-And-Data-Structures | /bubble_sort.js | UTF-8 | 425 | 3.546875 | 4 | [] | no_license | function bubbleSort(list) {
let no_swaps;
for (let i = list.length; i > 0; i--) {
no_swaps = true;
for (let j = 0; j < i - 1; j++) {
if (list[j] > list[j + 1]) {
[list[j], list[j + 1]] = [list[j + 1], list[j]];
no_swaps = false;
}
}
if (no_swaps) break;
}
return list;... | true |
b55e16acdd171a9d133ea547bb4839ca12fd510a | JavaScript | likehc/Download_Media | /js/Base_Js/baseParasPopup.js | UTF-8 | 3,423 | 3.15625 | 3 | [] | no_license | "use strict" //严格模式
//插入方法
var responsejs = `function DownloadFile(_downUrl,_fileName){
if (_downUrl ==undefined ||_downUrl ==null || typeof(_downUrl) != 'string' || _downUrl =='' ) {
console.log('the url not allowed to empty!');
return;
};
var fileInfo=new Object();;
fileInfo.dataType= 'download';
fileInf... | true |
b83214439433dee0cfce6abf8bff22503003f7c0 | JavaScript | hsnice16/palindrome-birthday | /src/SectionTwo.js | UTF-8 | 4,135 | 2.96875 | 3 | [] | no_license | import React, { useState } from "react";
import { GiClick } from "react-icons/gi";
import HandsWithCalendar from "./assets/hands-with-calendar.jpg";
import CalculatingGif from "./assets/calculating-gif.gif";
import {
getPalindromeFormat,
findNearestPalindromeDateAndMissedDays
} from "./functions";
export ... | true |
cd956672d1700458badc4f71a47ccef0ed7b24b2 | JavaScript | moiseyalaev/JS-Exercises | / Basics_Practice/FunctionPractice/funcPrac.js | UTF-8 | 738 | 4.46875 | 4 | [] | no_license | // Return if number is even
function isEven(num) {
return num % 2 === 0;
}
// Return factorial of number
function factorial(num) {
let sum = 1;
while (num > 0) {
sum *= num;
num--;
}
return sum;
}
// Convert a kebab case string to snake case
// function kebabToSnake(kebab) {
// ... | true |
ef39b95fce8533f436800de024d5bea73071af11 | JavaScript | adrianlafond/d3-scratch | /src/d3/lines/index.js | UTF-8 | 1,251 | 2.828125 | 3 | [] | no_license | import * as d3 from 'd3'
import { range } from 'lodash'
import { CONTAINER, CONTAINER_WIDTH, CONTAINER_HEIGHT } from '../../constants'
export default class Lines {
//
constructor() {
this.render()
}
render() {
const svg = d3.select(CONTAINER)
.append('svg')
.attr('width', CONTAINER_WIDTH)
... | true |
b29809d4b14fedf5a14fe2b8b863e3795027f7a7 | JavaScript | Belvedere-1987/Javascript_Projects | /JS/Basic_JavaScript_8.js | UTF-8 | 1,219 | 3.265625 | 3 | [] | no_license | function connect() {
var phrase_1= "Hello! ";
var phrase_2= "Nice to meet you, "
var phrase_3= "what's your name? "
var together= phrase_1.concat(phrase_2,phrase_3);
document.getElementById("statement").innerHTML=together;
}
function meat() {
var tacos; var reply;
var tacos= "Carnitas, pollo... | true |
2096e8fcfa13e05bff65af2fe8473a8b83c946c2 | JavaScript | jozsefmorrissey/node-server | /services/cabinet/test/tests/line-consolidate.js | UTF-8 | 10,317 | 2.65625 | 3 | [] | no_license |
const Test = require('../../../../public/js/utils/test/test').Test;
const Polygon2d = require('../../../../public/js/utils/canvas/two-d/objects/polygon.js');
const Line2d = require('../../../../public/js/utils/canvas/two-d/objects/line.js');
const Line3D = require('../../app-src/three-d/objects/line.js');
const Vertex... | true |
0168c979c95afc13016e73ba9d7c68bfcf987847 | JavaScript | nickparana/machine-learning | /train2.js | UTF-8 | 4,393 | 2.890625 | 3 | [] | no_license |
const fs = require("fs");
const stopwords = require('stopwords-es');
const brain = require('brain.js');
const commentsDir = '../comments';
const commentsPath = commentsDir + '/comments.txt';
const comments = fs.readFileSync(commentsPath, 'binary');
// split corpus in sentences (each sentence is a document for TFIDF... | true |
7b6a6288761331a00784093bebab33dfc8cd5ead | JavaScript | ivanDK5/santander-js | /js/S03-RT03.js | UTF-8 | 363 | 2.734375 | 3 | [] | no_license | const person = {
firstName: 'John',
lastName: 'Doe',
links: {
web: {
blog: 'https://johndoe.com'
},
social: {
facebook: 'https://facebook.com/john.doe',
instagram: 'https://instagram.com/john.doe'
}
}
}
const {facebook:fb, instagram:ig}=person.links.social;
console.log("fac... | true |
b01364ed7ed1569d0d55e88575176bec43595621 | JavaScript | Sergiojh-design/Algorithms_And_DataStructures | /4. Recursion/21-capitalizeWords.js | UTF-8 | 1,017 | 4.71875 | 5 | [] | no_license | /*
Write a recursive function called capitalizeWords. Given an array of words, return a new array containing each word capitalized.
*/
//My Solution
function capitalizeWords (array) {
// add whatever parameters you deem necessary - good luck!
let newArray = [];
let lengthOfArray = array.length;
let helper = ar... | true |
d48bfb8a4cac240652371c960d353764d9bf3dd7 | JavaScript | Mewse/carol-madlibs | /src/App.js | UTF-8 | 3,983 | 2.90625 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import songs from './songs.js';
import Inputs from './Inputs';
import Lyrics from './Lyrics';
const ESCAPE_KEY = 27;
const SPACE_KEY = 32;
const LEFT_ARROW_KEY = 37;
const RIGHT_ARROW_KEY = 39;
class App extends Component {
... | true |
d0c15f5e725818e26f3bf6b57d4b3f45ce7d583c | JavaScript | Irina-Pak/js_course | /types.js | UTF-8 | 947 | 4.6875 | 5 | [] | no_license | // 1. Строковый тип данных - String
// Строку можно создавать с помощью одинарных/двоиных ковычек. Или с помощью
// обратных бэктиков ( "", '', `` );
const myName = 'Шадияр';
let greeting = `Здравствуйте ${myName}, как ваши дела?`;
console.log(typeof greeting);
//2. Числовой тип данных - Number
let num1 = 5;
let num... | true |
eb91b25556228239a9ab9095b4b3216efaa2e991 | JavaScript | Jack1nho/Song-of-the-Free | /TattooLama/src/frontend/view/Result/Result.js | UTF-8 | 661 | 2.609375 | 3 | [] | no_license | import React, {Component} from 'react';
class Result extends Component {
constructor(){
super();
this.state = {
Lista: []
}
}
componentDidMount() {
fetch('http://localhost:5000/api/get/tatuatori/last')
.then(response => response.json())... | true |
6ccdb375252a094a9708af8b1ae9a77938e1225b | JavaScript | valeporti/fcc-timestamp | /server.js | UTF-8 | 900 | 2.765625 | 3 | [] | no_license | var express = require('express');
var app = express();
var url = require('url');
var mod = require('./module');
//make principal page:
app.use(express.static('public'));
//app.use(express.static('public/css'));
app.get("/:time", function(req, res) { //we ask app to get the thing after "/:" accessing to it as an obj... | true |
00ffae2d831969aac9a8a354aca0ae63df76d7ba | JavaScript | jelarson/Code-War-Challenges | /sumtype.js | UTF-8 | 126 | 2.765625 | 3 | [] | no_license | // https://www.codewars.com/kata/5a2e9ae2b6cfd7692a0000ba/train/javascript
function typeOfSum(a, b) {
return typeof (a+b)
} | true |
38db568723a01b5ae0e0272a05c80d1bc4c4fcf7 | JavaScript | gamesbykevin/AutoPostToFacebook | /index.js | UTF-8 | 11,480 | 3.109375 | 3 | [] | no_license | //used to connect to the database
const Firestore = require('@google-cloud/firestore');
//how we will access our database to store cookies
const cookieTableName = process.env.cookieTableName;
const cookieId = parseInt(process.env.cookieId);
const myProjectId = process.env.myProjectId;
//our firestore reference so we ... | true |
8d296af5202e8bb3e775c70ad893f02c6bb381a0 | JavaScript | jbuchermn/h264-live-player | /client/js/wsavc/index.js | UTF-8 | 2,226 | 2.609375 | 3 | [] | no_license | var YUVWebGLCanvas = require('./canvas/YUVWebGLCanvas');
var YUVCanvas = require('./canvas/YUVCanvas');
var Size = require('./utils/Size');
// Requires lib/broadway/Decoder.js defining global Decoder
export default class Wsavc{
constructor(canvas, onclose, {
type,
width,
height
}) {
... | true |
f114c58931bf66346f00a95d3c0e049714f24d8f | JavaScript | carmeneli1019/weather-app-react | /src/WeatherInfo.js | UTF-8 | 1,439 | 2.609375 | 3 | [] | no_license | import React from "react";
import WeatherIcon from "./WeatherIcon";
import WeatherTemperature from "./WeatherTemperature";
import WeatherForecast from "./WeatherForecast";
import FormattedTime from "./FormattedTime";
export default function WeatherInfo(props) {
function formatDate(timestamp) {
let date = new Dat... | true |
434806892d8af61218464efbb7d40d97d5f4bc74 | JavaScript | AnnLe4869/GitHub-Practice | /Optional argument passed in/1.js | UTF-8 | 407 | 3.453125 | 3 | [] | no_license | function addTogether(...arg){
if (!arg.every(ele => typeof ele === 'number')) {
return undefined
}
if(arg.length === 2){
return arg.reduce((accum, current) => accum + current)
}
return function (b) {
if (typeof b !== 'number') {
return undefined
}
... | true |
561773a858a357ab82eea88e2b10af2744b70ca1 | JavaScript | kimkyunhyung/Board_VS | /public/js/cyberir/decommon.js | UTF-8 | 933 | 2.84375 | 3 | [
"MIT"
] | permissive | /* 주가지수 롤링 */
function rollPoint(objid){
var obj=document.getElementById(objid);
var ul=obj.getElementsByTagName('ul')[0];
if(!ul.style.marginTop) ul.style.marginTop=0;
var lis=ul.getElementsByTagName('li');
var liheight=parseInt(lis[0].offsetHeight);
function getmargin(){
return parseInt(ul.... | true |
c69fc6f73fdfd4a8fd7f8a0e11cfc678a3cefd81 | JavaScript | nasir-001/Full-stack-open-practical | /part7/bloglist-frontend/src/reducers/blogsReducer.js | UTF-8 | 1,605 | 2.625 | 3 | [] | no_license | import blogService from '../services/blogs'
const reducer = (state = [], action) => {
switch (action.type) {
case 'NEW_LIKE':
case 'NEW_COMMENT':
return state.map((item) =>
item.id !== action.data.id ? item : action.data
)
case 'NEW_BLOG':
return [...state, action.data]
ca... | true |
bb395ee095f0afe2bc05662fc596e3e98b7b5a1f | JavaScript | hyx546/leetcode | /1684.js | UTF-8 | 578 | 3.796875 | 4 | [] | no_license | /**
* @param {string} allowed
* @param {string[]} words
* @return {number}
*/
var countConsistentStrings = function (allowed, words) {
let sum = 0;
for (let i = 0; i < words.length; i++) {
const str = words[i];
let flag = true;
for (let j = 0; j < str.length; j++) {
if (!... | true |
3361be9b4f7d50539b4e10bc8efb5a42975f69cb | JavaScript | Rimsha-Urooj/first | /src/components/Hello.js | UTF-8 | 455 | 2.75 | 3 | [] | no_license | import React from 'react'
function Hello (){
// codse using JSX
// return (
// <div>
// <h1>From Lahore</h1>
// <h2>Graduated</h2>
// </div>
// )
// Without using JSX
// React library provides createElement method.
return React.createElement(
'd... | true |
ad2a1a0350a75f883e9c783309299c00f6bd8491 | JavaScript | Martinlck/studio-x-backend | /models/GameState.js | UTF-8 | 1,076 | 3.25 | 3 | [] | no_license | class GameState {
/**
* If information is provided, it will use it for the current object. If not it will generate new data.
* @param params
*/
constructor(params) {
if(!params) {
this.gamesPlayed = 0;
this.score = 0;
} else {
this.gamesPla... | true |
8b0c2a9c58e509880a68b462ef5f5ba8af119759 | JavaScript | Daelamar/504425-pognali-18 | /source/js/countries.js | UTF-8 | 477 | 2.96875 | 3 | [] | no_license | "use strict";
(function () {
var countries = document.querySelector(".countries");
var countriesButton = document.querySelector(".countries__roll");
var countriesClose = document.querySelector(".countries__close");
countriesButton.addEventListener("click", function () {
countries.classList.toggl... | true |
ca22400e13ee32508a659e24a02eaf4078d86360 | JavaScript | XadillaX/Ero.js | /src/error.js | UTF-8 | 4,703 | 2.640625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | 'use strict';
if (!Error.captureStackTrace) throw new Error('Error.captureStackTrace does not exist!');
var util = require('./util');
var BaseError = require('./base_error');
var v = require('./validator').v;
var check = require('./validator').check;
/**
* This is a module which exports some APIs, the BaseError cla... | true |
d37eb104505ac28b61bd3a0551c51507bed1c06f | JavaScript | webmodules/unwrap-node | /index.js | UTF-8 | 2,383 | 3.15625 | 3 | [] | no_license |
/**
* Module dependencies.
*/
var findWithin = require('find-within');
var getDocument = require('get-document');
/**
* Module exports.
*/
module.exports = unwrap;
/**
* Unwraps the given `source` DOM element by prepending all of its child nodes
* into `target` before finally removing `source` from the DOM. ... | true |
5a23961f223d6799ff1acb7c1ed6e65a1a72aa20 | JavaScript | weijeuye/library | /src/main/webapp/bootstrap/js/lvmama-dialog.js | UTF-8 | 6,565 | 2.546875 | 3 | [
"MIT"
] | permissive | (function (d) {
d["skin"] = "dialog-blue";
d["mask"] = true;
d["okClassName"] = "btn-ok";
d["cancelClassName"] = "btn-cancel";
}(pandora.dialog.defaults));
function dialog(url, title, width, height, okfunc, okValue) {
if(!width){
width="400px";
}
if(!height){
height="400px";
}
var path;
if(url.length>0... | true |
4558374812056b9826272cf703288e8ba0d9db23 | JavaScript | shopgate/pwa | /libraries/core/classes/RequestBuffer/index.js | UTF-8 | 1,279 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | import { logger } from '../../helpers';
const REQUEST_BUFFER = 'RequestBuffer';
/**
* The RequestBuffer class.
* It stores instances of performing request.
*/
class RequestBuffer {
// Holds the ongoing requests.
requests = {};
/**
* Adds a new data request to the buffer store.
* @param {Object} req Th... | true |
1c7d441bd0b2f7fe8eccde95003e63498b3c96f0 | JavaScript | aminroosta/archived-repositories | /prj-escrow-website/src/math.js | UTF-8 | 161 | 2.71875 | 3 | [] | no_license | export const logTransform = ({ min, max }) => len => {
const res = (Math.log(len)/Math.log(2000.0)) * max;
return Math.min(+max, Math.max(+min, res));
}; | true |
0fe974ff9bfae513abc8ff6408e289b1dbc54538 | JavaScript | johnalphin/game | /dice.js | UTF-8 | 702 | 3.5625 | 4 | [] | no_license |
document.querySelector("button").addEventListener("click",rollDice);
function rollDice(){
var x=Math.random()
var a=Math.random()
x=(x*6)+1;
a=(a*6)+1;
var y=Math.floor(x);
var b=Math.floor(a);
console.log("dice value is "+y);
console.log("dice value is "+b);
var src=("dice"+y+".png");
var src2=(... | true |
ef93686fb9a77e822e0e0d0686efb89e66558a39 | JavaScript | Nicococococo/rabbitmq-order | /order/src/main/resources/static/js/index.js | UTF-8 | 201 | 2.5625 | 3 | [] | no_license | $("#goTop").on('click', function() {
let myDocument = document.documentElement || document.body;
let h = myDocument.scrollTop;
if(h <=100) return;
h = h - 10;
myDocument.scrollTop = h + 'px';
})
| true |
205ca2b6df2a5fd62041cdeb7e744d216f9db4d5 | JavaScript | loo41/some-person-small-item | /ask-server/src/util/split.js | UTF-8 | 1,285 | 3.03125 | 3 | [] | no_license | exports.splitQuAW = async(data) => {
let answers = []
let questions = data.allQuestion
data.allQuestion.forEach((element, index) => {
answers.push({index, value: element.trueSubject, grade: element.grade})
element.index = index
if (element.type === 1) {
element.trueSubjec... | true |
9ab2776ebc5400d0253f3bbf2b75e1046fb3a516 | JavaScript | SirStevenK/IndieBaie | /resources/js/carte.js | UTF-8 | 780 | 2.640625 | 3 | [
"MIT"
] | permissive | // Vue pour les cartes
Vue.prototype.$items = {};
var app = new Vue({
el: "#content-presentation",
created: function ()
{
// Fonction qui envoie le contenu json de chaque article dans la liste $items
// $items peut être appelé avec app.$items dans la console
var link = ... | true |
8c1d1e7f13e9286ddb3d02548a2ffb5c4463286e | JavaScript | akkias/jsCore | /getWindowSizeOnResize.js | UTF-8 | 347 | 3.734375 | 4 | [] | no_license | // Write a JavaScript program to get the width and height of the window (any time the window is resized).
function getWindowSize() {
let docHeight = console.log(window.innerHeight);
let docWidth = console.log(window.innerWidth);
return {
height: docHeight,
width: docWidth,
};
}
window.addEventListener... | true |
5e49a95ce6c7a9301a20dd9ccc6f098520bef545 | JavaScript | trusktr/hybrid-ui | /src/engine/node-components/Modes.js | UTF-8 | 1,967 | 2.78125 | 3 | [] | no_license | import NodeComponent from '../core/NodeComponent';
/**
* Modes Component
*
* @class Modes
* @extends NodeComponent
*/
export default
class Modes extends NodeComponent {
/**
* @constructor
*/
constructor (root) {
super();
this.node = root;
this.node._currentMode = null;
if (!this.... | true |
57ee38876af76eb42052b145028aa7ad2fde0a36 | JavaScript | xcqwan/use-pan-and-zoom | /src/utils.js | UTF-8 | 901 | 2.640625 | 3 | [
"MIT"
] | permissive | export const clamp = (min, max) => value => Math.max(min, Math.min(value, max));
export const identity = x => x;
export const noop = () => {};
export const compose = (...fns) =>
fns.reduce((f, g) => (...args) => f(g(...args)));
export const maybe = (f, g) => v =>
v === null || v === undefined ? f() : g(v);
export c... | true |
f2b3ea29373ab6afdf6605f9ae66fa44d5eaaa98 | JavaScript | fvanwijk/Note-Art | /src/instruments/Instrument.js | UTF-8 | 4,094 | 2.921875 | 3 | [
"MIT"
] | permissive | import {app} from '../'
import {Note} from '../models/Note'
import {firstToUpper} from '../addons/GlobalFunctions'
import {notesInRange, validateRawNote} from '../utilities/MusicalAddons'
import {MusicTheoryStructures as mts} from '../resources/MusicTheoryStructures'
/**
* @abstract
* Has all the methods any instru... | true |
5f607a7ab435383ddd40c0d7c1373b4175c57cd1 | JavaScript | aleksandra-codes/COMP4537_Term_Project | /frontend/termproject/API/V1/client_pages/js/add_actor.js | UTF-8 | 1,788 | 2.625 | 3 | [] | no_license | import {createYearOptions, createAlert} from '../../js/utils.js'
window.onload=()=>{
const token = window.localStorage.getItem('token')
if(token != null){
const year_selector = document.getElementById("born_year")
year_selector.innerHTML = createYearOptions(1900)
const submit_actor= document.getElemen... | true |
1fa0fb9fdbeea17c6347eb8c571230aea93c505b | JavaScript | ph-long/Coronavirus-Tracker | /src/components/Charts/Charts.js | UTF-8 | 2,693 | 2.96875 | 3 | [] | no_license | import React, {useState, useEffect} from "react";
import {fetchDailyData} from "../../api";
import {Line, Bar} from 'react-chartjs-2';
import styles from "./Charts.module.css"
// data is prop taking in that gets data.confirmed into confirmed etc
const Charts = ({data: {confirmed, deaths, recovered}, country}) => {
... | true |
0b9596cba6043559aee895b2d56d2b9fa24fe0bc | JavaScript | 55577799/Zakurdaeva_PHP8 | /public/js/scripts.js | UTF-8 | 513 | 2.546875 | 3 | [] | no_license | $(() => {
$('.js-add-to-to-cart').on('click', (event) => {
const $currentEl = $(event.target);
const id = $currentEl.data('id');
$currentEl.parent().empty().html('<span class="badge badge-success">Товар в корзине</span>');
$.ajax({
url: `?c=cart&a=ajaxAdd&id=${id}`,
... | true |
6fff0510671abda7479fe85d2f11bb32939482c7 | JavaScript | troy213/ongkir | /client/src/App.js | UTF-8 | 7,386 | 2.671875 | 3 | [] | no_license | import { useState, useEffect } from 'react'
import { useFetch } from './hooks/custom'
import axios from 'axios'
import './App.css'
const App = () => {
const [senderProv, setSenderProv] = useState(1)
const [receiverProv, setReceiverProv] = useState(1)
const [senderCity, setSenderCity] = useState(0)
const [recei... | true |
67f7e6793b9fa03126c36cff089610b9571f7870 | JavaScript | zithokamvalethu/ADMIN-APP | /main.js | UTF-8 | 8,606 | 2.953125 | 3 | [] | no_license | let button = document.getElementById("calcSalary");
let ADD = document.getElementById('ADD');
let p = document.getElementById('results');
table = document.getElementById("table");
var selectedRow = null;
var employeeList;
function editHtmlTableRow() {
var surname = document.getElementById("surname").value,
Pos... | true |
be365681c198bfbee706b2d74f3944ec93a2d918 | JavaScript | sebastiangeiger/credit_card_checker_ios | /App/Api.js | UTF-8 | 846 | 2.59375 | 3 | [] | no_license | let baseUrl = 'http://localhost:5000/api';
class Api {
constructor(authToken){
this.authToken = authToken;
}
getExpenses(){
var headers = new Headers();
headers.append("Content-Type", "application/json");
headers.append("Authorization", "Token token="+this.authToken);
let url = baseUrl + "/ex... | true |
5f8f4e47914f596cffeca410f536eb278ce0d0a0 | JavaScript | JhonniPinto/todolist | /assets/js/todoScript.js | UTF-8 | 3,172 | 3.140625 | 3 | [] | no_license | function addTask() {
const inTask = document.getElementById('inTask')
const inNote = document.getElementById('inNote')
const tbTasks = document.getElementById('tbTasks')
const task = inTask.value
const note = inNote.value
if ( task === '' || note === '') {
alert('Please add a task... | true |
3ea5e9308419307be6bf38ae422f54b8f2030460 | JavaScript | tripleplaay/Responsive-Grid | /my-first-js-app/basic-data-types.js | UTF-8 | 864 | 3.25 | 3 | [] | no_license | // Mickey Hall
var name = 'Mickey Hall';
var age = 56;
var airPlane = null;
var agenda;
var isAProgrammer = true;
console.log('type of name:', typeof name);
console.log('type of age:', typeof age);
console.log('type of airPlane:', typeof airPlane);
console.log('type of agenda:', typeof agenda);
console.log('type of i... | true |
90b6e4645626c469d37ee49c321812979b935123 | JavaScript | andreyCraftworkDesign/singltone | /js/script.js | UTF-8 | 3,528 | 2.5625 | 3 | [] | no_license | $(document).ready(function(){
$("#carousel-example-generic").carousel({
interval : false
});
$("#carousel-example-generic-1").carousel({
interval : false
});
$("#carousel-example-generic-2").carousel({
interval : false
});
$("#carousel-example-generic-3").carousel({
interval : false
})... | true |
3d35bec5140732986c221587721a22180026ccc4 | JavaScript | khanny17/cp | /frontend/src/selectors/find-failing-requirements.js | UTF-8 | 1,590 | 2.859375 | 3 | [] | no_license | import { createSelector } from 'reselect';
const getPlanState = state => state.plan;
export default createSelector(
[getPlanState],
(planState) => {
const { courses, requirements } = planState;
if(!requirements || Object.keys(requirements).length === 0) {
return {};
}
let courseMap = Objec... | true |
ca097d398a52d9473569ace6aca82db47603afd2 | JavaScript | wininieri/vabaco-lesson | /javascript stuff/example 1/index.js | UTF-8 | 3,111 | 3.5625 | 4 | [] | no_license | (function(){
var names = [{
firstname: 'Iona',
lastname: 'Geladze'
}, {
firstname: 'Kakhaber',
lastname: 'Bazerashvili'
},{
firstname: 'Beqa',
lastname: 'Bumbeishvili'
},{
firstname: 'Nini',
lastname: 'Mumladze'
}];
var firstnameInput = document.getElementById('firstname');
var lastnameInpu... | true |
c0248d1eff99fda9062cc93ef7a345da6ed51075 | JavaScript | renatorocketdev/TrTecnologias.LibreMaragogi | /LibreMaragogi.Razor/Libre.Maragogi.NetCore/wwwroot/js/Devolucao.js | UTF-8 | 848 | 2.609375 | 3 | [] | no_license | $(document).ready(function () {
$('#usuarios').select2({
placeholder: 'Selecione Um Usuario',
language: "pt-BR"
});
$('#livros').select2({
placeholder: 'Selecione Livro(s)',
language: "pt-BR"
});
$("#usuarios").change(function () {
$('#livros').val(null).tri... | true |