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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c7bcabc1d4789d20672cd22d03bf0d87ca67878e | JavaScript | kojun0401/self-introduction | /function-Time-from-birth.js | UTF-8 | 576 | 3.484375 | 3 | [] | no_license | (function(){
'use strict';
var myBirthTime = new Date(1995, 3, 1, 23, 30);
function updateParagraph(){
var now = new Date();
var seconds = (now.getTime() - myBirthTime.getTime())/1000;
var days = (now.getTime() - myBirthTime.getTime())/(1000*24*60*60);
document.getElementById... | true |
8fc9752fa85d0a9128a12430ff8f020bf908f4de | JavaScript | chollid/warswithcode | /ShortesWork_K7.js | UTF-8 | 340 | 4.34375 | 4 | [] | no_license | // Simple, given a string of words, return the length of the shortest word(s).
// String will never be empty and you do not need to account for different data types.
function findShort(s) {
let arr = s.split(" ");
const shorter = (left, right) => (left.length <= right.length ? left : right);
return arr.reduce... | true |
edfe61fa9996391d7026933cc43d9c0d6ab3c0bb | JavaScript | PDOK/pdokkaart | /v1.0/js/Geozet/Format/XLSLUS.js | UTF-8 | 5,497 | 2.59375 | 3 | [] | no_license | /**
* Copyright (c) 2010 PDOK
*
* Published under the Open Source GPL 3.0 license.
* http://www.gnu.org/licenses/gpl.html
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. S... | true |
9432a356374fd250119a7709d0a740cd8be4e2a6 | JavaScript | Dxxxxxxww/blog | /docs/js/javascript/code/cloneDeep.js | UTF-8 | 757 | 3.421875 | 3 | [
"MIT"
] | permissive | function cloneDeep(data, map = new WeakMap()) {
if (!data) return
let cloneData
// 解决循环引用
if (map.get(data)) {
return data
}
map.set(data, true)
if (typeof data === 'object') {
if (Array.isArray(data)) {
cloneData = []
data.forEach((item, index) => {
cloneData[index] = cloneDee... | true |
c8fdf16cd073a37f4103baa7594ae85f16492f3f | JavaScript | craygoza/react | /src/Book.js | UTF-8 | 2,177 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react';
class Book extends Component {
render(){
var { book, currentBookCategory, moveBookStatus } = this.props
var bookClassifications = [
{
name:'none',
description:'None'
},
{
n... | true |
6e75cfc1830a6740ad45f09e7d372516b9dd480b | JavaScript | thallosaurus/emu2 | /lib/Compiler.js | UTF-8 | 1,333 | 2.671875 | 3 | [] | no_license | // let emu = require("./Interpreter");
let opcodes = require("./OpcodeTable");
let fs = require("fs");
function removeComments(prg) {
let file = prg.replaceAll("\r", "");
let g = file.split("\n");
g = g.map((e) => {
let commIndex = e.indexOf(";");
if ( commIndex !== -1 ) {
... | true |
f87775510c43f3d9b0c6f195a06893e67cbae1a3 | JavaScript | jschmidtnj/Oswald | /src/events/index.js | UTF-8 | 2,469 | 2.8125 | 3 | [] | no_license | const https = require('https');
const fs = require('fs');
var google = require('googleapis');
const authorize = require('./authorize');
const events = require('./events');
//Google api links for practice and tournament calendars
const practiceURL = "9h5c4p0859pr36q7h3s8j6qges@group.calendar.google.com";
const tourname... | true |
945eebbcd1e01288fef0f5be2216127c788f6446 | JavaScript | XiaoFanZhou-code/Shopping-WeChat-applet | /pages/goods_details/goods_details.js | UTF-8 | 3,813 | 2.671875 | 3 | [] | no_license | // pages/goods_details/goods_details.js
import { getGoodsDetials } from "../../service/detail";
Page({
/**
* 页面的初始数据
*/
data: {
goodsObj: {},
bottom_info: {},
// 商品是否被收藏过
isCollect: false,
},
// 商品对象数组
GoodsInfo: {},
onShow() {
let pages = getCu... | true |
90e2fbfb334c0ce223be6c9336998ee957a22153 | JavaScript | Ricool06/JSWeather | /js/smoothScroll.js | UTF-8 | 548 | 2.984375 | 3 | [] | no_license | window.addEventListener("wheel", openControl);
var deltaY = 0;
var currentY = 0;
var increment = 0;
var scrollInterval;
function openControl(e){
clearInterval(scrollInterval);
e.preventDefault();
deltaY = e.deltaY;
increment = deltaY / 20;
scrollInterval = setInterval(smooth, 16);
}
function smoo... | true |
f84abc3be110ac6e03760477698796ba462b7635 | JavaScript | dzarling1/dzarling1.github.io | /script.js | UTF-8 | 1,215 | 2.90625 | 3 | [] | no_license | var page_load = function() {
console.log("Page loaded");
var xmlhttp = new XMLHttpRequest();
var url = "index.json";
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log("JSON loaded");
console.log(this.responseT... | true |
bc46cc6185d8f065cdab753113d7c07257fa93d0 | JavaScript | apaschenko/pxCore | /examples/pxScene2d/src/rcvrcore/utils/WrapObj.js | UTF-8 | 745 | 2.6875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-other-permissive"
] | permissive | module.exports = function (orig, override) {
var wrapper = {};
for (var prop in orig) {
(function(prop) {
if (override && override.hasOwnProperty(prop)) {
wrapper[prop] = override[prop];
} else if (typeof(orig[prop]) === 'function') {
wrapper[prop] = function () {
return or... | true |
095a3fc9a383cbc6fa712cd26a9d8c1992dd6596 | JavaScript | Deadbullfrog05/GuessingGame | /Desktop/GuessingGame/myscripts.js | UTF-8 | 2,164 | 3.1875 | 3 | [] | no_license |
let x=Math.floor((Math.random()*100)+1);
let opmsg=document.getElementById('message');
let lowhi=document.getElementById('lowhigh');
let guesses=document.getElementById('guesses');
let sub=document.getElementById('any');
let input=document.getElementById('quantity');
let guesscnt=1;
... | true |
c4695f9fb4de69229aba82ad923238ebb1a7621c | JavaScript | SerogaHumenchuk/JS-1-2 | /mpdule-9/lesson-time/script.js | UTF-8 | 3,017 | 3.234375 | 3 | [] | no_license | // const time = document.querySelector('.time');
// const start = document.querySelector('.start');
// const stop = document.querySelector('.stop');
///////////////////////////////погано//////////////////////
// let counter = 0;
// let timerid = null;
// let isActive = false;
// start.addEventListener('click', handle... | true |
491bf6409c0e91f1d0bbee0ba702be6e2068338c | JavaScript | MJ8506/Handwriting | /app.js | UTF-8 | 697 | 2.96875 | 3 | [] | no_license | function handwriting(){
let handwriting = document.getElementById('HandWriting').value;
console.log(handwriting)
if(handwriting == "HMA") {
document.getElementById('page').style.fontFamily ="Homemade Apple"
}
if(handwriting == "TGE") {
document.getElementById('page').style.font... | true |
eb41d536570ed4da6382813ab88c119ff6c1867e | JavaScript | docmarionum1/mtg-html-decklist-generator | /lib/inlinetooltip.1.0.js | UTF-8 | 12,791 | 2.953125 | 3 | [
"WTFPL"
] | permissive | /*!
Simple Inline Tooltips v1.0
http://www.infinitegyre.com/2014/03/simple-inline-tooltips.html
Copyright (c) 2014 Nickolas Reynolds
Released under the MIT license
Based on Footnotes by Lukas Mathis
http://ignorethecode.net/blog/2010/04/20/footnotes/
*/
/*
DESCRIPTION
This sc... | true |
f617bd838173cd224a6a0b6a05ceec7a3952ff72 | JavaScript | misterigl/HRprojects | /chatterbox-server/server/request-handler.js | UTF-8 | 3,997 | 2.890625 | 3 | [] | no_license | var fs = require('fs');
var path = require("path");
var url = require("url");
/*************************************************************
You should implement your request handler function in this file.
requestHandler is already getting passed to http.createServer()
in basic-server.js, but it won't work as is.
Yo... | true |
2e3d60c4fc26f6d9f31880e76c4a86daef4c4193 | JavaScript | jesuscuesta/Backbone | /04.- Routers/02.- Dinamico/hello.js | UTF-8 | 571 | 2.59375 | 3 | [
"MIT"
] | permissive | var AppRouter = Backbone.Router.extend({
routes: {
"posts/:id": "getPost", // index.html#posts/3
"*actions": "defaultRoute" // Backbone will try match the route above first
}
});
// Instantiate the router
var app_router = new AppRouter;
app_router.on('route:getPost', function (id) {
// Note the variable in the... | true |
c720189d1c19957bdfa93fe757400456a82b3bbc | JavaScript | FbW-E01/pb-functions2-recursion2-moseqmoseg | /start.js | UTF-8 | 135 | 3 | 3 | [] | no_license | function reverse(string) {
return string ? reverse(string.substr(1)) + string[0] : string;
}
console.log(reverse("hello world")); | true |
e485eb5c72e917a72936105b9c58578a7baeb275 | JavaScript | sexyGuyKangSungWoo/ujs-examples | /youtube-downloader/index.js | UTF-8 | 5,198 | 2.578125 | 3 | [] | no_license |
const loading = document.getElementById("loading");
const main = document.getElementById("main");
const url = document.getElementById("url");
const download = document.getElementById("download");
const resultPath = document.getElementById("resultPath");
const client = new UJS.Client();
(async () => {
await clie... | true |
b733c33e6bccbeaa427561610d6cc5f5fc382f5f | JavaScript | wuYingZunZhe/ZN | /丰乐优选用户端/pages/cart/cart.js | UTF-8 | 8,634 | 2.609375 | 3 | [] | no_license | // pages/z_ce/new/new.js
Page({
/**
* 页面的初始数据
*/
/**
* 页面的初始数据
*/
data: {
adminShow: true,//编辑或完成
totalPrice: 0,//总金额
allselect: false,//是否全选
selectArr: [], //已选择的商品
cartData: [],
cartData_: [//测试数据
{
"id": 1,
"amount": 2,
"price": 50,
... | true |
d02357fe82c6a95d1e2f766bbd4e2e5b37815b74 | JavaScript | kukuu/JavaScript-game-on | /snake/src/index.js | UTF-8 | 740 | 2.625 | 3 | [] | no_license | import * as PIXI from 'pixi.js';
import * as PIXISound from 'pixi-sound';
window.PIXI = PIXI;
window.PIXISound = PIXISound;
window.window.PIXI.sound = PIXISound.default;
const snakeApplication = new window.PIXI.Application({
width: window.innerWidth,
height: window.innerHeight,
antialias: true,
transparent: f... | true |
ab3d52819629e0e0e4ac53f839c8db80c3821409 | JavaScript | coderturtle/budgeter | /app/app.js | UTF-8 | 14,728 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | // Module to handle all the data logic for the budget
var budgetController = (function() {
var Expense = function(id, description, value) {
this.id = id;
this.description = description;
this.value = value;
this.percentage = -1;
};
Expense.prototype.calculatePercent = functio... | true |
ac3369dedd364925abd1d39ebff44d6f8e6e9fbf | JavaScript | Frosty21/node-Todo | /server/seeds/todo.js | UTF-8 | 670 | 2.75 | 3 | [] | no_license | // title - text
// priority - integer 1, 2, 3
// description - text
// done - boolean
// date - datetime
exports.seed = function(knex, Promise) {
// Deletes ALL existing entries
return knex('todo').del()
// Inserts seed entries
.then(function () {
const todos = [{
title: 'build CRUD app',
... | true |
d8c5e35b0026a05324ed2b694dc461c74216408c | JavaScript | reinzor/gps-photo-game | /js/helpers.js | UTF-8 | 2,166 | 3.1875 | 3 | [] | no_license | Helpers = {
findWithAttr: function(array, attr, value) {
for(var i = 0; i < array.length; i += 1) {
if(array[i][attr] === value) {
return i;
}
}
},
getDistanceInMeter: function(lat1, lon1, lat2, lon2) {
var R = 6371000; // Radius of the earth in m... | true |
2e96f65881ca676286d78285ea8c6e049e54866c | JavaScript | yurikoex/orange-squeezer | /src/gdax/index.js | UTF-8 | 2,947 | 2.5625 | 3 | [] | no_license | 'use strict'
import fetch from 'node-fetch'
import crypto from 'crypto'
import _ from 'lodash'
const apiUrl = `https://api.gdax.com`
const methods = {
post: 'POST',
_get: 'GET'
}
const requestPaths = {
orders: '/orders',
accounts: '/accounts',
withdrawalsCrypto: '/withdrawals/crypto'
}
const trimFloat = float... | true |
cab59ef6184f79c8395b363f711cadffc3d749d6 | JavaScript | emersonvictor/jornada-devweb-2018 | /Aula 07/Código/scripts/loop.js | UTF-8 | 769 | 4 | 4 | [] | no_license | var musics = [
'Cry Baby',
'Listen',
'Bare',
'My song'
];
// FOR Loop
for (var i = 0; i < musics.length; i++) {
console.log(musics[i]);
}
for (var i = 0; i <= musics.length - 1; i++) {
console.log(musics[i]);
}
for (var i = 0; i < 10; i++) {
console.log(i);
}
for (var music of musics) {
... | true |
132e48a67f66e4f02d313544209cff808db7d162 | JavaScript | dcdholder/cowsay-idol | /frontend/animated-cowsay-frontend.js | UTF-8 | 864 | 3.296875 | 3 | [] | no_license | let frameTime = 2000;
let currentFrameIndex = 0;
let xhr = new XMLHttpRequest();
xhr.open('GET', apiUrl, true);
xhr.send();
xhr.addEventListener("readystatechange", startAnimationLoopHandler, false)
function startAnimationLoopHandler(e) {
if (xhr.readyState==4) {
startAnimationLoop(JSON.parse(xhr.responseText))... | true |
974c94a7e09f5f7ccea9800ec4a831359f5a7d57 | JavaScript | greenhy/Web_and_Mobile_Development | /my-app/my-app/src/App_week4.js | UTF-8 | 4,242 | 2.890625 | 3 | [] | no_license | import logo from './qut-logo-large.jpg';
import './App.css';
import React, {useState} from 'react';
import {useNewArticles} from './api';
//basic animals array
const animals=[
{
name:"Lion",
number:3,
eats:["Zebra","antelope","buffalo","hippoptamus"]
},
{
name:"Tiger",
number:5,
eats:["mo... | true |
6de21c8c421cb30c95cba7493009f42a19665c80 | JavaScript | gayathribuddhika/Mern_CRUD | /crudreact/src/components/create.js | UTF-8 | 2,494 | 2.59375 | 3 | [] | no_license | import React, {Component} from "react";
// import { Router } from "react-router";
class Create extends Component {
constructor(props) {
super(props)
this.onChangePersonName = this.onChangePersonName.bind(this);
this.onChangeBusinessName = this.onChangeBusinessName.bind(this);
... | true |
2e395d9570af3c477929e00cb5e6dcc8bcbcedf3 | JavaScript | dwsjax/web-platform-tests | /encrypted-media/util/utils.js | UTF-8 | 3,619 | 2.5625 | 3 | [] | no_license | function getInitData(initDataType) {
if (initDataType == 'cenc') {
return new Uint8Array([
0x00, 0x00, 0x00, 0x00, // size = 0
0x70, 0x73, 0x73, 0x68, // 'pssh'
0x01, // version = 1
0x00, 0x00, 0x00, // flags
0x10, 0x77, 0xEF, 0xEC, 0xC0, 0xB2, 0x4... | true |
0ab77f431097a559f19d6743b09d4f2f6e87a6fc | JavaScript | lucianovsjr/serviceScheduleMobile | /src/mixen/reqFormat.js | UTF-8 | 1,178 | 2.921875 | 3 | [] | no_license | import { parseISO, format, set } from 'date-fns';
import pt from 'date-fns/locale/pt';
export const dateFormat = (date, req = true, reqDate = false) => {
let returnDate = date;
if (typeof date === 'string') returnDate = parseISO(date);
if (returnDate.getFullYear() === 1969) return null;
if (reqDate) return ... | true |
755cac40728cf809d80d0b64f78d0f50bc0a5cc0 | JavaScript | rmorosoff/test_driven_dev_exercise | /tallest_mountain.js | UTF-8 | 195 | 2.53125 | 3 | [] | no_license | (function(){
function tallestMountain(mountainHeights) {
mountainHeights.sort(function(a, b){return b-a});
return (mountainHeights[0])
}
module.exports = tallestMountain;
})()
| true |
b5c9a18d31cb4e51dacfe65b4051146d787bdbad | JavaScript | mtaslagyan/Platt-Challenge | /src/components/SearchBar.js | UTF-8 | 1,995 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react'
import SearchIcon from '../images/ic/black/ic_search.png'
export class SearchBar extends Component {
state = {
auto : [],
list : [],
isLoaded : false
}
componentDidMount() {
fetch('https://restcountries.eu/rest/v2/all')
.... | true |
c1fe7c1e53599646e9a67b65efb9d2daf06f5783 | JavaScript | puru-vishnoi/check-profit-loss | /app.js | UTF-8 | 1,792 | 3.671875 | 4 | [] | no_license | const initial_val = document.getElementById("initial-value");
const stock_qty = document.getElementById("stock-quantity");
const curr_val = document.getElementById("current-value");
const check_btn = document.getElementById("btn");
const message = document.getElementById("message");
function calculate_profit_or_loss(i... | true |
832c29fa6a608f556f1ebaf0377ea8352879dac8 | JavaScript | arbyte-br/Arbyte-Atividades | /turma-2/rafahmarinho/Lista_9/ex1.js | UTF-8 | 484 | 4.09375 | 4 | [] | no_license | // (OBRIGATÓRIO) Faça uma programa que receba 4 notas e calcule a mediana e
// apresente ao usuário o resultado.
// Utilize o pacote : https://www.npmjs.com/package/median
let median = require('median')
let rs = require('readline-sync')
let arr = []
function notaDoUser (nota) {
for (i = 1; i <= 4; i++){
l... | true |
0344bceb0d1e714d74d86b3c2ed7ab25273b6469 | JavaScript | radovankavicky/Free-Code-Camp | /Front End/Simon Game/javascript.js | UTF-8 | 9,443 | 3.015625 | 3 | [] | no_license | $(document).ready(function() {
var powerOn = false;
var gameStarted = false;
var scoreCounter = 0;
var sequenceArr = [];
var userArr = [];
var buttons = ['redButton', 'yellowButton', 'greenButton', 'blueButton'];
var playerTurn = false;
var difficulty = [1150, 900, 750, 600];
var bonusGame = false;
var stric... | true |
9cf58c324fe3493d15b3dcb71cc90425be9907e1 | JavaScript | arittrosaha/CS_and_Algorithms | /fight_club_2018/JavaScript/jsQuerks.js | UTF-8 | 1,191 | 4.34375 | 4 | [] | no_license | // IFFE:
// Immediately Invoked Function Expression
(function () {
console.log("hi");
// your code
})();
// Hoisting:
sayHello1(); // # => hi
// this def is hoisted (pushed to the very top)
function sayHello1() {
console.log('hi');
}
sayHello2(); // # => undefined
// only declaration (var sayHello2) is hoist... | true |
54e17bf505b6aba00a30e04b5d0300bd5372fb60 | JavaScript | noob-master147/JavaScript | /01Basics/nullandBool.js | UTF-8 | 325 | 4.09375 | 4 | [] | no_license | //temp is coming from website API
var temp
//done some calculations
// temp = 2
// console.log("current temperature is " + temp)
//Grading system of school
//10 - Great job
//5 - work harder
//2 - poor
//0 - fail
//Boolean operation - True/False
let actualMarks = 7
let grade = (actualMarks < 10)
console.log(g... | true |
976ffb8be5db03beee332efcf15a4622487bb7e1 | JavaScript | DimiPetrov/Bills-For-Loops- | /Exam/examRetention.js | UTF-8 | 580 | 3.40625 | 3 | [] | no_license | function solve(input) {
let students = Number(input[0]);
let seasons = Number(input[1]);
let totalStudents = students;
for(i = 1; i <= seasons; i++) {
totalStudents -= Math.ceil(totalStudents * 0.9);
totalStudents -= Math.ceil(totalStudents * 0.9);
totalStudents -= Math.ceil(totalStu... | true |
4ff2acbeaa5c7a36bd53d51ec040e3ae08d333bb | JavaScript | vinzdef/self-attaching-components | /src/components/PositionComponent.js | UTF-8 | 369 | 2.609375 | 3 | [
"Unlicense"
] | permissive | class PositionComponent {
constructor() {
this.position = {x: 0, y: 0}
}
move(offsetVector) {
this.position.x - offsetVector.x
this.position.y - offsetVector.y
}
moveTo(positionVector) {
this.position = positionVector
}
}
PositionComponent.requiredProperty ... | true |
b602dd8a5fe1b6a64134239137d1177353716a6d | JavaScript | iiceman40/BabylonDev | /Maze/js/Classes/Message.js | UTF-8 | 96 | 2.515625 | 3 | [] | no_license | var Message = function (text, sound) {
this.text = text;
this.sound = sound;
return this;
}; | true |
f08785334054cc22ffcb5e20b07d9612c9a15d6e | JavaScript | Max-ASC/SecondPage | /script.js | UTF-8 | 645 | 3.140625 | 3 | [] | no_license | let boDy = document.querySelector("body")
let submitButton = document.querySelector("#submit-button")
let submitButton2 = document.querySelector("#submit-button2")
function randomColor(){
var newColor = "#" + (Math.random() * 0xFFFFFF << 0).toString(16);
return newColor;
}
submitButton.onclick = func... | true |
abc891b679e1f5ce7aefedeb854a8cd9ddb38cf0 | JavaScript | nameofname/random-scripts | /js/problems/leetcode/surroundedRegions.js | UTF-8 | 2,885 | 3.609375 | 4 | [] | no_license | // looks like it's faster to check from the boarder in
// if the 'O' group is part of the boarder then don't flip
function solve(board) {
const visited = {};
// from 'O' on the edge do DFS
// everything else gets flipped to 'X'
function _visit(y, x) {
const key = `${y}-${x}`;
if (
... | true |
33a5f4cdfbcd323e45e9cc7bf7af6ecfa95238f0 | JavaScript | mateoCordoba/curso_jQuery | /Ejercicios_jQuery/Ejercicio1/problema_propuesto/e1.js | UTF-8 | 381 | 3.078125 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$("#p1").click(function(){
$("#p2").css({
'color': 'blue'
});
});
});
/* para cambiar lo estilos por jquery debemos hacerlo de la siguiente manera
$('#p2').css({
'color': 'blue'
});
Separando por comas los diferentes estilos
y tanto el es... | true |
ae7f91f0ec04bc162e5f2b5cdb63499bdd82059c | JavaScript | pmilgov/tdd_recipes | /src/MyListApp.js | UTF-8 | 1,184 | 2.796875 | 3 | [] | no_license | import React from 'react';
class MyListApp extends React.Component {
state = {
myList: [],
}
componentDidMount() {
this.setState({
myList: [...this.state.myList, { id: 'b', firstName: 'Peggy', lastName: 'Milos' },
{ id: 'c', firstName: 'Fred', lastName: 'Flintston... | true |
a3d0e756dba3b13c1e540118836a0ab18c47b951 | JavaScript | hjyao/auto-parking | /test/Bus.js | UTF-8 | 2,898 | 2.75 | 3 | [] | no_license | var assert = require('assert');
var busInitializer = require('../src/bus-initializer');
describe('bus', function() {
it('should be able to report current state after initialization', function() {
const input1 = 'PLACE 0,0,NORTH\nREPORT';
const input2 = 'PLACE 1,2,SOUTH\nREPORT';
const bus1 = busInitializ... | true |
b4a853edd6e3d0c3c351592a1d658aa9151caa0f | JavaScript | TAYBI/BilalTaybi | /js/main.js | UTF-8 | 2,536 | 2.921875 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function() {
// Smooth scroll
(function() {
scrollTo();
})();
function scrollTo() {
const links = document.querySelectorAll(".scroll");
links.forEach(each => (each.onclick = scrollAnchors));
}
function scrollAnchors(e, respond = null) {
const d... | true |
d04f14519974a03b5352ba7b743e327214d17147 | JavaScript | IFightForTheUsers/STABusStopAPI | /functionality2.js | UTF-8 | 11,462 | 3.328125 | 3 | [] | no_license | /*
Svetlana Kozubenko & Steven Richmond
CSCD378 - Web Application Development
Team Project - Bus Stop API
*/
var BoardTime = new Date();
var BusRoute = "Calculating...";
var BusStopName = "";
// References to the selects for the routes and stops.
var select_routes;
var select_stops;
var DefaultRoute = ... | true |
8055774f961b1f13a6cdee92b03cb997316f22c5 | JavaScript | davie-robertson/UN-LOCODEnoSQL | /locodenosql.js | UTF-8 | 5,925 | 2.890625 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const _ = require('lodash');
const readLine = require('readline');
const EventEmitter = require('events');
const functionsList = [
'Function not known', // 0
'Port', // 1
'Rail Terminal', // 2
'Road Terminal', // 3
'Airpo... | true |
7402d3695b0e409af97113276df84ca4eb8f549d | JavaScript | hreintke/Controller.js | /source/lib/settings/buttonThreshold.js | UTF-8 | 422 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* buttonThreshold
* ---------------
* Specifies how far a button must be pressed to register as a "press".
*
* default: 0.95
* possible: 0.0 to 1.0
*
*/
Controller.globalSettings.register(new GC_Setting('buttonThreshold', 0.95, function(value) {
if (typeof value === 'number' && value >=0 && value <= 1)... | true |
de42ab47f68fe974972c6bf28cb6fe7ff34dbb8d | JavaScript | rwjblue/ember-composable-helpers | /tests/unit/helpers/pipe-test.js | UTF-8 | 1,544 | 2.75 | 3 | [
"MIT"
] | permissive | import Ember from 'ember';
import { pipe } from 'dummy/helpers/pipe';
import { module, test } from 'qunit';
import sinon from 'sinon';
const { RSVP: { resolve, reject }, K } = Ember;
let sandbox;
module('Unit | Helper | pipe', {
beforeEach() {
sandbox = sinon.sandbox.create();
},
afterEach() {
sandbox.... | true |
8e7f8da3cd6bdc13668130cc319416308c64d26b | JavaScript | izzy001/30_days_of_node | /day-4/console.error().js | UTF-8 | 346 | 3.859375 | 4 | [] | no_license | /* The method is used to print to stderr.
* Multiple arguments can be passed where first argument is primary
* and remaining arguments are substitution values
*/
let x = 10;
let y = 20;
let result = x/y;
if(result == 2) {
console.log("Result : %d".result)
}else{
console.error("Error : Error in... | true |
654a4e96657d7248d6842f9fdb0415e7dda50f35 | JavaScript | Bobslegend61/quizapp | /js/app.js | UTF-8 | 4,229 | 3.0625 | 3 | [] | no_license | (function() {
let questionContainer = document.querySelector(".question-container p");
let answerContainer = document.querySelector(".answer-container");
let controls = document.querySelector(".controls");
let previous = document.querySelector(".previous");
let next = document.querySelector(".next")... | true |
8861b49429614b73ee5f86951b8d6ae632429a92 | JavaScript | danielyoun82/wdio-test-coverage-reporter | /lib/customEvents.js | UTF-8 | 4,338 | 3.125 | 3 | [] | no_license | /**
* Event handler to send custom event to custom reporter to generate json
* Usage:
* Include customEventHandler file
* const CustomEventHandler = new (require(testConfig.reporterDir + 'customEventHandler'))(__filename);
*
* Outside of describe (for spec file)
* CustomEventHandler.setMainFeature(text);
* Cust... | true |
c1c696cbc9873fef888fe1578b2746be0f869387 | JavaScript | viveloper/vanillajs-20-projects | /form-validator/script.js | UTF-8 | 3,666 | 2.953125 | 3 | [] | no_license | class RegisterForm {
constructor(el) {
this.el = el;
this.usernameEl = this.el.querySelector('#username');
this.emailEl = this.el.querySelector('#email');
this.passwordEl = this.el.querySelector('#password');
this.password2El = this.el.querySelector('#password2');
this.el.addEventListener('su... | true |
d7bd40228a516f5d59b637c5284a8ef1e758959b | JavaScript | zfedoran/prefab.js | /app/controllers/blockController.js | UTF-8 | 11,810 | 2.640625 | 3 | [] | no_license | define([
'lodash',
'math/vector2',
'math/vector3',
'core/controller',
'graphics/meshFactory',
'graphics/mesh'
],
function(
_,
Vector2,
Vector3,
Controller,
MeshFactory,
Mesh
) {
'use strict';
/*... | true |
925e01134503e8807149621d8fa0c84cb1f595dc | JavaScript | davlum/foursum | /src/typescript.js | UTF-8 | 9,453 | 2.84375 | 3 | [
"MIT"
] | permissive | /**
* Created by davidlum on 4/4/17.
*/
var twoPi = Math.PI * 2;
var Waves = (function () {
function Waves() {
this.waves = [];
var initWave;
initWave = new Wave();
this.waves.push(initWave);
}
Waves.prototype.calcAmpSum = function () {
this.ampSum = 0;
for ... | true |
b84af488d7cd8d68f96a94add95afde9266eba9f | JavaScript | thmsweaver/montecarlo-Pi | /scripts/views/circle.js | UTF-8 | 1,576 | 2.53125 | 3 | [] | no_license | ;(function() {
app.circleView = {
// TODO: a negative value is not accepted (small screen width)
initialize: function($svg, animationCenterPoint) {
this.$svg = $svg
this.animationCenterPoint = animationCenterPoint;
this.checkbox = document.getElementsByClassName(... | true |
924789c0d5b4818c935b88858fb24e1ab457e056 | JavaScript | tatarlos/login-test | /js/data.js | UTF-8 | 629 | 2.625 | 3 | [] | no_license | $(document).ready(function(){
var jsonData = "";
$.getJSON("ajax.php",data, function(data){
cusineJson = data['cusineTypes'];
atomosphereJson = data['atomosphere'];
cusineLen = cusineJson.length;
atmLen = atomosphereJson.length;
for(i=0;i<cusineLen;i++){
$('.option1 .sub-options-container').append("<... | true |
34652eb1074a382d2b008cd40036b40d732ee918 | JavaScript | arya56/meal-sharing | /src/client/components/TestComponent/meals.js | UTF-8 | 1,028 | 3.078125 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect } from 'react';
export function Meals() {
const [meals, setMeals] = useState([]);
const [errorMessage,setErrorMessage] = useState('')
useEffect(() => {
(async () => {
try {
// http
const result = await fetch(`api/meals`);
if (result.status ... | true |
f5edefdd33543c701333af90b951225f52f7ee58 | JavaScript | russx2/frontend-exercise | /src/Components/TodoList.test.js | UTF-8 | 3,964 | 2.640625 | 3 | [] | no_license | import React from 'react'
import { shallow } from 'enzyme'
import TodoList from './TodoList'
const getStateTemplate = () => {
return {
tasks: [
{ completed: false, text: 'Pick up dry cleaning' },
{ completed: false, text: 'Source ingredients for dinner' },
{ completed: false, text: 'Purchase t... | true |
40c3060c8872c4fcd540b77b77af8cb41192121c | JavaScript | jinyhu/nodeJS-ChatRoom | /server.js | UTF-8 | 1,779 | 2.953125 | 3 | [
"MIT"
] | permissive | /*
Creating a basic static file server
*/
var http = require('http');
var fs = require('fs');
var path = require('path');
var mime = require('mime');
var cache ={};
var chatServer = require('./lib/chat_server.js');
//error handle - 404
function send404(response){
response.writeHead(404,{'Content-Type':'text/plain... | true |
2a1c2ceee7ced126aeda65f6f0d509846e195ed8 | JavaScript | mowatermelon/learn-arcgis | /bak/showPoint.js | UTF-8 | 7,589 | 2.765625 | 3 | [] | no_license | //直接通过data.geojson中的coordinates值获取点信息,一个一个点的手动加载-----------start
function showByPoint(data){
var starttime =new Date();
console.log("starttime"+starttime);
console.log(data);
var s_geometry = data.geojson.features[0].geometry;
var s_labelPoint = Terraformer.ArcGIS.convert(data.geojson, ... | true |
4689db577aa0e97758829f3272ea0aca5eda0a43 | JavaScript | jackson-lenhart/showroom-manager | /client/utils.js | UTF-8 | 574 | 2.90625 | 3 | [] | no_license | export function nameToLabel(name) {
const narr = name.split('');
return [narr[0].toUpperCase()]
.concat(narr.slice(1)
.map(c => /[A-Z]/.test(c)
? ' ' + c.toLowerCase()
: c
)
)
.join('');
}
export function calculateWaitedSeconds(signedIn) {
const currentSeconds = Math.round(Date.now() / ... | true |
439d26e3ba3981703aefa69153ee9f545ba480ae | JavaScript | Kothari-Anshul/DiffEasy | /src/App.js | UTF-8 | 7,090 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | import React, { Component } from 'react';
import './App.css';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Grid from '@material-ui/core/Grid';
import Editor from './Editor';
import Header from './Header';
import Settings... | true |
12b2e67d5a20c8acb2c5ccee990e8b80ce317d52 | JavaScript | AbobkerElaghel/testing_suite_rbk_warmups | /tests/warmUp8.test.js | UTF-8 | 3,759 | 2.609375 | 3 | [] | no_license | const {objKey, objLength, objSort} = require('../warmUpsStaff/warmUp8');
beforeAll(() => {
test('objKey should be defined', () => {
expect(objKey).toBeDefined();
});
test('objLength should be defined', () => {
expect(objLength).toBeDefined();
});
test('objSort should be defined', ... | true |
61a7f86031bad588c3a6ef20cf69f39b3d808d36 | JavaScript | CyrilDenoyelle/Cv | /script.js | UTF-8 | 1,240 | 2.78125 | 3 | [] | no_license | $(document).ready(function(){
function r(x, y){
return Math.floor(Math.random()*(y-x)+x)
}
function Pos(posx, posy, posz){
this.posx = posx;
this.posy = posy;
this.posz = posz;
}
var tbp = [new Pos(20, 3, 1), new Pos(20, 5, 1), new Pos(20, 5.5, 1), new Pos(20, 1.8, 1), new Pos(20, 3.5, 1), new Pos(20, 1... | true |
8efbd6e4e90f39afa64450b4ca4be886e52c853e | JavaScript | yudazdk/smsedge | /src/reducers/reducer.js | UTF-8 | 897 | 2.625 | 3 | [] | no_license | import {types} from '../actions/logAction';
const initialState = {
countries: [],
users: [],
loadingFlag: false,
loadedFlag: false,
logResult: []
};
const reducer = (state = initialState, action) => {
let newState = { ...state };
switch (action.type) {
case types.LOAD_COUNTRIES:... | true |
8269d65ac5a3883a0a88da5a2c792e02dc24e379 | JavaScript | highkeen/nodejstrainig | /jsunderstanding/exercise/primetest.js | UTF-8 | 198 | 3.5 | 4 | [] | no_license | function isPrime(num){
for(let i=2;i<=Math.sqrt(num);i++){
if(num%i==0){
return false;
}
}
return true;
}
console.log(isPrime(10));
console.log(isPrime(17)); | true |
c3bb34b6b0d422071d879354986fc277f97ca83a | JavaScript | HeTyDeHer/ZapovA | /chapter_010_cars/src/main/webapp/assets/js/login.js | UTF-8 | 2,651 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | function changeWindow(toRegister) {
$('#alert').hide();
if(toRegister) {
$('#loginblock').hide();
$('#registerblock').show();
} else {
$('#loginblock').show();
$('#registerblock').hide();
}
}
function validateAndSend() {
event.preventDefault();
$('#reglogin').rem... | true |
61b185895589c34da160c49f095c721612605703 | JavaScript | mariejosea/todo-list-fetch | /src/js/component/TodoList.js | UTF-8 | 1,028 | 2.578125 | 3 | [] | no_license | import React from "react";
import PropTypes from "prop-types";
// forma de utilizar los props
const TodoList = ({ list, deleteTask }) => {
return (
<React.Fragment>
<div className="card">
<ul className="list-group list-group-flush">
{list.map((task, index) => {
return (
<li
classNam... | true |
c7deda74070f61f0b6dcfc323a7194335b7b3718 | JavaScript | DevonYarbrough/alexa-helloWorld | /index.js | UTF-8 | 986 | 2.765625 | 3 | [] | no_license | var alexa = require('alexa-app');
// Create a skill
var hello = new alexa.app('hello');
// Default intent
hello.launch((req, res) => {
res.say('You can ask me for the lunch menu or to lower the blinds');
// keep session open
// continue to listen for interacton, leave stream open
res.shouldEndSession(false);
})... | true |
8b91cd112f9276afc8322a243439ad8740df6f30 | JavaScript | SagePacheco/ZestGrill | /js/frontEndLogic.js | UTF-8 | 5,379 | 2.6875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | //Browser Support Code
// Initialize and redirect if needed
$( document ).ready(function() {
"use strict";
// new WOW().init();
timeFunction();
if (screen.width <= 1000) {
window.location = "http://m.zestgrill.com";
}
// Script for commercial video functions
var video = $('#bgvid');
video.on('ended', functi... | true |
32d1894a558f9ad0ae70b6998bc986fe471e8458 | JavaScript | h0psing/bixby-boxing-legends | /code/lib/helperFunctions.js | UTF-8 | 7,801 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | var console = require("console");
module.exports = {
sum: function(a,b) {
return a+b
},
multiply: function(a,b) {
return a*b
},
fighterArray : [
"lights out",
"thunder",
"bonecrusher",
"hitman",
"nigerian mightmare",
"south paw",
"fists of fury",
"golden boy",... | true |
1a14c8b86946a38b6211fe61fa65af7b8d9fb3a2 | JavaScript | morassman/process-palette | /lib/views/split-view.js | UTF-8 | 3,606 | 2.6875 | 3 | [
"MIT"
] | permissive | /** @babel */
/** @jsx etch.dom */
const etch = require('etch')
const View = require('./view')
const _ = require('underscore-plus');
class Container extends View {
constructor({ side }) {
super(false)
this.side = side
this.initialize()
this.setContent(new EmptyView())
}
setContent(content) {
... | true |
0bfe4e7ce06d4b576c4b11dde8f7bae583c149bf | JavaScript | Jnfagundes/_CursoDigitalInovationOne | /js/man.js | UTF-8 | 1,827 | 4.34375 | 4 | [] | no_license |
// let nome = "José Nilton";
//alert("Bem vindo " + nome); //O sinal de + está concatenando a string com a variável
//var lista = ["maçã", "pêra", "uva"]; /*Criação de uma estrutura do tipo lista*/
//lista.push("laranja"); /*Com esse comando acrescentamos itens na lista*/
//lista.pop(); /*Com esse comando excluimos o... | true |
aa9e8ee46a2b20fa4fba91b03e94f026d245325a | JavaScript | IlyasDeckers/vuetiful-utilities | /src/filter.unit.js | UTF-8 | 1,209 | 2.65625 | 3 | [] | no_license | /* eslint-disable */
import {filter} from './filter'
describe('./varianceOf', () => {
it('is a function', () => {
expect(typeof filter).toBe('function')
})
describe('filter arrays', () => {
it('filters list', () => {
const arr = [
'15464', '2456', '36546545', '568854', '46655'
]
... | true |
20352cda3ca563c484a677c04f0952dc80d52708 | JavaScript | eai04191/steam-game-header | /main.js | UTF-8 | 1,471 | 2.96875 | 3 | [
"MIT"
] | permissive | const key = getParam("key");
const steamid = getParam("steamid");
const refresh = getParam("refresh");
const scriptURL = "https://script.google.com/macros/s/AKfycbwTz8vBIAkYec3rgfxE9KYBnkHMpwo5S0zbPwQzmqfwYxdBPRA/exec";
const URL = `${scriptURL}?key=${key}&steamid=${steamid}`;
function getParam(key) {
let regExpSt... | true |
6940a4a74ffefdb88e0de609f3ace91df52fa5b2 | JavaScript | YuryYaroshevich/HibernateTask | /WebContent/js/validation.js | UTF-8 | 696 | 2.703125 | 3 | [] | no_license | $(document).ready(function() {
$("#entites-number-form").submit(function() {
var $input = $(this).find("#entities-number");
return isValid($input.val(), $(this));
});
$("#go-to-page-form").submit(function() {
var $input = $(this).find("input[name='currentIndex']");
return isValid($input.val(), $(this));
}... | true |
3c01ed131e89c44648806162dd8314f30591c8c9 | JavaScript | jaz1997/DigitalFun-Torrent | /src/public/src/js/app/format.js | UTF-8 | 1,552 | 2.828125 | 3 | [] | no_license | function _Format () {}
_Format.prototype.size = function (bytes) {
var sizes = ['b', 'kb', 'mb', 'gb', 'tb']
if (bytes === 0) return '0 b'
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10)
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]
}
_Format.prototype.speed = function (b... | true |
6aa8ccfcdf9124b17d1c554dbe5d263c2d9cefe7 | JavaScript | SimonLervad/Assignments-JS.Loops | /jsloops71.js | UTF-8 | 513 | 3.59375 | 4 | [] | no_license | //Assignment JS.Loops.71
'use strict';
/* Downey: thinkjava, ex 71 */
const loop = function(n) {
let i = n;
while (i > 1) {
console.log(i);
if (i % 2 == 0) {
i = i / 2; //hvis 2 går op i tallet halvere den tallet.
} else {
i = i + 1; //hvis to ikke går op i... | true |
3cb616479839b817e755d3c5bf5cc5a588e5052a | JavaScript | hrakt/project3-react-backend | /src/Login/Register.js | UTF-8 | 2,150 | 2.53125 | 3 | [] | no_license | import React,{Component} from 'react';
import { Link} from "react-router-dom";
import './Register.css'
class Register extends Component{
state={
username:'',
password:'',
firstName:'',
lastName:'',
logged:false
};
changeHandler = (e) =>{
this.setState({
... | true |
c24d01ab3fbd0b597434d2433b0653a023854c7a | JavaScript | pchronis/home-web | /src/main/resources/public/assets/js/src/home/actions/DashboardActions.js | UTF-8 | 7,021 | 2.71875 | 3 | [] | no_license | /*
/**
* Dashboard Actions module.
* Action creators for Dashboard section
*
* @module DashboardActions
*/
var types = require('../constants/ActionTypes');
var QueryActions = require('./QueryActions');
var HistoryActions = require('./HistoryActions');
const setLastSession = function(session) {
return {
... | true |
c08a5d32a46690415195c2a301929e7ba9baf5b2 | JavaScript | chloedb/cis108-a1 | /src/countItems.js | UTF-8 | 955 | 4.03125 | 4 | [
"CC-BY-4.0"
] | permissive | /**
* Given an array of strings, returns an object whose keys
* are the individual strings in the input array and the
* values are the number of times that string appears.
*
* @example
* // returns { 'apple': 2, 'goat': 1, 'potato': 1 }
* countItems(['apple', 'goat', 'apple', 'potato']);
*
* @param {string[]} ... | true |
6b9a3784789263b74c6287620899e4022fd9eed6 | JavaScript | MaskVulcan/badminton | /models/indApply.js | UTF-8 | 4,779 | 2.671875 | 3 | [] | no_license | /*
create table if not exists indApply
(
year INT,
studentid INT,
type INT,
stu1 INT,
nam1 VARCHAR(20),
dep1 INT,
ema1 VARCHAR(100),
pho1 VARCHAR(15),
stu2 INT,
nam2 VARCHAR(20),
dep2 INT,
ema2 VARCHAR(100),
pho2 VARCHAR(15),
primary key(year, studentid, type)
) c... | true |
bf64d7311c718dda2f614416fd9037711111e864 | JavaScript | leeherzog/coffee-shop | /main.js | UTF-8 | 1,047 | 3.390625 | 3 | [] | no_license | var coffeeShop = {
beans: 40,
drinkRequirements: {
latte: 10,
americano: 5,
doubleShot: 15,
frenchPress: 12
},
makeDrink: function (drinkType) {
if (drinkType in coffeeShop.drinkRequirements === false) {
alert("Sorry, we don't make " + drinkType);
}
else if (drinkType in coff... | true |
06a268e3b5d167f77607569f0fd9827a3674691c | JavaScript | pedrinhok/my-chat | /frontend/public/index.js | UTF-8 | 1,112 | 2.515625 | 3 | [] | no_license | (function () {
angular
.module("app", [])
.controller("app.controller", function ($scope) {
const vm = this
vm.auth = () => {
vm.params = ""
vm.connected = true
vm.user = { id: Math.round((Math.random() * 100)), name: vm.username }
vm.rooms = [1, 2, 3]
con... | true |
039d34ef815baa3f590edb5176df4be03997b05d | JavaScript | lennym/audit-ci | /lib/Model.js | UTF-8 | 4,476 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const flatMap = require("array.prototype.flatmap");
const { matchString } = require("./common");
const SUPPORTED_SEVERITY_LEVELS = new Set([
"critical",
"high",
"moderate",
"low",
]);
class Model {
constructor(config) {
const unsupported = Object.keys(config.levels).filter(
(curr) => !SUPPORTED_SE... | true |
f60a0f77cc35e238a22b6d26626f938c0f112f3c | JavaScript | kenpeter/mean_contact_list | /server.js | UTF-8 | 5,450 | 2.703125 | 3 | [] | no_license | // https://stackoverflow.com/questions/33695893/express-postman-req-body-is-empty
var express = require('express'),
bodyParser = require('body-parser'),
app = express();
// mongo db
var mongodb = require("mongodb");
// cors
var cors = require('cors');
// obj id
var ObjectID = mongodb.ObjectID;
// contacts
v... | true |
bb0588c3b256e822bde939aec5b54ad3a1735a08 | JavaScript | mohankumar80/ecommerce-cart | /src/components/private/Cart.js | UTF-8 | 2,393 | 2.71875 | 3 | [] | no_license | import React from 'react';
import cart_empty from "../../assests/cart_empty.png";
import { useCart } from "../../context/cart-context/cart-context"
export default function Cart() {
const { state: { cartItems }, dispatch } = useCart();
const totalItems = (acc, value) => {
return acc += value.quantity;
... | true |
c479b2d9fd1e5e861fc789cf686c4f1228c867f4 | JavaScript | andycloke/formula | /src/ifempty.js | UTF-8 | 253 | 2.671875 | 3 | [
"MIT"
] | permissive | // Copyright 2015-2021 JC Fisher
import isempty from "./isempty";
// IFBLANK return the `value` if empty, otherwise it returns `value_if_empty`.
export default function ifempty(value, value_if_empty) {
return isempty(value) ? value_if_empty : value;
}
| true |
bc43da520aeb5e4f3c4024b1b248f6f71a8a9764 | JavaScript | dwursteisen/parisweb-atelier-tdd | /public/javascripts/tests.js | UTF-8 | 379 | 2.84375 | 3 | [] | no_license |
test( "hello test", function() {
ok( 1 == "1", "Passed!" );
});
// extract("nomChamp").from(arrayOfObject);
var extract = function (fieldName) {
var result = [];
return {
from: function (array) {
$.each(array, function (index, elt) {
result.push(elt[fieldName]);
... | true |
e55bf3df9f80b2cad2e94cd4f514532ad3b55e2c | JavaScript | maichong/alaska | /src/alaska-middleware-session/session.js | UTF-8 | 1,091 | 2.953125 | 3 | [
"MIT"
] | permissive | // @flow
/**
* @class Session
* @property {boolean} isNew
* @property {number} length
*/
export default class Session {
_ctx: Alaska$Context;
isNew: boolean;
/**
* @constructor
* @param {Alaska$Context} ctx
* @param {Object} [obj]
*/
constructor(ctx: Alaska$Context, obj?: Object) {
this._c... | true |
7ed218ad86222f82733344b5837c51e5a79282b9 | JavaScript | partialtable/popular-dishes-backend | /db/postgres/index.js | UTF-8 | 1,638 | 2.65625 | 3 | [] | no_license | // EC2 ver2
const { Pool } = require('pg')
const pool = new Pool({
// sever: '',
user: 'postgres',
host: '13.52.57.138', // 'localhost' is the default;
port: 5432, // 5432 is the default;
database: 'dishes_service2',
password: '1234'
});
// the pool will emit an error on behalf of any idle clients
// it... | true |
5ca27a2fe7500e2fa672aba726c26a177e7c02e7 | JavaScript | bzzitsme/webdev2019 | /week0/Khan Academy - Intro to JS/Objects/movie-reviews.js | UTF-8 | 400 | 3.203125 | 3 | [] | no_license | var movies = [
{
title: "Puff the Magic Dragon",
review: "Best movie ever!!"
},
{
title: "2 + 1",
review: "Best dramatic movie!"
}
];
fill(84, 140, 209);
textAlign(CENTER, CENTER);
for(var i = 0; i < movies.length; i++){
textSize(20);
text(movies[i].title, 200, i... | true |
1cd7577835237f3571391dcf9b106dc5a4d4a329 | JavaScript | brentmc/howler-test | /example/HowerTest.js | UTF-8 | 2,412 | 2.8125 | 3 | [] | no_license | /**
* Created by brentmcivor on 10/11/15.
*/
import Howler from 'howler'
class HowlerTest{
constructor(){
this.soundsAr = []
this.MAX_SPLASHES = 10
}
setup() {
this.setupBurp()
this.setupMunch()
this.setupLoopingBG()
this.setupCountdown()
this.setu... | true |
48a9197b95ca38f89ddf7065c1750ad04173e756 | JavaScript | ahmedjalilqureshi/inflow-clone | /public/js/master_view.js | UTF-8 | 18,147 | 2.578125 | 3 | [
"MIT"
] | permissive | function load_job_slips(){
var xhttp = new XMLHttpRequest();
let c= 1;
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
let job_slips = JSON.parse(this.responseText).job_slips;
console.log('js',job_slips)
let table = document.getElementById('job_slip... | true |
fcd7a0a6807b3cd4b8e539c8646d7199277b531c | JavaScript | kcaze/magical_vacation_translation | /tools/translate/menu/main.js | UTF-8 | 7,306 | 2.84375 | 3 | [] | no_license | var menus;
var section = 0;
var number;
var section_names = [
'text',
'explanations',
'magic_notebook',
'bestiary',
'species_descriptions',
'md_dictionary',
'name_kanji',
'element_descriptions'
];
function readJSON(e) {
var file = e.target.files[0]; // FileList object
var fileReader = new FileReade... | true |
f1ef75eb30c1a0c5f6a0a258c5676d5495cb8345 | JavaScript | OlgaYatsuk/solve-react-native-app | /src/reducers/cardDataReducer.js | UTF-8 | 715 | 2.625 | 3 | [] | no_license | //@flow
/*eslint-disable*/
const initialValue = {
creditCardNumber: '',
date: '',
cvv: '',
expirationDate: '',
firstName: '',
lastName: '',
cardType: '',
};
export const cardDataReducer = (
state: {
creditCardNumber: string,
date: string,
cvv: string,
firstName: string,
lastName: st... | true |
3f5a83e2b26791678fb8de84a49cb625f6df0b7c | JavaScript | sundeepsspgupta/reactappsandy | /mortgage.client/src/actions/populateCombo.js | UTF-8 | 597 | 2.59375 | 3 | [] | no_license | import api from "./api";
export const ACTION_TYPES = {
SET_CURRENT_MORTGAGETYPE: 'SET_CURRENT_MORTGAGETYPE',
CREATE: 'CREATE',
UPDATE: 'UPDATE',
DELETE: 'DELETE',
FETCH_ALL: 'FETCH_ALL'
}
const formateData = data => ({
...data,
age: parseInt(data.age ? data.age : 0)
})
export const fetchA... | true |