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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b27a0a8d8ae66bceffdc2f76a78306f2504b6140 | JavaScript | mdmubeenkhan/rms | /src/main/webapp/js/review.js | UTF-8 | 6,711 | 2.78125 | 3 | [] | no_license |
function view(){
var rowId = event.target.parentNode.id;
var data = document.getElementById(rowId).querySelectorAll("td");
var rowID = data[1].innerHTML;
var rowVER = 0;
localStorage.setItem("rowID", rowID);
localStorage.setItem("rowVER", rowVER);
window.location.replace("http://localhost:9080/RMS/view.html");... | true |
59f91982d140b174fdd233f2603b8dad827c238e | JavaScript | sasha370/sasha370-TestGuru | /app/javascript/utilities/check_password_confirmation.js | UTF-8 | 1,150 | 2.953125 | 3 | [] | no_license | document.addEventListener('turbolinks:load', function () {
// Get form block whit password
form = document.querySelector('.need-validation')
if (form) {
var passwordField = this.querySelector('.password_field')
var confirmationField = this.querySelector('.confirmation_field')
// listen to an event in... | true |
e160afb0466a49cfbf700512dd772105fb3eaf48 | JavaScript | asafeliasim/COVID19-react-chartjs | /src/App.js | UTF-8 | 916 | 2.609375 | 3 | [] | no_license | import React,{useEffect,useState} from 'react';
import {Cards,Chart,CountryPicker} from './components';
import styles from './App.module.css'
import {fetchData} from "./api";
import covid19 from './images/covid19.png';
const App =()=> {
const [data,setData] = useState({});
const [country,setCountry] = useStat... | true |
c587110636471ba4fe43a5a470ebe26592d9ea6f | JavaScript | Kradox27/rukaPro2.0 | /middleware/handlebars.js | UTF-8 | 1,039 | 2.546875 | 3 | [] | no_license | const Handlebars = require('handlebars');
const moment = require('moment');
Handlebars.registerHelper({
eq: (v1, v2) => v1 === v2,
eqRol: (v1) => global.permisos.some(e => e.codigoPermiso == v1),
eqBool: (v1) => v1 === true,
ne: (v1, v2) => v1 !== v2,
lt: (v1, v2) => v1 < v2,
gt: (v1, v2) => v1... | true |
24945ee4fd0f359ae74861d63e2d42fa515ee149 | JavaScript | dannewoo/creativecode | /p5js/Week10_keys_events_images/key_events_07_key_press_release/sketch.js | UTF-8 | 380 | 3.171875 | 3 | [] | no_license | var drawT = false;
function setup() {
createCanvas(600, 400);
background(0);
noStroke();
textSize(200);
textAlign(CENTER);
fill(255);
}
function draw() {
background(0);
if (drawT == true) {
text("T", width/2, height/2 + 75);
}
}
function keyPressed() {
if (key == 'T' || key == 't') {
draw... | true |
9da1a25aa189cf18b658016c08ee0f87a0fd0026 | JavaScript | FlamingLotusGirls/Serenity | /sound/SoundAdmin/SoundAdmin.js | UTF-8 | 15,451 | 2.609375 | 3 | [
"MIT"
] | permissive |
const fs = require('fs');
const express = require('express');
const cors = require('cors');
const http = require('http');
const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: true })); // I think this means we support that too
app.use(cors());
const port = 9000;
// https://codeburs... | true |
a2af26d6fda36f99a0cde68ba6ba785cdc79ce1c | JavaScript | AlameerAshraf/Online-Store | /js/ProjectJs/OrdersLoader.js | UTF-8 | 2,482 | 2.65625 | 3 | [
"MIT"
] | permissive | var Data = document.getElementsByClassName("in-check") ;
var ItemsNumbers = document.getElementsByClassName("cart-items") ;
var db = openDatabase("AsssS", '1.0', "My WebSQL Database", 8 * 1024 * 1024);
var select = function () {
db.transaction(function (tx) {
tx.executeSql("SELECT * FROM ST23 WHERE Pieces... | true |
bcb3d3a28fda8671a2f92054b4316291aaab1c33 | JavaScript | SaraMoya/todo-web | /src/App.js | UTF-8 | 1,404 | 2.796875 | 3 | [] | no_license | import React, { useEffect } from 'react';
import TodosList from './todosList';
import Bar from './bar.js';
import './App.css';
class App extends React.Component {
state = {todos: [],
task: ''
}
handleChange = event => {
let { task } = {...this.state}
task = event.target.value
this.setSt... | true |
8421c2d22d24a8cbee66ca3c43526551650f202d | JavaScript | shfeat/tampermonkey-extension | /scripts/dytt-remove-ads.js | UTF-8 | 4,994 | 2.875 | 3 | [] | no_license | // ==UserScript==
// @name 电影天堂,阳光电影去掉广告与高亮高分电影
// @namespace https://github.com/yujinpan/tampermonkey-extension
// @version 1.3
// @license MIT
// @description 主要是在电影天堂,阳光电影网站去掉页面上的广告(隐藏广告比较烦)。还有就是标记高分和获奖的电影,方便找到精华电影。
// @author yujinpan
// @include http*://www.dytt8.net/*
// @include ... | true |
49b46a5fc82165696820ec5b17d1ecc70b5ebf79 | JavaScript | FedeSeg/grupo_7_andesnut | /src/controllers/userController.js | UTF-8 | 1,502 | 2.578125 | 3 | [] | no_license | const fs = require('fs');
//const bcrypt = require('bcryptjs')
const userController = {
register: (req,res) => {
//let password = req.body.password
//let resultado = bcrypt.hashSync(password, 10);
// TENGO QUE ARMAR TODO EL REGISTRO
res.render('users/register')
},
/* ss
... | true |
860ed14e5c38fc08864595134127ae1c3f4d80c9 | JavaScript | danielbarbosa-developer/ProductsAPI | /src/routes/routes.js | UTF-8 | 1,627 | 2.625 | 3 | [] | no_license | const md5 = require("md5");
const TimeControl = require ("../controller/time-control.js");
const ProductsRepository = require("../Repository/products-repository.js");
const timeControl = new TimeControl();
const productsRepository = new ProductsRepository();
// //Definição das rotas da API e métodos HTTP
const router... | true |
3d3bbc0c1f08ebadd6f3b8580f36dbbbc41ce72a | JavaScript | lasallejs/class-activities | /19.1-activities/01_Hello_World_Again/unsolved/js/index.js | UTF-8 | 370 | 4.1875 | 4 | [] | no_license | // Create a variable below
var helloWorld = 'Hello this is Me, Welcome to the Next Level';
// Console.log() your variable here.
console.log(helloWorld);
var x = 20;
var y = 2;
var z = 'There are ' + (x + y) + ' kids at my house';
function addkids() {
console.log(z);
console.log(x);
console.log(y);
... | true |
3d3ede9f1217e76750691207215f8fca6e935af1 | JavaScript | dzmitrybek/frontcamp-mentoring | /pure-part/src/app/AppPresenter.js | UTF-8 | 3,691 | 2.5625 | 3 | [] | no_license | export default class AppPresenter {
constructor(...args) {
[this.view, this.model] = args;
}
init() {
this.loadMainPage();
this.view.onSearchNews((query) => this.loadMainPage(query));
this.view.onRefreshNews(() => this.loadMainPage());
this.view.onAddNews(() => this.... | true |
49a6f56c72128c49f629620a32f8b1ec74436c1a | JavaScript | benhamilton15/FullStack-App-Bucket-List-Lab | /client/src/views/list_item_view.js | UTF-8 | 2,049 | 3.09375 | 3 | [] | no_license | const PubSub = require('../helpers/pub_sub.js');
const ListItemView = function (containerElement) {
this.containerElement = containerElement;
};
ListItemView.prototype.render = function (listItem) {
const listItemContainer = document.createElement('div');
listItemContainer.id = "list-item-container";
const t... | true |
d3247a4af81ba2ec90bb92224b90fac7c5f25a39 | JavaScript | Strategy11/formidable-forms | /js/packages/floating-links/s11-floating-links.js | UTF-8 | 8,198 | 3.21875 | 3 | [] | no_license | /**
* Class representing a floating action button for showing links.
*
* @class S11FloatingLinks
*/
class S11FloatingLinks {
/**
* Create a new S11FloatingLinks instance.
*
* @constructor
*/
constructor() {
wp.hooks.addAction( 'set_floating_links_config', 'S11FloatingLinks', ({ links, options }) => {
... | true |
dcc20737ec6c31ba00c962958240fd0cacfd7e7f | JavaScript | osama-allam/Examination-System | /Scripts/prompts.js | UTF-8 | 2,020 | 2.78125 | 3 | [] | no_license | var alertsCounter = 0;
var alerts = document.querySelector(".alert");
function addNewAlert(message)
{
var newAlert = document.createElement('div');
alertsCounter++;
newAlert.setAttribute('class','alert__content');
newAlert.setAttribute('id','alert'+alertsCounter);
newAlert.innerHTML = "<div class='... | true |
7e09f0a1cd43dfabdbe5b44b43153f0380539e51 | JavaScript | jleveau/M2-Workshops | /js/mongoWorkshop.js | UTF-8 | 2,314 | 2.625 | 3 | [] | no_license | const MongoClient = require('mongodb').MongoClient;
const url = 'mongodb://mongo:27017';
const dbName = 'workshopDatabase';
const COLLECTION_NAME = "workshops"
let db;
function init() {
return new Promise((resolve, reject) => {
MongoClient.connect(url, function(err, client) {
if (err) {
... | true |
b962554b09b8c0ad7b696eacf511d26e6738792f | JavaScript | ironclass/ironclass | /src/MixMyClass.js | UTF-8 | 6,840 | 3.375 | 3 | [] | no_license | // model data for testing the logic, just left the needed fields
let users = [
{
_workedWith: [],
_id: "3",
username: "Andre".toLowerCase(),
role: "Student"
},
{
_workedWith: [],
_id: "4",
username: "Malte".toLowerCase(),
role: "Student"
},
{
_workedWith: [],
_id: "5",
... | true |
9cd472c149a1f911ad86011179f63f43fc562189 | JavaScript | NatanshP/twitterApp | /src/reducers/explore.js | UTF-8 | 690 | 2.59375 | 3 | [] | no_license |
const initialState = {
tweets: {},
people: {},
trends: {}
}
export const explore = (state = initialState, { type, payload }) => {
const getNewData = (key) => {
const { list, page, ...rest } = payload
return {
...state,
[key]: page === 1 ? payload : {
list: [...(state[key].list || [... | true |
c43349374187c9169a3aed5300551668c10ce7d5 | JavaScript | aosante/advanced-node-concepts | /thread.js | UTF-8 | 969 | 2.625 | 3 | [] | no_license | require('dotenv').config()
process.env.UV_THREADPOOL_SIZE
const http = require('http')
const bcrypt = require('bcrypt')
// Default = 3600 req/sec (more below)
// UV_THREADPOOL_SIZE=1 | 1030 req/sec
// UV_THREADPOOL_SIZE=2 | 2000 req/sec
// UV_THREADPOOL_SIZE=3 | 2900 req/sec
// UV_THREADPOOL_SIZE=3 | 3500 req/sec
/*... | true |
bf2a13dcca649c9d925674261f5c9d23675e18e3 | JavaScript | hao-wang/Montage | /js-test-suite/testsuite/5ec9ee864cc131873370d5ab7bd181f4.js | UTF-8 | 3,556 | 3.046875 | 3 | [
"MIT"
] | permissive | function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error('bad value: ' + actual);
}
function iterator(array) {
var nextCount = 0;
var returnCount = 0;
var original = array.values();
return {
[Symbol.iterator]() {
return this;
},
ne... | true |
5b4977b6a726a23c1260ba2d499f2a35ff769f1d | JavaScript | Darko203/Back_End_Node.js | /lecture-7/peoples-registry/routes/index.js | UTF-8 | 1,211 | 2.6875 | 3 | [] | no_license | var express = require('express');
const { get } = require('../app');
var router = express.Router();
let people = require('../real-estate-data')
/* GET home page. */
router
.get('/people', function(req, res) {
res.send({
message:"All people registered on the platform",
items: people
})
})
.get('/people/... | true |
ad5f79f7d44f10ad50a7e5c96d8dee975294c369 | JavaScript | ashiqdev/COMPLETE-REACT | /es6_refresher/var_let_con.js | UTF-8 | 84 | 3.09375 | 3 | [] | no_license | const name = 'Ashik';
let age = 24;
age = 25;
console.log(name);
console.log(age);
| true |
46d9355bae691ea997ef1f5f63c5c0bfb9cdd773 | JavaScript | golfyos/tea-bot | /tea-admin/src/reducers/auth.js | UTF-8 | 420 | 2.5625 | 3 | [
"MIT"
] | permissive | import { USER_LOGIN } from "../constant";
const initState = {
isLogin: false,
username: "",
password: ""
};
const auth = (state = initState, action) => {
switch (action.type) {
case USER_LOGIN:
return {
...state,
username: action.payload.username,
password: action.payload.pas... | true |
c64b6e4737456c5475ad20c9c52d63389e891c3c | JavaScript | zyqzyq1314/letao | /public/back2/js/login.js | UTF-8 | 1,320 | 2.578125 | 3 | [] | no_license | /**
* Created by Jepson on 2018/5/9.
*/
// 入口函数, 可以防止全局变量污染
$(function() {
/*
* 1. 表单校验功能, 在表单提交时,会进行校验, 所以一定要给表单设置 name 属性
* 校验要求:
* (1) 用户名不能为空
* (2) 密码不能为空, 长度为6-12位
* */
$('#form').bootstrapValidator({
// 指定校验时的图标显示
feedbackIcons: {
// 校验成功的
valid: 'glyph... | true |
fe6146bd63ae444cdddab098cb743100e7f87ee7 | JavaScript | ITDevSolution/JRONCEROS_examFinal_ISIL2019 | /1/app.js | UTF-8 | 379 | 4.34375 | 4 | [] | no_license | /**
* Diseñar una función que permita retornar la suma de los “N” primeros números naturales. Debe ingresar
como parámetro el valor “N”
**/
function sumaN(n){
return (n*(n+1))/2;
}
var numero = parseInt(prompt("Ingrese numero: "));
document.getElementById("r").innerHTML = "La suma de los primeros numer... | true |
0e62f11ab177d7562ea19897009801afb688e86c | JavaScript | tylertrudgeon/JS-Snake-Game | /CanvasSetup.js | UTF-8 | 828 | 3.515625 | 4 | [] | no_license | //Targeting canvas by it's ID.
const canvas = document.getElementById('canvas');
const context = canvas.getContext('2d');
//Setting canvas to have squares.
const scale = 20;
const rows = canvas.height / scale;
const columns = canvas.width / scale;
let snake;
//Creating IIFE to set up the snake.
(function setup() {
... | true |
666c989d7ab19b5231154af5c1b5bd2293677b08 | JavaScript | Noushad-web/TPC | /src/component/allTags/ResmebleTag.jsx | UTF-8 | 978 | 2.546875 | 3 | [] | no_license | import React, { useState } from 'react';
import { resembleTag } from "../../action";
import { useDispatch } from 'react-redux';
const ResmebleTag = () => {
const dispatch = useDispatch();
const resembleTagHandler = (e) => {
const innerHTML = e.target.innerHTML.toLowerCase();
dispatch(resembleTag(inner... | true |
93b2e33d18f52c9ce3d91916453601e50db1396e | JavaScript | 2kuba/N220Summer2021 | /labs/lab8/bounceOffRect/js/bounce.js | UTF-8 | 1,350 | 3.578125 | 4 | [] | no_license |
//variables for circle location, velocity and rect location
circleX = 100;
circleY = 100;
xVel = 5;
yVel = 5;
rectX = 0;
rectY = 400;
rectW = 800;
rectH = 200;
//create the canvas
function setup() {
createCanvas(800,600);
}
//move the circle about the canvas
function move() {
//change location of circl... | true |
1ad61dcbd611a693404255b3407683844b4947b3 | JavaScript | asarudick/exercises | /js/tests/minimumInteger.js | UTF-8 | 1,241 | 3.3125 | 3 | [] | no_license | import assert from 'assert';
import minimumInteger from '../minimumInteger';
import range from 'lodash/range';
describe('minimumInteger', () => {
it('should return 1 on empty arrays', () => {
const arr = [];
const result = minimumInteger(arr);
assert.equal(result, 1);
});
it('should return 2 element on ... | true |
1193a5d4f150488d00627aa40e18d9407a728c57 | JavaScript | lilmissrayna/Curriculum-Resources | /Week3/Day2/PokemonPage/pokeDemo.js | UTF-8 | 4,748 | 3.96875 | 4 | [] | no_license | console.log("Hello");
//JS is going to be responsible for 2 things.
//For manipulating the page
function Pokemon(name,type,image,backImage){
this.name = name;
this.image = image;
this.type = type;
this.backImage = backImage;
}
//be careful, there are no generics so nothing stopping from sendi... | true |
e3aac100f452373feeaff3e0a7781574c6df5e8a | JavaScript | KeithTt/puppeteer-demo | /dist/rize_.js | UTF-8 | 587 | 2.71875 | 3 | [] | no_license | "use strict";
// https://rize.js.org/api/classes/_index_.rize.html
const Rize = require('rize');
const rize = new Rize();
// 在 puppeteer 中,在启动浏览器之后,您必须新建一个页面。然而在 Rize 中,您不需要这么做
rize
.goto('https://github.com/')
.type('input.header-search-input', 'node')
.press('Enter')
.waitForNavigation()
.assertSe... | true |
e5cfa754a1b3bf8f9ce49d832c8ffb7d72a12da4 | JavaScript | unicodeveloper/lindaikeji-cli | /factory/post.js | UTF-8 | 1,527 | 2.828125 | 3 | [
"MIT"
] | permissive | 'use strict';
var request = require('request'),
Q = require('q'),
_ = require('lodash');
var BLOGGER_HOST = 'https://www.blogger.com/feeds/9174986572743472561/posts/default?alt=json&max-results=';
// Fetches data from linda Ikeji's blog
function fetchTopStories(count, cb) {
request(BLOGGER_HOST + count, fu... | true |
3e4882d086bd9c423c9a011d00ee12dbb6c76f93 | JavaScript | agonzadu/primer_repositorio | /js/scripts.js | UTF-8 | 2,675 | 4.125 | 4 | [] | no_license | // Prueba de funcionamiento de JS
//document.write("Hola");
// Generar alerta en a usuario
// alert("Ventana de alerta para usaurio");
// Solicitar información a nuestro usuario
/*
var nombre = prompt("Por favor introduzca su nombre");
document.write("<h1>Bienvenid@: " + nombre + "</h1><br />");
var edad = prompt("... | true |
dba3af1c53470da2f6d957a0f9f0db9bca531919 | JavaScript | dkim0827/codecore_homework | /turtle_graphics/turtle-graphics.js | UTF-8 | 3,495 | 4.34375 | 4 | [] | no_license | // Since example is chaining the function
// exmaple > flash.forward(5).right().forward(5)
// each function will give return value of this
// except allPoints() & print();
class Turtle {
// create Turtle class
constructor(x, y) {
this.x = x || 0; // if const flash = new Turtle() has to be (0,0)
this.y = y ... | true |
fe33de49315d9a83fde20a55af4abdba3f8fb0fd | JavaScript | vickycodes/Blackjack | /js/application.js | UTF-8 | 4,089 | 3.15625 | 3 | [] | no_license | $(document).ready(function(){
var player = new BlackJackGame();
var dealer = new BlackJackGame();
//ON CLICK OF THE "HIT" BUTTON
$("#Hit").click(function(){
if (!player.isMoreThanTwentyOne()){
player.hit();
$(".cardDeck").append(`<img src="css/${player.getPictureCard()}">`);
$("#gamestat... | true |
5360dd87f2db128c045699a12a2e29c58fb45ea4 | JavaScript | Ishwar77/addroitt-nodejs | /models/country.js | UTF-8 | 1,842 | 2.6875 | 3 | [] | no_license | "use strict";
var dbConn = require("./../config/db.config");
//Employee object create
var Country = function (country) {
this.idcountry = country.idcountry;
this.country = country.country;
this.country_code = country.country_code;
this.create_timestamp = new Date();
this.update_timestamp = new Date();
};
Cou... | true |
d723a7f0045298718126d824b01ded7a80f5e87a | JavaScript | Cartman0/HatenaBookmarkFakeExtension | /background/background-script.js | UTF-8 | 609 | 2.640625 | 3 | [] | no_license | // when clicked icon
chrome.browserAction.onClicked.addListener(addHatenaBookmark);
function addHatenaBookmark(tab){
// permissions でtabsを有効にするとurl titleが取れる
//console.log('url', tab.url);
if (tab){
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.sendMessage(tabs[0].i... | true |
89bb5b60afb737ae245a391c0a7dd52a8bc15ed8 | JavaScript | kozulova/js | /game/script.js | UTF-8 | 240 | 2.546875 | 3 | [] | no_license | import Game from './classes/game.js';
const load = () => {
let emos = ["🐶", "🐱", "🐭", "🐹", "🐰", "🐻"];
let game = new Game(emos);
game.play();
}
document.addEventListener("DOMContentLoaded", load);
| true |
dfc6896e0f769b1afd49f1c9bab4736500be2ca7 | JavaScript | aroonm/Magnifier | /scripts/magnifier.js | UTF-8 | 3,991 | 2.84375 | 3 | [
"MIT"
] | permissive | var _browserZoomVal;
var _graphicalZoomVal;
var zoomDelta;
var offsetOnZoom;
var xOffset;
var yOffset;
var mouseDetectionoffset;
var keyPlus;
var keyMinus;
var windowWidth;
var windowHeight;
var bodyWidthBeforeGZ;
var bodyWidthAfterGZ;
var selectedText;
var refactoredContentContainer;
function initializeZoom() {
... | true |
f0ab6d2fc1294f4864539a563f50752045cc46d7 | JavaScript | tnemec/react-dgscore | /src/components/NewCourse.js | UTF-8 | 8,589 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
import { connect } from 'react-redux'
import { Button, Grid, Col, Row, ListGroup, ListGroupItem, Modal, Form, ControlLabel, FormGroup, FormControl, Glyphicon, Checkbox, Alert } from 'react-bootstrap';
import localCourses from '../utilities/localCourses.js';
import constants ... | true |
6829aed33a42412eafc6a55beae7ac82c9abb496 | JavaScript | Matheusfariasc/Serratec | /Fase 2/bolo.js | UTF-8 | 537 | 3.140625 | 3 | [] | no_license | // Ingredientes
var ovo;
var leite;
var farinha;
var manteiga;
var fermento;
var acucar;
// Atribuir
// armazenar; Guardar : Conceder
ovos = 3;
leite = " 1 copo";
farinha = " 2 xícaras e meia";
manteiga = " 2 colheres";
acucar = 0.75;
// Ana maria Brogui
ovo = 2;
manteiga = " 2 colheres de sopa... | true |
19bc0cdbf946c2b5b2e96d42a7ca95e9ce39c1a0 | JavaScript | tanveerg1/NodeJS-Practice | /vowel.js | UTF-8 | 438 | 4.25 | 4 | [] | no_license | //person object
var person = {
name : "John",
age : 30,
sex : "Male",
education : "Bachelor Degree",
eyeColor : "Blue"
}
//array of vowels
var vowels = ['a', 'e','i','o','u'];
//create an array of the keys in the person object
var keys = Object.keys(person);
//match the keys with the vowels and print the keys s... | true |
d5b5c3929e67057bf8519adc9ce47a196d1cf678 | JavaScript | DeAndreHarvey/PokeFind-Back-end | /server/controllers/poke.js | UTF-8 | 2,340 | 2.546875 | 3 | [] | no_license |
var api = require('pokemon-go-api');
var _ = require('underscore')
const username = '';
const password = '';
const provider = 'google';
var location = 'dublin blvd and donlon way'
var latitude ;
var longitude;
var results = []
// note the immediate function and the object that is returned
module.exports = (function() ... | true |
d339937df84e55c07a8d09632b44aea4d61be465 | JavaScript | 123Lez/Translator | /frontend/js/validation.js | UTF-8 | 1,396 | 3.03125 | 3 | [] | no_license | function validation()
{
var name=document.myform.name_signUp.value;
var lastname=document.myform.lastname_signup.value;
var email=document.myform.email_signup.value;
var password=document.myform.password_signup.value;
var repassword=document.myform.repassword_signup.value;
var atpos=email.indexOf("@");
var dot... | true |
cba8404111feab76c9cba846bdf2b7f6b51e2728 | JavaScript | Anakinliu/IJCE_Projects | /TomcatTest/out/artifacts/TomcatTest_war_exploded/js/m.js | UTF-8 | 1,764 | 3.4375 | 3 | [] | no_license | var usernameObj;
var passwordObj;
window.onload = function() { // 页面加载之后, 获取页面中的对象
usernameObj = document.getElementById("un");
passwordObj = document.getElementById("pw");
errorMsg = document.getElementById("msg");
};
function checkUsername() { // 验证用户名
var regex = /^[0-9a-zA-Z_]{0,9}$/; // 字母数字下划线1到10... | true |
31f284afe08192bad14e6dead9ec3a5543c7be6b | JavaScript | Akashh1996/Skylab-Bootcmamp-2020 | /daniel-martinez/Challenges/functions-javascript/codewars-exercices/disemvowel-trolls.js | UTF-8 | 349 | 3.171875 | 3 | [] | no_license | function disemvowel(str) {
var l = str.split('');
for (var i = 0; i < l.length; i++) {
if (
l[i].toUpperCase() === 'A' ||
l[i].toUpperCase() === 'E' ||
l[i].toUpperCase() === 'I' ||
l[i].toUpperCase() === 'O' ||
l[i].toUpperCase() === 'U'
) {
l[i] = '';
}
}
str = l.join('');
return str;
}
... | true |
f8ad029e0db71d17322e9183bbed65a5434ad503 | JavaScript | feross/bitmidi.com | /src/views/title.js | UTF-8 | 573 | 2.703125 | 3 | [] | no_license | import { Component } from 'preact'
export default class Title extends Component {
componentDidMount () {
const { title } = this.props
this.setTitle(title)
}
componentWillReceiveProps (nextProps) { // eslint-disable-line react/no-deprecated
const { title } = this.props
if (title !== nextProps.tit... | true |
107a633357066604c93410f03ca813b369f4f82f | JavaScript | n2sy/tp-express | /controllers/students.js | UTF-8 | 2,843 | 2.71875 | 3 | [] | no_license | let { students_list, student_schema, student_schema_update } = require("../models/students");
_ = require("lodash");
exports.getAllStudents = (req, res) => {
//res.send("All Students are there")
// res.status(200).json({
// students : "All Students are there",
// id : "A10"
// });
res... | true |
a7931583a3d7a0355a55c1b98d9db497e5084031 | JavaScript | AbbyShaw36/AbbyShaw36.github.io | /efficacy/react-calendar-note/src/util/createWeekDays.js | UTF-8 | 280 | 3.109375 | 3 | [] | no_license | import { pullAt } from "lodash";
export default function createWeekDays(weekOffset=0) {
const weekArr = ["日","一","二","三","四","五","六"];
let newWeekArr = [];
while(weekArr.length) {
newWeekArr.push(pullAt(weekArr,weekOffset));
}
return newWeekArr;
}
| true |
6f1432b3ee1bfd6208b2ea541aca18196200badf | JavaScript | whyzcandy/dancehack2017 | /src/three/features/pois.js | UTF-8 | 528 | 2.578125 | 3 | [
"MIT"
] | permissive |
import Draw from './../util/draw'
class Pois {
constructor(geometries, drawType, color, parent, origin) {
this.draw = new Draw();
this.color = color;
switch (drawType) {
case 'shapes':
this.drawPoisAsShapes(geometries, parent, origin, 4000);
break;
}
}
drawPoisAsShapes(geometries, parent, origin... | true |
8cb452dcb45cdd0eca8100631ea1055a12036d88 | JavaScript | nuxt-contrib/xs-url | /index.js | UTF-8 | 1,579 | 3.015625 | 3 | [
"MIT"
] | permissive | exports.parse = function (url) {
const output = {}
let protocolIndex = url.indexOf('://')
if (protocolIndex !== -1) {
output.protocol = url.substring(0, protocolIndex)
url = url.substring(protocolIndex + 3)
} else if (url.indexOf('//') === 0) {
url = url.substring(2)
}
let parts = url.split('/... | true |
fb2becd1cf633fe054ab710fd6237592c3733eb2 | JavaScript | PIKAIA-project/PIKAIA-frontend | /src/Binaural/componants/RenderTime.js | UTF-8 | 445 | 2.546875 | 3 | [] | no_license | import React from "react";
import "../styles/countdown.css";
export const RenderTime = ({ remainingTime }) => {
if (remainingTime === 0) {
return <div className="timer">Redo?</div>;
}
return (
<div className="timer">
<div className="value">
{Math.floor(remainingTime / 60)}m{" "}
{... | true |
39a77f4a846940f1cc6e5852d12f7b62bf1ea659 | JavaScript | taoning2014/crack-lintcode | /achieve/second-round/125.js | UTF-8 | 878 | 3.6875 | 4 | [] | no_license | 'use strict';
// ========================================================================
// Time: 5min
// Submit: 1
// ========================================================================
function isAlphanum(char) {
return (char >= 'a' && char <= 'z') || (char >= '0' && char <= '9');
}
/**
* @param {string... | true |
d1460c3cdeeef099babad3f2582411a35569a8d0 | JavaScript | balihoo-aharl/regionalsite-standard | /src/js/plugins.js | UTF-8 | 4,938 | 2.71875 | 3 | [
"MIT"
] | permissive | // Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'ta... | true |
b7d964b77bb571556747c4d9276ad6db8306f441 | JavaScript | miaozhirui/credan_app_recycling | /src/common/js/validate.js | UTF-8 | 3,936 | 3.109375 | 3 | [] | no_license | //验证类
export default {
isPhone(str) {
return /^1[2|3|4|5|6|7|8|9][0-9]\d{8}$/.test(this.deleteSpace(str));
},
isNumber(str) {
return /^\d+$/.test(this.deleteSpace(str));
},
//此判断语义有问题,由于历史遗留问题,被多处使用,暂不修改,可以用下面的isNotEmpty代替
isEmpty(str) {
return /^.+$/.test(this.d... | true |
beee6532d4f99f0d7fce2766908e78d862a39148 | JavaScript | instrumentsofchange/Aspire | /Aspire/ClientApp/src/areas/schedules/reducers/search-schedules-reducer.js | UTF-8 | 1,994 | 2.53125 | 3 | [] | no_license | import {
FETCH_PROGRAM_OPTIONS_REQUEST,
FETCH_PROGRAM_OPTIONS_SUCCESS,
FETCH_PROGRAM_OPTIONS_FAILURE,
SEARCH_SCHEDULES_REQUEST,
SEARCH_SCHEDULES_SUCCESS,
SEARCH_SCHEDULES_FAILURE,
DELETE_SCHEDULE_REQUEST,
DELETE_SCHEDULE_SUCCESS,
DELETE_SCHEDULE_FAILURE
} from '../actions/search-schedule-data-actions'... | true |
99e00c0c1326ddc7bd6d0507ff12e3726d544a8d | JavaScript | omerbguclu/enigma-react | /react-app/src/store/reducers/input.js | UTF-8 | 553 | 2.828125 | 3 | [
"MIT"
] | permissive | import { KEY_BACKSPACE, KEY_VALID } from "../types/inputTypes";
export const keys = {
VALID_KEY: 0,
UNVALID_KEY: 1,
BACKSPACE: 2,
}
const initial_state = keys.UNVALID_KEY;
const reducer = (state = initial_state, action) => {
switch (action.type) {
case KEY_BACKSPACE:
console.log(action.pa... | true |
8be9c35eff1e2e024dd6e856a4a6e87446139a18 | JavaScript | Bognar/Chartist-js | /assets/app.js | UTF-8 | 1,364 | 2.828125 | 3 | [] | no_license |
var obj = [
{
"_id": "5c649fd39e10e7a8fda259f1",
"picture": "http://placehold.it/32x32",
"age": 130,
"gender": "male"
},
{
"_id": "5c649fd344c4a506670b9e92",
"picture": "http://placehold.it/32x32",
"age": 26,
"gender": "female"
},
{
"_id": "5c649fd31138668b7e8a3ce6",
"... | true |
498e2a12be9c595e9f1a303d3bb7794dc583b08d | JavaScript | judelin/ProjectReact | /mon-app/src/appJeux/appTictato.js | UTF-8 | 6,046 | 2.796875 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import { Button } from 'react-bootstrap';
import {calculateWinner, findBestMove, differentZero, numbRandom} from './calculateWinner';
//import {CarreVal} from './component/Carre';
import { CarreVal} from './component/tictactoComponent';
import './component/affBra.css';
... | true |
88c2faf8b9e1b142e139066c675bbeb5890a56a6 | JavaScript | sigvef/analytics-unsplash | /analytics-unsplash.js | UTF-8 | 697 | 2.515625 | 3 | [] | no_license | (function(){
var x = new XMLHttpRequest();
x.onload = function(){
var parser = new DOMParser();
var descriptions = parser.parseFromString(x.responseText, 'application/xml')
.querySelectorAll('description');
var description = descriptions[1 + (descriptions.length - 1) * Math.random() | 0];
v... | true |
6b33c736ede72bc4cf6e06c7929ca2959b8920b2 | JavaScript | fmartinez2345/galery-movie | /src/components/MoviesContainer/MovieList/MovieList.component.js | UTF-8 | 422 | 2.5625 | 3 | [] | no_license |
import React from 'react';
import MovieData from './MovieData/MovieData.component';
const strToComponent = data => (
data.map( movie => <MovieData img = {movie} key={movie} />)
);
const MovieList = ({data}) => {
if(data !== undefined) {
return (
<div className='img-conteiner'>
{strToComponent... | true |
22045298c7322386559cf68bbfa79f5fa2e6deed | JavaScript | ramziash/Weather-App-React | /src/components/Page/GraphPage.js | UTF-8 | 2,032 | 2.671875 | 3 | [] | no_license |
// details from these websites.
//https://recharts.org/en-US/examples/AreaResponsiveContainer
//https://reacttraining.com/blog/react-router-v5-1/
import React, { useState, useEffect } from "react";
import {
useParams,
useHistory
} from "react-router-dom";
import {
AreaChart, Area, XAxis, YAx... | true |
fe941059587c6961f90e9fe5cf7391668299c7c3 | JavaScript | geekbing/geekbing.github.io | /vote/js/vote.js | UTF-8 | 3,407 | 2.9375 | 3 | [] | no_license | var total_vote= 0;
var xing_vote = 0;
var chu_vote = 0;
var bing_vote = 0;
var ling_vote = 0;
function the_max_vote()
{
var temp1=(xing_vote>chu_vote)?xing_vote:chu_vote;
var temp2=(bing_vote>ling_vote)?bing_vote:ling_vote;
var max_vote=(temp1>temp2)?temp1:temp2;
return max_vote;
}
//根据最大票数设置显示结果的整体宽度
function ... | true |
200d37dda4ba6fbfedad302041b39a7bdfbb3c9e | JavaScript | sjx1995/Learning-Code | /Leetcode/src/sourceCode/LinkedList/面试题02.07/main.js | UTF-8 | 1,036 | 3.046875 | 3 | [
"MIT"
] | permissive | /*
* @Author: Sunly
* @Date: 2020-11-18 11:12:28
* @LastEditTime: 2020-11-18 11:12:30
* @LastEditors: Sunly
* @Description:
* @FilePath: \Leetcode\src\sourceCode\LinkedList\面试题02.07\main.js
*/
export const getIntersectionNode = (headA, headB) => {
const map = new Map();
while (headA) {
map.set(headA);
head... | true |
339aaa42ad657b961256cff589879d102b0d8fa1 | JavaScript | samplek/js-functional-library-project-web-112017 | /index.js | UTF-8 | 2,935 | 2.9375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | fi = (function() {
return {
libraryMethod: function() {
return 'Start by reading https://medium.com/javascript-scene/master-the-javascript-interview-what-is-functional-programming-7f218c68b3a0'
},
each: function(input, action) {
if (input.constructor === Array) {
for (i = 0; i < input... | true |
81143baba65a1ad95f29a79a6139553a152d3cad | JavaScript | salesforce/lwc | /packages/@lwc/integration-karma/test/polyfills/proxy-concat/index.spec.js | UTF-8 | 2,360 | 3.40625 | 3 | [
"MIT"
] | permissive | it('should correctly concatenate 2 standard arrays', () => {
const first = [1, 2];
const second = [3, 4];
const result = first.concat(second);
expect(result.length).toBe(4);
expect(result).toEqual([1, 2, 3, 4]);
});
it('should correctly concatenate all parameters', () => {
const result = [1].c... | true |
3477c19995837d59606d4c921ec8f90d33f2ca64 | JavaScript | FirePontiac/FullStackApp | /middleware/passport.js | UTF-8 | 1,625 | 2.59375 | 3 | [] | no_license | // Тут будем описывать параметры для работы с json web token
const JwtStrategy = require('passport-jwt').Strategy
const ExtractJwt = require('passport-jwt').ExtractJwt
const keys = require('../config/keys')
const mongoose = require('mongoose')
const User = mongoose.model('users')
const options = {
jwtFromRequest: ... | true |
907101a1fe5c104eb2bcec5ac0cba8fa5139f8d1 | JavaScript | dlochrie/FileThingy | /lib/queue.js | UTF-8 | 2,247 | 3.0625 | 3 | [
"MIT"
] | permissive |
/**
* @param {number=} opt_operationLimit Optional operation limit passed in as an
* argument.
* @constructor
*/
function Queue(opt_operationLimit) {
this.limit = opt_operationLimit || this.DEFAULT_FILE_LIMIT;
}
/**
* @const
* @type {number} Default MAX limit of simultaneously opened operations.
*/
Qu... | true |
001039e467e41bc62f3c27a9ad55b50b5a4ddaa7 | JavaScript | liazcortez/Node-introduccion | /03-Fundamentos/promesas.js | UTF-8 | 1,095 | 3.546875 | 4 | [] | no_license | let empleados = [{ id: 1, nombre: 'fer' }, { id: 2, nombre: 'pancho' }, { id: 3, nombre: 'juan' }];
let salarios = [{ id: 1, salario: 1000 }, { id: 2, salario: 2000 }];
let getempleado = (id) => {
return new Promise((resolve, reject) => {
let empleadoDB = empleados.find(empleado => {
return... | true |
724f8c58f50535d9554b6d4220bad9f179cfc6c9 | JavaScript | Anna-Myzukina/nodeschool.io-tower-of-babel | /tower-of-babel/Main.js | UTF-8 | 184 | 2.546875 | 3 | [] | no_license | //Exercise 5
var arg1 = process.argv[2];
var arg2 = process.argv[3];
import Main from './Math';
console.log(Main.PI);
console.log(Main.sqrt(+arg1));
console.log(Main.square(+arg2)); | true |
9e6213bb47942343de278b5c98416367b978a2c2 | JavaScript | bruthlee/npmpack | /Demo/nzh.js | UTF-8 | 551 | 2.796875 | 3 | [] | no_license | var Nzh = require("nzh");
var nzhcn = require("nzh/cn"); //直接使用简体中文
var nzhhk = require("nzh/hk"); //繁体中文
// 转中文小写 >> 十万零一百一十一
console.log(nzhcn.encodeS(100111))
// 转中文大写 >> 壹拾万零壹佰壹拾壹
console.log(nzhcn.encodeB(100111))
// 科学记数法字符串 >> 十二万三千四百五十六万万七千八百九十万亿
console.log(nzhcn.encodeS("1.23456789e+21"))
// 转中文金额 >> 人民币壹... | true |
114cd8caaec0402f9d4f51fe81123b3112901d8c | JavaScript | HIONJOINONKJNJ/h5 | /js/rem.js | UTF-8 | 150 | 2.65625 | 3 | [] | no_license | let width = window.innerWidth;
if(width>640){
width=640;
}
let fontSize = width/750*100;
document.querySelector("html").style.fontSize=fontSize+"px"; | true |
527ced75a5cb9223ce586c77b91517c0fed8e6d6 | JavaScript | SrSandeepKumar/TheWeatherApp | /app/actions/users.js | UTF-8 | 2,591 | 2.625 | 3 | [
"MIT"
] | permissive | import { polyfill } from 'es6-promise';
import request from 'axios';
import { push } from 'react-router-redux';
import * as types from '../types';
polyfill();
const getMessage = res => res.response && res.response.data && res.response.data.message;
function makeUserRequest(method, data, api = '/login') {
return r... | true |
24f1309b01f1399ffb9a65365e6890906fd07806 | JavaScript | d-sergio/ecotrans | /src/libs/react-components/sliders/slider-highlight/animation/create-animation.js | UTF-8 | 2,371 | 3.140625 | 3 | [] | no_license | //Используется в animate-move.js
import Animation from "../../../../animate/animate";
import changeStyleProperty from '../../../../animate/draw-functions/change-style-property';
import sliderTimeFunction from '../../../../animate/time-functions/slider-time-functions';
/**Создать и вернуть объект анимации
*
* Функц... | true |
27059ac5fbd8143e11c4c12525a316909366e045 | JavaScript | Riiiad/riaddesign | /src/assets/js/main.js | UTF-8 | 2,156 | 3.140625 | 3 | [] | no_license | var fooFunc = require('./export');
fooFunc.foo();
(function () {
var i = 0, cl = 0;
var words = ['with JavaScript', 'or jQuery', '& hope you like it x).'];
var output = document.querySelector('#typing h1');
type();
function type() {
output.innerHTML = words[i].substring(0, cl++);
//c... | true |
c5887be6f892181bc24ec57bca16d78ce578e2bb | JavaScript | rfrancalangia/scraper | /starters/examples/pinterest.js | UTF-8 | 947 | 2.53125 | 3 | [] | no_license | /* ***************************************************************
*
* File Name : pinterest.js
* Created By : rfrancalangia
*
* Creation Date : 10-03-2017
* Last Modified : Tue Oct 3 08:29:30 2017
* Description :
*
* *************************************************************** */
var express = requ... | true |
9ed791faa3955ec06bf39ec9045d912236f42338 | JavaScript | nandopacheco/micthing | /src/utils/MessageBus.js | UTF-8 | 586 | 3 | 3 | [
"MIT"
] | permissive | class MessageBus {
constructor(initialValue) {
this.lastValue = initialValue;
this.listeners = [];
}
addListener(listener) {
this.listeners.push(listener);
listener(this.lastValue);
}
removeListener(listener) {
const index = this.listeners.indexOf(listener);
if (index < 0) {
... | true |
b2bb06de8382ab320b6a52eff97ca864f0bebba5 | JavaScript | Sayantika23/process-miner | /core/repository.js | UTF-8 | 1,823 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | const fetch = require('axios');
const fs = require('fs');
class Repository {
constructor(url) {
this.url = url;
this.data = null;
this.extracted_data = null;
this.attribute_results = null;
}
json() {
return {
url: this.url,
data: this.data,
... | true |
006b0eb97c81269c414a3410da78643426d91e3a | JavaScript | ZarifS/rented-backend | /server.js | UTF-8 | 6,279 | 2.65625 | 3 | [] | no_license | const express = require("express");
const bodyParser = require("body-parser");
const admin = require("firebase-admin");
const serviceAccount = require("./secret-keys/rented-project-key.json");
const app = express();
const port = process.env.PORT || 8000;
const cors = require("cors");
app.use(cors());
app.use(bodyParse... | true |
474518da15b59b4a408dd697cf6438610ed36c6a | JavaScript | Fengxx545/RNStudyTest | /js/page/AyncStoreDemoPage.js | UTF-8 | 3,396 | 2.71875 | 3 | [] | no_license |
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View, TextInput, AsyncStorage } from 'react-native';
const KEY = "save_key";
export default class AyncStoreDemoPage extends Component {
constructor(props) {
super(props)
this.state = {
showText: ''
}
}
doSave() ... | true |
ee2c21cb07f496e77ba7d9959948137e7e321fed | JavaScript | surajhiremath23/Project3rdSem | /web PROJECT/game.js | UTF-8 | 4,958 | 2.765625 | 3 | [] | no_license | var docPs0=document.getElementById('pScore-0');
var docPs1=document.getElementById('pScore-1');
var PScore=0,CScore=0,TCScore;
var activePlayer=1;
var gamePlaying=false;
document.getElementById('red1').style.display='block';
document.getElementById('red0').style.display='none';
document.getElementById('comturn')... | true |
d6ba38411e2d81b1977a5be83df8532714c319dd | JavaScript | HYBOBOBO/The.letao_myself | /public/front/js/category.js | UTF-8 | 1,236 | 2.78125 | 3 | [] | no_license | // 左边分类
$(function(){
// a标签上的ID
var id ;
$.ajax({
type:"get",
url:"/category/queryTopCategory",
dataType:"json",
success:function(res){
console.log(res);
var htmlStr = template("leftTpl",res)
$(".ul_left").html(htmlStr)
// 根据... | true |
6d7fa7d2a301f191b25258cfb53b2526c55a6282 | JavaScript | dann-y/portfolio-gatsby | /src/components/CustomCursor/CustomCursor.js | UTF-8 | 996 | 2.5625 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect, useContext } from 'react';
import { MouseContext } from '../../context/mouse-context';
function useMousePosition() {
const [mousePosition, setMousePosition] = useState({ x: null, y: null });
useEffect(() => {
const mouseMoveHandler = (event) => {
const { clientX, cli... | true |
cf7a1dc57a455c6e4578f74e89256de01ed6ac0a | JavaScript | coguy450/WagonTwo | /public/js/reports.js | UTF-8 | 1,090 | 2.515625 | 3 | [
"MIT"
] | permissive | var app = new Vue({
el: '#app',
methods: {
goHome: () => {
location.href= "/";
}
}
})
var reportsDiv = new Vue({
el: '#reportsDiv',
methods: {
},
data: {
reports: {}
},
beforeCreate: function() {
this.$http.get('/pastActions').then(response => {
this.reports = response.da... | true |
0a8c04eac76e1fd6a4f4bc883a8e89f771f0d89f | JavaScript | SurpreetM/fewpjs-iterators-filter-lab-v-000 | /index.js | UTF-8 | 464 | 3.375 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Code your solution here
function findMatching (driver, string) {
return driver.filter( function(d) {
return d.toLowerCase() === string.toLowerCase()
})
}
function fuzzyMatch(driver, string) {
let nameLength = string.length
return driver.filter( function(d) {
return d.slice(0, nameLen... | true |
773863604d5188abb5d2df404798b57345fb7fc3 | JavaScript | Ivan-Makarov/hj-homeworks-3 | /event-object/skateboard-gallery/js/gallery.js | UTF-8 | 738 | 2.796875 | 3 | [] | no_license | 'use strict';
let thumbnailsSelector = document.getElementById('nav');
let thumbnails = thumbnailsSelector.getElementsByTagName('a');
let images = ['images/full/01.jpg', 'images/full/02.jpg', 'images/full/03.jpg', 'images/full/04.jpg', 'images/full/05.jpg', 'images/full/06.jpg', 'images/full/07.jpg']
let bigImage =... | true |
a99acb51dde72bfc19f8b74009f54b866dde6cb9 | JavaScript | charlottedrb/lpdim_javascript | /tp3_socket/chat/main.js | UTF-8 | 1,470 | 2.78125 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", () => {
//io appelle l'api
const socket = io("51.83.36.122:8080")
const pseudo = document.querySelector("#pseudo")
const text = document.querySelector("#text")
const button = document.querySelector("#chat button")
//nous met direct dans le ... | true |
2e9af4a71ede791e368a5e73eda11f63292fe097 | JavaScript | developert1990/SimpleMovie_React.js | /client/src/components/Main.jsx | UTF-8 | 4,066 | 3.0625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Zoom from 'react-reveal/Zoom';
const Main = () => {
const USER_LS = "currentUser";
const [name, setName] = useState(localStorage.getItem(USER_LS));
const [timeString, setTimeString] = useState('');
const [randomNum, setRandomNum] = useState(par... | true |
5d59da051eeba5e46bab2ff79e48d256829702a3 | JavaScript | K750i/JS30 | /02 - JS and CSS Clock/script.js | UTF-8 | 1,141 | 3.640625 | 4 | [] | no_license | var secondHand = document.querySelector('.second-hand');
var minuteHand = document.querySelector('.min-hand');
var hourHand = document.querySelector('.hour-hand');
function setTime() {
// executed at the interval set by setInterval
var now = new Date();
var seconds = now.getSeconds();
var mins = now.getMinutes... | true |
40bd57163aaacae759b24ed6ec1d43ec4a628d23 | JavaScript | zsnr1/nodejschat | /lekcja1.js | UTF-8 | 237 | 3.21875 | 3 | [] | no_license | /*
let i = 10;
while(i > 0){
console.log(i);
i--;
}*/
let tablica = ['Tottenham', 'Man United'];
/*
for (let i of tablica){
console.log(i);
}*/
for (let i = 0; i < tablica.length; i++){
console.log(tablica[i]);
}
| true |
8e36bd05e3b030dffb9c3562268341f15d870dd7 | JavaScript | sergixnet/javascript-async-examples | /promise-then-catch-finally.js | UTF-8 | 535 | 3.546875 | 4 | [] | no_license | const error = true // this is to simulate an error, dont do it in production
function sleep(ms) {
console.log('Sleeping...')
return new Promise((resolve, reject) => {
if (error) {
return reject({ msg: 'there was an error' })
} else {
setTimeout(() => {
resolve(ms)
}, ms)
}
}... | true |
77c9be178e57c795811d518d2b6c30c096d416b2 | JavaScript | Ebecode/lm-ents | /js/elements.js | UTF-8 | 7,712 | 3.109375 | 3 | [] | no_license | // selectors
//
// paning selectors
const showcase = document.querySelector('.showcase-screen');
const menuIcon = document.querySelector('.show-list');
const editIcon = document.querySelector('.show-edit');
const closeIcon = document.querySelector('.hide-list');
const backIcon = document.querySelector('.hide-edit');
... | true |
31a16d0a4bd0c1af82fc66bd84de42cb137c9f20 | JavaScript | sunny-sky/iqa_ssm | /src/main/webapp/js/view/permissionPage.js | UTF-8 | 4,476 | 2.53125 | 3 | [] | no_license | var base = $('#base').val();
/* 增加权限 */
function addPermission() {
//获取模态框数据
var logicName = $('#addLogicName').val();
var physicalName = $('#addPhysicalName').val();
$.ajax({
type: "POST",
url: "addPermission",
data: {
"logicName":logicName,
... | true |
b706bdebef5e4b5a0c84af235aa099f398878c9d | JavaScript | chuyingqifei/2017-05-18-01-58-06-1495072686 | /main/main.js | UTF-8 | 220 | 3.140625 | 3 | [] | no_license | module.exports = function main(str) {
// Write your cade here
var len = str.length;
var sum = 0;
for(var i = 0;i<len;i++){
var x = parseInt(str.charAt(i));
sum += x;
}
return sum;
}
| true |
c68946a550d347fabbb05fc879d4beb15d864354 | JavaScript | toneyhiggins2/liri-node-app | /liri.js | UTF-8 | 6,893 | 3.078125 | 3 | [] | no_license | require("dotenv").config();
var keys = require("./keys.js");
var axios = require("axios");
var fs = require("fs");
var moment = require("moment");
var Spotify = require('node-spotify-api');
var spotify = new Spotify(keys.spotify);
var selectAction = process.argv[2];
var userSearch = process.argv.slice(3).join(" ");... | true |
95b4181777b6390633f8ba73232d4ba26e639c9f | JavaScript | NSIPIRAN/NodeJSCoursera | /models/biclicleta.js | UTF-8 | 906 | 3.09375 | 3 | [] | no_license | var bicicleta=function(id,color,modelo,ubicacion){
this.id =id;
this.color=color;
this.modelo =modelo;
this.ubicacion=ubicacion;
}
bicicleta.prototype.toString=function(){
return 'id: '+this.id + "| color: "+ this.color;
}
bicicleta.allBicis = [];
bicicleta.add=function(aBici){
bicicleta.allBici... | true |
da4b721278a94407156d65d25a6ec31ed3317fe9 | JavaScript | jameskreye/Web-Development | /2. Maths Game (JS)/javascript.js | UTF-8 | 5,831 | 3.21875 | 3 | [
"MIT"
] | permissive |
var playing = false;
var action;
var timeremaining;
var score;
var correctAnswer;
//game lan komanse a zero , epi varyab playing komanse ak valeur faux. kote kem rele function an, kom kondisyon if lan pa executer , li ynyorel li ale nan else la, epi else la chanje valeur palying li bal true. sa vle di map jwe, konnya... | true |
a18242fb06c04cd7dd00afd4761239068f0c7ee9 | JavaScript | bhanu-pappala/Random | /JavaScript/howSum.js | UTF-8 | 653 | 2.953125 | 3 | [] | no_license | #!/usr/bin/node
const howSum = (target, arr, memo={}) => {
if (target in memo) return memo[target];
if (target == 0) {
return [];
}
if (target < 0) return null;
for (let num of arr) {
const remainder = target - num;
const result = howSum(remainder, arr);
... | true |
02bebf1bba5cd641541a31a8534c39759bc69cb7 | JavaScript | thanhnavi17/DotaStore | /src/main/webapp/js/hethong.js | UTF-8 | 5,019 | 2.703125 | 3 | [
"MIT"
] | permissive | var FormModalIsValid = true;
function ValidateRequireControl(el, errorMes) {
$(el).removeClass('is-invalid')
$(el).nextAll(".spanError").remove()
if ($(el).val() == null || $(el).val() == undefined) {
$(el).addClass('is-invalid')
$(el).after(`<span class = "text-danger spanError"> ${errorMes... | true |