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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
237b1e0438a28e367e11ea7229054064b37a004e | JavaScript | manishkhanchandani/myReactProjects | /learn/manny/familytreesample/src/utils/renderTree.js | UTF-8 | 1,760 | 2.59375 | 3 | [] | no_license | 'use strict';
import d3 from 'd3';
export default function(treeData, svgDomNode) {
const margin = {top: 50, right: 120, bottom: 20, left: 120};
const width = 725 - margin.right - margin.left;
const height = 500 - margin.top - margin.bottom;
let i = 0;
// Cleans up the SVG on re-render
d3.select(svgDomN... | true |
8eebd12a8722493dbc508417a88d8a5d6efa5b07 | JavaScript | epicallan/di-express-react | /src/components/YearSlider/YearSlider.js | UTF-8 | 1,537 | 2.78125 | 3 | [] | no_license | import React, { Component, PropTypes} from 'react';
import Slider from 'react-rangeslider';
// import styles from './YearSlider.scss';
export default class YearSlider extends Component {
static propTypes = {
years: PropTypes.array.isRequired,
updateCurrentYear: PropTypes.func.isRequired,
currentYear: Pr... | true |
84cd6fd7cb21b942e8ed68ac3bdc7e32cf6bf7e5 | JavaScript | asukakenji/achievement-challenge | /nodejs/lib/AchievementsCompiler.js | UTF-8 | 4,006 | 3.09375 | 3 | [
"MIT"
] | permissive | 'use strict';
const Utils = require('./Utils');
const LVCompiler = require('./LevelCompiler');
const HRCompiler = require('./HighRollerAchievementCompiler');
const BSCompiler = require('./BigSpenderAchievementCompiler');
const LSCompiler = require('./LuckyStarAchievementCompiler');
const PCCompiler = require('./Perenn... | true |
482d5c533a697335a8346fc4d7e56638e697d777 | JavaScript | erickwize/vanillajs | /sorting_bands/index.js | UTF-8 | 948 | 3.1875 | 3 | [] | no_license | function insertUnOrderedListItem(ul, item) {
const li = document.createElement('li');
const textNode = document.createTextNode(item);
li.appendChild(textNode);
ul.appendChild(li);
}
const bands = ['The Plot in You', 'The Devil Wears Prada', 'Pierce the Veil', 'Norma Jean', 'The Bled', 'Say Anything', '... | true |
00cf35e990831975cec901bac1504c79e7bba9d2 | JavaScript | Olukemi/UFO-Game | /scripts/objects.js | UTF-8 | 783 | 2.921875 | 3 | [] | no_license | // --- objects --- //
class Objects {
constructor() {
}
spaceship(x, y, spaceship_image) {
this.x = x;
this.y = y;
this.width = 34;
this.height = 28;
this.spaceship_image = spaceship_image;
this.spaceship_image.src = "images/ship.png";
return this;
}
bullet(x, y) {
this.x = x;
this... | true |
5723708f3457b1da7dfc3d08c815d50331064b35 | JavaScript | sedson96/fresh-clean | /server/controllers/scheduleCtrl.js | UTF-8 | 1,921 | 2.546875 | 3 | [] | no_license |
const getSchedule = async (request,response) => {
const db = request.app.get("db")
const {id} = request.session.user
const week = await db.get_users_schedules(id).catch(error => console.log(error));
response.json(week)
}
const getAdminCurrentWeek = async (request, response) => {
const db = request.... | true |
5223372f4faf46e67a81dea17897dcf828ad8a60 | JavaScript | readwritetools/ternwords | /cjs/utils/terminal.js | UTF-8 | 2,319 | 2.578125 | 3 | [
"MIT"
] | permissive | /* Copyright (c) 2020 Read Write Tools */
module.exports = class terminal {
static gray(t) {
return `[37m${t}[0m`;
}
static red(t) {
return `[31m${t}[0m`;
}
static green(t) {
return `[32m${t}[0m`;
}
static yellow(t) {
return `[33m${t}[0m`;
}
st... | true |
d2cb8341d0b8d7740a810fa519d0bc47ca60934e | JavaScript | ayeletronen/my-real-js-exercises | /champions.js | UTF-8 | 619 | 2.59375 | 3 | [] | no_license | const formula1Champions = [
"Schumacher",
"Schumacher",
"Schumacher",
"Schumacher",
"Schumacher",
"Alonso",
"Alonso",
"Raikkonen",
"Hamilton",
"Button",
"Vettel",
"Vettel",
"Vettel",
"Vettel",
"Hamilton",
"Hamilton",
"Rosberg",
"Hamilton",
"Ham... | true |
2d0b41943e89eafefc34a8b7212e70efcff359bc | JavaScript | GiladanoN/Recaman-Sequence | /recaman/DataStructs/Recaman.js | UTF-8 | 308 | 3.265625 | 3 | [] | no_license |
let Recaman = function (n) {
let arr = [];
arr[0] = 0;
for (let i=1; i<n; i++) {
let cur = arr[i-1];
let next = cur-i;
if (next < 0 || arr.includes(next))
next = cur+i;
arr[i] = next;
}
return arr;
}
// interesting. the series acctually
// does contains repeate elements!
| true |
92951e3026cdf51b4d7e5ebd447cd6067908f7ef | JavaScript | fadisdh/bo-crypto-address-validator | /src/eos_validator.js | UTF-8 | 246 | 2.609375 | 3 | [
"MIT"
] | permissive | module.exports = {
isValidAddress: function (address) {
if (/^[a-z0-9]+$/.test(address) && address.length === 12) {
// Numbers and small case letters. It also should be 12 characters
return true;
}
return false;
}
};
| true |
03ddf5b378e172f2be816c183a9114798e47beef | JavaScript | paulpark330/c0621-code-solutions | /object-manipulation-2/src/invert.js | UTF-8 | 337 | 3.296875 | 3 | [] | no_license | /* exported invert */
// PSEUDOCODE
// Storage for new object
// Go through each property
// Make new property for new object
// Source value as key and source key as value
// Return new object
function invert(source) {
var newObj = {};
for (var prop in source) {
newObj[source[prop]] = prop;
}
... | true |
9f2b411f63c27ca939add10fa7e16ef8f3763ec8 | JavaScript | Temasys/SkylinkJS | /src/features/data-transfer/helpers/base64ToBlob.js | UTF-8 | 486 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | const base64ToBlob = (chunk) => {
// eslint-disable-next-line no-undef
const byteString = atob(chunk);
// write the bytes of the string to an ArrayBuffer
const ab = new ArrayBuffer(byteString.length);
const ia = new Uint8Array(ab);
for (let j = 0; j < byteString.length; j += 1) {
ia[j] = byteString.char... | true |
094f7ee9a4cc1abc5863ff287b348f6d5e40dbb9 | JavaScript | drbishopdev/bishop-nutrition | /backend/dbObjects.js | UTF-8 | 3,999 | 3.15625 | 3 | [] | no_license | import * as firebase from 'firebase/app'
import 'firebase/auth'
import 'firebase/firestore'
import healthTrackingTemplate from '../dataTemplates/healthTrackingTemplate'
import bodyTrackingTemplate from '../dataTemplates/bodyTrackingTemplate'
export let todaysHealthTrackingDocId = ""
export let todaysBodyTrackingDocId... | true |
a6341d5a4cbd56849fea98429b18a71e1585c6e5 | JavaScript | ellardaaron/99linesOfCode | /app.js | UTF-8 | 2,260 | 3.8125 | 4 | [] | no_license | // let friends = ['Katherine', 'Sophia', 'Xan', 'Torin', 'Terrance'];
// function codeInTheFile(friends) {
// let word = "lines"
// let count = 99;
// while (count > 0) {
// if (count == 1) {
// word = 'line';
// }
// console.log(count + " " + word + " of code in the fil... | true |
f3c9797696e2ead3dc27e075e108d7d5dbcb97fa | JavaScript | mahlilmahee/firebaseshop | /milestone 4/day 5/oddeven.js | UTF-8 | 520 | 4.15625 | 4 | [] | no_license | // how to identify a even no
function oddNm(value){
if( value%2==0){
return true;
}
return false;
}
const no = 21223;
const asho = oddNm(no);
console.log( "is my no even", asho);
const isherno =731226;
const mygf= oddNm(isherno);
console.log( "is her no even", mygf);
// how to identify the odd... | true |
a085029e8ab8d0846e7a9c6d6be1a5a0b092b4fe | JavaScript | lucasspeixoto/cursojs | /Exercicíos/Fundamentos, Estruturas de Controle e Funções/ex19.js | UTF-8 | 688 | 3.40625 | 3 | [] | no_license | const Preco = function(cod, qnt){
switch(cod){
case 100: return `${qnt} Cachorro quente: R$ ${qnt*3.00}`
case 200: return `${qnt} Hambúrguer Simples: R$ ${qnt*4.00}`
case 300: return `${qnt} Cheeseburguer: R$ ${qnt*5.50}`
case 400: return `${qnt} Bauru: R$ ${qnt*7.50}`
... | true |
b068b6b810724dddd0922851651ef071169dee44 | JavaScript | omkarghule27/foodies-app | /Model/planModel.js | UTF-8 | 1,166 | 2.546875 | 3 | [] | no_license | // mongoose
const mongoose = require("mongoose");
// mongoose => promise based library
// connection
const DB_LINK = process.env.DB_LINK||require("../config/secrets").DB_LINK;
mongoose
.connect(DB_LINK, {
useNewUrlParser: true,
useCreateIndex: true,
useUnifiedTopology: true,
})
.then(function (db) {
... | true |
ff5c6a7a3d6029d753ef7da631804521152f7919 | JavaScript | joaquimnet/hanabi | /src/commands/reactions/cry.command.js | UTF-8 | 1,804 | 2.5625 | 3 | [] | no_license | const { Command } = require('sensum');
const makeEmbed = require('../../util/makeEmbed');
const findPerson = require('../../util/findPerson');
// const Gifs = require('../../services/gifs');
const random = (arr) => arr[Math.floor(Math.random() * arr.length)];
const images = [
'https://i.imgur.com/5eCOs01.gif',
'h... | true |
e65fe0679951ae8fe36c92471ef0a3107a4b621a | JavaScript | Kolobok12309/quillVue-trouble | /src/table.js | UTF-8 | 3,598 | 2.625 | 3 | [] | no_license | import Table from 'quill/modules/table';
function toolbarHandler(options) {
const table = this.quill.getModule('table');
switch (options) {
case 'insertTable':
table.insertTable();
break;
case 'deleteTable':
table.deleteTable();
break;
... | true |
2abc95f3d00318d5db667082e40e1522abb18fd8 | JavaScript | dylanchristopherson/p5.js | /smallProjects/moon.js | UTF-8 | 287 | 2.859375 | 3 | [] | no_license | function Moon() {
this.x = 20;
this.y = 20
this.show = function(Planet) {
translate(Planet.posx, Planet.posy);
rotate(angle * -4);
ellipse(this.x, this.y, 10, 10);
}
this.out = function () {
console.log("px", Planet.posx);
console.log("py", Planet.posy);
}
} | true |
4a4028d702f41574faf5101a7c4aa2d6c180cd97 | JavaScript | egorTsvetkov/officeSiteServer | /backend/info/static/scripts/map.js | UTF-8 | 2,279 | 2.71875 | 3 | [] | no_license |
function draw_unions(unions) {
let map_elements = document.getElementsByClassName('offices');
let real_unions = [];
//Довавляем классы объединения каждому элемену.
for (let i = 0; i < map_elements.length; i++) {
let union = unions['union-' + i];
if (union != null) {
for... | true |
f80cd3f79c3a395e44f18aa11f25ba6c25e04431 | JavaScript | PavelKulkov/Tsz | /scripts/js/zagses_common.js | UTF-8 | 18,623 | 2.5625 | 3 | [
"MIT"
] | permissive | var countWSNow = 0;
function modalShow() {
countWSNow++;
$('#exampleModal').arcticmodal({
closeOnEsc: false,
closeOnOverlayClick: false
});
}
function modalHide() {
countWSNow--; if (countWSNow<=0) $('#exampleModal').arcticmodal('close');
$('#exampleModal').arcticmodal('close');
}
... | true |
81f46634f772781e6128d51b25eb81a66f52b14c | JavaScript | tesk9/pe | /numberLetterCounts.js | UTF-8 | 1,465 | 3.84375 | 4 | [] | no_license | var numberToWord = {
0: '',
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
6: 'six',
7: 'seven',
8: 'eight',
9: 'nine',
10: 'ten',
11: 'eleven',
12: 'twelve',
13: 'thirteen',
14: 'fourteen',
15: 'fifteen',
16: 'sixteen',
17: 'seventeen',
18: 'eighteen',
19: 'nineteen',
2... | true |
9cdf554bfa392fab9d3cf1f7017fa1c7dca8a3bd | JavaScript | A3vk/WEBPHP | /StudyMate/resources/js/file-input.js | UTF-8 | 375 | 2.828125 | 3 | [
"MIT"
] | permissive | window.addEventListener('load', () => {
let input = document.querySelector('.custom-file-input');
if(input) {
input.addEventListener('change', function (e) {
let fileName = document.getElementById("file").files[0].name;
let nextSibling = e.target.nextElementSibling;
n... | true |
c53b7dd60ffaa1cd78c8ae0098ad7a61fa6126eb | JavaScript | soyabeans1000/FriendFinderApp | /public/assets/js/formhandler.js | UTF-8 | 1,862 | 3.078125 | 3 | [] | no_license | const { fetch, alert } = window
const numOfQuestions = 10
const getCompatibleUser = (x,y,z) => {
fetch('/friendsAPI')
.then(r => r.json())
.then(friends => {
let sum = 0
let bestMatch = friends[0]
let bestMatchDiff = 0
let noOfFriends = friends.length
for (let i=0; i < noOfFriends; i++)
... | true |
802ed31100bc7a0b85c6f88cb518e7496e78ff9d | JavaScript | hello-snsa/Unit3 | /Coding/week1/25-06-21 Pagination/Assignments/main3.js | UTF-8 | 2,815 | 3.34375 | 3 | [] | no_license | console.log("script is working");
// key:
// e8ecc7eb806a44cf84b713b3183e2685
let container= document.getElementById('container');
var apiKey="e8ecc7eb806a44cf84b713b3183e2685";
var query;
var data;
var category;
main();
async function main() {
data= await getNewsData();
showNewsData();
showButtons(... | true |
2b6f59caf2aa444c83eb233a83399842e2f42b44 | JavaScript | delongamateo/junior-react-test | /src/components/Context/StoreContext.js | UTF-8 | 2,179 | 2.71875 | 3 | [] | no_license | import React, { Component } from "react";
import { findIndex, isEqual, cloneDeep } from "lodash";
const StoreContext = React.createContext();
const getInitialContextState = () => {
return (
JSON.parse(localStorage.getItem("jrt-web-shop-state")) || {
items: [],
storeCurrency: "USD",
selectedCat... | true |
f9b97bd7bb0cefd6dd065da4e1386ba12cbb37cb | JavaScript | PYYuriy/Part-of-cod | /Konstructor and Class.js | UTF-8 | 807 | 3.71875 | 4 | [] | no_license | Person = function(name,surname){
this.name = name;
this.surname = surname;
}
Person.prototype.greet = function() { //осіклькт всі функції(конструктори ). наслідуються від прототипа то в началі вони мають пустий прототип , в який можна щось дописувати
console.log("Hello, my name is "+this.name);
console.log("... | true |
0ca2fc06b82b4d63abbbfa5c2e0aa617c0a5e9ab | JavaScript | sunmenghan2017/JS-advanced-lessons | /课程练习/LS02/js/ch02.js | UTF-8 | 1,321 | 3.109375 | 3 | [] | no_license | // NaN
var x = Number ( " xis021 " ); //试着转成Number类型
console . log (x); // NaN
isNaN (x); // true
typeof NaN ;
console . log ( Math . log ( - 1 )); // NaN
console . log ( Math . acos ( 2 )); // NaN
console . log ( NaN === NaN ); // false
// Infinity与-Infinity
var y1 = 2 / 0 ;
co... | true |
6190512da46e1474e7185d30e5e04140c83d0241 | JavaScript | evanwatterud/react-snake | /src/snake.js | UTF-8 | 1,318 | 2.953125 | 3 | [] | no_license | import {
gameSize, RIGHT
} from './helpers/constants'
const randomPos = () => { return { x: Math.floor(Math.random() * gameSize), y: Math.floor(Math.random() * gameSize) } }
const initialState = {
direction: RIGHT,
snake: [{ x: 9, y: 9 }],
fruit: randomPos()
}
const comparePoints = (p1, p2) => { return p1.x ... | true |
5fabd3fef73dd7c7eeb4bf861b81554ecc6336e5 | JavaScript | sofyansetiawan/timestamp-api | /server.js | UTF-8 | 1,444 | 2.640625 | 3 | [] | no_license | var express = require('express');
var app = express();
var cors = require('cors');
app.use(cors({optionsSuccessStatus: 200}));
app.use(express.static('public'));
app.get("/", function (req, res) {
res.sendFile(__dirname + '/views/index.html');
});
app.get("/api/hello", function (req, res) {
res.json({greeting:... | true |
a4098bf567d432054a9e91a2478bb4cb4009367d | JavaScript | jtfl2008/my_pulgins | /js/tabs.js | UTF-8 | 852 | 2.5625 | 3 | [
"MIT"
] | permissive | // tab
;(function($) {
$.fn.tabs = function(options) {
return this.each(function(){
var defaults = {
event: "mouseenter",
timeout: 300
};
var opts = $.extend({}, defaults, options),
_this = $(this),
tab_meun = _this.... | true |
0414c9f43a407fbf1680579f01edad11ddeb684f | JavaScript | trivedi-vatsal/weather-app | /src/components/DayCard.js | UTF-8 | 830 | 2.546875 | 3 | [] | no_license | import React from "react";
const moment = require("moment");
const DayCard = ({ reading }) => {
let newDate = new Date();
const weekday = reading.dt * 1000;
newDate.setTime(weekday);
// const imgURL = `owf owf-${reading.weather[0].id} owf-5x`;
return (
<div>
<div className="day-card text-center">
... | true |
c91b3c797c7537a1c8489b74d4e7c7fd970e46e9 | JavaScript | nubobap2015/GBLVL2 | /public/lesson3/js/shop.js | UTF-8 | 1,529 | 3.265625 | 3 | [] | no_license | class List {
_items = []
preloading = false
constructor (CartInstane) {
this.fetchGoods()
.then(res => {
return res.json()
})
.then(data => {
this.preloading = false
const goods = data.data.map(item => {
return new GoodItem(item, CartInstane)
})
... | true |
2b3b1c09dc954f3eead885f280531ee0077d6bc1 | JavaScript | jsdelivrbot/WEB-4 | /Recursive_Functions.js | UTF-8 | 1,220 | 3.203125 | 3 | [] | no_license | function Each(fn, arr) {
arr = arr || this;
var length = arr.length;
return (function Each(index){
return (index < length) ?
(function(){
fn.call(arr, arr[index], index, arr);
Each(++index);
}()) : false;
}(0));
};
function sib(node, fn){if (node == null) {return;}
this.stack = typeof this.stack === "undefined... | true |
3998fc47812cce2b67e1f28bd98d5e82df9826e2 | JavaScript | andarilhoz/cleanCodeTalk | /test/personagem_test.js | UTF-8 | 2,367 | 2.625 | 3 | [] | no_license | define(function(require){
ctxTest = {
y: 0,
fillStyle: '',
fillRect: () => {},
stroke: () => {},
moveTo: () => {},
lineTo: () => {},
strokeStyle: '',
strokeRect: function(x,y,w,h) {
this.x = x
this.y = y
this.w = w
... | true |
2c379241189443914554b1e797c5c271b1b2dbf9 | JavaScript | Alan-Rowlands/LIT-Gallery | /litGallery K00221640 Dylon McCabe/build/web/js/nav.js | UTF-8 | 485 | 2.875 | 3 | [] | no_license | document.getElementById("menu").style.display ="none";
function mymenuFunction(){
var x = document.getElementById("menu");
if (x.style.display === "flex"){
x.style.display = "none";
}else{
x.style.display = "flex";
}
}
function returnmenuFunction(){
var x = document.getElementById("menu")... | true |
0861b1d85b1a221d54d7abdad97cb8f00e0803d8 | JavaScript | suvelocity/recoil-boilerplate | /src/Tests/changeRect.test.js | UTF-8 | 2,789 | 2.78125 | 3 | [] | no_license | const puppeteer = require("puppeteer");
let page;
let browser;
jest.setTimeout(30000);
describe("Edit rectangle", () => {
beforeEach(async () => {
//open a chromium browser
browser = await puppeteer.launch({ headless: true });
//open a new page within that browser
page = await browser.newPage();
await page.... | true |
bf5e1859253225407031cd0a42fe385f3526946a | JavaScript | danielassada/Aoki_chrome | /payload.js | UTF-8 | 200 | 2.59375 | 3 | [] | no_license | let target = document.getElementById('target');
var tmp = document.createElement("div");
tmp.appendChild(target);
let msg = tmp.innerHTML;
let obj = [];
obj.push(msg)
chrome.runtime.sendMessage(obj); | true |
148322c82b4309d8d2e897e6e67118d83de8b66e | JavaScript | blazejblazej/bitcoinDashboard | /script copy old api.js | UTF-8 | 8,591 | 3 | 3 | [] | no_license | $(document).ready(function () {
//Microsoft apple comparison chart
$.ajax({
url: "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=AAPL&interval=1min&apikey=J23GGW7WKB4QYO6T",
dataType: "json",
data: "{}",
success: function (data) {
//api sends data every minute only f... | true |
c43d3b9a46a1013319a59f1885450f5a19006867 | JavaScript | Nashaath/docs-is | /en/docs/assets/js/theme.js | UTF-8 | 2,861 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /*!
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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/l... | true |
5c4498864949b8e20d156598bda8ac870663ebd5 | JavaScript | nelsontky/let-it-go | /src/utils/utils.js | UTF-8 | 3,034 | 3.015625 | 3 | [
"MIT"
] | permissive | function latLonToMetres(lat1, lon1, lat2, lon2) {
if (lat1 === null || lat2 === null || lon1 === null || lon2 === null) {
return "Location not available"
}
const R = 6371000 // Radius of the earth in m
const dLat = (lat2 - lat1) * (Math.PI / 180)
const dLon = (lon2 - lon1) * (Math.PI / 180)
const a =
... | true |
8dff88c96f79e8645479b51da29593878210c31b | JavaScript | ektx/iServer | /bin/sendFile.js | UTF-8 | 1,820 | 2.53125 | 3 | [
"MIT"
] | permissive |
const fs = require('fs')
const mime = require('mime')
const statAsync = require('./statAsync')
const resDefHeader = require('./resDefHeader')
// mime.define({
// 'text/vue': ['vue', 'VUE']
// })
/**
* 发送文件功能
* @param {string} filePath 绝对文件地址
* @param {object} req 请求信息
* @param {object} res 返回信息
*/
module.ex... | true |
94a52973cd871686cfdb1b017d3d13aa1cd6874e | JavaScript | pbhanu1994/next-js-learning | /src/components/EventHandling.js | UTF-8 | 295 | 2.640625 | 3 | [] | no_license | import React, {useState} from 'react';
export default function EventHandling() {
const [count, setCount] = useState(0);
return(
<>
<h1>User has clicked {count} times</h1>
<button onClick={() => setCount(count + 1)}>Increment</button>
</>
)
} | true |
8a4a7cb97e31e78ecf927ef9d7e3015c36e2c706 | JavaScript | gaoxinxiao/makingWheels | /progress/server.js | UTF-8 | 734 | 2.515625 | 3 | [] | no_license | const http = require('http')
const fs = require('fs')
const server = http.createServer((req, res) => {
if (req.url === '/') {
res.writeHead(200, { 'Content-Type': 'text/html;charset=UTF-8' })
const html = fs.readFileSync('./index.html', 'utf-8')
res.end(html)
} else if (req.url === '... | true |
f98f6ee65b9bf9b71c50034080152f38917da365 | JavaScript | goiblas/generador-imagenes | /nieve/orbit.js | UTF-8 | 1,666 | 2.953125 | 3 | [] | no_license | var k = 5;
function Orbit(pos, r, n, k, direccion, parent) {
this.k = k;
this.pos = pos;
this.r = r;
this.parent = parent;
this.speed = function(){
if (direccion) {
return radians(pow(-this.k, n -1)) / resolution;
} else {
return radians(pow(this.k, n -1)) / ... | true |
54232763831d3124c5f97f1e1076918d011f5a85 | JavaScript | KarolGrydz/mySite | /src/js/utils/work.js | UTF-8 | 909 | 3.046875 | 3 | [] | no_license | //Creating Element ot put data in
export const createItem = ({ path, img, gitPath, title, technologies }) => {
const div = document.createElement('div');
const image = createImage(path, img);
const btnLight = createButton(path, null);
const btnDark = createButton(null, gitPath);
const noGithub = `<div class="... | true |
475f003d296bd3515c03c5a7dd9fb3a918653349 | JavaScript | kjart/BookApp_Api | /controllers/books.js | UTF-8 | 5,405 | 2.796875 | 3 | [] | no_license | const path = require('path');
const fs = require('fs');
const uuid = require('uuid');
const ErrorResponse = require('../utils/errorResponse');
// @desc Get all books
// @route Get /api/v1/books
// @access Public
exports.getBooks = (req, res, next) => {
//read all file from storage
fs.readFile(
... | true |
0b87f06c86ab6ef1ffbd406b11d05f011d264c45 | JavaScript | mattcllhn/jen-stack-cc | /public/scripts/jokes.js | UTF-8 | 893 | 3.078125 | 3 | [] | no_license | console.log('sourced');
$(function(){
console.log('jquery is working');
var displayArray=[];
//create a local array to get jokes
function ajaxCall(joke) {
$.ajax({
type:'POST',
url:'/',
data:joke,
success:function (data) {
console.log('in ajax call', data);
displayJokes();
for (... | true |
77cc36e95d2c7178bd13c2a83228b452fde4cc0b | JavaScript | yoga1234/new-profile | /assets/js/main.js | UTF-8 | 3,407 | 3.1875 | 3 | [] | no_license | // header element related
let headerElement = document.querySelector(".header-banner");
//creating element title for header
let h1Header = document.createElement("h1");
h1Header.innerHTML = headerData.headerTitle;
headerElement.appendChild(h1Header);
// creating element paragraph for header
let pParagraph = document.cr... | true |
891c6afdce245b9536b4042f7990f8f15ebbfea5 | JavaScript | AaronMacken/Pomotron-Singlepage | /public/js/stopwatch.js | UTF-8 | 4,855 | 3.453125 | 3 | [] | no_license |
// -------------------------- HTML element variables ------------------------------------ //
var radios = document.getElementsByName("radio"),
radioContainers = document.getElementsByClassName("container"),
display = document.querySelector("#timer__clock"),
start = document.querySelector(".start"),
pause = d... | true |
12000384cd7eb837f5ba8a55b1710eec62fc3733 | JavaScript | kelingm/functional-programming | /partial.js | UTF-8 | 946 | 3.53125 | 4 | [] | no_license |
/**
* 预设原始函数的一些参数来创建一个拥有更少参数的新函数
*/
// 使用 Function.prototype.bind 实现偏函数。(会改变this指向)
// const add1More = add3.bind(null, 2, 3)
// // 不改变 this 指向的方法
// function partial(fn) {
// var args = [].slice.call(arguments, 1);
// return function() {
// var newArgs = args.concat([].slice.call(arguments));
// ... | true |
af9b2ec83dbafb8eecf4fa4d151222913111e8eb | JavaScript | McTaliesin/assignments | /FINALnwestVERSIONS/coinfullstackbakup/client/src/Components/Home/Home.js | UTF-8 | 2,175 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
import SearchResults from "../SearchResults/SearchResults"
import Form from "../Form/Form";
import "./styles.css";
const CoinmktcapAPI = "https://api.coinmarketcap.com/v1/ticker/"
//const CoinmktcapAPI = "https://api.coinmarketcap.com/v2/global/?conv... | true |
c2625a89cd95a6c35307977d4ae847359d5e2c59 | JavaScript | mikeweissbluth/triviagame | /assets/javascript/main.js | UTF-8 | 4,604 | 3.625 | 4 | [] | no_license | $(document).ready (function(){
//click start button will start the game
$('.js-start').on('click', function(){
//execute instructions
setUpGame();
timer();
});
//global variables
//questions data
let questions = [
{
"question": "'Newfie' is the a... | true |
19f72d6d5387485c8315d95e6022d9c89c34c3ad | JavaScript | WebDollar/Node-WebDollar | /src/common/blockchain/global/difficulty/Blockchain-Difficulty.js | UTF-8 | 7,767 | 2.84375 | 3 | [
"MIT"
] | permissive | import consts from 'consts/const_global';
import BlockchainGenesis from 'common/blockchain/global/Blockchain-Genesis';
let BigNumber = require ('bignumber.js');
class BlockchainDifficulty{
static async getDifficulty(getDifficultyCallback, getTimeStampCallback, blockTimestamp, blockNumber){
// difficult... | true |
c189c5eefdad592b5d8a69065092c257d261a72c | JavaScript | Chambrse/CLI_Hangman | /letter.js | UTF-8 | 849 | 4.25 | 4 | [] | no_license |
// Letter constructor
function Letter (letter) {
// Store the letter string
this.letter = letter;
// Has this letter been guessed correctly?
this.isGuessed = false;
// If the letter has been guessed, return the letter. Otherwise, return an underscore.
this.charReturn = function () {
if... | true |
84759995f3633cb4ed5704c05d431ed2c29c3bcd | JavaScript | alicehan1734/React-Project-_-tester | /src/app.jsx | UTF-8 | 1,862 | 2.875 | 3 | [] | no_license | import React, { Component } from "react";
import Habits from "./components/habits";
import "./app.css";
import Header from "./components/header";
class App extends Component {
state = {
habits: [
{ id: 1, name: "Reading", count: 0 },
{ id: 2, name: "Running", count: 0 },
{ id: 3, name: "Coding"... | true |
bcc2576e68f20157b5970861c53bf7e2a1e7bb08 | JavaScript | sejalp7/javascript-code-challenges | /js-concepts/longestnonrepeatingSubstrin.js | UTF-8 | 1,062 | 4.15625 | 4 | [] | no_license | // Longest Substring Without Repeating Characters
var lengthOfLongestSubstring = function (s) {
if (!!!s.length || typeof s !== 'string') return 0;
if (s.length == 1) return 1;
``
let hashTable = {};
let longestSubstringLength = 0;
let length = s.length;
let start = 0;
//convert our strings to an ar... | true |
b0e538d45b84334333d800e33cc12ebab498c854 | JavaScript | cerebrl/take-home | /_public/dev/js/main.js | UTF-8 | 11,250 | 2.640625 | 3 | [] | no_license | /*! take-home | Version: 0.0.1 | Concatenated on 2014-01-26 */
// Global controller for client-side behaior.
// This is not route specific, and mostly
// controls the animation direction.
angular.module('TH').
controller('ctrlrGlobal', [
'$rootScope', '$scope',
function ($rootScope, $scope) {
'use str... | true |
2620f56064a9b190ef9afb5e14674bfb8c093a90 | JavaScript | antoniocanaveral/galapagos | /siicgg_web/src/main/webapp/js/sync.js | UTF-8 | 3,252 | 2.875 | 3 | [] | no_license | /*Function que se carga al iniciar el sitio web*/
function loadSync(){
loadFecha();
/**
* Manejador de evento click boton btnRequirimiento.
*/
$('btnRequerimiento').observe('click',function(inEvent){
$('divRequerimiento').removeClassName('testIcon');
$('divRequerimiento').addClassNa... | true |
80084313dcd27af38eb70c0f6c9019b19ba90c19 | JavaScript | henry-thomas/nodejs-practice | /dbops.js | UTF-8 | 880 | 2.71875 | 3 | [] | no_license | const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/nodepractice')
.then(console.log('connected to mongodb'))
.catch(err => console.log('could not connect to mongodb...!'));
const deviceSchema = mongoose.Schema({
serialNumber: String,
deviceName: String,
deviceType: String,
... | true |
f60f48df36ebf71088ef3b60ff9a510c7996f5e9 | JavaScript | loki-tailor/tutorials | /cypress_web_ui_javascript_path/js/cds-demo.js | UTF-8 | 233 | 2.6875 | 3 | [] | no_license | let btn_toggle = document.querySelectorAll('ul.todo-list input.toggle')
let shouldToggle = false;
for (let i = 0; i < btn_toggle.length; i++) {
if (shouldToggle)
btn_toggle[i].click();
shouldToggle = !shouldToggle;
}
| true |
51f5ca8bad875e1698dbe6624d5caf79f57168c8 | JavaScript | thirtyaughtsix/make-me-a-sandwich | /extras/xhr/xhr.js | UTF-8 | 2,980 | 2.75 | 3 | [
"MIT"
] | permissive | // ###getXhr
// While getting a new XMLHttpRequest is standardized now, we are still going
// to provide this syntactic sugar to allow the setting of global headers (will
// be set on each request) as well as the onload, onerrer, and onloadend callbacks
// to be set with one call.
// Does not have a default for params... | true |
6e766a0bcfdffd8a42774861c840885c17f44db4 | JavaScript | mwanduka/triangle-tracker | /js/scripts.js | UTF-8 | 885 | 3.28125 | 3 | [] | no_license | function triangles(){
var side1 = parseFloat(document.getElementById('side1').value);
var side2 = parseFloat(document.getElementById('side2').value);
var side3 = parseFloat(document.getElementById('side3').value);
// var side1side2 = side1 + side2;
// var side1side3 = side1 + side3;
// var side2side3 = side2 + side3;... | true |
6f34f9493f6727274360d7f8ed00075971c65f1a | JavaScript | AntouanK/cabbie | /src/js/app/map.js | UTF-8 | 7,495 | 3 | 3 | [] | no_license | (function() {
'use strict';
//
// our 'map' business logic
// functions to handle the route and
// filtering out any potential 'error' points
//
// store here the google distance service
var DistanceMatrixService;
var DEFAULT_ERROR_MARGIN = 3;
var DEFAULT_SPEED_VALUE = 20;
// make a google maps point
var poin... | true |
d9519b514372ea841877f5bc56a027e08b7de866 | JavaScript | drgorah/AK | /Algorithm/Equal.js | UTF-8 | 664 | 2.8125 | 3 | [
"BSL-1.0"
] | permissive | //AK/Algorithm/Equal.js
//Copyright Richard Harris 2017.
//Distributed under the Boost Software License, Version 1.0.
//(See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//Use of this code for anything other than illustrative purposes is discouraged.
"use strict";
(function() {... | true |
20952183803ba0330b97354adbecd6022833417e | JavaScript | hminah0215/Node-study | /nodebird-api/routes/middlewares.js | UTF-8 | 1,470 | 2.859375 | 3 | [] | no_license | // jsonwebtoken 패키지 사용
const jwt = require("jsonwebtoken");
// 로그인 여부를 파악한다.
exports.isLoggedIn = (req, res, next) => {
//
// req객체에 isAuthenticated 메서드를 추가, 로그인 중이면 true!
if (req.isAuthenticated()) {
next();
} else {
res.status(403).send("로그인 필요");
}
};
exports.isNotLoggedIn = (req, res, next) => {... | true |
813b366d36a9084a731c24916da524b0961726c9 | JavaScript | pamcy/50Websites | /38-madegentle-website/src/js/scroll.js | UTF-8 | 669 | 2.578125 | 3 | [] | no_license | const topBtn = $('.to-top-btn');
function toggleBtn() {
const $this = $(this);
const topHeight = 300;
const opacityHeight = 1200;
if ($this.scrollTop() > topHeight) {
topBtn.addClass('is-visible');
} else {
topBtn.removeClass('is-visible is-fadeout');
}
if ($this.scrollTop... | true |
a035790aedf85ec8709d953324182099bf56bf42 | JavaScript | Bachbx/Bachbx2502 | /caudo2.js | UTF-8 | 685 | 3.25 | 3 | [] | no_license | console.log("Con nhện có mấy chân");
console.log("1. 10 chân");
console.log("2. 4 chân");
console.log("3. 6 chân");
console.log("4. Không có chân nào");
var answer = prompt("Câu trả lời của bạn:");
if (answer === "1"){
console.log("Bạn nên đi viện tâm thần!!!");
}
else if (answer === "2"){
conso... | true |
c7830aa11dbe3312ebf87c2568a0a2a96080dcf3 | JavaScript | willsims14/Acme-Explosions | /javascripts/main.js | UTF-8 | 711 | 3.03125 | 3 | [] | no_license |
"use strict";
$("#userCategory").change(loadCategory);
// Hide sub header on load
$("#subheader").hide();
// Get variable for output div
var output = $("#product-container");
// Global variables
var categoryID;
var typeIDs = [];
var finalProducts = [];
// When user changes categories, it sets off the chain of eve... | true |
b9fe76d698f5669f5f9640bec69a1f84d8948956 | JavaScript | salemshah/redux | /src/Redux/CounterReducer.js | UTF-8 | 667 | 2.6875 | 3 | [] | no_license | import {INCREASE, DECREASE, RESET} from "./Redux-Actions/Action"
const defaultValue = {
count: 0,
name: "Salem",
message: false,
}
export default function reducer(state = defaultValue, action) {
switch (action.type) {
case INCREASE:
return {...state, count: state.count + 1, message... | true |
7461cc14ac9a7682af6ee7ee7a7e2f307492773b | JavaScript | FinalFoods/mlab100app | /utils/blueFiService.js | UTF-8 | 2,565 | 2.609375 | 3 | [
"MIT"
] | permissive | import BleManager from 'react-native-ble-manager';
export default class blueFiService {
constructor(bleManagerEmitter) {
this.bleManagerEmitter = bleManagerEmitter;
bleManagerEmitter.addListener('BleManagerConnectPeripheral', this.handleDeviceConnect);
this.devices = new Map();
this.service = 'ffff... | true |
5e5bb5ed482ca4632183f3c326afdffd4b8f1ba2 | JavaScript | Sami-ith/React-Laboration-1 | /src/Question.js | UTF-8 | 836 | 2.8125 | 3 | [] | no_license | import React from "react";
import { useState } from "react";
import './Question.css'
function Question(props) {
const [isActive,setisActtive]=useState(false)
let allAnswer = [];
function checkAnswer(userAnswer) {
setisActtive(true)
props.onChange(userAnswer)
}
props.answers.... | true |
3abfe4c14bc752d8e02543fa33b0d40dd31a3aaa | JavaScript | mulhollen/grunt-starter | /js/main.js | UTF-8 | 166 | 2.6875 | 3 | [] | no_license | "use strict";
var gettingStarted = true;
console.log("getting started", gettingStarted);
console.log("hey gurl hey");
var thisIsGREAT = true;
thisIsGREAT = false; | true |
37217fe6763eb5ad08d377f435cc4dfbbd6fa6d7 | JavaScript | linjulong/web-learn | /包装对象.js | UTF-8 | 471 | 4.21875 | 4 | [] | no_license | let a = 1
Number.prototype.plus = function (num) {
return this + num
return this.valueOf() + num
}
Number.prototype.mins = function (num) {
return this.valueOf() - num
}
// Number.prototype.plus = function (num) {
// let number = new Number(this)
// number += num
// return number
// }
// Numb... | true |
e43c77a958585b9e756d217dd838e1ddcaae3249 | JavaScript | danilpanshin/TestGuru | /app/assets/javascripts/utilities/timer.js | UTF-8 | 598 | 2.984375 | 3 | [] | no_license | document.addEventListener('turbolinks:load', function() {
let timer = document.getElementById('timer')
if (timer) { changeTimer(timer) }
})
function changeTimer(timer) {
let testCreated = timer.dataset.testCreated,
timeTest = timer.dataset.timeTest,
timeNow = (Date.now() / 1000).toFixed(),
... | true |
857b542eaf2bc1bd884c525253358832ab4413dc | JavaScript | poluektik/Dots | /src/main/webapp/resources/scripts/game.js | UTF-8 | 9,035 | 2.625 | 3 | [] | no_license | function Game(settings, state){
var self = this;
//board params
var offset = 30;
var distance = 20;
var boardLayer = null;
var board = [];
var boardColor = "grey";
var stage = null;
//game params
var m_state = 'waiting';
var m_gameId = '';
var m_players = {};
var m_activePlayer = null;
var m_me = null... | true |
5b8d19866b7313fdecb538e407b1af3913b62a82 | JavaScript | Code-7-Classroom/weeklychallenges2020-mai-sam | /JavaScript Week 1 Challenges/JavaScript - Easy /script.js | UTF-8 | 126 | 2.953125 | 3 | [] | no_license | var name1 = 'John'
var name2 = 'Patrick'
console.log(name2 + '\'s name is longer than ' + name1 + '\'s by three letters.');
| true |
4874ef709c227b3321404c245478d14d15ea84b1 | JavaScript | HuyckS/Algos | /Sorts/Radix_Sort.js | UTF-8 | 1,710 | 4.46875 | 4 | [] | no_license | // Radix Sort
// For integers -- it will look at each digit in a number
// starting at the farthest right (the one's place) moving left and group the
// integers in "buckets" to sort.
// Build a helper function to find the digit place and a function to get the digit count
// and a function to find the most digits
func... | true |
54acebee7b5d899e551136f0fb7080e0fe98681f | JavaScript | dimitar1024/Software-University | /Level #1/03. JavaScript/03. Loops, Arrays, Strings/Problems/20. DoubleRakiyaNumbers.js | UTF-8 | 1,282 | 3.421875 | 3 | [] | no_license | function doubleRakiyaNumbers(arr) {
var start = Number(arr[0]);
var end = Number(arr[1]);
var isRakia = false;
var result = "<ul>" + "\n";
for (var i = start; i <= end; i++) {
var number = i;
function isTwice(number) {
var output = [];
while (number) {
... | true |
5e784495331ba3b9ac5937cc694da6a785e16bd2 | JavaScript | mustafaagca/AI | /templates/Skill-Template/src/typescript/generator-botbuilder-skill/generators/app/index.js | UTF-8 | 18,391 | 2.734375 | 3 | [
"MIT",
"LicenseRef-scancode-generic-cla"
] | permissive | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
"use strict";
const Generator = require("yeoman-generator");
const chalk = require("chalk");
const path = require("path");
const pkg = require("../../package.json");
const _pick = require("lodash/pick");
const _camelCase = ... | true |
5297d7a54cfe43f263e8205661be4054abefb649 | JavaScript | mlaga97/dagger-redux | /src/components/Assessments/Assessment/utilities/chunkify.js | UTF-8 | 554 | 2.828125 | 3 | [
"MIT"
] | permissive | import areFriends from './areFriends';
function chunkify(types, questions) {
const chunks = [];
let currentType = questions[0].type;
let currentChunk = [];
questions.forEach((question) => {
if (areFriends(types, currentType, question.type)) {
currentChunk.push(question);
} else {
chunks.p... | true |
48b512b73632bc07727b1a6cee615411f6b671db | JavaScript | quasare/devsource-frontend | /src/Reducers/comments.js | UTF-8 | 632 | 2.65625 | 3 | [] | no_license | import { LOAD_COMMENT, POST_COMMENT, REMOVE_COMMENT } from "../Actions/types";
const INITIAL_STATE = {};
function comments(state = INITIAL_STATE, action) {
let c = state['comments']
switch (action.type) {
case LOAD_COMMENT:
return {
...state, ...action.payload
};
cas... | true |
ec86d4494e1ca36e89633cfc448489217b88268f | JavaScript | h22ju/Javascript | /test8.js | UTF-8 | 246 | 3.0625 | 3 | [] | no_license | var color = ["white", "yellow", "aqua", "purple"];
var i = 0;
function changeColor() {
i++;
if (i >= color.length) {
i = 0;
}
var bodyTag = document.getElementById("theBody");
bodyTag.style.backgroundColor = color[i];
}
| true |
8e5c66caecadbbe75ad922ed1fca479804591bc2 | JavaScript | dave-vsdevs/social-security-tools | /src/spousal-chart.mjs | UTF-8 | 33,087 | 2.71875 | 3 | [
"MIT"
] | permissive | import * as utils from './utils.mjs';
/**
* Code for driving a chart displaying spousal benefits.
* @constructor
*/
function SpousalChart(selectedDateCb) {
this.updateSelectedDate = selectedDateCb;
this.canvas_ = null;
// recipientA/B are references to the passed in recipients from the
// setRecipients call... | true |
fc1ea1a7aa6351a3e387f9433c7a3d038d92da18 | JavaScript | PDXCodeGuildJan/AndreaCGPDX | /price_list/pricing_1.js | UTF-8 | 5,256 | 3.546875 | 4 | [] | no_license | // Establish the event listener for when they click an item
// Add the click event handler to the "add-item" button
var addItemButton = document.getElementById("add-item");
addItemButton.onclick = addItem;
var addStockButton = document.getElementById("add-stock");
addStockButton.onclick = addStock;
var removeStockBut... | true |
91cca8b919654c10851520cf3e0e793ddb64767b | JavaScript | youjinchoi/test_youjinchoi | /src/loc/PresIn.js | UTF-8 | 2,380 | 2.78125 | 3 | [
"MIT"
] | permissive | import React, { Component } from 'react';
import Select from 'react-select';
import 'react-select/dist/react-select.css';
/*
* First Presentation component [named: PresIn] should contain a textarea that will
* update a localstorage field ‘stored_value’, and a multiselect that will have options
* [one, two, three, four... | true |
9c29eba1d16b9c90ce8fd2c8d91e73af0c54bc7d | JavaScript | hbretdhsp/doantt | /js/Cart.js | UTF-8 | 6,848 | 2.796875 | 3 | [] | no_license | var count = 0;
function listCart() {
var currentUser
if (localStorage.getItem("currentUser") != null) {
currentUser = JSON.parse(localStorage.getItem("currentUser"));
}
if(currentUser != null){
if (localStorage.getItem("cart") != null) {
cart = JSON.parse(localStorage.getItem("... | true |
6ed5df1ce211de60233d7ec8076f188962f46aab | JavaScript | jens3cakes/knex-shopping | /routes/products.js | UTF-8 | 992 | 2.546875 | 3 | [] | no_license | const express = require('express');
const app = express();
const router = express.Router();
const db = require('../db/knex');
router.get('/', (req, res)=> {
db.raw('SELECT * FROM products')
.then((products) => {
console.log(products);
res.json(products.rows);
})
.catch((err)=>{
console.error('Product n... | true |
6c7dcc96ab71a50679c810549adf3044eb5595b0 | JavaScript | nokia-wroclaw/innovativeproject-reservation-system | /Frontend/src/Components/ReservationForm/ReservationPage.js | UTF-8 | 1,997 | 2.53125 | 3 | [
"MIT"
] | permissive | import React ,{Component} from 'react'
import ReservationForm2 from './ReservationForm'
import axios from 'axios';
import Dnd from './Calendar';
class ReservationPage extends Component {
constructor(props){
super(props);
this.state = {
data:[],
isDialogOpen: false,
}
}
loadReservationFro... | true |
d55ff54d8e9e42ccd26f69def6d4e0be5010e74e | JavaScript | mateo951/js_capstone_m2 | /src/modules/retrieveData.js | UTF-8 | 305 | 2.59375 | 3 | [
"MIT"
] | permissive | import displayData from './displayData.js';
const retrieveData = async (api) => {
await fetch(api, {
method: 'GET',
})
.then((response) => response.json())
.then((result) => {
displayData(result);
}).catch((error) => {
throw error;
});
};
export default retrieveData; | true |
2fcadfb1031ccfe18ee796428e8f44c1c5097fe4 | JavaScript | rodrigor123/sample_chrome_extension | /sample_ext/js/popup.js | UTF-8 | 2,319 | 2.640625 | 3 | [] | no_license | // Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* Get the current URL.
*
* @param {function(string)} callback called when the URL of the current tab
* is found.
*/
function getCurrentTabU... | true |
c136cdbe8a2b7df6b7456b109a0fc47093bbdfff | JavaScript | terraroush/Talking-In-Code-the-daily-journal-of-Terra-Roush | /scripts/JournalEntryForm.js | UTF-8 | 2,249 | 3.1875 | 3 | [] | no_license | import { saveEntry } from "./JournalDataProvider.js";
import { getMoods, useMoods } from "./MoodProvider.js";
const eventHub = document.querySelector(".container");
// listen for the submit button: if it's clicked, make a "new entry" from the field values, and store them in a variable. Clear the form/re-render the fo... | true |
1a7a79aa1397e40df5ba3ae45b871541499895c9 | JavaScript | tehong/Network-Performance-App | /src/utils/getThreshold.js | UTF-8 | 2,019 | 2.75 | 3 | [] | no_license | /**
* The examples provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
... | true |
861ad1b6190430424995cbd7a9706cdcb534ac1c | JavaScript | whqkdhfh13/sswp | /js/cs20projects/brick breaker/sketch.js | UTF-8 | 11,054 | 2.859375 | 3 | [] | no_license | var bricks; // bricks[x][y] = life of that brick; my game has [x|0~6], [y|0~9].
var currentStage; // Number that will insert to brick after stageReset
var stageReset = 1; // Switch to reset stage, will be subtracted after Reset has done and will be added after all balls are come back
var incNum = 2, incSpeed = 1.2; // ... | true |
50d89a025077a70fdc098c658beb14783bb3eff5 | JavaScript | sjpoot/opdracht_38_password_verifier | /passwordverifier.js | UTF-8 | 1,805 | 3.65625 | 4 | [] | no_license | // Utility functions
const isNotNull = (str) => {
str = "bas"
return str != null;
}
const hasRightLength = (str) => {
str = "ikheetbas"
return str.length <= 9;
}
const hasUpperCaseCharacter = (str) => {
str = "ikheetBas"
let upperCaseCheck = false;
const letters = /^[A-Za-z]+$/;
Array... | true |
a0f6249edb30995d4e0271186d770eed0f0b02c2 | JavaScript | brennanclark/tweeter | /public/scripts/app.js | UTF-8 | 5,085 | 3.265625 | 3 | [] | no_license | $(document).ready(function() {
//--------------------------Utility Functions----------------------------------
//converts the unix time to the elapsed time between the present
//and the time the post was made
function formatDate(unixTime) {
return moment(unixTime).fromNow();
};
//Factry function that accepts an... | true |
8799bd4e753bebecb565138fffb2a1350a7ce28b | JavaScript | salesforce/lwc | /packages/@lwc/integration-karma/test/shadow-dom/Node-properties/Node.contains.spec.js | UTF-8 | 4,890 | 2.609375 | 3 | [
"MIT"
] | permissive | import { createElement } from 'lwc';
import Slotted from 'x/slotted';
import Test from 'x/test';
describe('Node.contains', () => {
it('should return the right value for node outside the shadow tree', () => {
const div = document.createElement('div');
document.body.appendChild(div);
const ... | true |
e2dcafec4cbd5a48fca79d5fce4eada55c2d9906 | JavaScript | thawaitnam/pom.protractor.xyz | /pom.protractor.xyz/src/com/protractor/pages/CustomersPage.js | UTF-8 | 473 | 2.59375 | 3 | [] | no_license | var Customers=function(){
var searchCust=element(by.model('searchCustomer'));
var deleteCust=element(by.partialButtonText('Delete'));
this.enterCustName=function(custNameValue){
searchCust.sendKeys(custNameValue);
return this;
}
this.deleteCustomer=function(){
deleteCust.click();
}
this... | true |
b9d0dbc86e684cf23514f1a642058ac9836beafd | JavaScript | fredWills224/first-app | /lib/handlers.js | UTF-8 | 80,514 | 2.734375 | 3 | [] | no_license | /*
* Request handlers
*
*/
// Dependencies
var _data = require('./data');
var helpers = require('./helpers');
var config = require('./config');
// Dependencies
// Define [handlers]
var handlers = {};
// [users] handler
handlers.users = function(data, callback){
// call func... | true |