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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7a8deb925a938eaad9961c5206dbcc0027d7248e | JavaScript | loopisjr/eventos-cz-web | /src/actions/index.js | UTF-8 | 2,824 | 2.53125 | 3 | [] | no_license | import { eventosRef, Storage, FirebaseDB } from '../firebase'
import { LISTAR_EVENTOS, TOGGLE_CADASTRAR_MODAL, SALVAR_EVENTO_EDITAR, TOGGLE_EDITAR_MODAL, EDITAR_LISTA_2 } from './types';
import swal from 'sweetalert';
export const adicionarEvento = (evento, foto) => {
return async () => {
eventosRef.push(... | true |
0ff176beea750c75835e8e567e9625f8019b9ed9 | JavaScript | josedarjona/tom-hanks-catch-game | /src/script.js | UTF-8 | 8,405 | 3.046875 | 3 | [] | no_license | window.onload = function() {
var currentGame;
var canStart = true;
var obstacles = [];
// var speedCoco = 0;
var gameOver = false;
var addLife = [];
//toms starting point
var Tom = function() {
this.x = 233;
this.y = 500;
this.width = 75;
this.height = 100;
this.img = "./images/tom... | true |
4ea92b0f6a93b9087b7ae624acaa19346eec55ec | JavaScript | tnisula/Web_ohjelmistoasiantuntija_kurssi | /TweetApp/public_html/app.js | UTF-8 | 3,583 | 2.578125 | 3 | [
"MIT"
] | permissive | var mongoose = require("mongoose");
var express = require('express');
var uriString = 'mongodb://localhost/test';
var app = express();
app.configure(function () {
app.use(
"/", //the URL through which you want to access to you static content
express.static(__dirname) //where your static content is... | true |
fc133554899f4820540e9e03aa9788db2a97d94f | JavaScript | betancourtneidys/fundamentos-node.js | /modulos/fs.js | UTF-8 | 595 | 3.21875 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
function leer(ruta, cb) {
fs.readFile(ruta, (err, data) => {
cb(data.toString());
})
}
function escribir(ruta, contenido, cb) {
fs.writeFile(ruta, contenido, function (err) {
if (err) {
console.error('No he podido escribirlo', err);
} else {
console.log('Se ha e... | true |
150125aeaea0be37304ad4de11fd13c43f4ef134 | JavaScript | octopitus/feather | /src/core/editor/utils/string.js | UTF-8 | 1,686 | 2.703125 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | import UTF16String from './Utf16String'
const ZERO_WIDTH_SPACE = '\uFEFF'
const NON_BREAKING_SPACE = '\u00A0'
const OBJECT_REPLACEMENT_CHARACTER = '\uFFFC'
function utf16StringDifference (a, b) {
let leftIndex = 0, rightIndexA = a.length, rightIndexB = b.length
while (leftIndex < rightIndexA && a.charAt(leftIndex... | true |
9206f2cbdfbf18c4bd37907a78babfc12467d7de | JavaScript | shz/hs-server | /croquet/croquet.client.js | UTF-8 | 15,161 | 2.703125 | 3 | [] | no_license | var croquet = {};
(function() {
// We either need XDR support or CORS support. If we have neither,
// bomb out.
var XHR = null;
if (typeof XDomainRequest == 'undefined' &&
typeof(new XMLHttpRequest().withCredentials) === 'undefined') {
alert("Sorry, but your browser doesn't support security feature... | true |
421b6ef2f02c381963965aeef1c4bda0bc64bb97 | JavaScript | careybaldwin02/User-Interface-Project-Week | /js/index.js | UTF-8 | 3,599 | 3.8125 | 4 | [] | no_license | // JS goes here
class Tabs{
constructor(element)
{
this.element = element;
console.log(element);
// create a reference to the ".tabs-link" class nested in your tab object
this.links = this.element.querySelectorAll(".tabs-link");
//this step will map over the array creating new TabsLink class instances of each link... | true |
13ca20fcd12f5167b03812cf8987b977e830f244 | JavaScript | tinafangkunding/the-complete-js-course | /9-data-structure/code/script-code2.js | UTF-8 | 1,203 | 3.28125 | 3 | [] | no_license | const game = {
team1: 'Bayern Munich',
team2: 'Borrussia Dortmund',
players: [
[
'Neuer',
'Pavard',
'Martinez',
'Alaba',
'Davies',
'Kimmich',
'Goretzka',
'Coman',
'Muller',
'Gnarby',
'Lewandowski',
],
[
'Burki',
'Schulz',
... | true |
e7f32f8ebd4be0d29551b03c5d59fcf71cde1b45 | JavaScript | TheDahv/eversound | /_assets/js/speaker/main.js | UTF-8 | 3,061 | 2.546875 | 3 | [] | no_license | /**
* Speaker Module
*
* Manages connections and audio streams for browsers connecting as
* output-only speakers
*/
// Helpful links
// - https://www.webrtc-experiment.com/docs/webrtc-for-beginners.html#waitUntilRemoteStreamStartsFlowing
// - http://stackoverflow.com/questions/24287054/chrome-wont-play-webaudio-getuse... | true |
ffc2f8520929e0278efdc1d37e41936cdae29d9c | JavaScript | irwan279/tugas_12_java | /tugas12.js | UTF-8 | 181 | 2.609375 | 3 | [] | no_license | function tampil() {
var buah = ['pisang','jeruk','apel','mangga'];
console.log(buah);
var buah2 = buah.pop()
console.log(buah);
buah.shift()
return buah
}
console.log(tampil());
| true |
9b32fe650ef899b9aff5ed62f6488790b97b0559 | JavaScript | Floha258/schedulereveal | /scripts.js | UTF-8 | 4,846 | 2.78125 | 3 | [] | no_license | // var fs = require('fs');
// var _ = require("lodash");
// var d3 = require('d3');
var cuts = "cuts.csv";
var bsgContent = [];
var scheduleContent = [];
var number = 0;
var gamenaam = document.querySelector('#gameNaam');
var estnaam = document.querySelector('#estNaam');
var catnaam = document.querySelector('#catNaam')... | true |
24c78caf5b731bc7f0011ca4519b0e01b22f3c2d | JavaScript | LeopoldJr/covid-calculator | /src/components/Calculator.js | UTF-8 | 1,388 | 2.78125 | 3 | [] | no_license | import React, {Component} from 'react';
import '../styles/Calculator.css';
import Form from "./Form.js"
class Calculator extends Component {
constructor(props){
super(props);
this.Compute = this.Compute.bind(this);
this.state = {percentage: "0%"};
}
Compute( countryCases, countryPopulation, nu... | true |
e661663f5208f03ad05ecf7f6ebb35852c550ea1 | JavaScript | chemsoc/ShouldIT | /lib/summariser.js | UTF-8 | 1,800 | 3.34375 | 3 | [
"MIT"
] | permissive | var colors = require('colors');
/**
* "summariser"
*
* Renders summary output of passes, failures, unimplemented and line numbers.
*/
function summariser(results) {
var response = [],
callback = function(output) {
response.push(output);
};
var passed = 0;
if( results.hasO... | true |
88ec1b4719049ea5552905ac2b21b198072b953c | JavaScript | levelasquez/firebase-serverless-rest-api-example | /public/main.js | UTF-8 | 1,437 | 3.15625 | 3 | [] | no_license | const url = 'https://us-central1-rest-api-15b67.cloudfunctions.net/api/pets'
const darDeBaja = async id => {
event.target.parentElement.parentElement.remove()
await fetch(`${url}/${id}/daralta`)
}
const fetchPets = async () => {
const response = await fetch(url)
const json = await response.json()
return js... | true |
522252b1651ea7c8d4733ea5b2ed203ea8d0abff | JavaScript | JheysonGalvis/planeta | /assets/js/calc.js | UTF-8 | 696 | 2.921875 | 3 | [] | no_license | var boton = document.getElementById("btn_calcular");
boton.addEventListener("click", fcalcular);
/*var nombre_planeta;*/
var g_tierra = 9.8;
function fcalcular() {
var peso = document.getElementById("txt_peso").value;
var select = document.getElementById("planetas").value;
peso_final = peso * select / g_tierra;... | true |
5130937443ba106f2049a99b9947f9e67a712320 | JavaScript | Emmettt/web03 | /NutriTUNE_OOP/js/tableUI.js | UTF-8 | 13,249 | 2.640625 | 3 | [] | no_license | class TableUI {
constructor(menu, linechart) {
this.tableContainer = document.querySelector('.tableContainer');
this.footer = document.querySelector('.footer');
this.chooseFoodIntakeMenu = document.querySelector('.chooseFoodIntakeMenu');
this.addFoodIntakeMenuItem = document.querySelector('.add... | true |
abd357c8365e5089660fe48ddfee23928257ef09 | JavaScript | hillmodo/Midterm-Project | /index.js | UTF-8 | 21,416 | 3.328125 | 3 | [] | no_license | let cartObject = {
price: 0,
flight: 0,
hotel: 0,
event: 0,
};
class Package {
constructor(name, category, desc, price, flight, flightPrice, hotel, hotelPrice, event, eventPrice) {
this.name = name;
this.category = category;
this.description = desc;
this.price = pri... | true |
94027eeeed8d113867a69e2709fac284e77500c8 | JavaScript | inflearn-react-study/movie-site | /client/src/components/views/FavoritePage/FavoritePage.js | UTF-8 | 3,072 | 2.546875 | 3 | [] | no_license | import React, {useEffect, useState} from 'react';
import './favorite.css'
import Axios from "axios";
import {Popover} from 'antd';
import {IMAGE_BASE_URL} from "../../Config";
function FavoritePage(props) {
const [favorites, setFavorites] = useState([]);
useEffect(() => {
fetchFavoredMovie();
}, ... | true |
1e7b457bfd234a6cd092f82fa301bb396c39ebfc | JavaScript | justingolden21/map-generator | /js/tunnel.js | UTF-8 | 1,602 | 3.4375 | 3 | [
"MIT"
] | permissive | function createTunnelMap(numTunnels, tunnelDist, tunnelWidth) {
// fill 1s
for(let x=0; x<width; x++) {
grid[x] = [];
for(let y=0; y<height; y++) {
grid[x][y] = 1;
}
}
let startPoint = {x: randInt(0, width-1), y: randInt(0, height-1) };
let prevDirection = randInt(0,3);
for(let i=0; i<numTunnels; i++) {... | true |
82d83c2bb8272fb72d0cd50e5055dccec24a8f9a | JavaScript | Jeff-Duke/giphy-curator | /src/Header.js | UTF-8 | 2,369 | 2.625 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
export default class Header extends Component {
constructor() {
super();
this.state = {
searchTerm: null,
resultCount: 5,
rating: 'g'
};
}
createGiphyQueryUrl() {
const { searchTerm, resultCount, rating } = this.state;
const apiKey = 'd... | true |
87b62f2da14410cf06547474797680336cd7e051 | JavaScript | Wayne-Bai/AST-normalize | /data/michael/unveil/src/scene/actors/label.js | UTF-8 | 612 | 2.625 | 3 | [] | no_license | // Label
// =============================================================================
uv.Label = function(properties) {
// super call
uv.Actor.call(this, uv.extend({
text: '',
textAlign: 'start',
font: '12px Helvetica, Arial',
fillStyle: '#444',
lineWidth: 0,
backgroundStyle: '#eee',
... | true |
8fc98f4e4c7f832a24c53ca2baec1472efae2d69 | JavaScript | disel-brest/SellFilms-react | /src/helpers/sortFilms.js | UTF-8 | 620 | 2.859375 | 3 | [] | no_license | import {
SORT_BY_HIGHER_PRICE,
SORT_BY_LESS_PRICE,
SORT_BY_RATE,
SORT_BY_YEAR,
} from '../constants';
function sortFilms(films, sorting) {
if (sorting === SORT_BY_HIGHER_PRICE) {
return films.sort((a, b) => b.cost - a.cost);
}
if (sorting === SORT_BY_LESS_PRICE) {
retur... | true |
8d7842f544b31ab72a3eb80c423d4803a17cdd4b | JavaScript | ALaudelino/tabelas | /tabelas/main.js | UTF-8 | 531 | 2.984375 | 3 | [] | no_license | <script type="text/javascript">
window.onload=function(){
var filtro = document.getElementById('filtro-nome');
var tabela = document.getElementById('tabela');
var nomeFiltro = filtro.value;
for (var i = 1; i < tabela.rows.length; i++) {
var conteudoCelula = tabela.rows[i]... | true |
1ee1ed1f447730cc3336b6a2bd0dc1941c03fcda | JavaScript | DetegiCE/KWEB_2020_2R | /week2/17_asyncwait.js | UTF-8 | 444 | 2.90625 | 3 | [] | no_license | const fs = require('fs');
const util = require('util');
const readFile = util.promisify(fs.readFile);
//await는 비동기 함수 내에서만 사용 가능
const printFileSize = async filename => {
try {
const data = await readFile(filename);
console.log(`Data length: ${data.length}`);
} catch(err) {
console.err... | true |
b150bf149d9ef5ae4c2de6283feaeed21136677f | JavaScript | agustinramos/react-coreui-component | /src/FieldNormalize/index.js | UTF-8 | 703 | 2.78125 | 3 | [
"MIT"
] | permissive | export function cleanWhiteSpace (value) {
let primerBlanco = /^ /
let variosBlancos = /[ ]+/g
value = value.replace(variosBlancos, ' ')
value = value.replace(primerBlanco, '')
return value
}
export function toInt (value, vDefault) {
return value !== undefined && value !== '' && !isNaN(Number(value)) ? pars... | true |
ed9493a43ab1363167007049cf2433218677b98f | JavaScript | trichellehaight/trichellehaight.github.io | /assignments/lesson10/js/windchill.js | UTF-8 | 149 | 2.921875 | 3 | [] | no_license | function windChill(temp, speed) {
return 35.74 + (0.6215 * temp) - (35.75 * Math.pow(speed, 0.16)) + (0.4275 * temp) * (Math.pow(speed, 0.16));
} | true |
cb77f192689515541f995aceedbfadcf5dfe96cc | JavaScript | FeRuk2020/digitsys.github.io | /folio.js | UTF-8 | 245 | 2.890625 | 3 | [] | no_license | function swipe(){
nav.classList.toggle('shift');
menu.classList.toggle('spin');
}
//Allocate Variables
var menu = document.querySelector('.menu');
var nav = document.querySelector('.nav-list');
menu.onclick = function(){swipe();};
| true |
e031b2985b6fdfe09d936cfce5ba5e374435e067 | JavaScript | BanisharifM/Training | /Javascript/other/Async with CallBack func/js/callbacks.js | UTF-8 | 984 | 2.984375 | 3 | [] | no_license | const astrosUrl = "http://api.open-notify.org/astros.json";
const wikiUrl = "https://en.wikipedia.org/api/rest_v1/page/summary/";
const peopleList = document.getElementById("people");
const btn = document.querySelector("button");
//make an ajax request
function getJson(url, callback) {
const xhr = new XMLHttpRequest... | true |
1cfb57c3c16d99fcfaefd8ca6e0b56541227816c | JavaScript | jhosm/workflow-charts | /src/tests/workItemsLoader.test.js | UTF-8 | 2,758 | 2.5625 | 3 | [] | no_license | "use strict";
import fs from "fs";
import WorkItemsLoader from "../workItemsLoader";
import Papa from "papaparse";
describe("WorkItemsLoader", () => {
let sampleData = "";
let parsedSampleData = "";
let loader = new WorkItemsLoader();
beforeAll(() => {
sampleData = fs.readFileSync(__dirname + "/testData.... | true |
aa9634e605df7efb78336898ae6342615e8d5f79 | JavaScript | comp426-dead-poets-society/comp426-devetry | /devetry/src/pages/SubmitPage.js | UTF-8 | 3,535 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react'
import { } from '../api/publicAPI';
import { createPoem } from '../api/userAPI';
import '../App.scss';
import PropTypes from 'prop-types';
import getRandomWord from '../api/randomWordAPI';
export default class SubmitPage extends Component {
constructor(props) {
super(p... | true |
62a7094c2c83a41b3bca620795bff32676641186 | JavaScript | corinthoneto/web-crypto-storage | /demo/demo.js | UTF-8 | 2,767 | 2.9375 | 3 | [
"MIT"
] | permissive | const { CryptoStorage } = require('../dist/web-crypto-storage.cjs');
let cryptoStorage;
const INITIAL_NOTES = `You can insert any text you want here.
Save it to storage and reload the page.`;
function value(id, val) {
let input = document.getElementById(id);
if (val !== undefined) {
input.value = val;
} el... | true |
bfb02a504f0c5a0201c7d6f65cf4f50b00a67abd | JavaScript | AlissonRaphael/programming_challenge | /beginner/algorithm0052.js | UTF-8 | 650 | 4.125 | 4 | [
"MIT"
] | permissive | /**
* Multiplication Table
* Read an integer N (2 < N < 1000). Print the multiplication table of N.
* 1 x N = N 2 x N = 2N ... 10 x N = 10N
*
* Input
* The input is an integer N (1 < N < 1000).
*
* Output
* Print the multiplication table of N., like the following example.
*/
... | true |
a2cfc0cd60f560c320ced2a88eec40a090111d72 | JavaScript | ivanna777/goit-js-hw-13-image-find | /src/apiService.js | UTF-8 | 703 | 2.984375 | 3 | [] | no_license | export default class ApiService {
constructor() {
this.searchPicture = '';
this.page = 1;
}
fetchPictures() {
const url = `https://pixabay.com/api/?image_type=photo&orientation=horizontal&q=${this.searchPicture}&page=${this.page}&per_page=12&key=20828965-4298cb7d6f87f653ca708a263`;
... | true |
e8aa6ecbb686c7f907ff28330d0ac14a53e579e8 | JavaScript | GoG-Lan/GoFrontend | /js_1.2/js/script.js | UTF-8 | 528 | 3.984375 | 4 | [] | no_license | var nameList = [];
for (var i = 0; i < 5; ++i) {
var newName = prompt("Enter new name:");
if (newName === null) {
i--;
alert("Ты че, думал меня обмануть? Пробуй снова!");
} else {
nameList.push(newName);
}
}
var yourName = prompt("Enter your name: ");
function nameSearch(name) {
for ... | true |
bbc983cb042609fc7b204ba8c81fb551adc65db8 | JavaScript | fmd123/WDB-Udemy | /Stalker_Exercise/stalker.js | UTF-8 | 402 | 3.828125 | 4 | [] | no_license | var userFirst = prompt("What is your first name?");
var userLast = prompt("What is your last name?");
var userAge = prompt("What is your age?");
var sent1 = "Your name is " + userFirst +" " + userLast +".";
var sent2 = "Your age is "+ userAge + ".";
document.getElementById("sentence1").innerHTML = sent1;
document.getEl... | true |
2f5bb3177959a27200569a5022b8826e78b4e4c8 | JavaScript | Chr1st1ancz/Le-servr | /main.js | UTF-8 | 10,044 | 2.859375 | 3 | [] | no_license | /*To Do*/
/*Rozsvítí se buy tlačítko když na to máš peňáze*/
/*Dat stepanovou do okna a jak mele odkaz v odkazu a pak rickroll ez*/
/*Převést všechny innerHTML z různých funnkcí do jedné funkce na výpis*/
/*Math round na title*/
let spsmb = 0; /*susenky ano*/
let multiplaier1 = 1; /*nasobic kliku*/
let multiplaierpoce... | true |
25a065f6c1a00e882823a84552a58da39db52a38 | JavaScript | mohammed-ghesmoune/pretaoser-pwa | /src/components/Contact/ContactForm.js | UTF-8 | 1,503 | 2.703125 | 3 | [] | no_license | import React, { useState } from 'react'
const initialValue = {
username: '',
email: '',
phone: '',
text: ''
}
const ContactForm = () => {
const [message, setMessage] = useState(null);
const [user, setUser] = useState(initialValue)
const handleChange = e => {
setUser({ ...user, [e.target.id]: e.target.value... | true |
8fc1bed3c0b7ba208544b34e103a96e1924cbb50 | JavaScript | WilfredTA/javascript_exercises | /repeat_grocery_list.js | UTF-8 | 1,105 | 4.46875 | 4 | [] | no_license | /*
Write a function which takes a grocery list (array) of
fruits with quantities and converts it into an array
of the correct number of each fruit.
Input: an array of arrays, where each sub
array has a string and an integer
Output: an array of strings
- The strings are the strings of the sub array
Strin... | true |
f3e57f80938a7b892ebe8428d27564395bf2138e | JavaScript | Korneback/JARVIS | /commands/fun/troll.js | UTF-8 | 2,004 | 2.9375 | 3 | [
"MIT"
] | permissive | const { Command } = require('discord.js-commando');
module.exports = class TrollCommand extends Command {
constructor(client) {
super(client, {
name: 'troll',
group: 'fun',
memberName: 'troll',
description: 'trolls the mentioned user',
examples: [... | true |
01727e2c9cd4701d45217febe66ed31d45e5f67a | JavaScript | doncarlosx/electron1 | /scratch/udp.js | UTF-8 | 391 | 2.640625 | 3 | [] | no_license | const dgram = require('dgram')
const socket = dgram.createSocket('udp4')
const p = new Promise((resolve, reject) => {
socket.on('connect', resolve)
socket.on('error', reject)
})
socket.connect(11111, 'localhost')
async function connect() {
await p
const msg = new Uint8Array(4)
msg[0] = 1
msg... | true |
dc3790b09a9a7fd0cadcc6c292cbe070ee9c8032 | JavaScript | EvgenPrushk/lessons | /JS_Canvas_11_Mouse_Coordinates/script.js | UTF-8 | 879 | 3.03125 | 3 | [] | no_license | const canvas = document.querySelector("canvas");
const context = canvas.getContext("2d");
canvas.width = 500;
canvas.height = 500;
const mouse = createMouse(canvas);
const colors = ["red", "blue", "green", "red"];
let color = "red";
let r = 5;
animation({
clear() {
// context.beginPath();
// c... | true |
8494a311d01d1ab6378f6c4d445b5bbf43229ac5 | JavaScript | vselva-15/Code-Clan-Public | /week_02/weekend_homework/top_trumps/top_trumps_solution/game.js | UTF-8 | 1,218 | 3.515625 | 4 | [] | no_license | class Game{
constructor (cards, players) {
this.deck = cards;
this.players = players;
this.winner = null;
}
dealCard(card) {
this.players[0].addCard(card);
}
switchPlayers() {
const player = this.players.shift();
this.players.push(player);
}
dealDeck() {
for (const card of t... | true |
27a600af908bfba9e34f7fc461d5374c46fdcbba | JavaScript | artemkoralkov/andersen-internship | /par5/task9.js | UTF-8 | 2,133 | 4.25 | 4 | [] | no_license | /* Создать абстрактный класс Figure с методами вычисления площади
и периметра, а также методом, выводящим информацию о фигуре на экран.
Создать производные классы: Rectangle (прямоугольник), Circle (круг),
Triangle (треугольник) со своими методами вычисления площади и периметра.
Создать массив n фигур и вывести полную ... | true |
52cdd5723794331afcae4101312ffbc05025a823 | JavaScript | yanlee26/resharpe | /js/sum/ICD.js | UTF-8 | 22,134 | 2.765625 | 3 | [] | no_license | /**
* ICD Library v1.0.0
*
* Includes select.js, event.js, animate.js
*
* Copyright 2014 ICD Foundation
* Author XXXXXXX
* Tel XXXXXX
* Email XXXXXX
*
* Date: 2014-11-30
*/
(function(window) {
var ICD = function(str) {
if (typeof str == 'function') {
window.onload = str;
} else {
return new IC... | true |
08075a38e4e805a71c8d99968c67e65f1ee588b0 | JavaScript | blainekasten/tiny-flux-implementation | /src/Provider.js | UTF-8 | 3,804 | 3.328125 | 3 | [
"MIT"
] | permissive | /***
* Welcome to the Tiny Flux Implementation.
*
* You should read this guide in the following order:
*
* 1. store.js
* 2. Provider.js
* 3. listener.js
* 4. updateState.js
*/
/*
* Here we are! The final stop. This is the part that hooks everything together.
* If you haven't used something like coflux or r... | true |
aa6df49e4f6d34ad1593a0e43287f788678b2c58 | JavaScript | esraamelsayed/Rafai3-backend | /routers/productRouter.js | UTF-8 | 3,730 | 2.5625 | 3 | [] | no_license | const express = require('express');
const mongoose = require('mongoose');
const Product = require('../models/product');
const ProductRouter = new express.Router();
const cloudinary = require('../utilities/cloudinary'); //importing cloudinary middlewhere to help in image upload
const upload = require('../utilities/mult... | true |
9ccd414ff4c3a212eadefd5b290ae86c312f0674 | JavaScript | maccalla/react-introducing | /src/index.js | UTF-8 | 2,287 | 3.4375 | 3 | [] | no_license | import { StrictMode } from "react";
import ReactDOM from "react-dom";
import React from "react";
import App from "./App";
const rootElement = document.getElementById("root");
ReactDOM.render(
<StrictMode>
<App />
</StrictMode>,
rootElement
);
//秒刻みで動く時計
//stateとライフサイクル:再利用可能かつカプセル化されたものにする
//内部処理を実装するためにはコ... | true |
4105d8d2762a1114318cebab432019aa5ef37e98 | JavaScript | Devansh-2008/Newton-s-Cradle-2 | /Rope.js | UTF-8 | 571 | 2.59375 | 3 | [] | no_license | class Rope {
constructor(bodyA,bodyB,xOffset){
var options = {
bodyA:bodyA,
bodyB:bodyB,
stiffness:0.05,
angularStiffness:1,
length:100,
pointA:{x:xOffset,y:0}
}
this.xOffset = xOffset;
this.chain = Constraint.create(options);
World.add(world,this.chain);
... | true |
b355e80c698bf74be6a4c201a8e80a1caf90d6d9 | JavaScript | machadowelton/restful-express | /app.js | UTF-8 | 492 | 2.546875 | 3 | [] | no_license | const app = () => {
const express = require('express')
const server = express()
const compression = require('compression')
const bodyparser = require('body-parser')
server.use(compression())
server.use(bodyparser.urlencoded({ extended: false }))
server.use(bodyparser.json())
const port = process.env.POR... | true |
08d34c5074a9b5a2da57cc0b363506715b657916 | JavaScript | Sunber2111/TodoList-client | /src/app/models/RulesColor.js | UTF-8 | 368 | 2.578125 | 3 | [] | no_license | export const getValues = key => {
switch (key) {
case 1:
return { title: "Not now", color: "green" };
case 2:
return { title: "Today", color: "yellow" };
case 3:
return { title: "Tomorrow", color: "teal" };
case 4:
return { title: "Fast", color: "orange" };
default :
... | true |
debb214fa4535d3449869f55e4874be18d3b8857 | JavaScript | Zaman-Meer/blog-site-react-tailwindCSS | /src/pages/create/Create.js | UTF-8 | 7,871 | 2.5625 | 3 | [] | no_license | import React,{ useState,useLayoutEffect,useContext,useCallback } from "react";
import { useParams,useHistory } from "react-router-dom";
import Select from 'react-select';
import { Context } from "../../context/Context";
import TextEditor from "../../components/textEditor/TextEditor"
import axios from "axios";
import Re... | true |
53f9947a9e59264ee4a0f643a6f740c9f0657c01 | JavaScript | Glajik/airbag-backend | /src/db.js | UTF-8 | 3,961 | 2.8125 | 3 | [] | no_license | /* eslint-disable import/prefer-default-export */
import SheetWrapper from '@glajik/sheet-wrapper';
import isArray from 'lodash/isArray';
import isEqual from 'lodash/isEqual';
class DB extends SheetWrapper {
toRowData(values) {
const fn = (acc, value, index) => {
const field = this.getField(index);
i... | true |
0650a1a1883b022f2f8ba54a0a1adca0ac162425 | JavaScript | twotwo/practice-nodejs | /hello-winston/format.js | UTF-8 | 769 | 2.65625 | 3 | [
"MIT"
] | permissive | const { createLogger, format, transports } = require("winston")
const { combine, timestamp, label, printf, simple } = format
const myFormat = printf(info => {
return `${info.timestamp} [${info.label}] ${info.level}: ${info.message}`
})
const logger = createLogger({
format: combine(label({ label: "my label" }), ti... | true |
b4b9be8ec4e0f08163bd1ad29d2de433f5d1ee17 | JavaScript | thiagohissa/COMP3123-Assignment2 | /src/Forecast.js | UTF-8 | 2,835 | 2.609375 | 3 | [] | no_license | import React from 'react';
import axios from 'axios';
import API from './api';
import { Button, Container, Row, Col } from 'react-bootstrap';
const API_KEY = require("./secrets");
const URL = "http://api.openweathermap.org/data/2.5/weather?q=Toronto&units=metric&appid=" + API_KEY;
export default class Forecast extends... | true |
243256a141843e37e5b4e62ea8bb07008234a0b1 | JavaScript | rjsabia/test_4 | /src/App.js | UTF-8 | 961 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import List from './components/List'
import AddTodo from './components/AddTodo'
import Hello from './components/Hello'
class App extends Component {
constructor(props){
super(props)
this.state = {
todos: []
}
this.addTodo = thi... | true |
b20f7d20efe0f1ee2b6d4e9f55e99b4a041f85e1 | JavaScript | heidijane/java-provider | /scripts/employee/EmployeeList.js | UTF-8 | 511 | 3.09375 | 3 | [] | no_license | import { useEmployee } from "./employeeDataProvider.js"
import { employeeRepresentation } from "./Employee.js";
/*
Shows all employees on the DOM
*/
//get the DOM element to put the employees into
const contentElement = document.querySelector('.employeeList')
export const employeeList = () => {
//get the arr... | true |
1bfcd5ab0152a3977079462b1cd74aa9362c3945 | JavaScript | txu2012/stock-tracker | /src/minWait.js | UTF-8 | 578 | 2.671875 | 3 | [
"WTFPL"
] | permissive | const logger = require('./logger')
const delay = (ms) => {
return new Promise((res, rej) => {
setTimeout(() => {
res()
}, ms)
});
}
module.exports = (cb, minTimeBetweenCb) => {
let lastCallTS = 0;
return async (...args) => {
const now = Date.now()
const diff = now - lastCallTS
if (di... | true |
475fe7af1a594f01ee4e6720fe5346391f8cf48f | JavaScript | gaurav-singh-au16/F22_Labs | /signup/src/container/Signup/index.js | UTF-8 | 3,163 | 2.546875 | 3 | [] | no_license | import React, {useState} from 'react'
import Navbar from '../../component/Navbar'
import './index.css'
import * as yup from 'yup'
import Toast from '../../component/Toast'
let schema = yup.object().shape({
email: yup.string().required().email(),
companyName: yup.string().required(),
password: yup.string().... | true |
f5c8adccd18a68f0f68492c738a58306f823ae0c | JavaScript | evachengrq/javascript-exercise | /3-object/values/index.js | UTF-8 | 206 | 2.828125 | 3 | [] | no_license | export default function countTypesNumber(source) {
const array = Object.values(source);
// ['3', '4', '5']
return array.map(char => parseInt(char, 10)).reduce((prev, current) => prev + current, 0);
}
| true |
b711f3c05c06c79bb604b7bd08a22116784f1445 | JavaScript | satker/go-together | /frontend/src/forms/utils/validation.js | UTF-8 | 3,694 | 2.78125 | 3 | [] | no_license | import {get} from 'lodash';
const PATTERN_TO_CHECK_FILE_EXTENSION = "image/(png|jpg|jpeg)";
const PATTERN_TO_CHECK_URL = "\\b(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]";
export const isEmptyValidation = (fields, pathNames) => {
const result = {};
if (!fields) {
pathNames.f... | true |
874775e1f1e515489d28abe6b08dc8c0c0f1f53e | JavaScript | katrienMonteyne/nmct-front-2017 | /exercises/w6/src/js/frequency.module.js | UTF-8 | 276 | 2.703125 | 3 | [] | no_license | let _startKey = null;
export function getStartKey(){
return _startKey;
}
export function setStartKey(v){
return _startKey = v;
}
export function calculateFrequency(keyNr){
if(_startKey === null);
return _startKey * Math.exp(keyNr * Math.LN2 / 12);
}
| true |
eb8b9fd50726d0d7325d9be077a9c15bd19c92a5 | JavaScript | zmdy/aulas.txt | /source/src/themes/standard/standard.js | UTF-8 | 2,133 | 2.75 | 3 | [
"MIT",
"LGPL-3.0-only"
] | permissive | function standard(){
// Identifica a biblioteca de Slides utilizada
if(Bonisa.engine == 'reveal'){
Reveal.initialize({
// Transition style
transition: 'fade', // none/fade/slide/convex/concave/zoom
// Transition speed
transitionSpeed: 'slow' // default/fast/slow
// Back... | true |
52a9fd7a4fd40f15b5ee8458cea3e609fe42cec4 | JavaScript | tombra4ril/hms-client | /src/components/Pagination.js | UTF-8 | 2,632 | 2.765625 | 3 | [] | no_license | import React from 'react'
const Pagination = ({start, setStart, end, setEnd, total, page, setPage, numberOfItems, last}) => {
// function for handling clicking on the first button in the pagination section
const handleFirst = () => {
if(page !== 1){
let _start = 0
let _end = _start + numberOfItems ... | true |
2904eb8b93c268cd1758e56b7e20a818a98cce98 | JavaScript | AkBo24/JavascriptPractice | /Chapter_6_Document_Object_Model/chapter6.js | UTF-8 | 5,747 | 3.765625 | 4 | [] | no_license | //To find an element within the DOM use the .querySelector()
//Ex find the paragraph underneath "Query the DOM"
const para = document.querySelector('p'); //grabs the first p tag in the html
console.log(para);
//to get the inner text, access the innertext property:
console.log(para.innerText);
//to change the inner te... | true |
1c1883f5d2ecf2c0e08736077ff35e6b1ba13149 | JavaScript | alrocar/carto-vl | /src/renderer/viz/expressions/classification/GlobalEqIntervals.js | UTF-8 | 1,584 | 2.8125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla"
] | permissive | import Classifier from './Classifier';
import { checkExactNumberOfArguments } from '../utils';
/**
* Classify `input` by using the equal intervals method with `n` buckets.
*
* It will classify the input based on the entire dataset without filtering by viewport or by `filter`.
*
* @param {Number} input - The input... | true |
0de6eba7fa8529b72c1b6122844c7630e3988b78 | JavaScript | gazedash/react-test-utils-training | /src/api/index.test.js | UTF-8 | 896 | 2.6875 | 3 | [] | no_license | import api from "./index.js";
import "isomorphic-fetch";
var nock = require("nock");
var request = nock("https://localhost:80/some")
.get("/endpoint")
.reply(200, {
hello: "world"
});
var request2 = nock("https://localhost:80/some/other")
.get("/endpoint")
.twice()
.reply(200, {
hello: "another w... | true |
f3e74dfc4f934c638495520330ea6b3d419df804 | JavaScript | huditama/hacktivgit | /client/js/getHome.js | UTF-8 | 1,424 | 2.546875 | 3 | [] | no_license | function getHome() {
$('#getSearchForm').empty()
$('#searchStarredRepoResult').empty()
$('#getCreateRepoForm').empty()
$('#successCreateRepoAlert').empty()
$('#getUnstarRepoForm').empty()
$('#successUnstarRepoAlert').empty()
$('#getSearchUserRepoForm').empty()
$('#searchUserRepoResult').... | true |
cda97a50faa4bf8fd4c57247719ab2612d063b75 | JavaScript | fega/snake-js-twitch | /index.js | UTF-8 | 5,928 | 3.578125 | 4 | [] | no_license | // const CUADRICULA = new Array(20).fill(0).map(()=>new Array(20))
/**
* @enum {string} 'up' | 'down' | 'left' | 'right'
*/
const SQUARE_SIZE = 20;
const GRID_HEIGHT = 20;
const GRID_WIDTH = 30;
const UP = 'up';
const DOWN = 'down';
const RIGHT = 'right';
const LEFT = 'left';
let speed = 3;
let counter = 0;
class W... | true |
b59a50382421785cd8c11bda8b6a8f3350d43260 | JavaScript | os-Indigo/Graviton | /modules/fs.js | UTF-8 | 1,042 | 2.703125 | 3 | [
"MIT"
] | permissive | const fs = require('fs')
module.exports = {
listAllFilesInDirectory: (path) => {
let files = []
fs.readdirSync(path).forEach(file => {
files.push(file)
})
return files
},
createDirectory: (path, name) => {
try {
... | true |
682b530ac2053f618f83b1df52f4b8a922e36241 | JavaScript | hockeytarget/hockeytarget.github.io | /js/index.js | UTF-8 | 3,406 | 3.046875 | 3 | [] | no_license |
var re=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
var objExp=new RegExp(re);
function pan(){
var str=document.getElementById("email").value;
if(document.getElementById("username").value=="Name:")
{
alert("Please enter your name.");
return false;
}
else if(document.getElementById("email").value=="... | true |
a465f823b437220b6514bb0d84c26efe9f1a36d9 | JavaScript | P3T3R-Z/Learning-and-review | /tsdemo/build/index.js | UTF-8 | 2,465 | 2.859375 | 3 | [] | no_license | "use strict";
var other;
(function (other) {
var Header = /** @class */ (function () {
function Header() {
var el = document.createElement("div");
el.innerText = "Header";
document.body.appendChild(el);
}
return Header;
}());
other.Header = Header;... | true |
a1ae9358deddf83d975151c1baa32b40681c004b | JavaScript | JUSTIVE/platformer | /src/sample.js | UTF-8 | 774 | 3.5 | 4 | [] | no_license | /* eslint-disable */
// Yet another code sample...
// There would be two "modes" in the game engine; this somewhat resembles
// OLTP and OLAP mode - Once the entity is not actively moving, it'll be
// moved to "batch" mode, which is ... batched.
const store = new EntityStore();
// All components are managed by Compone... | true |
23b0d4c1f6b49158e048dbd685fa30914e91ecd5 | JavaScript | kimmikirino/hackathon-senai | /dist/chat-estoque.js | UTF-8 | 1,549 | 2.625 | 3 | [] | no_license | setTimeout(sendWellcome, 500)
const e = query => document.querySelector(query)
function sendWellcome () {
sendMessage('Olá, Mariazinha\nSeu produto Bolacha tem validade até 20/12/2017.\nVocê já consumiu o alimento?', 'bot')
}
function sendMessage (text, sender) {
const message = document.createElement('li')
... | true |
c5da30fca666f375d808228f290a2b522a420a2d | JavaScript | YoImYoseph/bookmarkApp | /src/api.js | UTF-8 | 1,585 | 2.890625 | 3 | [] | no_license | 'use-strict';
const api = (function(){
const BASE_URL = 'https://thinkful-list-api.herokuapp.com/yoseph-bookmarks-app';
const createBookmark = function(bookmark = Object){
return fetch(`${BASE_URL}/bookmarks`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json'
... | true |
a7eff6bfc2f9b0e4037a30ac7c0d2ab3ae27088e | JavaScript | ElektraInitiative/libelektra | /src/tools/webui/src/components/TreeItem/dialogs/AdditionalMetakeysSubDialog.jsx | UTF-8 | 4,604 | 2.75 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* @file
*
* @brief section of the settings dialog where users can add additional metakeys
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*/
import React, { Component } from "react";
import TextField from "material-ui/TextField";
import FlatButton from "material-ui/FlatButton";
imp... | true |
9b490c663e8783fb6adc8f682b11f210fe896580 | JavaScript | wcm/infomap | /src/modules/helpers.js | UTF-8 | 990 | 3.46875 | 3 | [] | no_license | export function toRad(Value) {
/** Converts numeric degrees to radians */
return Value * Math.PI / 180;
}
export function distSq(x1, y1, x2, y2){
return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
}
export function getArea(array) {
var x = array;
var a = 0;
if (x.length < 3) return 0;
for (var i = 0; i < (x.le... | true |
f849f1d4e7a4646888fa0d67b23c8ac2d4835918 | JavaScript | BartoszLewosz/hydro__app | /src/js/main.js | UTF-8 | 1,654 | 3.109375 | 3 | [] | no_license | "use strict";
// service worker registration - remove if you're not going to use it
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('serviceworker.js').then(function(registration) {
// Registration was successful
console.log('ServiceW... | true |
e9c69825bb08c53b875efce3a15f2422c30dacce | JavaScript | 17603489109/zc | /D32_Node/1911.js | UTF-8 | 1,615 | 2.65625 | 3 | [] | no_license | const _http=require("http");
const _fs=require("fs");
_http.createServer(function(_request,_response){
// _response.end("this is a first node js program!");
/**
* TODO:
* 根据客户端浏览器地址栏的中url(保存在request对象中)信息,
* 可以从硬盘中找到客户想要的文件内容
*
* 1.希望看到文件内的内容
*
* fs 系统模块可以帮我们打开文... | true |
e8dd5f0a6456aa343e8375743e572abe9a61d87f | JavaScript | tomrogghe/calculator_react | /src/calculator.js | UTF-8 | 1,300 | 2.875 | 3 | [] | no_license | import React, { PureComponent } from 'react';
class Calculator extends PureComponent {
constructor() {
super()
this.state = {
input: "",
done: "0"
}
}
render() {
const { input, done } = this.state
return (
<div className="viewport">
<input type='text' value={input}... | true |
a7cf666fca086f9d7ca8ffbc9a8785ff02e12449 | JavaScript | enovz/Pooler | /lib/api/models/data.js | UTF-8 | 690 | 2.671875 | 3 | [] | no_license | /**Data
* Data represents an Data of choice, either food or drink.
* Data properties are :
* 1. name
* 2. value
* 3. measure
* Example > Data.name = Coca-Cola
* Data.value = 5
* Data.measure = L
*
*/
'use strict';
var mon... | true |
9bd43aefb486cd2f87f75fe0594d5b31fc8ee243 | JavaScript | krnets/codewars-practice | /5kyu/Human Readable Time/index.js | UTF-8 | 1,308 | 4.25 | 4 | [] | no_license | // 5kyu - Human Readable Time
/* Write a function, which takes a non-negative integer (seconds) as input and returns
the time in a human-readable format (HH:MM:SS)
HH = hours, padded to 2 digits, range: 00 - 99
MM = minutes, padded to 2 digits, range: 00 - 59
SS = seconds, padded to 2 digits, range: 00 -... | true |
3665f16c2675eb2e821e5562c17c88b78b9d1186 | JavaScript | pranshu2610/Luggage-Organizer | /script.js | UTF-8 | 3,607 | 3.15625 | 3 | [
"MIT"
] | permissive | var ulmain = document.getElementById("mainlist");
var ulside = document.getElementById("sidelist");
var ulfro = document.getElementById("finallist")
var button = document.getElementById("enter");
var input = document.getElementById("maininput");
var ul = document.querySelector("ul");
function inputLength() {
... | true |
1c32c3f0083ce0a8f789c09a925ea4dc864caa15 | JavaScript | kegsplitter/fish | /fish/util/AudioContext.js | UTF-8 | 394 | 2.53125 | 3 | [] | no_license | // AudioContext
// This might be different things depending on wether the env is node or browser
// TODO: just browser for now
let _getAudioContext = () => {
const audioContext = new AudioContext();
_getAudioContext = () => audioContext;
return audioContext;
}
export function isOffline(){
return fal... | true |
1b78066fd770c3e1253a3251f782c5af7a56df0e | JavaScript | jsanchez254/Smash-Bros-Wiki | /client/src/components/updateCharacter.jsx | UTF-8 | 13,917 | 2.78125 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from "axios";
//import logo
import logo from "../assets/img/smashLogo.png";
class updateCharacter extends Component {
state = {
characters: [],
tier: ["S", "A", "B", "C", "D", "E" ,"F"],
class: ["Heavy", "Projectile", "Melee", "Swords... | true |
b23ade1cf2bb530e1b51e0a6e082b6d72ac75d76 | JavaScript | JanneMattila/jannemattila.github.io | /SurvoSolver/scripts/worker.js | UTF-8 | 830 | 2.859375 | 3 | [
"MIT"
] | permissive | (function () {
"use strict";
importScripts("Board.js");
var board = new Board();
function solve(puzzleIndex, puzzle) {
postMessage({ "text": "Solving(" + puzzleIndex + "): " + puzzle.name });
board.setBoard(puzzle.board);
var solution = board.execute();
var... | true |
41defb75c3a28657512845a49cfc87622ea77374 | JavaScript | tkers/isomer-babel | /js/index.js | UTF-8 | 442 | 2.65625 | 3 | [
"MIT"
] | permissive | import Isomer, { Shape, Point, Color } from "isomer";
const red = new Color(160, 60, 50);
const blue = new Color(50, 60, 160);
const init = () => {
const canvas = document.getElementById("playground");
const iso = new Isomer(canvas);
iso.add(Shape.Prism(Point.ORIGIN, 3, 3, 1));
iso.add(Shape.Pyramid... | true |
855accc27a6be62a1f8237642965c7387011aa12 | JavaScript | endidev/React-Fernando-Herrera | /02-intro-javascript/src/bases/01-Const-Let.js | UTF-8 | 231 | 3.9375 | 4 | [] | no_license | // variables y constante
const nombre = 'Adrian';
const apellido = 'Martinez';
let valorDado = 5;
console.log(nombre, apellido, valorDado);
if(true){
let valorDado = 6;
console.log(valorDado);
}
console.log(valorDado) | true |
789bd3424d8bcdb8e2ab8e15cfe891beae2f2f55 | JavaScript | tthew/playlistr | /app/components/backbone.marionette/src/marionette.eventbinder.js | UTF-8 | 880 | 2.59375 | 3 | [
"MIT"
] | permissive | // EventBinder
// -----------
// Import the event binder from it's new home
// https://github.com/marionettejs/backbone.eventbinder
Marionette.EventBinder = Backbone.EventBinder;
// Add the EventBinder methods to the view directly,
// but keep them bound to the EventBinder instance so they work properly.
// This allow... | true |
530872b0492767784f6a28f5a763953f93470045 | JavaScript | SamanthaBandini/node-demo | /app.js | UTF-8 | 2,634 | 2.640625 | 3 | [] | no_license |
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
//TODO: Change port for meraki
var portForMeraki = 9201; //TCP listening port
var secret = "testmeraki"; //Secret that you chose in the Meraki dashboard
var validator = "VALIDATOR"; //Validator stri... | true |
1f27f4fa1027857339051ffd9c8267c923bf14e9 | JavaScript | adam-lafontaine/CutCalculator | /javascript_cc/scripts/page.js | UTF-8 | 7,642 | 3.3125 | 3 | [
"MIT"
] | permissive | /*
page.js - functionality that is directly related to user interface
*/
// Function that runs when page is loaded
$(function()
{
// set up page
$('#Results').hide();
$('#Error').hide();
resetInput();
// event handlers
$('#ButtonAddCutRow').click(function(e)
{
addCutRow();
});
//--------------... | true |
05c4165cba8e04b6801ee4f99471382f2ca4a89a | JavaScript | spicysoup/sei32 | /week7/recursion/dom/js/main.js | UTF-8 | 1,236 | 3.984375 | 4 | [] | no_license |
const traverseDOM = node => {
// Recursively visit each child node of the argument given,
// printing out the node type (div, p, span, a?) and the class if any
// NOTE: to do this you will need to loop over node.children
console.log( node.nodeName, node.className );
for( let i = 0; i < node.children.length; ... | true |
1c69d20342fa17f8650712f3e7047bf878fc2081 | JavaScript | luohong123/lets-go-coding | /leetcode/5.最长回文子串.js | UTF-8 | 1,313 | 3.3125 | 3 | [] | no_license | /*
* @Author: qingcheng
* @Date: 2020-05-06 11:59:24
* @LastEditors: qingcheng
* @LastEditTime: 2020-05-06 22:14:16
* @Description:
* @email: 3300536651@qq.com
*/
/*
* @lc app=leetcode.cn id=5 lang=javascript
*
* [5] 最长回文子串
*
* https://leetcode-cn.com/problems/longest-palindromic-substring/description/
*
... | true |
1a77732210e525b8590d2b7536bfdb14f9798558 | JavaScript | adushaj2022/building-management | /src/EmployeeForm.js | UTF-8 | 4,434 | 3.140625 | 3 | [] | no_license | import Axios from "axios";
import React, { useEffect, useState } from "react";
import "./EmployeeForm.css";
const EmployeeForm = () => {
const [employees, setEmployees] = useState([]);
const [active, setActive] = useState(true);
const [firstName, setfirstName] = useState("");
const [lastName, setlastName] = u... | true |
8f3af8dc9bdcdffcb23777508462dc7401a923da | JavaScript | agtravis/npm-algorithms-package | /algorithms/binarySearch/sumOfTwoNumbers.js | UTF-8 | 531 | 3.546875 | 4 | [] | no_license | 'use strict';
module.exports = (nums, k) => {
// establish a set to track which numbers have been seen
const equalsK = new Set();
// loop through the array
for (const num of nums) {
// check the set to see if it already contains a key for the target minus the current number
if (equalsK.has(k - num)) {
... | true |
9563e3a2094a24d3afdd6dc84a272d79fa32f8d7 | JavaScript | PetePhx/bordersify | /borderify.js | UTF-8 | 180 | 2.8125 | 3 | [] | no_license | const arrayize = pseudoArr => Array.prototype.slice.apply(pseudoArr);
arrayize(document.body.getElementsByTagName("*")).forEach(elm => {
elm.style.border = "1px solid red";
});
| true |
b604b46a9c1974228ad3dc06563033e0e1eb8d73 | JavaScript | sawao7/onepiece_s | /script.js | UTF-8 | 731 | 2.921875 | 3 | [] | no_license | // 要素の特定
const close_btn_clone = document.querySelector(".close"); //閉じるボタン 同じ名前がだめみたいだからcloneに
const main_div = document.querySelector("#main");
const play_btns = document.querySelectorAll(".play_btn"); //押されるとゲーム画面を表示,そこまでスクロール
const main_container_clone = document.querySelector(".main_container");
close_btn_clone.... | true |
64b1d2143c0de959b85364b5e78728187878d153 | JavaScript | Beagbarreto/DB-TESTING | /client/src/components/Profile/Profile.jsx | UTF-8 | 2,821 | 2.546875 | 3 | [] | no_license | import React from 'react';
class Profile extends React.Component {
constructor(props) {
super(props);
this.state = {
name: '',
LastName: '',
Nickname: '',
phone: '',
birthdate: '',
gender: [],
nationality: '',
identification: '',
education_level: [],
... | true |
59adeaa3206d0f19e9c19d7f89777aaeb317fae2 | JavaScript | StxGeorge/focusOnScroll | /fos.js | UTF-8 | 1,360 | 3.015625 | 3 | [] | no_license | const back = document.querySelector('#bg'),
w1 = document.querySelector('#w1'),
w2 = document.querySelector('#w2'),
w3 = document.querySelector('#w3'),
bArr = [w1,w2,w3],
girl = document.querySelector('#girl'),
intro = document.querySelector('.intro'),
control = document.queryS... | true |
4da7ef28d0cb3eb597e1466fea1a8ce013ccf3cc | JavaScript | warnabroda/warnabroda-app | /www/js/services.js | UTF-8 | 5,753 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | angular.module('starter.services', [])
.factory('Chats', function() {
// Might use a resource here that returns a JSON array
// Some fake testing data
var chats = [{
id: 0,
name: 'Ben Sparrow',
lastText: 'You on your way?',
face: 'https://pbs.twimg.com/profile_images/514549811765211136/9SgAuHeY.... | true |
fdaaba8939221900b962c4e891a0a4adad01a08f | JavaScript | NatanaelSaymon/Javascript | /3-js-object/02-javascript-objetos-prototype/aula/script.js | UTF-8 | 302 | 2.984375 | 3 | [] | no_license | const animaisListas = [
"cachorro",
"gato",
"lobo",
"leão"
]
const ulLista = document.querySelectorAll('li')
// const arrayLista = Array.prototype.slice.call(ulLista)
const arrayList = Array.from(ulLista)
const Carro = {
marca: 'Ford',
preco: 2000,
acelerar() {
return true
}
} | true |