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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
72402be0d437be7d44bbd6cd960bfd9d712a30ca | JavaScript | Issawat/Sec1_PJ1_code_6088099_6088147_6088235_5988017 | /assets/js/history.js | UTF-8 | 2,710 | 2.625 | 3 | [] | no_license |
$(document).ready(function () {
if (localStorage.getItem('ishct')) {
$("#toggleHCT").css('color', 'yellow')
for (let i = 1; i <= 26; i++)
$(`#hctComponent${i}`).addClass('hct')
}
$("#toggleHCT").click(function () {
if (localStorage.getItem('ishct')) {
localSt... | true |
70a4456740fb622e94117fa38c3a251fed9faeab | JavaScript | akaterra/apidog | /src/templates/html/assets/compile_body_form.js | UTF-8 | 666 | 2.65625 | 3 | [
"MIT"
] | permissive | const compileBodyForm = (body) => {
function compile(e, k) {
if (Array.isArray(e)) {
return e.reduce((acc, val) => {
return acc + compile(val, `${k || ''}[]`);
}, '');
}
if (e && typeof e === 'object') {
return Object.keys(e).reduce((acc, key) => {
return acc + compile(e... | true |
41873ab3cb9b8ddd364745a1c383f2bbc37ad8d0 | JavaScript | Ellil1/Personality-Test | /personalityTest.js | UTF-8 | 27,323 | 2.8125 | 3 | [] | no_license | var radios=["logos1","logqos2","logos3","logos4","kosmos1","kosmos2","kosmos3","kosmos4","eros1","eros2","eros3","eros4"]
var displayArray = []
var secondOrigin = function(name,description,originString,originVar,approaches,domains,roles,totalValues) {
this.name = name;
this.description = description;
this.origin... | true |
d0800b1eecb6cf35f42db82a960b98a0b963c7bb | JavaScript | Rebecca70/Neighborhood-Map | /js/script.js | UTF-8 | 4,181 | 2.953125 | 3 | [] | no_license | var allActivities = ["","outdoor", "indoor", "museum"]
var markerImage = "https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png";
var allLocations = [
{
location: {
lat: 47.052122,
lng: 8.309038
},
name: "Seebrücke",
address: "Seebrücke, Luzern... | true |
c82c27368fcc1ac2cd5fd72ab9289af66800f1f4 | JavaScript | bernallium/roadstartire | /main_app/static/js/user_edit_popup.js | UTF-8 | 592 | 2.75 | 3 | [] | no_license | // References on User Edit page
const btnSave = document.getElementById("btn-save");
const popupEditConfirm = document.getElementById("popup-edit-confirm");
const close = document.getElementById("close")
// SHOW THE MODAL
btnSave.addEventListener('click', () => {
popupEditConfirm.style.display = 'block';
});
// CL... | true |
48aa717eb3ed23c8fcc3d3d33539de81d9e65581 | JavaScript | Saapasmono/veikkausbonukset-react-native | /src/Reducers/PickReducer.js | UTF-8 | 918 | 2.515625 | 3 | [] | no_license | import {
FETCHING_PICK_DATA,
FETCHING_PICK_DATA_FAIL,
FETCHING_PICK_DATA_SUCCESS
} from "./../Utils/ActionTypes";
const initialState = {
isFetching: null,
data: [],
hasError: false,
errorMessage: null,
};
export default function (state = initialState, action) {
switch (action.type) {
case FETCHIN... | true |
4ece8619ad27daa08b665a5cc29dbc0060646085 | JavaScript | proweb4all/js-6_0 | /lesson1/hard/main.js | UTF-8 | 477 | 3.5625 | 4 | [] | no_license | 'use strict';
let num = 33721,
multiNums = 1;
console.log('Исходное число: ', num);
while (num > 0){
multiNums *= num % 10;
num = Math.floor(num/10);
};
console.log('Произведение цифр исходного числа: ', multiNums);
console.log('Куб произведения цифр: ', multiNums**3);
console.log('Две левые цифры от куб... | true |
7604869035e5248b30b2472a53fc693c08bf68af | JavaScript | malszhang/ChinaVis2020 | /NewsAndRumour/js_draw/tAnalyst/nodeMatrix.js | UTF-8 | 7,676 | 2.734375 | 3 | [] | no_license | var clickNodes = [];
var useLinks = [];
var i = 0;
function divideCate(categories){
var result = [[],[]];
categories.forEach(function(cate){
if (cate.length == 4){
result[0].push(cate);
}else{
result[1].push(cate);
}
});
return result;
}
function nodeToBubble(nodes, keyWords){
var buData = [];
keyWord... | true |
2e64cc6ec7d92f053900a41291c1933de7f1e7da | JavaScript | CodingDojo-MEAN-06-18/Keoni-G | /MEAN1/Week1/NinjaClasses/II/ninja.js | UTF-8 | 1,419 | 3.859375 | 4 | [] | no_license | function Ninja(name = "Anonymous") {
this.name = name;
this.health = 100;
var speed = 3;
var strength = 3;
this.sayName = function() {
console.log("My ninja name is " + this.name + "!");
return this;
}
this.showStats = function() {
console.log("Name: " + this.name);... | true |
5026448d5c190f957c75316279d63bfa91e0923d | JavaScript | eval1749/evita | /evita/dom/global/command.js | UTF-8 | 2,301 | 2.640625 | 3 | [] | no_license | // Copyright (c) 2016 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
goog.provide('commanders');
goog.scope(() => {
/** @const @type {!Map<string, !Command>} */
const commandMap = new Map();
class Command {
/**
* @publ... | true |
4f8350f2c5f8640d6108324e3e5459611a60188f | JavaScript | fmkeir/enumeration_callback_lab | /models/cinema.js | UTF-8 | 800 | 3.21875 | 3 | [] | no_license | const Cinema = function(films=[]){
this.films = films
}
Cinema.prototype.getFilmTitles = function () {
return this.films.map(film => film.name);
};
Cinema.prototype.findFilm = function(filmName) {
return this.films.find(film => film.name === filmName);
};
Cinema.prototype.filterByProperty = function(property, ... | true |
ecd6d3dacedcd7cad8e1016b755605e99b4edc9e | JavaScript | nagyistoce/bpm | /node/TestDomain.js | UTF-8 | 890 | 2.6875 | 3 | [
"MIT"
] | permissive | (function ()
{
"use strict";
var os = require("os");
function cmdGetMemory(total)
{
if (total)
{
return os.totalmem();
}
else
{
return os.freemem();
}
}
function init(domainManager)
{
if (!domainManager.hasDomain("simple"))
{
domainManager.registerDomain("simple", {major: 0, minor:... | true |
137b52639ee38a65aa1a8dab678eabdc096045a2 | JavaScript | HarpersGeekly/Codeup-Web-Exercises | /js/refactor_grades_and_discounts.js | UTF-8 | 5,529 | 3.78125 | 4 | [
"MIT"
] | permissive | /**
* Created by RyanHarper on 11/9/16.
*/
'use strict'
//
// /* Knowing that a student's grades are 70, 80, 95. Write a Javascript program, using conditionals that logs to the console
// "You're awesome" if the average of her grades is greater than 80, otherwise the message should be "You need to practice more". */... | true |
a033b0f3bb4793df82238135c6003c5437a16d32 | JavaScript | nfreedom9/project_euler | /js/005.js | UTF-8 | 2,463 | 3.5625 | 4 | [] | no_license | /*
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
*/
/*
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
[ 1, 2, 3, 2*2, 5, 2*3, 7, 2*2*2, 3*3, 2*5 ]
2*2*2 * ... | true |
1cdad71c3ea7b9221cc5406559fb61442d042216 | JavaScript | spendlively/snippets | /js/generators/01_getting_values.js | UTF-8 | 1,180 | 3.953125 | 4 | [] | no_license |
(() => {
console.log("01 =============================================================");
/**
* 0. function* при вызове возвращает генератор
* 1. При создании генератора код находится в начале своего выполнения.
* 2. При вызове next() генератор возобновляет выполнение до ближайшего yield.
... | true |
8e36d391baaacc66cf6b8184e5ba2ef327ef867b | JavaScript | RickRieger/auth-frontend-2 | /src/components/Utils/Axios.js | UTF-8 | 428 | 2.640625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | //This how axios creates an instance. If in development mode,
//use the specified address, otherwise, use deployed address.
//The time out is set to 5 sec, think of it as a phone hanging
// up if no answer.
import axios from "axios";
const Axios = axios.create({
baseURL:
process.env.NODE_ENV === "development"... | true |
d2d39e2dacc063fc6186435feec03b96fc3e7dfa | JavaScript | Akrabut/App-Academy | /Javascript/Codecademy/restaurant.js | UTF-8 | 1,649 | 3.3125 | 3 | [] | no_license | /* eslint-disable no-underscore-dangle */
/* eslint-disable no-console */
const menu = {
_courses: {
appetizers: [],
mains: [],
desserts: []
},
get appetizers() {
return this._courses.appetizers;
},
get mains() {
return this._courses.mains;
},
get desserts() {
return this._courses.... | true |
f4da322662ea83803fc7085f2ef777c323ee6412 | JavaScript | ioanamirela/rosetta | /src/models/graph.js | UTF-8 | 2,108 | 3.875 | 4 | [] | no_license | 'use strict'
class Graph {
constructor() {
// initialize adjacency list
this.AdjList = new Map()
this.hasCycle = false
}
/**
* Takes a vertex as an argument and adds it to the graph
* @param vertex
*/
addVertex(vertex) {
if (!this.AdjList.has(vertex)) {
this.AdjList.set(vertex, ... | true |
137c75cd37215d8819e760a7e9022381d86f875b | JavaScript | denys-glu/js_challenges | /leetcode/groupThePeople.js | UTF-8 | 1,489 | 3.6875 | 4 | [] | no_license | // There are n people that are split into some unknown number of groups. Each person is labeled with a unique ID from 0 to n - 1.
// You are given an integer array groupSizes, where groupSizes[i] is the size of the group that person i is in. For example, if groupSizes[1] = 3, then person 1 must be in a group of size 3... | true |
3f8ce06f12271477e8beb7679d1fdacc2fed4873 | JavaScript | shpp-vprihozhenko/shpp | /day8-js-node/server_ajax.js | UTF-8 | 779 | 2.59375 | 3 | [] | no_license | var express = require('express');
var app = express();
//var bodyParser = require('body-parser')
//
//app.use(bodyParser.urlencoded({
// extended: true
//}));
//app.use(bodyParser.json());
app.get('/test1', function(req, res){
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-... | true |
f4631c2911e1ea3726da39747f4eb1f1173fc875 | JavaScript | avranju/conf-rat | /data-service/drivers/documentdb/load-data.js | UTF-8 | 1,578 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | var async = require('async'),
dataService = require('./index'),
sessions = require('../json-file/talks-reset.json');
function main() {
dataService.init(loadData);
}
function loadData(err) {
if(err) {
return console.log("Data service init failed. ", err);
}
// load all sessions into th... | true |
23de93819cda34d250be7b1c879df088ac32bab5 | JavaScript | gygy7151/Vue.js2-Spring5-web-app | /chap01/p.50.js | UTF-8 | 1,106 | 3.546875 | 4 | [] | no_license | // 프로미스
//프로미스는 js에서 비동기 프로그래밍에 사용하는 콜백 (callback),
//이벤트 (event) 이외에 선택할 수 있는 또 다른 기능
// ES6이전에는 bluebird가 Promises/A+ 스펙에 호환됨
// 여기선 ES6 언어 스펙에 정의된 프로미스임
// 콜백버전
function getProjects(callback) {
// 서버 API를 호출하는 데 setTimeout을 활용
setTimeout(() => {
callback([{ id: 1, name: 'Project A'}, { id:2, name:... | true |
dcbcae246d9f8058f7255fd93e06a4033d2a30dd | JavaScript | gyjin/video-store-consumer | /src/App.js | UTF-8 | 5,988 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import {
BrowserRouter as Router,
Switch,
Route,
Link
} from "react-router-dom";
import Search from './components/Search';
import CustomerCollection from './components/CustomerCollection';
import MovieCollection from './components/MovieCollection';
i... | true |
cdc65563cc0dc21a94cd4273178ecafcfc0a0d18 | JavaScript | ethereum/mix | /qml/html/cm/anyword-hint.js | UTF-8 | 3,362 | 2.765625 | 3 | [
"MIT"
] | permissive | (function() {
"use strict";
var WORD = /[\w$]+/, RANGE = 500;
CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
var word = options && options.word || WORD;
var range = options && options.range || RANGE;
var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
var start = cur.... | true |
2d7234347fe03b7165ef2961b38df5e02701e00b | JavaScript | aribrow/hero-digital | /form.js | UTF-8 | 4,079 | 2.828125 | 3 | [] | no_license | const getValidForm = () => {
const aRequiredFields = document.getElementsByClassName("required");
const aInvalidFields = Array.from(aRequiredFields).filter(($input) => {
const $errorMessage = $input.parentElement.getElementsByClassName("errorMessage")[0];
if ($input.value === "") {
... | true |
dbe1223ebcce488852d7939e7801bcdb1a270249 | JavaScript | toma2004/csci571 | /js_function.js | UTF-8 | 23,018 | 3.015625 | 3 | [] | no_license | /**
* Created by NguyenTran on 6/6/2015.
*/
/*Function to add option based on user's input on form 1*/
var usr_arr = [];
var myindex;
/*Variable from form1*/
var food_checkbox = document.getElementsByName('food_day');
var radio_element = document.getElementsByName('radio1');
var radio_element2 = document.getElements... | true |
1df0dc827b7d59848dfc1e08827ed40ba874440c | JavaScript | orsa-scholis/hashcode-2018 | /src/models/Ride.js | UTF-8 | 1,378 | 2.78125 | 3 | [] | no_license | module.exports = class Ride {
constructor(id, startPositionX, startPositionY, endPositionX, endPositionY, earliestStart, latestFinish) {
this.id = id;
this.startPositionX = startPositionX;
this.startPositionY = startPositionY;
this.endPositionX = endPositionX;
this.endPositionY = endPositionY;
... | true |
e458ac96ca15d30a521503e2fee0995811348f48 | JavaScript | UPSICodingTeam/UPSINewTabChromeExt | /assets/js/app.js | UTF-8 | 2,520 | 2.609375 | 3 | [] | no_license | $(document).foundation()
var dateToday = Date.today();
var newDate = dateToday.toString('dddd, d MMMM yyyy');
document.getElementById("date").innerHTML = newDate;
function updateTime(){
var d = new Date();
var hr = d.getHours();
var min = d.getMinutes();
if (min < 10) {
min = "0" + min;
}
var ampm = hr ... | true |
00798e32bbc9d9fc211bb9713284cb7c78932203 | JavaScript | sarawithad/modern-frameworks-worldWideTravel123 | /app/controllers/BookCtrl.js | UTF-8 | 544 | 2.609375 | 3 | [] | no_license | "use strict";
app.controller("BookCtrl", function($scope, GuideFactory){ //$scope = glue!
let printGuides = function(){
//Guide Factory accesses functionality from guideFactory.js
GuideFactory.getGuides()
.then( (guides) => {
//digs into json array
$scope.guides = guides.data.guides;
});
};
//have to... | true |
199241a16f914ea6971f15a0c32c3ea2ebce7403 | JavaScript | alejandrozeb/Curso-Javascript | /23-otrasfunciones/66-expresionesregulares2.js | UTF-8 | 1,754 | 3.796875 | 4 | [] | no_license | //negar la expresion
expReg = /[^0-9]/; //(^)niega la expresion, acepta todo lo contrario del 0 al 9
valor = 1992;
console.log(expReg.test(valor));
//prueba
valor = 'Hola';
console.log(expReg.test(valor));
/* otra de forma de hacer fechas */
//La sintaxis {1,2}
expReg = /\d{1,2}-\d{1,2}-\d{4... | true |
d7ac90f686578d9c110618283f5be27eb1e52ccb | JavaScript | GalGurGurevich/mySwitch | /src/App.js | UTF-8 | 514 | 2.5625 | 3 | [] | no_license | import React, {useState} from "react";
import "./styles.css";
export default function Switch() {
const [value, setValue] = useState(false);
return (
<>
<div className={'mySwitch' + (value ? ' open' : '')} onClick={e => setValue(!value)}>
<div className={'circle' + (value ? ' open' : '')} onClick={e... | true |
582d9c8e6e5e3dd97e694e68e02d8d7f8769d6b3 | JavaScript | brunowallisonf/GoStack-Desafio01 | /index.js | UTF-8 | 1,565 | 2.59375 | 3 | [] | no_license | const express = require("express");
const server = express();
let projects = [];
server.use(express.json());
let requestCount = 0;
server.use(requestCounter);
server.post("/projects", (req, res) => {
const { id, title } = req.body;
projects.push({ id, title, tasks: [] });
return res.json(projects);
});
server.ge... | true |
3c856d6d688f5b669f03557ff4d7d022805f6c45 | JavaScript | adzajko/september-node | /class-02/server.js | UTF-8 | 1,405 | 3.1875 | 3 | [] | no_license |
/**
* Importing the http module, assigning it to a value.
*/
const http = require('http');
/**
* Importing our own files. Note the difference in the path passed as an argument (The relative path denoted with ./)
*/
const promises = require('./promises');
/**
* Creating a server using the createServer() method lo... | true |
055310e7b4c811bb29e39bb4fdaeaf844b21107c | JavaScript | boxgames1/hack4sd-team-3 | /src/containers/MapContainer.js | UTF-8 | 1,937 | 2.671875 | 3 | [] | no_license | import React, { Component } from "react";
import Map from "../components/Map";
import MapList from "../components/MapList";
import "../css/components/map.css";
import { getCiudadesByType } from "../mocks/mock1";
/*
* This is the place where we make the sort of places based on 3 air quality parameters
* that we got fr... | true |
98d938db133d8065bd54b7920efef7d1faa5d1a3 | JavaScript | JDAtaide/RockPaperScissor | /MeuJavaScript.js | UTF-8 | 2,309 | 2.875 | 3 | [] | no_license | function Move(P1) {
var P2 = Math.floor(Math.random() * 3);
document.getElementById("stats").innerHTML = "P1= " + P1 + " e P2= " + P2;
if (P1 == P2) {
document.getElementById("resultado").innerHTML = "DRAW!!";
}
if (P1 == 0 && P2 == 1) {
document.getElementById("r... | true |
631e408b7e5b83f9780d1afce560fd24172f98f5 | JavaScript | guangbinggu/redux-source | /generator.js | UTF-8 | 553 | 3.796875 | 4 | [] | no_license | 'use strict'
// function * fn(){
// console.log('ggb')
// }
// var a=fn(); //没有任何结果,仅仅返回了一个指针,该指针指向generator接口,也就是generator对象
// console.log(a.next())
function *fn(_name){
let name=yield _name;//yield 默认返回undefined
return {name,age:123} ;
}
let it = fn('ggb');
console.log(it.... | true |
babefe519a7d78e603f58e359b29fa1a9701f9d6 | JavaScript | sonic-screwdriver-cd/template-validator | /test/index.test.js | UTF-8 | 3,878 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | 'use strict';
const { assert } = require('chai');
const fs = require('fs');
const hoek = require('hoek');
const path = require('path');
const TEST_YAML_FOLDER = path.resolve(__dirname, 'data');
const VALID_FULL_TEMPLATE_PATH = path.resolve(TEST_YAML_FOLDER, 'valid_full_template.yaml');
const BAD_STRUCTURE_TEMPLATE_PA... | true |
8291341685075b09994682e80b2108feaaf405b2 | JavaScript | loganeb/react-calculator | /src/components/NumPad.js | UTF-8 | 896 | 2.671875 | 3 | [] | no_license | import React from 'react';
import NumButton from './NumButton';
class NumPad extends React.Component {
constructor(props){
super(props);
this.state = {
buttons: []
}
}
componentDidMount(){
var temp = [];
for(var i = 0; i < 10; i++){
temp.push(<NumButton inputFu... | true |
e25a2dc41f5f0a31545a709879988c856de060f8 | JavaScript | jlm1234/register-a-food-business-service | /src/services/notifications.service.js | UTF-8 | 8,304 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* Functions for transforming the data and sending notifications using Notify
* @module services/notifications
*/
const moment = require("moment");
const { logEmitter } = require("./logging.service");
const { statusEmitter } = require("./statusEmitter.service");
const { sendSingleEmail } = require("../connectors... | true |
9b545d245dd3e33db0c4676ce228ff15abe0a57b | JavaScript | whizzrd/phakt | /src/Configuration/Shared/PHP_ADODB/scripts/UpdateFiles.js | UTF-8 | 10,680 | 2.53125 | 3 | [] | no_license | //SHARE-IN-MEMORY=true
// Copyright 2001-2004 Interakt Online. All rights reserved.
/**
* @class
* UpdateFiless
* Static Class. Contains functions used to update site files for new versions
*
**/
function UpdateFiles() {
alert("This is a static class!"); // Display an error message if we try to instant... | true |
74364a2542188e37875b686051f10da4e699dd74 | JavaScript | aymericdelab/fitbit_waveform_replica | /app/index.js | UTF-8 | 2,062 | 2.96875 | 3 | [] | no_license | import clock from "clock";
import document from "document";
import { preferences } from "user-settings";
import * as util from "../common/utils";
import { HeartRateSensor } from "heart-rate";
import userActivity from "user-activity";
let tap = 0;
const face = document.getElementById("face");
face.addEventListener("cl... | true |
f76d8a8a42a031f6a8b53b8f1d00d19186dfde88 | JavaScript | team-scrb/artwlk | /app/utils/movement.js | UTF-8 | 528 | 2.828125 | 3 | [] | no_license | export const distance = {
pretty: meters => {
if (meters >= 1000) {
const km = meters / 1000;
if (km >= 10) return (km | 0) + ' km';
const s = String(km);
const dot = s.indexOf('.');
if (dot === -1) return s + ' km';
return s.slice(0, dot + 2) + ' km';
}
if (meters >= ... | true |
5532fcf4006d1d042408da8796a2e4f3ed1930dc | JavaScript | dcyoung/MultiShaderProgramEnvMapping | /JS/index.js | UTF-8 | 12,118 | 2.78125 | 3 | [] | no_license | var targetWidth = 1920;
var targetHeight = 1080;
var targetAspectRatio = targetWidth / targetHeight; // 16:9
var canvas = null; // JQuery Object
var canvasHolder = null; // JQuery Object
var canvasElement = null; // DOM Element
var gl = null; // WebGL Context.
var currentTimeStamp = 0.0;
var deltaTime = 0.0;
var prev... | true |
b986bfccf03fa8cf700b978d8c587a829100f130 | JavaScript | ferisagaragu/expenditure-web | /page/home/day-expenditures.js | UTF-8 | 3,213 | 2.765625 | 3 | [] | no_license |
var dayExpendituresData = null;
function init() {
getDayExpenditures1();
getDayExpenditures2();
}
function putDayInfoTable(data,period) {
var out = '';
var total = 0;
var totalPayed = 0;
if (data !== '') {
var resp = JSON.parse(data);
dayExpendituresData = resp;
for ... | true |
20192572bb490769a769a64cb6ba30eae579ae31 | JavaScript | franklinjpt/clinica-mascotas-spring | /src/main/resources/static/logica/scriptsEntrada.js | UTF-8 | 745 | 2.734375 | 3 | [] | no_license | $(function(){
$("#form-login input[type=submit]").on('click',function(ev){
ev.preventDefault();
var url = '/login';
var username = $('#login').val();
var pwd = $('#password').val();
login(url,username,pwd);
});
});
var login = function(url, username, passwd){
$.ajax({
url:url,
method:'POST',
header... | true |
2e034a46c06f17572442d38173a4053501818894 | JavaScript | CommanderXL/reptile | /src/js/component/dropdown.js | UTF-8 | 2,207 | 2.53125 | 3 | [] | no_license | /**
* Created by XRene on 16/8/23.
*/
'use strict';
import React from 'react';
import classSet from 'classnames';
import {render} from 'react-dom';
require('../../styles/dropdown.less');
var DropDown = React.createClass({
getInitialState: function () {
return {
isListShow: true,
... | true |
f09f4cad342c9cd819f74c6d4b9db20833c56e93 | JavaScript | tyZulh/livecoding-nodeExpress-router | /routes/city.js | UTF-8 | 488 | 2.859375 | 3 | [] | no_license | const express = require('express')
const router =express.Router()
const cities =[
{name: 'Paris', id: 1},
{name: 'Wuhan', id: 2}
]
router.get('/', (req, res) =>{
return res.status(200).send(cities)
})
router.get('/:id', (req, res) => {
const city = cities.find(element => element.id === parseInt(req.params.i... | true |
c10fc31a4c3264d5254c3caed0aee969ec037d41 | JavaScript | soujiro27/waltmart-react | /Components/Users.js | UTF-8 | 2,289 | 2.609375 | 3 | [] | no_license | import React,{Component} from 'react';
export default class Users extends Component{
state = {
data:this.props.data,
all:this.props.data
}
select = (event) => {
let id =[];
let data = [];
let $container = document.querySelectorAll('input');
docume... | true |
1f2c7293dfd5da7fcbb2b8cfa2ad3203358cf45a | JavaScript | pir8aye/mapjs | /specs/core/content/apply-idea-attributes-to-node-theme-spec.js | UTF-8 | 3,894 | 2.53125 | 3 | [
"MIT"
] | permissive | /*global require, describe, it, expect, beforeEach*/
const underTest = require('../../../src/core/content/apply-idea-attributes-to-node-theme');
describe('applyIdeaAttributesToNodeTheme', () => {
'use strict';
let nodeTheme, idea;
beforeEach(() => {
nodeTheme = {
font: {
size: 10,
sizePx: 12,
line... | true |
41ddcc292c0b4f04037529abac79dbc79f213a1a | JavaScript | johnnybainguyen/KissDownloader | /filemanager.js | UTF-8 | 1,372 | 2.59375 | 3 | [
"MIT"
] | permissive | var app = angular.module("fileManagerApp", []);
app.controller("fileManagerController", function($scope, kissService) {
// Button for Episode Download
$scope.downloadEpisode = function(seriesName, episodeName, url) {
chrome.downloads.download({
url: url,
filename: seriesName + " - " + episodeName + ".mp... | true |
ca637646f981ea463e973c727e3e1b1581090d31 | JavaScript | kingking888/js_reverse-2 | /ast_learn/39字符串base64编码数组乱序/9.2.4.js | UTF-8 | 2,448 | 2.78125 | 3 | [] | no_license | const parser = require("@babel/parser");
const traverse = require("@babel/traverse").default;
const t = require("@babel/types");
const generator = require("@babel/generator").default;
const fs = require('fs');
const jscode = fs.readFileSync("./demo.js", {
encoding: "utf-8"
});
let ast = parser.parse(jscode... | true |
b4340ae7e160aeaf261bd796a9adc2a5785465bd | JavaScript | MrLizs/gatling-web | /js/login.js | UTF-8 | 1,102 | 2.5625 | 3 | [
"MIT"
] | permissive | window.token = null;
function checkLogin(){
var token = localStorage.token;
if(token != null){
this.tokenLogin(token);
}
else{
this.clickLogin();
}
}
function tokenLogin(_data){
var obj = JSON.parse(_data);
if(document.getElementsByClassName("checkBox").checked){
localStorage.token = obj.token;
}
else{... | true |
6da541c97a017b732ebb18ea35e5ca05c09d04a4 | JavaScript | doctorchao/project | /资料笔记代码/css3例子代码/代码+笔记+课件/newCode/01js基础.js | UTF-8 | 268 | 3.0625 | 3 | [] | no_license | var oBtn = document.getElementById('btn');
var box = document.querySelector('.box');
var num1 = 998;
var num2 = 888;
alert(num1 - num2)
oBtn.onclick = function () {
box.style.background = '#ff0';
box.style.width = '200px';
box.style.fontSize = '30px';
}
| true |
68680baca6fa7d79e6b76472807eb2a5356b8ca2 | JavaScript | manojmansukh7004/JavaScript | /Algorithamic/Programs/SelectionSort.js | UTF-8 | 276 | 2.765625 | 3 | [] | no_license | var rl=require('readline-sync');
var u=require('./Utility/Utility');
var n=rl.questionInt("Enter the no of elements in arrar");
var arr=[];
console.log("enter the array elements:");
for(var i=0;i<n;i++){
arr[i]=rl.questionInt();
}
console.log(arr);
u.selectionSort(arr); | true |
7878cbe71ea7e59bd9353ad42201f90e97a9340f | JavaScript | jessicaLarsson/awesomeAI | /js/player.js | UTF-8 | 789 | 3.171875 | 3 | [] | no_license | function player(){
this.pos = gameBoard.pickRandomPosition();
this.direction = {x:0, y:0}
this.hasPresent = false;
this.svgElement = svgContainer.append("image");
this.draw = function() {
if(this.hasPresent){
this.svgElement
.attr("x", sca... | true |
dc9f58e8b2521bde25a0f028176596b4043f8220 | JavaScript | dslming/learningComputerGraphics | /ThreejsLearning/023-模拟ThreeJS相机/App.js | UTF-8 | 1,809 | 2.75 | 3 | [] | no_license | // import * as THREE from "../../../three.js/src/Three.js"
import * as THREE from './lib/three.module.js'
import { Stage } from './Stage.js'
import { PerspectiveCamera } from './myCamera.js'
import { vertexShader } from './glsl.vertexShader.js'
import { fragmentShader } from './glsl.fragmentShader.js'
class App {
co... | true |
33380e0f0d97390a5a013eb3b6b53375aa1bb970 | JavaScript | cd-chicago-june-cohort/JS_If_U_Dont_Mind_NH | /if_u_dont_mind.js | UTF-8 | 1,673 | 3.3125 | 3 | [] | no_license |
function TimeApprox(){
if(MIN == 5) {
if(PER == 'PM'){
console.log("It's 5 after " + HR + " in the evening");
}
else
{
console.log("It's 5 after " + HR + " in the morning");
}
}
else
{
if(MIN == 15) {
if(PER == 'PM'){
... | true |
36340d1aeae34fbccddf3c7e0b925d24d9e61e5d | JavaScript | The-CJ/PhaazeQuery | /PhaazeQuery.js | UTF-8 | 13,235 | 2.90625 | 3 | [] | no_license | // because JQuery is to huge, i want a light wight framework, AND i have a lot of freetime, so i made my own
function _(query) {
return new PhaazeQuery(query);
}
_.get = function (url, parameter) {
if (typeof url == "undefined") {throw "1 arguments 'url' required"}
return new PhaazeRequest("GET", url, parameter... | true |
113eb2486c349fdc9ec00566d7a95ac16414b1e2 | JavaScript | heliotherapyy/interviewCake | /IDeserve/stack/next_greater_element_in_an_array.js | UTF-8 | 919 | 3.890625 | 4 | [] | no_license | var Stack = function() {
this.storage = [];
}
Stack.prototype.push = function(value) {
this.storage.push(value);
}
Stack.prototype.pop = function() {
return this.storage.pop();
}
Stack.prototype.peak = function() {
var length = this.storage.length;
return this.storage[length - 1];
}
Stack.prototype.isEmpt... | true |
ae80027ffee7352bd0006d0745a1929216b3dd19 | JavaScript | NATHALIEBENARROCH/m2-3-js--thedom | /__solution/exercise-2/exercise-2-challenge/app.js | UTF-8 | 500 | 3.890625 | 4 | [] | no_license | // Here is the updated code to fulfill the Challenge.
// Exercise 2.2
let racers = [];
while (racers.length < FROGS) {
const newFrog = frogStable[Math.floor(Math.random() * frogStable.length)];
// need to confirm that they are not already in the race.
function validateEntry(frog) {
return racers.some(functi... | true |
c3e3fe6c8f706b0d1653a7168dce7714cf1b4345 | JavaScript | ldplmt/wxDemo | /pages/audio/audio.js | UTF-8 | 3,764 | 2.609375 | 3 | [] | no_license | function parseLyric(lrc) {
var lyrics = lrc.split("\n");
var lrcObj = {};
for(var i=0;i<lyrics.length;i++){
var lyric = decodeURIComponent(lyrics[i]);
var timeReg = /\[\d*:\d*((\.|\:)\d*)*\]/g;
var timeRegExpArr = lyric.match(timeReg);
if(!timeRegExpArr)continue;
var ... | true |
7ef5c6b9a103b9a2a5068ae6039ed12766ffad52 | JavaScript | AbdulKanjo/NoDb-Batman | /src/components/SearchInput/SearchInput.js | UTF-8 | 1,024 | 2.609375 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
class ListOfMovies extends Component {
constructor() {
super();
this.state = {
movies: []
};
}
componentDidMount() {
axios.get("/api/movie").then(res => {
this.setState({ movies: res.data });
});
}
// handel... | true |
dda091700d63b7bc0f1e15658db245e7cefb8774 | JavaScript | ramast/redux | /examples/async/src/actions/index.js | UTF-8 | 2,700 | 2.78125 | 3 | [
"MIT",
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | import {AjaxAction} from "../ooredux"
export const SELECT_SUBREDDIT = 'SELECT_SUBREDDIT'
export const selectSubreddit = subreddit => ({
type: SELECT_SUBREDDIT,
subreddit
})
class PostListAction extends AjaxAction {
constructor() {
/*
The string `"POST_LIST_ACTION"` will be a prefix for all actions rel... | true |
ec4003c851d5ec6892520c5c2a9cc854ba7edf63 | JavaScript | lizhuomeng71/hawksbill-api-mgdb | /src/api/equipment.js | UTF-8 | 1,176 | 2.625 | 3 | [
"MIT"
] | permissive | import resource from 'resource-router-middleware';
import Equipment from '../models/equipment';
export default ({ config, db }) => resource({
/** Property name to store preloaded entity on `request`. */
id : 'equipment',
/** For requests with an `id`, you can auto-load the entity.
* Errors terminate the reques... | true |
e0c0f554eb6979c9efe01d1d440be16c2d778ce1 | JavaScript | la289/dashboardauth | /iotdbfrontend/src/components/LogInForm.js | UTF-8 | 1,521 | 2.546875 | 3 | [] | no_license | import React, { useState } from 'react';
import LogInButton from './LogInButton.js';
import FormTextField from './FormTextField.js';
import Cookies from 'js-cookie';
import { authState } from '../constants.js';
const LogInForm = ({ setLoggedIn }) => {
const [email, setEmail] = useState('')
const [password, s... | true |
c60125fe43cbbf5d62b142cba6e433e642044de4 | JavaScript | rick195s/ProjetoTI | /projeto/scripts.js | UTF-8 | 1,224 | 3.6875 | 4 | [] | no_license | // São criadas variáveis para guardar os elementos identificado por id
const rmCheck = document.getElementById("rememberMe");
const username = document.getElementById("username");
/* Ao carregar a página caso a checkbox tenha sido selecionada anteriormente
e o seu valor seja diferente de vazio o campo username irá f... | true |
f5fcf9ec96cf28df9cf09d0287822dd54a4347e8 | JavaScript | PeiYumeng/JS-advanced-lessons | /课程练习/LS05/0503.js | UTF-8 | 833 | 3.765625 | 4 | [] | no_license | var b = 2;
var a = 1;
function fn1(){
var b = 3;
var a = 5;
console.log(b);//3
function fn2(){
var b = 5;
var e = 6;
}
fn2();
}
fn1();
console.log(b);//2
//作用域的静态性,只要完成函数的定义
//变量的作用域是确定的
var username = "zhangsan";
function foo(){
console.log(username);//zhangsan
}
function ... | true |
a9b2c9f1ed5ba9c374278c8b9e83d387c23bf3d3 | JavaScript | rsruggles/Todo-api | /playground/basic-sqlite-db.js | UTF-8 | 1,914 | 2.953125 | 3 | [] | no_license | /*jslint devel: true, node: true, eqeq: true, nomen: true, plusplus: true, regexp: true, sloppy: true, vars: true, es5: true*/
var Sequelize = require('sequelize');
var sequelize = new Sequelize(undefined, undefined, undefined, {
'dialect': 'sqlite',
'storage': __dirname + '/basic-sqlite-db.sqlite'
});
var Todo = ... | true |
1133fd439444da6015440aabfa66df0117c18c0f | JavaScript | dchiapa/curso_JS_16825 | /Clases/clase__07/js/json.js | UTF-8 | 874 | 3.765625 | 4 | [] | no_license | //? JSON es JS Object Notation
//? JSON es un formato de codificación
//? de datos
//! metodos de JSON
//* stringify(object)
//* Devuelve un string con el JSON
//* de un objeto
//* parse(string)
//* Devuelve un objeto con los
//* datos JSON de un string
let item1 = {
nombre: "PAN",
cantidad: 6,
};
localStorage... | true |
ccbe227d670975c620186f4079a4f96607fe77aa | JavaScript | PyryM/rc-aframe | /js/videocontrol.js | UTF-8 | 1,248 | 2.640625 | 3 | [
"MIT"
] | permissive | AFRAME.registerComponent('videocontrol', {
schema: {
radius: {type: 'number', default: 1.0},
src: {type: 'selector'},
pos: {type: 'vec3'},
hide: {type: 'boolean', default: true}
},
init: function() {
this.triggerpos = new THREE.Vector3();
this.videoState = "unknown";
// var c... | true |
828e25fb0154c84a81348474b9e820ddb40f5846 | JavaScript | Fpisti-dev/FormBuilder-C-Sharp | /Scripts/js/NewForm.js | UTF-8 | 2,683 | 2.609375 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
//Hook up the click event for the add/edit work request button
$("#btnNewForm").click(function () {
//clear form
ClearForm();
//open modal window
$('#newFormModal').modal('toggle');
});
//Hook up the click event for the save button on t... | true |
48e3f1c118411828516f39d3dfc7b1ee88f93d9f | JavaScript | the0m/connect4 | /public_html/js/connect4.js | UTF-8 | 15,697 | 2.953125 | 3 | [] | no_license |
/*
* Connect 4 by Kevin Shannon and Tanner Krewson
*/
/*
* Variable declarations
*/
//gamemode (local multiplayer: 0, singleplayer: 1, p2p host: 2, p2p opponent: 3)
var gamemode;
var AIDelay = 1000;
var resetButtonActive = false;
//online multiplayer
var peer;
var connection;
//colors and design
var startin... | true |
4a802f8c034b38a13f2fbbeafa3ed2fb37f894a0 | JavaScript | m32/pyduktape2 | /tests/test2.js | UTF-8 | 233 | 2.765625 | 3 | [] | no_license | try {
console.log("require('test1')");
var test1 = require('test1');
console.log("test1=", test1.a, test1.b);
var res = test1.a + test1.b;
console.log("res=", res);
} catch ( e ) {
console.log("error=", e);
}
| true |
98bb7a4a4b9e442975cccd563ebd7616768dc4a2 | JavaScript | javascript-ninja-123/RxJS_autoComplete | /index.js | UTF-8 | 1,970 | 3.28125 | 3 | [] | no_license | //Dom
const autoSearch = document.querySelector('#autoSearch');
const list = document.querySelector('#list');
//api call
const callingNYTimesData = async() => {
let url = `https://api.nytimes.com/svc/books/v3/lists/overview.json?api-key=9295035052fa4dfc85794bbc1846f9da`;
let response = await fetch(url);
re... | true |
6f72e5406104f8545661ea74acaa38b68767a7ce | JavaScript | green-fox-academy/ecsekitibi | /week-08/day-02/matreview/bubbling.js | UTF-8 | 1,300 | 3.578125 | 4 | [] | no_license | /*
Here is an image inspector, but the buttons are not implemented yet, that will
be your task!
- the nav buttons(up, down, left, right) move the background by 10px
- the zoom buttons increase / decrease the image by 20 %
- attach only two event listeners to the nav element
- one for navigation
... | true |
286950777cfe38a75b847f02ed42e871c2126bc6 | JavaScript | Razza1234/raa | /app.js | UTF-8 | 156 | 3.1875 | 3 | [] | no_license | var num = 20.25;
var round = Math.round(num)
var floor = Math.floor(num)
var ceil = Math.ceil(num)
console.log(round)
console.log(floor)
console.log(ceil)
| true |
8c7f74514f0fd666076ed0675b165d7604a10c0f | JavaScript | andybeers/advent-of-code-2019 | /01-tyranny-equation/solution.js | UTF-8 | 719 | 3.546875 | 4 | [] | no_license | // --- Day 1: The Tyranny of the Rocket Equation ---
const { readFileAndSplitNewline } = require('../utils/data-files')
// take its mass, divide by three, round down, and subtract 2
function calculateFuelByMass(mass) {
const roundedValue = Math.floor(parseInt(mass) / 3)
return roundedValue >= 1 ? roundedValue - 2 ... | true |
ae42c7c2bc1fdc8a0ac44d7e23bd9d139d596ded | JavaScript | DaniBarcelo/UrlShortener | /src/main/resources/static/js/app.js | UTF-8 | 5,894 | 2.546875 | 3 | [
"MIT"
] | permissive | $(document).ready(
function() {
$("#shortener").submit(
function(event) {
event.preventDefault();
$.ajax({
type: "POST",
url: "/link",
cache: true,
data: $(this).serialize(),
... | true |
88036f65caab46e2c7acc5812dd657140d4e41d2 | JavaScript | susisu/archerfish | /lib/logger.js | UTF-8 | 1,092 | 2.640625 | 3 | [
"MIT"
] | permissive | "use strict";
const log4js = require("log4js");
/**
* @type {Logger}
*/
const defaultLogger = log4js.getLogger();
class WrappedLogger {
/**
* @param {Logger} logger
*/
constructor(logger) {
this._logger = logger;
}
/**
* @param {string} msg
* @returns {void}
*/
trace(msg) {
this._... | true |
ba13560a533bb9e892145feaa01d486f0527bccd | JavaScript | brittanyrjones/video-store-consumer | /src/components/Library.js | UTF-8 | 1,759 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Movie from './Movie';
import axios from 'axios';
class Library extends Component {
constructor(props) {
super(props);
this.state = {
movies: [],
moviePicked: "Legends of De Fault"
}
}
componentDidMoun... | true |
d9364f7b355e9e3409be2ddf86bbfeff7f9cf9e4 | JavaScript | KonstantinGeorgiev/maze | /mazeBig.js | UTF-8 | 3,173 | 3.109375 | 3 | [] | no_license | function mazeBig(){
let mazeBig =
[
['*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', ' ', '*'],
['*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', ' ', '*'],
['*', '*', '*', '*', '*', '*', 's', '*', '*', '*', '*', '*', '... | true |
0bda1c27842a32550a1b50f45ecb4deae7c52b10 | JavaScript | skyinhindi/upcycle | /scripts.js | UTF-8 | 1,131 | 3.296875 | 3 | [] | no_license | let shop = document.querySelector("shop");
let about = document.querySelector("about");
let images = document.querySelector("images");
var images = [
'images/1.jpg',
'images/2.jpg',
'images/3.jpg',
'images/4.jpg'
];
var img = document.querySelector('.hero');
var index = 0;
var iterations = 0... | true |
154586e230cc88d019e159e96163ac60ff065cad | JavaScript | bibek948/twitterBot | /bot.js | UTF-8 | 3,347 | 3.0625 | 3 | [] | no_license | //before you start copying this code, make sure you have a node.js server up and running and that you have configured authorization
//then create a new file under node_modules ('whatever you want to name is') in my case it is bot.js
console.log('The bot is starting')
var Twit=require('twit');
var config= require('./c... | true |
478e65cad956a6339d31a9e1469f8499bc4a363e | JavaScript | tim-gao/demo_angularJS | /mytest/directive/Directive&Directive.js | UTF-8 | 1,109 | 2.5625 | 3 | [] | no_license | var myModule = angular.module('myModule',[]);
myModule.directive('superman',function(){
return {
scope : {},
restrict : 'AE',
controller : function($scope){
$scope.abilities = [];
this.addStrength = function(){
$scope.abilities.push("strength");
};
this.addFly = function(){
$scop... | true |
cbaf9c0e4850b6e8d41bed17436cf64ccda11fd8 | JavaScript | hmilx90/saber-account | /dep/saber-widget/1.0.0/src/main.js | UTF-8 | 8,920 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* Saber Widget
* Copyright 2014 Baidu Inc. All rights reserved.
*
* @file 主模块
* @author zfkun(zfkun@msn.com)
*/
define(function (require) {
/**
* 主模块
* 提供组件全局配置、注册、管理等
*
* @exports widget
* @singleton
* @requires saber-lang
*/
var main = {};
/**
* 控件库默认配... | true |
6586853614a771d0cf34b057ad27d82d0bce7885 | JavaScript | flvargas/netpoint | /index.js | UTF-8 | 2,034 | 2.921875 | 3 | [] | no_license | $(document).ready(function(){
var checkboxError = 0;
var counterError = 0;
// Sanitize and send form data
$('#send').click(function(e){
e.preventDefault();
sanitize();
// Send Data
if (checkboxError == 0 && counterError == 0){
$('#result').html('Formulário enviado com sucesso!');
message = "... | true |
c2906c6740772aab753c26b289886ef23ab441cc | JavaScript | smilyk/sederBHeaderFront | /photo/photoChecklist.js | UTF-8 | 2,217 | 2.71875 | 3 | [] | no_license | (
function (window) {
let App = window.App || {};
let $ = window.jQuery;
function RowPhoto(photo) {
let $div = $('<div></div>',
{
class: 'form_display',
'data-seder-photo': 'checkbox'
... | true |
7eb818b12a8f444f15c6203f088030202ad75e36 | JavaScript | dsherret/swc | /tests/tsc-references/internalModules/codeGeneration/nameCollision/input.ts/es5.1.normal/output.js | UTF-8 | 968 | 2.671875 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var A;
(function(A) {
// these 2 statements force an underscore before the 'A'
// in the generated function call.
var A1 = 12;
var _A... | true |
5d66ec06362ac773be6bcce59f354f7abb8923ad | JavaScript | ypearson/nodejs_course | /node-todo-api/server/models/user.js | UTF-8 | 461 | 2.53125 | 3 | [] | no_license | var mongoose = require('mongoose');
var Users = mongoose.model('users', {
name:{
type:String,
required: true,
minlength:1,
trim: true
},
email:{
type:String,
required:true
}
});
Users.create(
{ name: 'Star Wars',
email: "bob@gmail.com"})
.then(... | true |
b7d3052be33d5b6680d417b754daecc59991c716 | JavaScript | snehh/Quizz | /public/script/editformscript.js | UTF-8 | 7,583 | 3.203125 | 3 | [] | no_license | function len(){
return (document.getElementById("ques-container").childElementCount);
}
var length = len();
function lencheck(){
var l = len();
if (l<=4){
document.getElementById("remove").classList.add('disable')
}
else if (l>=10){
document.getElementById("add").classL... | true |
c2e4e6ac3b8f4a9dc4825ec2001245aa939893f1 | JavaScript | dsaldana/cloudo-robot-website | /js/main.js | UTF-8 | 3,333 | 2.640625 | 3 | [
"MIT"
] | permissive | $(function() {
// Image Rotation Loader
var preload;
var image_list = [];
var image_map = {};
for (var i = 0; i <= 2; i++) {
image_map[i] = {};
for (var j = 0; j <= 9; j++) {
image_map[i][j] = null;
var reference = "img/cloudo_3d/{0}_{1}.jpg";
reference = reference.replace("{0}"... | true |
b516748c6a6c8a00dcf66509047edbac512833ae | JavaScript | PaulMathon/personnal_website | /src/js/header.js | UTF-8 | 393 | 2.84375 | 3 | [] | no_license | let isHeaderToggled = false;
function toggleHeader() {
if (window.scrollY > 0 && !isHeaderToggled) {
document.getElementById("header").classList.add("header-toggled");
isHeaderToggled = true;
} else if (window.scrollY === 0 && isHeaderToggled) {
document.getElementById("header").classList.remove("heade... | true |
4be81ed462e0ff67cbbdfe4b7d4efb6c0bed7350 | JavaScript | TaniaBondarenko/frontend-2021-homeworks | /submissions/Jigsaff/a-tiny-JS-world/index.js | UTF-8 | 2,399 | 4 | 4 | [
"MIT"
] | permissive | /* Refer to https://github.com/OleksiyRudenko/a-tiny-JS-world for the task details
Complete the below for code reviewers' convenience:
Code repository: _put repo URL here_
Web app: _put project's github pages URL here_
*/
// ======== OBJECTS DEFINITIONS ========
// Define your objects here
const dog = {
... | true |
4b68036e6ce106e00246089db792870b5e32c343 | JavaScript | Mavuks/ICD0006 | /Exam/Main.js | UTF-8 | 1,254 | 3.21875 | 3 | [] | no_license |
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
setInterval(
function setRandomColor() {
// $("#colorpad").css("background-color", getRandomColor());
$(... | true |
4175302b325660266a3a2cb4b9d7708f0ac4ea46 | JavaScript | LostHell/JS-Advanced | /05. ARRAYS/Exercises/1. Print an Array with a Given Delimiter.js | UTF-8 | 420 | 3.75 | 4 | [] | no_license | function stringSeparator(arr) {
let string = '';
for (let i = 0; i < arr.length - 1; i++) {
if (i == arr.length - 2) {
string += arr[i];
break;
}
string += arr[i] + arr[arr.length - 1];
}
console.log(string);
}
// stringSeparator(['One', 'Two', 'Three',... | true |
cae773d3e2d8bdd3134a427b133d0bd3b8f5eafd | JavaScript | drawwithcode/2020-04-Francescapievani | /coversketch.js | UTF-8 | 1,403 | 3.0625 | 3 | [] | no_license | let myImageCover;
let myImagePlay;
let mySong;
function preload(){
//preload the file for the background
myImageCover = loadImage("./assets/images/theoffice_cover.png");
myImagePlay = loadImage("./assets/images/play.png");
//preload the file for the song
mySong = loadSound("./assets/sounds/The Office Theme Song.mp3");... | true |
56449ad47add272f2874c4f1fe160f4df578965e | JavaScript | olartetrejos/bitmusic_am | /back/app.js | UTF-8 | 941 | 2.71875 | 3 | [] | no_license | /*
Va a contener toda la lógica de ruteo de Express
Declaración de rutas, uso de la librería body-parser
Permisos de acceso a cualquier cliente (Permisos a Angular)
*/
const express = require('express'); // Importamos Express
const bodyParser = require('body-parser'); // Permite analizar datos de URL
cons... | true |
b409bdbd8a610e6bae2d9cc06a3aca9a3f97169d | JavaScript | duringpan99/nevesse | /Java_Script/week7.1.1.js | UTF-8 | 646 | 2.6875 | 3 | [] | no_license | var form_tasks=document.querySelector("#tasks");
var aa=document.querySelector("#newtask").value="";
//even submit handler
/*form_tasks.onsubmit=()=>{
var newtask=document.querySelector("#newtask").value;
var li=document.createElement("li");
li.innerHTML=newtask;
document.querySelector("#tasklist").app... | true |
3a6fef49bad69256a60e31816ffff62abbf08fcc | JavaScript | gitter-badger/webBoilerPlate | /htdocs/scripts/app/app.js | UTF-8 | 344 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | "use strict"; //enable strict mode
require([
'dojo/on',
'app/mod1',
'app/mod2'
], function (on, mod1, mod2) {
on(document, "click", function () {
var res = "App getting from mod1: '" + (new mod1).get() + "' and from mod 2: '" + (new mod2).get() + "'";
console.log(res);
alert(res... | true |
4dab74486eacab7de7df7060d2171d27f5867b6e | JavaScript | akankshakutal/csv-parser | /test/headerParserTest.js | UTF-8 | 722 | 2.84375 | 3 | [] | no_license | const assert = require("assert");
const { parseHeader } = require("../src/headerParser.js");
describe("parseHeader", function () {
it("should give object ", function () {
let input = "1 of 13 2018 Weather";
let actual = parseHeader(input);
let expected = { week:1, periodNumber:13, year:2018... | true |