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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ecbe134534fee08651718dc018bdc8d848796302 | JavaScript | owlypixel/Fridge | /js/main.js | UTF-8 | 700 | 3.015625 | 3 | [
"MIT"
] | permissive | const input = document.querySelector('input[type="range"]');
const handle = document.querySelector('.handle');
function handleUpdate(){
var suffix = this.dataset.sizing || '';
document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix);
checkFlipAngle(this.value);
}
input.addEventLis... | true |
19b12bcfad6ac089dec05fa3bae46a17abb668f6 | JavaScript | Nicholas-Acosta-Storie/Fundamentals | /APIs-Objects-Interfaces.js | UTF-8 | 353 | 4.25 | 4 | [
"Apache-2.0"
] | permissive | //APIs, Objects, and Interfaces
/*
let dog = {
name: "Duke",
color: "black",
breed: "pitBull",
size: "large",
bark: function(typeOfBark){
console.log("Bark!");
},
};
dog.bark();
*/
function x(y) {
y.number = y.number + 5;
console.log(y);
}
let y = {
name: "tom",
numb... | true |
ea018226c2e703048074c71b6a981bb1116918a0 | JavaScript | piyushdolar/react-test | /src/Component/Api/Api.jsx | UTF-8 | 1,900 | 2.765625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import Box from '@material-ui/core/Box';
import Typography from '@material-ui/core/Typography';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import Axios from 'axios';
import FormControl from '@material-ui/core/Fo... | true |
3e0a4f13c8ad6f50ef72eb81168d2a0368062b8f | JavaScript | potatoMilkMeat/JS | /book/JavaScript设计模式/JS-17.7对象解耦.js | UTF-8 | 2,314 | 3.6875 | 4 | [] | no_license | document.write('1');
document.body.innerHTML = '';
/** =====17.3-创建一个观察者 =================== */
var Observer = (function (){
var _messages = {}; // 消息队列,是静态私有变量
return {
// 注册信息接口
regist: function(type, fn){
if(typeof _messages[type] === 'undefined'){
_messages[type] = [fn];
}else{
... | true |
b10db72e86396cc9632b219d315c521bf7ddda7f | JavaScript | croupiertraining/croupiertraining.github.io | /modules/controls/setting.mjs | UTF-8 | 586 | 2.65625 | 3 | [] | no_license | class Setting {
constructor( gameRef, formName, settingName ) {
this.gameRef = gameRef;
this.settingName = settingName;
this.input = document.querySelector(`#settings-${formName}-${settingName}`);
this.preview = document.querySelector(`#preview-${formName}-${settingName}`);
}
... | true |
f81f2a7930c6c408f100e850d2ac52a02dc3f700 | JavaScript | Okewusi/love | /index.js | UTF-8 | 2,464 | 3.234375 | 3 | [] | no_license | const data =[
{
id: 1,
text: 'I love you more than anyone in the world and this will always be the case',
image: `url(/img/mostHandsome.jpg)`
},
{
id: 2,
text: 'I want to be the one to always wakeup by your side and experience all the Jesus Jesus moments',
image: `url(/im... | true |
4bc18e6c1e544356458276e127ddfb68ffcd00ff | JavaScript | SeabassJames/cs325-game-prototypes | /DA6/js/Game.js | UTF-8 | 15,108 | 2.9375 | 3 | [] | no_license | "use strict";
BasicGame.Game = function (game) {
// When a State is added to Phaser it automatically has the following properties set on it, even if they already exist:
/*
this.game; // a reference to the currently running game (Phaser.Game)
this.add; // used to add sprites, text,... | true |
9171e021bb5d43e376d50ce8606608f13773bb09 | JavaScript | swc-project/swc | /crates/swc_ecma_minifier/tests/terser/compress/reduce_vars/array_forin_2/input.js | UTF-8 | 71 | 2.828125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | var a = [];
for (var b in [1, 2, 3]) a.push(b);
console.log(a.length);
| true |
d5f633c2fa27213e7d66ee5af97a5110cff81658 | JavaScript | fullyouth/font-end | /zhufeng-lesson/src/stream/readStream.js | UTF-8 | 1,858 | 2.84375 | 3 | [] | no_license | const fs = require('fs')
const path = require('path')
const eventEmitter = require('events')
class ReadStream extends eventEmitter {
constructor(path, options = {}) {
super()
this.path = path;
this.flags = options.flags || 'r';
this.encoding = options.encoding || null;
if (typeof options.autoClos... | true |
5277142738b365b37e521b40bda81503570e0ecd | JavaScript | RAVIS513/webapp01-02 | /src/main/webapp/js/userAgent.js | UTF-8 | 1,271 | 2.5625 | 3 | [] | no_license | /**
* 端末種別判定
*/
var userAgent = function() {
this.pc_url = "endlesstrip/";
this.mobile_url = this.pc_url + "sp/"
}
userAgent.prototype = {
// UserAgent判別
find : function() {
var ua = (function(u){
var mobile = {
0: (u.indexOf("windows") != -1 && u.indexOf("phone") != -1)
|| u.indexOf("iphon... | true |
055e4615fca1a3ab772d47d79bb0364a0cc33b8f | JavaScript | surendp/BoardGame_CanvasJquery | /playMode/javascript/model/Shape.js | UTF-8 | 658 | 3.796875 | 4 | [] | no_license |
class Shape{
constructor(x_coordinate, y_coordinate, x_size, y_size){
this.x = x_coordinate;
this.y = y_coordinate;
this.length = x_size;
this.breadth = y_size;
}
getX(){
return this.x;
}
getY(){
return this.y;
}
setX(x){
this.x = x;
}
setY(y){
this.y = y;
}
... | true |
e1fdccb65e135b40d61ac5a9e10fb6068498dd8e | JavaScript | WISE-Community/WISE-Steps | /node/template/template.js | UTF-8 | 4,953 | 3.5 | 4 | [] | no_license | /*
* This is a template step object that developers can use to create new
* step types.
*
* TODO: Copy this file and rename it to
*
* <new step type>.js
* e.g. for example if you are creating a quiz step it would look
* something like quiz.js
*
* and then put the new file into the new folder
* you created ... | true |
17db6c224f7fda0e36d91444970d54586581df10 | JavaScript | imageslr/spaces | /js/spaces.js | UTF-8 | 24,161 | 2.734375 | 3 | [
"MIT"
] | permissive | /* global chrome */
(() => {
const UNSAVED_SESSION = '<em>Unnamed window</em>';
const nodes = {};
let globalSelectedSpace;
let bannerState;
// METHODS FOR RENDERING SIDENAV (spaces list)
function renderSpacesList(spaces) {
let spaceEl;
nodes.openSpaces.innerHTML = '';
... | true |
43df7a5427f3179aad58c4df23a846a8b29ed2d1 | JavaScript | MihaP-Production/quadratic-equation | /src/index.js | UTF-8 | 302 | 2.96875 | 3 | [
"MIT"
] | permissive | module.exports = function solveEquation(equation) {
let k = equation.replace(/ /g, '').match(/[^\^]\d+/g);
let D = Math.pow(k[1], 2) - 4 * k[0] * k[2];
return [
(-k[1] - Math.round(Math.sqrt(D))) / (2 * k[0]),
(-k[1] + Math.round(Math.sqrt(D))) / (2 * k[0])
].sort((a, b) => a - b);
} | true |
9160402d1c6a378a04894ca5cd3debc956d1f8bb | JavaScript | Azure/azure-xplat-cli | /lib/util/bitArray.js | UTF-8 | 1,672 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | //
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless requi... | true |
fea9bc7614caba9db14d5b33d562c54562b13703 | JavaScript | ozair-dev/vite-snake | /src/components/Game/Board/Board.jsx | UTF-8 | 921 | 2.5625 | 3 | [] | no_license | import React, {useRef, useState, useEffect} from 'react';
import './Board.css'
const Board = (props) => {
const [style, setStyle] = useState({})
useEffect(()=>{
setStyle({
gridTemplateRows: `repeat(${props.rows}, ${props.boxSize}px)`,
gridTemplateColumns: `repeat(${props.columns}, ${props.boxS... | true |
22b15758103ec22d602dd96abce0304b8a3b7349 | JavaScript | jeet1751998/grocery_shop | /js/index.js | UTF-8 | 1,578 | 3.703125 | 4 | [] | no_license | var enter = document.getElementById("enter");
var input = document.getElementById("userInput");
var list = document.querySelector("ul");
var product = document.getElementsByTagName("li");
// Random price generator
function stringSize(){
return input.value.length;
}
// Price Generator
function getPri... | true |
2410923d365efbaf2e61318efe2405c75571e9e1 | JavaScript | Avikaura/BaggyStore_React | /ecomm_react_project-master/src/pages/Products.js | UTF-8 | 3,822 | 2.84375 | 3 | [] | no_license | import React, {useState} from 'react'
import Layout from '../components/Layout'
import SearchResult from '../components/SearchResults'
const productsPerPage = 4;
const PRODUCT_RANGE = {
'0-150': {min:0, max:150},
'151-250': {min:151, max:250},
'251-350': {min:251, max:350},
'351-500': {min:351, max:500}
}
c... | true |
1564a90589dc14da685ed8b6e8625275f5794093 | JavaScript | 18445166828/cxrck | /nodejs/lianxi/pratice.js | UTF-8 | 398 | 3.0625 | 3 | [] | no_license |
// module.exports=function(){
// say=function(){
// console.log(123);
// };
// eat=function(){
// console.log(456);
// }
// }
function Peoson(){
this.say=function(){
console.log("say");
};
this.eat=function(){
... | true |
42ba0af22a7511cca89cc257bb2424440480cef0 | JavaScript | alirezaebg/Order-Service | /client/src/components/Create.js | UTF-8 | 6,191 | 3.109375 | 3 | [] | no_license | import React, { Component } from 'react'
import { Link } from 'react-router-dom';
import axios from 'axios';
import "bootstrap/dist/css/bootstrap.min.css"
class Create extends Component {
state = {
itemQuery: '', //item that was looked up
inventory: '', //returned inventory object for the... | true |
0cbc550ee4befe5bc0fe6aeebe3b0f80858caab6 | JavaScript | Coel316/cookie-stand | /app.js | UTF-8 | 6,412 | 3.765625 | 4 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | /*
//example of what we did in class on 10-7-2019
var parentEl = document.getElementById('parentElement')
var child = document.createElement('h1')
child.textContent = 'proof of life';
var iceCreamShop = {
shopHours: ['6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7... | true |
bd37bcec7e3f543732d9c920a6ddf407fb289fd7 | JavaScript | lart2150/tivo-scripts | /autoDelete.js | UTF-8 | 4,416 | 2.640625 | 3 | [] | no_license | import {Tivo} from './lib/tivo.js'
import {config} from './config.js';
/**
*
* @param {{title: string, collectionId: string}} recording
* @returns shouldDelete
*/
const shouldDelete = (recording) => {
if (
(config.deleteTitles && config.deleteTitles.includes(recording.title)) ||
(config.delet... | true |
0f466ef8ebe01417de2ba285e92c0ce60c9b69ce | JavaScript | marshallhelenm/tome-frontend | /src/actions/charactersActions.js | UTF-8 | 3,317 | 2.671875 | 3 | [] | no_license | import { getLocal, setLocal, BASE_URL } from "../App";
export const setCharacters = characters => {
// console.log("setting these characters: ", characters);
return {
type: "SET_CHARACTERS",
payload: characters
};
};
export const setStoryCharacters = characters => {
// console.log("setting these story... | true |
81e4b5b251e7549c0f2005b212ea11d62ccc9740 | JavaScript | logicfeel/PolymerRef_2.0 | /logicTable.2/logicTable.0.2.js | UTF-8 | 22,894 | 2.53125 | 3 | [] | no_license | /**
*
* logicTable 설계 전체 변경
* - DataSet 도입
*/
// 주석 블럭 : DataAdapter
(function() {
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// function Connection() {
// Connection.prototype.mothod = function() {}
// }
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// function... | true |
f901b372e0fd14a66f5521368d2c704365583c5a | JavaScript | kertliinat/iseseisev-projekt | /main.js | UTF-8 | 6,354 | 2.828125 | 3 | [] | no_license | /*jshint esversion:6*/
window.onload = function() {
let gameField = document.getElementById("gameFloor");
let ctx = gameField.getContext("2d");
let score = document.getElementById("score");
let destroyedBlocks = document.getElementById("dBlocks");
let pause = document.getElementById("pauseButton... | true |
55f493d5d778bb5bff914cc0f3aebb181f94be8d | JavaScript | arnaudjuracek/www-bam | /src/components/toc.js | UTF-8 | 917 | 2.734375 | 3 | [
"MIT"
] | permissive | 'use strict'
import Sticky from './../js/sticky'
const defaultOpts = {
anchorSelector: '.highlighter',
tocSelector: '.highlightable',
className: 'is-highlighted',
offy: 0,
}
export default function (opts) {
opts = Object.assign({}, defaultOpts, opts || {})
const sticky = Sticky({
selector: opts.anch... | true |
7bcbc77ed7471f076d67da26026884a6c145350f | JavaScript | Niix-Dan/FelinosBot | /off/start.js | UTF-8 | 2,005 | 2.90625 | 3 | [] | no_license | //https://discordapp.com/api/v6/entitlements/gift-codes/${code}?with_application=false&with_subscription_plan=true
exports.run = ({Discord, client, message}) => {
const request = require('request');
const PROXY_FILE = __dirname + "./proxies.txt";
var proxyLine = 0;
var proxyUrl = "";
let canallogs = client.... | true |
e7428c444861defa97977c9d4eb5d0501a827ff2 | JavaScript | michaelprince3/ternaryTraveler | /src/scripts/api.js | UTF-8 | 1,107 | 2.59375 | 3 | [] | no_license |
const API = {
getPlaces() {
return fetch ("http://localhost:3000/places")
.then(resp => resp.json())
},
getInterests() {
return fetch ("http://localhost:3000/interests")
.then(resp => resp.json())
},
getInterestsEdit(editId) {
return fetch (`http:/... | true |
9b573fb57e7f10fb94d3172ddd2d649c7d5ce5f9 | JavaScript | KhajaMoulali/expense-tracker-task | /src/context/GlobalState.js | UTF-8 | 1,808 | 2.53125 | 3 | [] | no_license | import React, { createContext, useState, useEffect } from "react";
// import uuid from "uuid";
// import AppReducer from "./AppReducer";
// Initial state
// const initialState = {
// transactions: JSON.parse(localStorage.getItem("transactions")) || []
// };
// Create context
export const GlobalContext = createConte... | true |
235f28ab1c02c69a3ad4a17cf6c69e41385a5cb4 | JavaScript | RomanVavryn/FLX | /FLX_homework_8/homework/js/formatTime.js | UTF-8 | 387 | 3.3125 | 3 | [] | no_license | function formatTime(minutes) {
let sec = minutes * 60;
let days = Math.floor(sec / 60 / 60 / 24);
sec -= days * 24 * 60 * 60;
let hours = Math.floor(sec / 60 / 60);
sec -= hours * 60 * 60;
let min = Math.floor(sec / 60);
alert(days + ' days, ' + hours + ' hours, ' + min + ' min.');
ret... | true |
44cd880ee519c61e91687cdd1d1e0601d7fdd1e0 | JavaScript | auberdream/dawn | /models/cell-repository.js | UTF-8 | 580 | 2.765625 | 3 | [] | no_license | 'use strict';
(function(exports) {
function CellRepository() {
this._store = [];
}
CellRepository.prototype.store = function() {
return this._store;
};
CellRepository.prototype.add = function(cell) {
this._store.push(cell);
};
CellRepository.prototype.findCellByBodyId = function (id) {
... | true |
6955596193b2ab7e004ccb548bc867a811dabe41 | JavaScript | plura/public | /ModuleCompiler/test/assets/js/es6/code.js | UTF-8 | 717 | 3.171875 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', () => {
let form = document.createElement('form'),
input1 = form.appendChild( document.createElement('div') ),
input2 = form.appendChild( document.createElement('div') ),
attr = (obj, props) => Object.entries( obj ).forEach( ([key, value] ) => obj.setAttribute(ke... | true |
03fb638ba555734a4696d3ff525d3631b7cae1d8 | JavaScript | EnDriash/WeatherWidget | /src/helpers/category/data.js | UTF-8 | 335 | 2.609375 | 3 | [] | no_license | import moment from 'moment';
export const getDataTimeDiffer = (a, b) => {
const x = new moment(a);
const y = new moment(b);
return moment.duration(y.diff(x));
};
export const getDataHourInterval = (weatherData) => {
return getDataTimeDiffer(weatherData[0].dt_txt, weatherData[1].dt_txt).as(
'h... | true |
a5ed9ed87d8dfacf0dd48b6c38fd67c45ee1cbd1 | JavaScript | MrNightingale/exercises | /date_ago.js | UTF-8 | 186 | 3.265625 | 3 | [] | no_license | var date = new Date(2015, 0, 2);
getDateAgo(date, 1);
function getDateAgo(date, days) {
var newDate = new Date(date);
newDate.setDate(newDate.getDate() - days);
return newDate;
} | true |
d0c9ba386c0c4b13ce6ac7b204f3e0e440ebd838 | JavaScript | bryantwofourtwo/hangman-game | /assets/javascript/gameTwo.js | UTF-8 | 3,000 | 3.984375 | 4 | [] | no_license |
// Global Variables ------------------------------------------------------
// Arrays and Variables for holding data
var wordOptions = ["javascript", "web", "developer", "internet", "server", "database", "programmer",
"browser", "pantaloons"];
var selectedWord = "";
var lettersInWord = [];
var numBlanks = 0;
var b... | true |
29acae62a53fb85b513813b0ecc7b24fd9726b64 | JavaScript | alexrpagan/expertsrc | /www/static/js/availvis.js | UTF-8 | 2,552 | 2.671875 | 3 | [
"MIT"
] | permissive | $(function() {
var margin = {top: 20, right: 80, bottom: 30, left: 50},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var x = d3.scale.linear().range([0, width]);
var y = d3.scale.linear().range([height, 0]);
var color = d3.scale.category10();
... | true |
f51f1ac4f34b14eaede55423755fa2703c12e9af | JavaScript | andrewspadaro/READmeGenerator | /index.js | UTF-8 | 1,609 | 3 | 3 | [] | no_license | // array of questions for use
var inquirer = require('inquirer');
var generateMarkdown = require("./utils/generateMarkdown");
const fs = require('fs')
const path = require('path')
const questions = [
{
type: "input",
name: "title",
message: "What is the title?"
},
{
type: "input",
name: "desc... | true |
19b27dde0d5395bb28d4949bb9cbdfc9e878f202 | JavaScript | KaraPedersen/resty-api | /src/components/history/HistoryList.jsx | UTF-8 | 1,112 | 2.578125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import History from './History';
import styles from './HistoryList.css';
const HistoryList = ({ history, onClick }) => {
const historyElements = history.map((eachHistory, index) => (
<li
key={index}
onClick={onClick}
>
<History... | true |
058952a2949e2e87581dda07fd047364c2309de6 | JavaScript | karljamoralin/google-maven-repo-display-latest-package-versions | /extractor.js | UTF-8 | 1,570 | 2.71875 | 3 | [
"MIT"
] | permissive | const fs = require('fs')
const util = require('util')
const request = require('request')
const convert = require('xml-js')
const requestPromisify = util.promisify(request)
const BASE_URL = 'https://dl.google.com/dl/android/maven2/'
const main = async () => {
const { error, response, body } = await requestPromisi... | true |
7634d82830828219eedf980a828c11019c679a49 | JavaScript | Bendernnm/Practice | /tasks/matrix/src/helpFunctions/CreateAndSettingElements.js | UTF-8 | 1,407 | 3.046875 | 3 | [] | no_license | function createAndSettingNumeric() {
var numeric = document.createElement("input");
numeric.type = "number";
numeric.value = "1";
numeric.min = "1";
numeric.max = +MAX_ROW_COLUMN;
numeric.defaultValue = 1;
return numeric;
}
function setNumericOnchange(self, numericRow, numericColumn) {
... | true |
1fcc1758ee92dfb350aea35f82b932e6d7a75d2e | JavaScript | vanessakoch/coletali-web | /src/services/auth.js | UTF-8 | 556 | 2.5625 | 3 | [] | no_license |
export const TOKEN_KEY = "4e7994c1396e90bf45b9fcddbaa87c8b62add66223135cf227e200ce3dab7c8f";
export const isAuthenticated = () =>
localStorage.getItem(TOKEN_KEY) !== null;
export const isAdmin = () =>
localStorage.getItem('is_admin') !== null &&
Number(localStorage.getItem('is_admin')) === 1;
export const get... | true |
8be85b5b712cfb27397206235d3bf63d7b3256bd | JavaScript | karelrosseel/mathiesca-tools | /WholeRepresentationMatch/js/Localization.js | UTF-8 | 3,436 | 2.578125 | 3 | [] | no_license | //This is where we will store localization for now
localization =
{
openingDialogTitle:["Kies je nummer-symbool die je wilt bij elkaar matchen.","Choisir les nombres que vous voulez faire correspondre."],
openingDialogSecondInstruction:["Choose two or more representations.","Choisir au moins deux représentations.... | true |
722f307259a931fff65f7e7ef4e1efdaf56beec0 | JavaScript | i3acsi/job4j_carsales | /src/main/webapp/js/hint.js | UTF-8 | 617 | 2.671875 | 3 | [] | no_license | function errorT(text) {
document.getElementById("hintSuccess").textContent = ''
document.getElementById("hint").textContent = text
}
function error() {
document.getElementById("hintSuccess").textContent = ''
document.getElementById("hint").textContent = 'Ошибка вставки данных'
}
function ok() {
do... | true |
b9fdcb8a36c7e779185235765e135b6076d14b98 | JavaScript | sehiitaran/travelagency.github.io | /assets/js/scroll-nav.js | UTF-8 | 295 | 2.671875 | 3 | [
"MIT"
] | permissive | window.onscroll = function () {
var html = document.documentElement, body = document.body;
var navigation = document.querySelector('.main-nav');
if(html.scrollTop>50||body.scrollTop>50) {
navMain.classList.add('main-nav-scroll');
}else{
navMain.classList.remove('main-nav-scroll');
}
} | true |
88069628969e88c1fedba6913b64d1c12a5defd9 | JavaScript | mukulomer/holidayList-NS | /src/App.js | UTF-8 | 683 | 2.53125 | 3 | [] | no_license | import React from "react";
import "./styles.css";
// const Cities = [
// "Goa(India)",
// "Amsterdam(Netherlands)",
// "New York(USA)",
// "Darjeeling(India)",
// "Tokyo(Japan)",
// "Lonavala(India)"
// ];
// const getCity = Cities.map((city) => city);
export default function App() {
return (
<div cl... | true |
24a3a9fab1640ffd7ff1345e6a42c2c9d4e3ca98 | JavaScript | yashaswinishekar/interview_management_system | /candidate.js | UTF-8 | 1,559 | 3.15625 | 3 | [] | no_license | function validate() {
var Name = document.forms["firstform"]["name"];
if (Name.value == '') {
alert("name cannot be empty");
return false;
}
if (!isNaN(Name.value)) {
alert("name cannot have number");
return false;
}
reg1 = /([A-Za-z][0-9])+|([0-9][A-Za-z])+/;
if (reg1.test(Name.value)) {
alert("name... | true |
adc285300c055a54ff720b9d0341cea81e1d3b5d | JavaScript | rkaw92/esdf | /utils/loadAggregate.js | UTF-8 | 7,197 | 2.78125 | 3 | [
"MIT"
] | permissive | /**
* @module esdf/utils/loadAggregate
*/
//TODO: Documentation.
var when = require('when');
var util = require('util');
/**
* An EventSink has not been provided to the aggregate loader function. At least an EventSink is required - otherwise, Event Soutcing as such can not function.
*/
function AggregateLoaderSi... | true |
aa49a97f7ce83f2866dbc8bbbe09b0c3ac05fa9f | JavaScript | balqees0325/miva_talent | /youtube-p/script.js | UTF-8 | 385 | 2.796875 | 3 | [] | no_license | // menuToggle for sidebar menubar.
// menu for header menu bar.
const menuToggle = document.querySelector('#menubar');
const menu = document.querySelector('#menu');
const sidebar = document.querySelector('.sidebar');
menuToggle.addEventListener('click', ()=>{
sidebar.classList.remove('show-menu');
});
menu.addEventL... | true |
b8d375bc89b6d0e296a5c333c945fbd74a16fc2a | JavaScript | AAiTweb/Dating_Application | /ui/assets/Questionnaire_Profile/js/handler.js | UTF-8 | 2,581 | 2.828125 | 3 | [] | no_license | var questionBox=function(questionId,userQuestion,wishQuestion,answers){
$("select").empty().html(' ');
// var questionNumber=$(".question_number");
// questionNumber.empty();
// questionNumber.append()
$(".question_number").html(questionId);
$(".userQuestion").html(userQuestion);
$("... | true |
e268d8e2ac139171056bbfc8fecd2deaf57c10d8 | JavaScript | Shim0017/cremeria | /controlador/finca.js | UTF-8 | 8,128 | 2.65625 | 3 | [] | no_license | (function ($) {
// variables globales
var table = $('#finca-tabla').DataTable({
"order": [1, 'asc'],
"columnDefs": [
{ className: "d-none", "targets": [ 8 ] }
]
}); //variable de la tabla
// Definición de eventos
document.getElementById("finca-button-agregar")... | true |
9b1d7bebbc12afeabcceea92ebca976ff2f105d8 | JavaScript | itziaramor/ie-career | /integration/static/js/accordion.js | UTF-8 | 4,235 | 2.578125 | 3 | [] | no_license | jQuery(document).ready(function ($) {
var isDesktop;
var isTablet;
function init() {
isDesktop = $(document).width() >= 960;
isTablet = $(document).width() >= 768;
accordion();
}
function accordion() {
jQuery.fn.extend({
toggleText: function (stateOne, ... | true |
e71fad5e0ab51cf1c6a7bdb7759e7e599a518fce | JavaScript | mkuckro/time_split_calculator | /index.js | UTF-8 | 2,501 | 4.03125 | 4 | [] | no_license | // access user inputs from form
const formInput = document.querySelector('#input-form');
const inputType = document.querySelector('#time-split');
const inputMinutesSelector = document.querySelector('#user-input-minutes');
const inputSecondsSelector = document.querySelector('#user-input-seconds');
// functionality for ... | true |
caee338b72c9c76942d90cbbecdb617cf8745a78 | JavaScript | jjmateer/Trivia-game | /assets/javascript/app.js | UTF-8 | 4,348 | 2.9375 | 3 | [] | no_license | $("#inputForm").hide();
var timerInterval;
var correctAnswers = 0;
var incorrectAnswers = 0;
var unanswered = 0;
var timeLeft = 30;
var clockRunning = false;
var correctChoices = ["burgerking", "mcdonads", "tacobell", "innout","kfc"]
$("#resetButton").hide();
$("#question1").text("What fast food chain sells the whoppe... | true |
da8427b0ea212d970821436c47780fea79d09c23 | JavaScript | nathanabela/spaceinvaders | /Assets/Scripts/BordersCalculator.js | UTF-8 | 736 | 2.578125 | 3 | [] | no_license | #pragma strict
static var leftmost:float;
static var rightmost:float;
static var topmost:float;
static var bottommost:float;
function Start () {
}
function Update () {
leftmost = Camera.main.ScreenToWorldPoint(Vector3(0,0,0)).x;
rightmost = Camera.main.ScreenToWorldPoint(Vector3(Screen.width,0,0)).x;
topmost... | true |
eedf3d4651d849873ca057c98de58297b28f94a9 | JavaScript | Tombapa/AdventOfCode2017 | /attachments/day8output.js | UTF-8 | 1,594 | 2.546875 | 3 | [] | no_license | var output = "<pre>\n\
day8(): Hello, World!\n\
day8(): About to read attachments\\day8input.txt.\n\
readInputFile(inputFile, processLine): start.\n\
\t ... inputFile.on('data', function(data)).\n\
\t... inputFile.on('end', function()): moving to afterReading().\n\
\n\
afterReading(): Start! \n\
\tUp next: createRegist... | true |
4f56c51c51ac494c0eb310b3bc9f23f9176cb592 | JavaScript | anshulbajpai/TrainSignalling | /src/js/ui/signalElement.js | UTF-8 | 889 | 2.859375 | 3 | [] | no_license | var SignalElement = function(blockId, position, bus) {
this.blockId = blockId;
this.position = position;
this.bus = bus;
this.$signalDiv = this._createSignalDiv();
this._subscribeForUpdates();
};
SignalElement.prototype._createSignalDiv = function() {
$signalDiv = $('<div id="signal'+ this.blockId+'"></div>');
... | true |
7b113cb8be5af161ce7068f95f9415b777087a87 | JavaScript | egzoniar/food-delivery | /api/controllers/product.js | UTF-8 | 3,601 | 2.515625 | 3 | [] | no_license | const mongoose = require('mongoose');
const Product = require('../models/product')
// Get all products (User)
exports.user_get_products = (req, res, next) => {
Product
.find()
.select('_id name desc price img')
.exec()
.then(data => {
const response = {
count: data.length,
prod... | true |
26d3ca01e3ff1b891f0a0a0334882d392d6fba42 | JavaScript | Ellohir-noldo/AdivinaElFotograma | /server.js | UTF-8 | 2,196 | 2.84375 | 3 | [] | no_license | /* Setting things up. */
var fs = require('fs'),
path = require('path'),
express = require('express'),
app = express(),
helpers = require(__dirname + '/helpers.js'),
twitter = require(__dirname + '/twitter.js');
app.use(express.static('public'));
/* You can use uptimerobot.com or a similar sit... | true |
953e0d39ae8b00d35859d10ec96baef0bb95988d | JavaScript | Micjoyce/ioredis | /lib/subscription_set.js | UTF-8 | 852 | 2.78125 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
* Tiny class to simplify dealing with subscription set
*
* @constructor
* @private
*/
function SubscriptionSet() {
this.set = {
subscribe: {},
psubscribe: {},
};
}
SubscriptionSet.prototype.add = function (set, channel) {
this.set[mapSet(set)][channel] = true;
};
SubscriptionSet.... | true |
1b4a3fd3dac394957d1552abcb943407a8f552b6 | JavaScript | CDH-Studio/Kalend-Backend | /server/services/googleTokenGeneration.js | UTF-8 | 1,946 | 2.890625 | 3 | [] | no_license | const request = require("request");
const client_secret = require("../config/client-secret");
/**
* Gets a new accessToken and a refreshToken (if we didn't get one yet) from the serverAuthToken
*
* @param {String} code The serverAuthCode which would be sent by the client
*/
let serverAuthentication = (code) => {
... | true |
1f6df6f052a628af269372d635ff7b9b85e9c09e | JavaScript | Aszurar/Discover_Rocketseat | /javascript/expressions_and_operators/operadoresAritmeticos.js | UTF-8 | 751 | 4.21875 | 4 | [] | no_license | /*
Operadores Aritméticos
*/
//Multiplicação *
console.log(5 * 3.4);
//Divisão /
console.log(12 / 2);
// Soma +
console.log(34 + 87);
// Subtração -
console.log(123-12);
// Resto da divisão %
console.log(23 % 2);
// Incremento ++
let value = 9
console.log(++value);
console.log(value++);
console.log(value);
//... | true |
15ce524af5e19a35828a0324153f16e2ba7e5f29 | JavaScript | chaitanyabaranwal/JSON_Visualizer | /src/helpers/json-parse.js | UTF-8 | 736 | 3.265625 | 3 | [
"MIT"
] | permissive | // Add class to color-highlight
function addClass(string, className) {
return '<span class="' + className + '">' + string + '</span>';
}
// Using regex to determine what kind of object it is
export function syntaxHighlight(json) {
return json.replace(/("(\\u(\w+)|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-... | true |
4025a55c83bb0d75139e7d7f67dae944cac8d7fd | JavaScript | renardpasmagique/WORKSHOP_SC4 | /API/SAVEAPI/lib/pointer.js | UTF-8 | 545 | 3.078125 | 3 | [] | no_license | // # pointer.js
// Small helper class that represents a pointer to a certain record in the
// subfile.
const { hex } = require('./util.js');
class Pointer {
// ## constructor(type, address)
constructor(type, address = 0x00000000) {
this.type = type;
this.address = address;
}
// ## get [Symbol.toP... | true |
1fa6077d06cc4e734065aabe30fb816fddb649af | JavaScript | duongtiendat1990/-Th-c-h-nh-X-y-d-ng-l-p-m-ph-ng-s-ho-t-ng-c-a-n-pin | /script.js | UTF-8 | 909 | 3.09375 | 3 | [] | no_license | let Battery = function () {
this.setEnergy = function (energy) {
this.energy = energy
};
this.getEnergy = function () {
return this.energy
};
this.decreaseEnergy = function () {
if (this.energy>0) {
this.energy--
}
}
};
let FlashLight = function () {
... | true |
aa5680b0fe75c0bf45afbb756816c6243e894818 | JavaScript | Anouk95/frontendvoordesigners | /opdracht3/JSON.js | UTF-8 | 2,091 | 2.9375 | 3 | [] | no_license | var requestURL = 'https://open.data.amsterdam.nl/Attracties.json';
var request = new XMLHttpRequest();
request.open('GET', requestURL);
request.responseType = 'json';
request.send();
request.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200) {
showData(request.response)
}
}... | true |
a992c417d97f2b8b5e557f3d88516372b3646547 | JavaScript | stacyhi/gameOfLifeLive | /board.js | UTF-8 | 1,561 | 3.53125 | 4 | [] | no_license | function Board(width=32, height=32, cells) {
this.width = width
this.height = height
this.cells = cells || new Uint8Array(width * height)
}
Board.prototype.indexFor = function([row, col]) {
if (row < 0 || row >= this.height || col < 0 || col >= this.width)
return
return row * this.width + col
}
Board.pr... | true |
a3099975bc8e7235dbef0c09571032c618d32dbe | JavaScript | ValentinChion/sports-stats | /front/src/SessionStats/Calendar/StatsCalendar.js | UTF-8 | 3,042 | 2.53125 | 3 | [] | no_license | import React from "react";
import StatsCalendarDisplayer from "./StatsCalendarDisplayer";
import globalUtils from "../../utils/globalUtils";
import moment from "moment";
import runningUtils from "../../utils/runningUtils";
import constants from '../../utils/constants/basketball';
class StatsCalendar extends React.Comp... | true |
3bb31b9bb6993d0860c1dda130059da1e1f9692b | JavaScript | G6-Desarrollo-de-Software/Reto-3 | /js/funciones.js | UTF-8 | 3,988 | 2.609375 | 3 | [] | no_license | function registrar() {
var elemento={
id:$("#miId").val(),
name:$("#name").val(),
email:$("#miEmail").val(),
age:$("#miAge").val()
}
var dataToSend=JSON.stringify(elemento);
$.ajax({
datatype: 'json',
data: elemento,
url: "https://g2d19cca01d808e... | true |
963253a9eed2429fdd701d193dcde50d9fe78b6c | JavaScript | seenuvasanv/speed-typing | /js/main.js | UTF-8 | 3,315 | 2.546875 | 3 | [] | no_license | const randomWords = [
"half",
"vest",
"polite",
"form",
"decorous",
"wrench",
"rapid",
"woman",
"sofa",
"call",
"lie",
"fire",
"direful",
"joke",
"chief",
"stone",
"nation",
"imported",
"attack",
"rub",
"leg",
"roasted",
"value",
"handsome",
"popcorn",
"hurried",
"o... | true |
4f9a735ba70fd9f05e7176212465f0d63acaeeeb | JavaScript | Srikanth979/SyncBookmarksExtensionChrome | /app/firebase/auth/auth.js | UTF-8 | 3,625 | 2.953125 | 3 | [] | no_license | /**
* Handles the sign up button press.
*/
function handleSignUp(email, password) {
console.log("handle Sign Up ...");
var email = email;
var password = password;
configuredFirebase.auth().createUserWithEmailAndPassword(email, password).catch(function (error) {
var errorCode = error.co... | true |
a04ee5b82e052e932791721bf049586b567ff55f | JavaScript | 0x8801/commit | /contributions/remkl/JavaScript/Core/2016-10-28.js | UTF-8 | 143 | 2.546875 | 3 | [] | no_license | Types of numbers
Using the double tilde `~~`
Double and single quotes
Infix operators are left-associative
Apply `map` function to array items | true |
d16299b9dbf90894727baabf840a9089fd9f5be2 | JavaScript | PTLamTOP/A-Level | /homework1JS/3 ЧАСТЬ/06.js | UTF-8 | 308 | 3.890625 | 4 | [] | no_license | /*6. Дан объект obj. С помощью цикла for-in выведите на экран ключи и элементы этого объекта.*/
let obj = {green: 'зеленый', red: 'красный', blue: 'голубой'}
for (let keys in obj) {
console.log(`${keys} - ${obj[keys]}`)
}
| true |
878815c57e996294b9945a829150f290e1c0028b | JavaScript | pabloalexandre1/desafio-Supera-Laravel-PHP-laravelapp | /front end/js/oneCar.js | UTF-8 | 3,718 | 3.09375 | 3 | [] | no_license | if(!sessionStorage.getItem("car_id")){window.location = 'home.html';}
let insideMainPanel = document.createElement("div");
insideMainPanel.innerHTML =
`
<div>
<h1>Bem Vindo, ${sessionStorage.getItem("name").split(" ")[0]}!</h1>
</div>
<div>
<h2>aqui ao lado estão as manutenções do seu carro.</h2>
... | true |
df601cbda29c6c6819f78f7887314f8cba9d96d5 | JavaScript | shamansir/ielm | /src/server/document.js | UTF-8 | 2,924 | 2.59375 | 3 | [] | no_license | const ElmRepl = require('node-elm-repl');
const preludeTemplate = require('./prelude.template.js');
const screenTemplate = require('./screen.template.js');
class RevlDocument {
constructor() {
this.refresh();
this.blockReader = new BlockReader({
imports: isImport,
definitions: line => isDefini... | true |
31cc22f4be3a0225ae6fe24b5c0c51b994231793 | JavaScript | cllin/Cassandra101 | /server/server.js | UTF-8 | 1,456 | 2.609375 | 3 | [] | no_license | var http = require('http');
var url = require('url');
var server = http.createServer(function (request, response) {
requestCallback(request, response);});
// Listen on port 8000, IP defaults to 127.0.0.1
server.listen(8000);
// Put a friendly message on the terminal
console.log("Server... | true |
fb0a0bf3119a19a65cff3c49deca8db44a71b47e | JavaScript | ygberg/labbar | /Frontend_labbar/javascript/filterbyage.js | UTF-8 | 247 | 3.46875 | 3 | [] | no_license | var input = ['12', 'John', '15', 'Alfred', '9']
var minage = parseInt( input[0])
for(i=1;i!=input.length;i++){
if(parseInt (input[i])> minage)
console.log(i)
agepos = i
break
}
console.log("name = "+input[i]+" age = "+input[i+1]) | true |
2f7d9a518b87d41d0b2f6048a75c7cbf3b217d62 | JavaScript | oliverwalsh7/gradecalculator | /js/Utils.js | UTF-8 | 1,062 | 2.59375 | 3 | [] | no_license | const grades = ['N/A','A+', 'A', 'A-', 'B+', 'B', 'B-', 'C+', 'C', 'C-', 'D+', 'D', 'D-', 'F'];
const gpaScaleUnchecked = ['4.3', '4.0', '3.7','3.3','3.0','2.7','2.3','2.0','1.7','1.3','1.0','0.7','0'];
const gpaScaleChecked = ['4.33', '4.0', '3.67','3.33','3.0','2.67','2.33','2.0','1.67','1.33','1.0','0.67','0'];
ex... | true |
43ad5bd7c66a0533a22a08307b429a09131f0dd5 | JavaScript | selden-CBC2021/Team-Profile-Generator | /index.js | UTF-8 | 3,716 | 3.421875 | 3 | [
"MIT"
] | permissive | const Manager = require('./lib/manager');
const Engineer = require('./lib/engineer');
const Intern = require('./lib/intern');
// Inquirer package for questions/answers and fs to write the html
const inquirer = require('inquirer');
const fs = require('fs');
const path = require('path')
// destination where the html fil... | true |
eb25c8d142a64ebd9b92d44d411731f781f033eb | JavaScript | brandres/SAD | /Sem6-7/gestionDB.js | UTF-8 | 521 | 2.859375 | 3 | [] | no_license | async function getStock(db, cod,cb) {
let doc = await db.collection('products').findOne({cod: cod});
await db.close();
return await doc.stock;
}
function comprobarStock(db, producto, cb) {
console.log('cantidad requerida' + producto.cantidad);
getStock(db,producto.cod).then(function (stock) {
... | true |
02873eae2c5605b1cb5c256d236168905a3c3e4a | JavaScript | Vynalith/n220spring2021jared | /labs/lab6/example3/js/app.js | UTF-8 | 1,681 | 3.5625 | 4 | [] | no_license |
function setup(){
createCanvas(800, 600);
background("#11114f");
//draws the moon
fill(255);
stroke(0);
circle(700, 100, 50);
//moon craters
fill(225);
circle(725, 90, 10);
circle(700, 125, 10);
//random number of clouds up to 15
drawClouds(int(random(15)));
}
func... | true |
c8850846bc3812aee64011a93f5f6c3060d68de5 | JavaScript | vincentliu99999/react-practice | /src/components/ReduxForm/joi_redux_form.js | UTF-8 | 1,645 | 2.5625 | 3 | [] | no_license | import Joi from '@hapi/joi';
// take a joi schema and create a validator function for redux form
export default function createValidator(schema) {
return (values) => {
const result = Joi.validate(values, schema, { abortEarly: false });
if (result.error === null) {
return {};
}
const errors = r... | true |
bc3676582ed10cbc6c431188b92ab142bdb232b4 | JavaScript | CamiloBeltran24/Curso-de-Asincronismo-Javascript | /src/callbackVSpromisesVSasync.js | UTF-8 | 1,218 | 3.21875 | 3 | [
"MIT"
] | permissive | // ================ Callbacks
// ventajas;
// nos permite garantizar una funcion que recibe otra funcion y va a ejecutarse sin ningun problema
// Son universales, es decir que corren en cualquier navegador, antiguo o nuevo.
// Desvetajas
// anidamiento de callbacks tras callbacks lo que termin convertido en el ... | true |
aecffbf60d031b1019014e58a0fef41779812490 | JavaScript | Avbillie/project-2 | /public/js/amadeus.js | UTF-8 | 1,445 | 2.9375 | 3 | [] | no_license | $(document).ready(() => {
const displayEl = $("#displayEl");
const submitBtn = $("#submitBtn");
// getting the name of the city and converting it to geo locations
$(submitBtn).on("click", event => {
event.preventDefault();
const searchValue = $("#cityValue :selected").text();
$.post("/api/amadeus", ... | true |
9f52bd78caf7b048eeb3cb59d558ff37b343c043 | JavaScript | kamaxacademy/OpenSourceLibrary | /server/controllers/DeveloperController.js | UTF-8 | 3,621 | 2.796875 | 3 | [
"MIT"
] | permissive | /**
/------------------------------------
/ Developers Controller
/-------------------------------------
/ Holds all basic operations
/ of the developer
*/
// const callbacks = require('../config/callbacks.js');
const Developer = require('../middlewares/models/').Developer;
// require('dotenv').config();
// var... | true |
55d2f0f05650a8b92742977d70f735bbd8ce3162 | JavaScript | MarcelaSouza1995/MovieCardStateful | /src/components/MovieLibrary.jsx | UTF-8 | 2,107 | 2.65625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import SearchBar from './SearchBar';
import MovieList from './MovieList';
import AddMovie from './AddMovie';
class MovieLibrary extends React.Component {
constructor(props) {
super(props);
const { movies } = props;
this.state = {
searc... | true |
e0b65f9f8b7839319f1a15f0cdae4bde52ca94ea | JavaScript | AndroidNinjaX/Udemy-React-Course-Section-11-Assignment_Routing | /src/containers/Courses/Courses.js | UTF-8 | 2,238 | 3.015625 | 3 | [] | no_license | import React, { Component } from 'react';
//Import the NavLink componet from React-Router-Dom
import { NavLink } from 'react-router-dom';
//Import the Course component
import Course from '../Course/Course';
//Import Route
import { Route } from 'react-router-dom';
import './Courses.css';
//This component is responsible... | true |
3eeb2a819857207c9c3197a747657a7ca1027a30 | JavaScript | JohnyNogueira/fibonacci-all-languages | /javascript/test.js | UTF-8 | 1,010 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | const iterateArray = require("./iterate_array");
const recursive = require("./recursive");
const whileLoop = require("./while");
const reduce = require("./reduce");
describe("Fibonnaci sequence", () => {
test("Iterate array", () => {
const sequence = iterateArray(15);
expect(sequence.length).toBe(15);
ex... | true |
f0c76c71ada242ea1171f60dcfe0f1db58d7780e | JavaScript | jotapalas/basic-marketplace-challenge | /server/controller/basketController.js | UTF-8 | 665 | 2.640625 | 3 | [] | no_license | const ITEMS = require('../model/items')
const calculateTotalPrice = (basket) => {
if (!basket.items || basket.items.length === 0) {
return -1;
}
totalPrice = 0;
for (item in basket.items) {
const modelItem = ITEMS[item];
const itemAmount = basket.items[item];
if (modelItem.discount && modelIte... | true |
ef7f54470eb0029a5f53afd14e9b17a24ad01d00 | JavaScript | VicatS/javascript_2020 | /22/loop-array.js | UTF-8 | 170 | 3.15625 | 3 | [] | no_license | 'use strict'
//Arrays
var paises = ['España', 'Suiza', 'Alemania', 'Italia']
var total = paises.length
for (let i = 0; i < total; i++) {
console.log(paises[i]);
} | true |
9e48ce5890ff50a0c32202d7c51464af079fabd4 | JavaScript | Louis-yes/chain | /diy/generateLinksFile.js | UTF-8 | 1,153 | 2.6875 | 3 | [] | no_license | const path = require('path')
const fs = require('fs')
require('dotenv').config()
console.log("This is a quick and dirty file for making the lists csv from the are.na channel -", process.env.CHANNEL_SLUG, "!!!!!!")
const Arena = require("are.na");
const arena = new Arena();
let blocks = []
let pp = 1
let per = 100
f... | true |
56463c57a271be896347c9c273d409040e01b54d | JavaScript | cojocariuovidiu/MEAN-HR-1 | /public/app/controllers/teamCtrl.js | UTF-8 | 4,061 | 2.5625 | 3 | [] | no_license | angular.module('teamCtrl', ['teamService'])
.controller('teamController', function(Team) {
var vm = this;
// set a processing variable to show loading animation
vm.processing = true;
// grab all the teams at page load
Team.all()
.success(function(data) {
... | true |
78c7ad2c4930e4a263910f8e0b002b1e64519a70 | JavaScript | VladimirGlushets/WebChatNodeJs | /createDb.js | UTF-8 | 4,305 | 3.125 | 3 | [] | no_license | //// 3 вариант
var async = require('async');
var User = require('./models/user').User;
var mongoose = require('./libs/mongoose');
// 1. drop db
// 2. create & save users
// 3. close connection
// запускаем функции друг за другом
async.series([
open,
dropDatabase,
createUsers,
close
], function(err, results){
... | true |
26c3787109a7bcd6ca3eef1eaed42fe5dbb1d962 | JavaScript | rubberdork/ananos-airdropper | /lib/shorten_account_id.js | UTF-8 | 159 | 2.515625 | 3 | [] | no_license | export function shortenAccountID (accountID) {
const len = accountID.length
return accountID.substring(0, 4) + '…' + accountID.substring(len - 4, len)
}
| true |
c4269b87feed39a646d6dcca0a3969610cee7eab | JavaScript | TeamFloorPlan/TeamFloorPlan | /testing.js | UTF-8 | 7,509 | 3.34375 | 3 | [] | no_license | 'use strict'
function setFloorNumber(floorNumber){
document.getElementById('floor').value = floorNumber;
}
function getFloorNumber(){
return document.getElementById('floor').value;
}
function updateFloorNumber(){
document.getElementById('floor').onchange();
}
function testFloor(data,wantChange){
setFloorNumber(... | true |
298a0fd573ce7f994cae018877da2c6d7cc2121e | JavaScript | smaabjorg/cloud-assignment-2 | /sub.js | UTF-8 | 677 | 2.828125 | 3 | [] | no_license | var mqtt = require('mqtt');
var client = mqtt.connect('mqtt://localhost:8080')
var topic = 'Smart Home'
client.on('message', (topic, message) => {
message = message.toString()
/* console.log(message) */
})
client.on('connect', () => {
client.subscribe(topic)
})
// Transform our data to JSON.
const xml2... | true |
8d7e18d53e66f2b41236eaa318620e2e978c4591 | JavaScript | renso3x/nodejs-notes | /test/Class.js | UTF-8 | 711 | 3.5 | 4 | [] | no_license | class Class {
constructor(name) {
this.name = name;
this.students = [];
this.teacher = null;
}
addStudent(student) {
if (this.isFull()) {
return console.log('Sorry, the class is full');
}
if (student.age < 18) {
return console.log(`${student.fname} ${student.lname} is below 18`);
}
this.stude... | true |
3ed9321501af28345369d57701fc28d8959401f4 | JavaScript | llacroix/rsa-js | /test/crypto.js | UTF-8 | 2,013 | 3 | 3 | [] | no_license | var assert = require("assert")
, crypto = require("../crypto")
describe('Big numbers', function(){
it('Greatest common divisor', function(){
assert.equal(crypto.RAE(32, 16).toNumber(), 16)
assert.equal(crypto.RAE(16, 32).toNumber(), 16)
assert.equal(crypto.RAE(1072, 462).toNumber(), 2)
assert.equal... | true |
11c61490d48c8691cd1d3ac1be81651952278b64 | JavaScript | classAndrew/js3d | /index.js | UTF-8 | 9,776 | 3 | 3 | [
"MIT"
] | permissive | const canvas = document.querySelector("#cv")
const c = canvas.getContext("2d")
const { PI, cos, sin, tan } = Math
const { width, height } = canvas
const [a0, a1, b0, b1] = [0, 2 * PI, 0, 2 * PI]
const FOV = PI / 4;
const ASPECTRATIO = width / height;
var [NEAR, FAR] = [0.0, 100];
const PREC = 80;
/*
Cartesion Coor... | true |
62f0cfbed1c1af6343ebe558ce8d1ab8bf0620ea | JavaScript | krkr58/test | /javasc/script10.js | UTF-8 | 802 | 2.859375 | 3 | [] | no_license | for(var i=1;i<=10;i++){
document.write(i);
document.write("/")
}
document.write("<br>");
for(var a=10;a>=0;a--){
document.write(a);
document.write("/")
}
document.write("<br>");
for(var a=1;a<7;a++){
document.write(a);
document.write("<br>")
}
document.write("<br>");
for(var a=1;a<5;a++){
... | true |
0f56da375c56c0fbb685a84b530052ef55061d1d | JavaScript | brianjkelly/mars-daily-weather-report | /js/script.js | UTF-8 | 5,523 | 3.109375 | 3 | [] | no_license | /*----- constants -----*/
var d = new Date();
var d2 = new Date(d.getTime() - 86400000);
var date = d2.getDate();
var month = d2.getMonth();
var monthArr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var dateStr = monthArr[month] + " " + date;
var d3 = new Date(d.getTime() - ... | true |