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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
15f60cea5d2c6bb5b307779543dbe2a009b58e13 | JavaScript | wiaspectre/Test | /js/script.js | UTF-8 | 116 | 2.78125 | 3 | [] | no_license | var car1 = "Saab";
var car2 = "BMW";
var car3 = "Mazda";
var cars = ["Saab","BMW","Mazda"];
console.log(cars[0]);
| true |
558dc6533a2b52495a62db83eb83f8c37391d1eb | JavaScript | Endr1us/game_snake | /js/script.js | UTF-8 | 5,024 | 3.453125 | 3 | [] | no_license | // JavaScript Document
let field = document.createElement('div');
document.body.appendChild(field);
field.classList.add('field');
for (let i = 1; i<101; i++) {
let excel = document.createElement('div');
field.appendChild(excel);
excel.classList.add('excel');
}
let excel = document.getElementsByClassNa... | true |
ddfe446a50337f733a808b3377710e7fa9344eb6 | JavaScript | sarah-hart-landolt/TriviaGame | /alert.js | UTF-8 | 1,203 | 3.578125 | 4 | [] | no_license | /*
This component holds the function to set the proper alert to judge if an answer is correct/ incorrect
*/
export const alert = (variableName) => {
if (variableName === "correct") {
return `
<div class="alert alert-success" role="alert">
<h4 class="alert-heading">Well done!</h4>
<hr>
<p>E... | true |
65c50d779c26b67e587076cf2e26f062f32a22b2 | JavaScript | javacoder1502/nocoediv | /WebContent/resources/design/js_videcon/change.js | UTF-8 | 545 | 2.515625 | 3 | [
"MIT"
] | permissive | function showonlyone(thechosenone) {
var newboxes = document.getElementsByTagName("div");
for(var x=0; x<newboxes.length; x++) {
name = newboxes[x].getAttribute("class");
if (name == 'newboxes') {
if (newboxes[x].id == thechosenone) {
... | true |
02987774a83635bada0aee19ec4f18a346e3acee | JavaScript | nguyenbinhanltv/yostore-admin | /dist/tax/tax.helper.js | UTF-8 | 2,325 | 2.53125 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaxHelper = void 0;
class TaxHelper {
/**
* Get taxSummary per one or multiple orders
*/
static getTaxSummary(order) {
var _a;
const summaryLines = (_a = order.lines) === null || _a === void 0 ? void 0... | true |
7328339f9f1ad073ab43d7487ce4493120f71585 | JavaScript | sophi-li/weather-app | /src/App.js | UTF-8 | 1,348 | 2.671875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import moment from 'moment'
import WeatherCard from './components/WeatherCard'
import styles from './App.module.css'
const App = () => {
const [datalist, setDatalist] = useState([])
const [error, setError] = useState(false)
useEffect(() => {
let url = `htt... | true |
4620e6427309a2c3788e8d61aa9f7072b633dd6c | JavaScript | dkkop225/nodejs | /functionalProgramming.js | UTF-8 | 296 | 3.546875 | 4 | [] | no_license | 'use strict'
const numbers = [10,20,30,40]
const sum = numbers.reduce((tot,val)=> tot+val)
const avg = numbers.reduce((tot,val,idx , arr)=> {
tot+= val
if(idx === arr.length -1) {
return tot/arr.length
} else {
return tot
}
})
console.log(sum)
console.log(avg) | true |
c19b98781eb7c08729208a2ce2864a31fb4b18c6 | JavaScript | Oruc123/helios | /src/utils/html/AnimationFrame.js | UTF-8 | 472 | 2.703125 | 3 | [] | no_license | class AnimationFrame {
frame = null;
constructor(handler) {
Object.assign(this, { handler });
}
request() {
if (this.frame == null) {
this.frame = requestAnimationFrame(() => {
this.frame = null;
this.handler();
});
}
return this;
}
cancel() {
const { fram... | true |
2166f4f04d9fac1a9faee9dd153cfd7bdef95938 | JavaScript | Rmole57/launch-school | /js210/js210-language_fundamentals/objects/afterMidnight1.js | UTF-8 | 2,091 | 4.25 | 4 | [] | no_license | const MILLISECONDS_PER_MINUTE = 60000;
function timeOfDay(deltaMinutes) {
let deltaMilliseconds = deltaMinutes * MILLISECONDS_PER_MINUTE;
let newTime = new Date(deltaMilliseconds);
let hours = padWithZeroes(newTime.getUTCHours(), 2);
let minutes = padWithZeroes(newTime.getMinutes(), 2);
return `${hours}:${... | true |
8f15541ae7fd57f64749517c74cee9af835e0ab6 | JavaScript | dev-bootcamp-2019/final-project-elshaek | /client/src/App.js | UTF-8 | 3,409 | 2.8125 | 3 | [
"MIT"
] | permissive | import React, { Component } from "react";
import GatherContract from "./contracts/Gather.json";
import getWeb3 from "./utils/getWeb3";
import "./App.css";
class App extends Component {
state = {
storageValue: 0,
web3: null,
accounts: null,
contract: null,
contractAddress: n... | true |
7846b21c6f3e256f3e33c4b709d1b34dc4a22677 | JavaScript | Tasmi31/site_fan | /Backend/utilities/loop-workshop-init/loop-workshop-init.js | UTF-8 | 564 | 2.859375 | 3 | [] | no_license | // --- Require
const Activity = require('./../../models/activity')
const suffleArray = require('./../shuffleArray')
// --- Main
/*
* Loop through all documents to init new Workshops
* @param {array} : MongoDB documents
* @return {array} : Workshop objects
*/
function loopWorkshopInit (docs)
{
let workshops = docs
... | true |
9d779e7e6b76a3e085926e02f3ce7b933c23f4ec | JavaScript | akdavila2/CDMX011-lab-notes | /mynotes/src/components/containers/LoginForm.jsx | UTF-8 | 861 | 2.609375 | 3 | [] | no_license | import React, { useState } from "react";
const FormLogin = ({ handleSubmit }) => {
const [state, setState] = useState({});
const handleEmail = (e) => setState({ ...state, email: e.target.value });
const handlePassword = (e) =>
setState({ ...state, password: e.target.value });
const { email, password } = s... | true |
27fe63ca20c57fb346436d60cea32c4eff46d9b8 | JavaScript | sunweixing123/algorithm | /node/jeekbang/猜拳/index.js | UTF-8 | 220 | 3.28125 | 3 | [] | no_license | let argv = process.argv[process.argv.length - 1];
let num = Math.random() * 100;
console.log("你出"+ argv)
console.log("我出"+ num)
if (argv > num) {
console.log("你赢了")
} else {
console.log("我赢了")
}
| true |
5a5d8c73f7d0e597ed5d1dc8b69976c71696b7c5 | JavaScript | jekatigr/metrics-demo | /pages/index.js | UTF-8 | 3,448 | 2.609375 | 3 | [] | no_license | import React from 'react';
import createApi from './api';
const api = createApi();
const IndexPage = ({ repos: reposProps }) => {
/* ========================== Counter ============================== */
const handleIncreaseCounter = () => {
api.increaseCounter();
};
const renderCounter = () ... | true |
dec6c75182a5303869c8417c9c75b88ab8b5879f | JavaScript | fasulu/graphql-tutorial | /server/app.js | UTF-8 | 835 | 2.59375 | 3 | [] | no_license | const express = require('express');
const { graphqlHTTP } = require('express-graphql');
const schema = require('./schema/schema');
const app = express();
const portNum = 3500;
app.use('/myquery', graphqlHTTP({
schema,
graphiql: true // this will activate graphical interface in browser to do queries
}));... | true |
78edecac4ae54c1cbc9c59f9f19162c3f2ab44d8 | JavaScript | SaiDhanush3/In-Memory-Database | /DatabaseBackend.js | UTF-8 | 2,196 | 2.859375 | 3 | [] | no_license | const clone = require('clone');
const fs = require('fs');
module.exports = class myDB {
constructor () {
this.data = [{}];
this.tIndex = 0;
this.transactionMode = false;
this.count = function (value) {
let count = 0;
if (value) {
for (let property in this.data[this.tIndex]) {
... | true |
43e2eb0f1b323e16bd27940c601cd49f79d7e65f | JavaScript | maxiVidarte/Laboratorio3-2017 | /Guia-Javascript/Ejercicio04/script.js | UTF-8 | 236 | 2.984375 | 3 | [] | no_license | window.onload = function(){
var nprimo = 0;
for (var index = 2; nprimo < 20; index++) {
if((index % 2) ==0){
nprimo++;
document.getElementById("parrafo").innerHTML += index + "</br>";
}
}
} | true |
d2fe2c7373476822ff3ad82792e0453d984fa02a | JavaScript | HJain13/plan-it | /frontend/src/components/ComplaintService.js | UTF-8 | 1,140 | 2.59375 | 3 | [] | no_license | import axios from 'axios';
var baseUrl = '/api';
class ComplaintService {
sendData(data) {
axios
.post(baseUrl + '/complaints/add/post', {order: data})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
}
check... | true |
14c6d7eca7ae6798cbaab6498479cb6076274827 | JavaScript | L-AirDnD/timluu-service | /client/src/Rating.jsx | UTF-8 | 2,573 | 2.578125 | 3 | [] | no_license | import React from 'react';
import {
TopLeft,
NumOfReviews,
Stars,
GreenStar,
GreenStarHalf,
GreenStarBorder,
SubRatings,
RatingsColumn,
RatingField,
RatingName,
RatingStars
} from '../ratingStyles.jsx';
class Rating extends React.Component {
constructor(props) {
super(props);
}
con... | true |
89e73eef9f3ad3fdc3db7b7174ec67d1b6b61f80 | JavaScript | judaihyun/google-auto-focus | /focusingSearch.js | UTF-8 | 365 | 2.8125 | 3 | [] | no_license |
'use strict'
window.onkeydown = function(event)
{
var queryEle = document.getElementsByName('q')[0];
var keyCode = event.keyCode;
if(queryEle != document.activeElement)
{
if(keyCode===8) queryEle.value = '';
if(keyCode >= 112 || keyCode <= 123) return;
queryEle.selectionStart = queryEle.selectionEnd = quer... | true |
13c4453bd44963a6f82cd800f14fe62af3ac2c45 | JavaScript | ValentinFertillet/base | /js/controllers/overlayController.js | UTF-8 | 1,719 | 2.59375 | 3 | [] | no_license | "use strict";
//------------------------------------------------------------------
// Selectors
//------------------------------------------------------------------
var overlayOpen = document.getElementsByClassName('overlay-open'),
overlayClose = document.getElementsByClassName('overlay-close'),
navbar = do... | true |
5453d2441043218141bff156421f839d681ede0b | JavaScript | TahsinaSnow/Js-simple-problems | /fibonacci-recusive.js | UTF-8 | 472 | 4.28125 | 4 | [] | no_license | // [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
/*
3rd = 2nd + 1st
4th = 3rd + 2nd
5th = 4th + 3rd
6th = 5th + 4th
7th = 6th + 5th
16th = 15th + 14th
nth = (n-1)th + (n-2)th
ith = (i-1)th + (i-2)th
*/
function fibonacci(n){
if(n==0){
return [0];
}
if(n==1){
return [0, 1];
}
const fibo = ... | true |
588326fb5c4a548087dd6f883595ac49fdd45049 | JavaScript | Nurha/RedAndGreen | /task4.js | UTF-8 | 433 | 3.15625 | 3 | [] | no_license | function myFunction() {
var background = document.getElementById("square1").style.backgroundColor;
if (background == "red") {
document.getElementById("square1").style.background = "green";
}
else {
document.getElementById("square1").style.background = "red";
}
var text = docu... | true |
d851ecb48614036431be5e0fe2f7853722f2ddd1 | JavaScript | mrdoob/three.js | /examples/jsm/renderers/common/Info.js | UTF-8 | 1,018 | 2.734375 | 3 | [
"MIT"
] | permissive | class Info {
constructor() {
this.autoReset = true;
this.render = {
frame: 0,
drawCalls: 0,
triangles: 0,
points: 0,
lines: 0
};
this.memory = {
geometries: 0,
textures: 0
};
}
update( object, count, instanceCount ) {
this.render.drawCalls ++;
if ( object.isMesh || object.i... | true |
352cbc3a5d9da13371f310480e57d0a457d26564 | JavaScript | 5haw4/TopMoviesRN | /MoviesApp/src/store/reducers/MoviesFullInfoReducer.js | UTF-8 | 2,233 | 2.796875 | 3 | [] | no_license | import { SET_LOADING_MOVIE, ADD_MOVIE, SET_MESSAGE_MOVIE } from '../actions/MoviesFullInfoActions'
const initialState = {
movies: {
/*
### Sample object:
<MOVIE-ID>: {
isLoading: true,
message: {
isError: false,
... | true |
39bea444ef6cb291a0678a10380112b293369e62 | JavaScript | Uvacoder/js-lib | /libs/string-tools.js | UTF-8 | 11,290 | 3.484375 | 3 | [
"MIT"
] | permissive | //replace all occurances of string
export function replaceAll(currentString, stringToReplace, replacement) {
return currentString.replace(new RegExp(stringToReplace, ["g"]), replacement);
}
//this is ghetto hacked for now, handles only single characters and only a subset
export function stringRemove(text, thin... | true |
dfa720c1ff90764497b98e5900ac3a4a3b362172 | JavaScript | dr-js/dr-js | /source/common/module/UpdateLoop.js | UTF-8 | 1,638 | 2.53125 | 3 | [
"MIT"
] | permissive | import { CLOCK_TO_SECOND, requestFrameUpdate, cancelFrameUpdate, createTimer } from 'source/common/time.js'
import { objectSet, objectDelete } from 'source/common/immutable/Object.js'
const createUpdater = () => {
let funcList // prefer drop, index non-constant, will be refreshed on every update
let funcMap // pre... | true |
86a67d5e25602cb7326e654aebd311c2130dabeb | JavaScript | seanpe11/GreenPokerRoomServer | /yeehawholdem.js | UTF-8 | 29,740 | 3.046875 | 3 | [] | no_license | function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}
class Player {
name = "";
stack = 1000;
score = 0;
isWinner = false;
hand1 = {};
hand2 ... | true |
fdfb216391914c2c5a273193a25652f1efcf2575 | JavaScript | j-norwood-young/rollingstone-top-500-songs-2021 | /src/index.js | UTF-8 | 1,523 | 2.75 | 3 | [] | no_license | import fs from "fs"
import path from "path"
import { title } from "process";
const songmapper = song => {
try {
const subtitle_parts = song.subtitle.replace("\r\n", "").replace("\\r\\n", "").match(/<div class="rs-list-item--year">(\d*)<\/div>.*<span class="rs-list-item--credits__names">(.*)(<\/span>)/)
... | true |
247175d6aa53073f36c1d4ab76a14a28471ccaa4 | JavaScript | maximumdata/canvasdm | /socketstuff.js | UTF-8 | 6,671 | 2.703125 | 3 | [] | no_license | const shortid = require('shortid');
const randomColor = require('randomcolor');
const EntityModel = require('./EntityModel.js');
let game = {
entities: [
new EntityModel({
id: 1,
name: 'Kris',
color: '#cc6766',
type: 'player'
}),
new EntityMod... | true |
9efe0054c4537d3dc35914f76d40230a5e0acb40 | JavaScript | DerekSip/DrawingApp | /script.js | UTF-8 | 2,768 | 4.03125 | 4 | [] | no_license | //Bringing in the html buttons and canvas by ID
//And adding the html5 canvas content
const canvas = document.getElementById('canvas');
const increaseBtn = document.getElementById('increase');
const decreaseBtn = document.getElementById('decrease');
const sizeEL = document.getElementById('size');
const colorEl =... | true |
64275e414af98b59532bb7fba45c897e7af20ae0 | JavaScript | dtries/exp-locallib-tut | /app.js | UTF-8 | 2,320 | 2.609375 | 3 | [] | no_license | var createError = require('http-errors'); /* creates http errors info when they occur */
var express = require('express'); /* 3rd party node server framework */
var path = require('path'); /* core node library for parsing file and directory paths */
var cookieParser = require('cookie-parser'); /* 3rd party npm that par... | true |
37e84038e94d91f2de98bbea08454982477132a2 | JavaScript | amiraliamhh/css-practice | /3dbox/script.js | UTF-8 | 1,547 | 3.15625 | 3 | [
"MIT"
] | permissive | const box = document.querySelector('#box')
let dragging = false
let oldX = null
let oldY = null
document.addEventListener('mousedown', e => {
dragging = true
})
document.addEventListener('mouseup', e => {
dragging = false
})
document.addEventListener('mouseleave', e => {
dragging = false
})
document.... | true |
300e363ce3469e69d674e91aeaab49cf81c27599 | JavaScript | AJOmer/MEAN | /JS Fundamentals/bracesValid/bracesvalid.js | UTF-8 | 489 | 3.5625 | 4 | [] | no_license | function bracesValid(str){
var braces = {'}':'{', ']':'[', ')':'('};
var closing = [];
for(var i = 0; i < str.length; i++){
if(str[i] == '{' || str[i] == '[' || str[i] == '('){
closing.push( str[i] );
continue;
}
if(closing[closing.length - 1] === braces[str[i]]){
closing.... | true |
d3563c5270c44f5e1f7b125689d99086b0581adf | JavaScript | anthonyjeamme/react-hooks-elements | /src/form/utils.js | UTF-8 | 449 | 2.6875 | 3 | [
"MIT"
] | permissive | export const emailValidator = (email) => {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
export const validate = ({ validator, type }, value) => {
if ... | true |
515b501437f7076f32a17e0c30cfaa44baa8d6be | JavaScript | anugrah3199/foodimoji | /src/App.js | UTF-8 | 1,477 | 2.96875 | 3 | [] | no_license | import React, { useState } from "react";
import "./styles.css";
const emojiDict = {
"🍕": "Pizza",
"🍔": "Burger",
"🍟": "Fries",
"🌭": "Hot Dog",
"🍞": "Bread",
"🥐": "Croissat",
"🥨": "Pretzel",
"🧀": "Cheese",
"🍜": "Noodles",
"🍚": "Rice bowl",
"🍪": "Cookie"
};
export default function App() ... | true |
44a103a518a280d67c67de16c2761279ada1af0b | JavaScript | enricodangelo/advent-of-code | /2020/15/15.part1.js | UTF-8 | 2,311 | 3.53125 | 4 | [] | no_license | const fs = require('fs');
function readInput(filename) {
const res = []
const data = fs.readFileSync(filename, "UTF-8");
const lines = data.split(/\r?\n/);
lines.forEach((line) => {
line.split(",").forEach((n) => {
res.push(Number(n.trim()));
});
});
return res;
}
... | true |
6c5b50c0eadfdb7c4aada7c13ca8b130355d82ce | JavaScript | mingliee/asgn_usmers | /admin/assets/js/alerts.js | UTF-8 | 12,478 | 2.53125 | 3 | [] | no_license | (function($) {
showSwal = function(type) {
if (type === 'error-message') {
swal({
title: 'Error!',
text: 'Error Occur',
icon: 'error',
button: {
text: "Continue",
value: true,
visible: true,
className: "btn btn-primary"
}
... | true |
17b825a4d53e2db3f28780d7926dfcd76908b916 | JavaScript | YordanStoyanov/SoftUni-Work-JavaScript-Advanced | /SYNTAX-FUNCTIONS-AND-STATEMENTS/lab-4.js | UTF-8 | 527 | 3.484375 | 3 | [] | no_license | function solve(a, b, c) {
return `The largest number is ${[a, b, c].
sort((a, b) => a - b).
pop()}`;
}
console.log(solve(5, -3, 16))
function solve2(...params) {
//return `The largest number is ${[...params].sort().pop()}`;
return `The largest number is ${[...params].
so... | true |
03c20167347a964de1bd538a0051b357a5457da9 | JavaScript | xizher/datastructure | /stack/stack.js | UTF-8 | 818 | 2.828125 | 3 | [] | no_license | import { CustomEvent } from '../../customevent'
export class Stack extends CustomEvent {
constructor () {
super()
const _items = [] // 私有变量 存储栈元素的数组
Object.assign(this, {
push (item) {
_items.push(item)
this.fire('push', { pushItem: item })
},
pop () {
const pop... | true |
b9e2026627b2b6ea06fc4f24073de4ffdf0ca005 | JavaScript | devon-wolf/red-green-refactor-lab | /__tests__/fetch-quotes.test.js | UTF-8 | 604 | 2.65625 | 3 | [] | no_license | const fetchQuotes = require('../fetch-quotes.js');
jest.mock('node-fetch', () => () => Promise.resolve({
json: () => Promise.resolve([
{
character: 'Leela',
quote: 'Something unimpulsive',
image: 'http://fakeleelaimage.png'
}
]),
}));
describe('test fetchQuotes function', () => {
it(... | true |
22573fae12ae42a3ef40bc7d4e46ba77063385bd | JavaScript | Bankole2000/game-catalogue | /src/reducers/gamesReducer.js | UTF-8 | 414 | 2.640625 | 3 | [] | no_license | const initialState = {
popularGames: [],
newGames: [],
upcomingGames: [],
searchedGames: [],
gameDetails: null
}
export const gamesReducer = (state = initialState, action) => {
switch(action.type){
case "fetchGames":
const {popularGames, upcomingGames, newGames } = action.payload
retur... | true |
3495dde98df9caefdddad04c3ea056e2c211cc3b | JavaScript | NickChuCode/my-code | /frontend/scriptOJ/easy/44.同字母异序.js | UTF-8 | 1,170 | 4.46875 | 4 | [
"MIT"
] | permissive | // 同字母异序指的是两个字符串字母种类和字母的数量相同,但是顺序可能不同。
//
// 完成 isAnagram,接受两个字符串作为参数,返回true 或者 false 表示这两个字符串是否同字母异序。例如:
//
// isAnagram("anagram", "nagaram") // => return true.
// isAnagram("rat", "car") // => return false.
// 字母数量相同,类型相同
const isAnagram = (str1, str2) => {
if (str1.length !== str2.length) return false
for ... | true |
d0452bad12213fb6b0110730d29519a288dbe57e | JavaScript | dsherret/swc | /tests/tsc-references/es6/destructuring/destructuringControlFlow/input.ts/es5.1.normal/output.js | UTF-8 | 1,967 | 3.03125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for(var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true){
_arr.push... | true |
6e544a104c49d8744ea3981669805c200fd25e94 | JavaScript | hytonenl/infection-visualizer | /src/Particle.js | UTF-8 | 3,436 | 3.53125 | 4 | [
"MIT"
] | permissive | 'use strict';
const HEALTHY_COLOR = 'rgba(200, 200, 200, 0.7)';
const SICK_COLOR = 'rgba(200, 50, 50, 0.7)';
const IMMUNE_COLOR = 'rgba(0, 255, 0, 0.7)';
const DEAD_COLOR = 'rgba(0, 0, 0, 0.7)';
const SPEED_SCALE = 1.2; // Particle speed scale
// Class to represent a single particle.
class Particle {
constructor(i... | true |
eeaf3ba4d37be6b6ee2f6d3eaf68aa64ef6e6445 | JavaScript | maxckelly/compass-coding-test-backend | /initData.js | UTF-8 | 2,392 | 2.765625 | 3 | [] | no_license | const { gql } = require('apollo-server-express');
const { createItems, getItems, createItem } = require('./controllers/GQL');
let keystone;
let context;
module.exports = async (ks) => {
keystone = ks;
context = keystone.createContext({});
const surveyCount = await getListCount('Survey');
const questionCount ... | true |
25b5a290c6920d3a2cab26dedbc303297fc3d0aa | JavaScript | tomyoder/groceries | /js/scripts.js | UTF-8 | 555 | 3.1875 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$("form").submit(function(event){
event.preventDefault();
var groceryList = [];
var itemList = ["item1", "item2", "item3", "item4", "item5", "item6"]
itemList.forEach(function(item) {
var item1 = ($("#" + item).val()).toUpperCase();
groceryList.push(item1);... | true |
d06cafb92c03a800ee3d2cbc1cf1049545e62ce1 | JavaScript | hezhirong/building-blocks | /server/api/index.js | UTF-8 | 1,724 | 2.796875 | 3 | [] | no_license | const apiEntry = {
/**
* 调度所有API方法
* @param {Object} io socket.io
* @param {Object} socket socket链接对象
* @param {Object} receiveData {method: [get, post, put, delete], path: '/getComponent', data: { 自定义数据 }}
* @param {Function} cb 回调方法
* @return {[type]}... | true |
66c05d914eaac0b9ef88eccd1f55afb6c0a6e094 | JavaScript | tramleit/MiniProject_COVID19_Report | /server/covid19server/routes/data.js | UTF-8 | 1,596 | 2.625 | 3 | [
"MIT"
] | permissive | var express = require('express');
var router = express.Router();
const request = require("request");
const axios = require("axios");
const cheerio = require("cheerio");
const url = "http://ncov.mohw.go.kr/";
const log = console.log;
let dataString;
// ### 1. request 사용 ###
router.get('/', function(req, res, next) ... | true |
4a089202e2027cfcd7359d4c8d9c040944b0cb7e | JavaScript | ankitatechie/homevil_github | /js/booking_hours.js | UTF-8 | 10,285 | 3.171875 | 3 | [] | no_license | var total_hours = 1;
var extra_hours = 0;
function addHours(){
var bedroom_hrs = document.getElementById('bedrooms').value;
var bathroom_hrs = document.getElementById('bathrooms').value;
if(extra_hours >= 0.5){
total_hours = parseFloat(bedroom_hrs) + parseFloat(bathroom_hrs) + extra_hours;
}else{
total_hours = ... | true |
b78db7f26316e4dc66189bf568bf816e31607aa8 | JavaScript | Amiralikh1377/hokm-socket-api | /frontEnd/filesLoader.js | UTF-8 | 874 | 2.71875 | 3 | [] | no_license | const files = ['./files/img/carp.jpg', './files/img/club.png' , './files/img/crown.png' , './files/img/diamond.png' ,'./files/img/flip.png' ,'./files/img/heart.png' , './files/img/card/0.png', './files/img/card/1.png', './files/img/card/2.png', './files/img/card/3.png'];
let filesLoaded = 0;
const progressBar = $('#pro... | true |
225bda5d817c9cb2772aeaf2ac204efb07284f8d | JavaScript | bbbgbr/js-basic | /src/test2.test.js | UTF-8 | 510 | 2.546875 | 3 | [] | no_license | const {multipleHello, multipleTextByCharacter} = require('./test2')
test("multipleHello", () => {
expect(multipleHello(2)).toBe('hellohello');
expect(multipleHello(3)).toBe('hellohellohello');
});
test('multipleTextByCharacter', () => {
expect(multipleTextByCharacter('hello', 'l')).toBe('hellohello')
expect(m... | true |
f7a3a4ba73dacb99838727f78b63845f627cc175 | JavaScript | xjz1994/LeetCodeSolution | /Solution/Javascript/763. Partition Labels.js | UTF-8 | 775 | 3.53125 | 4 | [] | no_license | /**
* @param {string} S
* @return {number[]}
*/
var partitionLabels = function (S) {
let posDict = {};
for (let i = 0; i < S.length; i++) {
let char = S[i];
if (posDict[char]) {
posDict[char].end = i;
} else {
posDict[char] = { start: i, end: i };
}
... | true |
600c93344ed92ad970959f8cdd82f0d1539f6ad6 | JavaScript | bhorzcollection/desi-hip-hop.github.io | /document_files/mozlive.js | UTF-8 | 13,143 | 2.65625 | 3 | [] | no_license | /* MozLive 3 */
function mozLive3(settings)
{
var defaults = {
source: null, // Source object (id, name, global, superglobal).
action: '', // Component-specific action to execute.
parameters: {}, // Additional action-specific parameters.
response: {
... | true |
f4a6c105ff25856b1de4b613065be3626ba2b463 | JavaScript | lgrave264/RPS | /JS/RPS.js | UTF-8 | 3,473 | 3.234375 | 3 | [] | no_license | var rock = 0;
var paper = 0;
var scissors = 0;
var Airock = 0;
var Aipaper = 0;
var Aiscissors = 0;
var win = 0;
var tie = 0;
var lose = 0;
document.getElementById('win').value = win;
document.getElementById('tie').value = tie;
document.getElementById('lose').value = lose;
function crock(){
rock = 1;
paper... | true |
7cc1b060c4893582faf8abd4278e950c138ade76 | JavaScript | MatheusEli/Logica_JavaScript | /Aula_1/LojaProdutos/impressao.js | UTF-8 | 134 | 2.8125 | 3 | [] | no_license | function imprimeTexto(frase) {
var p = document.createElement("p");
p.innerHTML = frase;
document.body.appendChild(p);
}
| true |
72163496d4cc144eaa389a29fa0ae94e0818999d | JavaScript | morozec/PersonalPortal | /PersonalPortal/App/containers/header/HeaderReducer.js | UTF-8 | 1,043 | 2.53125 | 3 | [] | no_license | import {LOGIN_ERROR, INPUT_LOGIN, INPUT_PASSWORD, LOGIN_SUCCESS, LOGOUT, SHOW_LOGIN_FORM} from './HeaderConstants'
import AuthHelper from "../../utils/AuthHelper"
const initialState = {
isLogged:AuthHelper.isLogged(),
name:AuthHelper.getLogin(),
password:'',
error:'',
isLoginFormShown:false
}
expo... | true |
57e65d25f5839517906fbb7216bdcdf08ab10ea2 | JavaScript | Dstom/Citas-React-App | /src/reducers/articleReducer.js | UTF-8 | 1,806 | 2.578125 | 3 | [] | no_license | import { types } from '../types/types';
/*
{
id: 53534543,
title: 'Cumpleaeños del jefe',
user: {
_id: '234d',
name: 'Tom'
}
}
*/
const initialState = {
articles: [],
activeArticle: null,
articleModal: false
}
expor... | true |
0f0d2b6e47a80fe153ab8f398dc00c7bde036eca | JavaScript | fredericmarx/rss-reader | /src/containers/AppShell/test.js | UTF-8 | 1,187 | 2.84375 | 3 | [
"MIT"
] | permissive | /*
ava is a test framework, here we pull it's
default import, which has the main API
attached.
*/
import test from 'ava';
/*
We need React whenever we want to compile some
JSX, which we do here.
*/
import React from 'react';
/*
This is the shallow renderer from airbnb/enzyme.
It allows us to render a sp... | true |
63c8ace58312fa68986a26b56397de4875bbd450 | JavaScript | todun/zifi | /src/index.old.js | UTF-8 | 3,921 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* @class Story
*/
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import Modal from 'react-modal'
import styled, { injectGlobal } from 'styled-components'
import sizeMe from 'react-sizeme'
import Fullscreen from 'react-full-screen'
// import './styles.css'
// const StyledFullscreen =... | true |
a13e3b5df4162276f4a836f73c983619e02b5e57 | JavaScript | sakarila/Running-App-backend | /queries/authQueries.js | UTF-8 | 2,103 | 2.59375 | 3 | [] | no_license | const bcrypt = require('bcrypt');
const jwt = require('jsonwebtoken');
const saltRounds = 8;
const { pool } = require('./pool')
function createUser(user, res) {
bcrypt.hash(user.password, saltRounds, function(err, hash) {
if (err) {
throw err;
}
pool.query('INSERT INTO users (us... | true |
adf76b68b92c918446cc70c8fc05148a5bcefa1e | JavaScript | vdernis/ParseTool | /src/background/tab-debugger/listener-manager.js | UTF-8 | 560 | 2.828125 | 3 | [
"MIT"
] | permissive | class ListenerManager {
constructor() {
this.listeners = new Set();
}
addListener(listener) {
if (typeof listener !== 'function') {
throw new Error('Listener must be a function.');
}
this.listeners.add(listener);
}
removeListener(listener) {
if (typeof listener !== 'function') {
... | true |
433006e4273e149341e780afe35b4deb30721fac | JavaScript | zanderson/WebColorsAPI | /index.js | UTF-8 | 513 | 2.703125 | 3 | [] | no_license | var request = require('request');
request('https://cdn.rawgit.com/metaraine/swatch/74580660c9229541622bbf1fd4198618d9f677e5/webcolors.json', function (error, response, body) {
var colors
if (!error && response.statusCode == 200) {
colors = JSON.parse(body)
}
var requestedColor = process.argv[2]
requestedColor ... | true |
021540c7eda424848ff359045c99702d68b1e4e9 | JavaScript | tedKim816/-Capstone-Project- | /assets/js/script.js | UTF-8 | 7,095 | 3.53125 | 4 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | var test = "using js via assests folder for CodeIgniter";
//alert(test);
/**
* javascript arrays (not outputting)
*
*/
//var numbers = new Array();
//numbers = [1, 2, 3, 4, 5];
//numbers[2] = 8;
//numbers[2];
//var twoDimension = [[1,2,3], [4,5,6], [7,8,9]];
//twoDimension[0][1]; // first index of array (values 1... | true |
8d7661747c4ca93329a4a36599da51c9dfd866c2 | JavaScript | eelf/services | /client/lib/api.js | UTF-8 | 718 | 2.59375 | 3 | [] | no_license |
export default class Api {
url;
constructor(url) {
this.url = url;
}
call(method, data, responseType) {
return fetch(this.url, {
credentials: 'include',
method: 'POST',
headers: {
'X-Method': method
},
body: dat... | true |
589378380192e2cc88c848e88361c34c16709aa4 | JavaScript | lukaswe/buzzcalu | /libraries/jquery.blink.js | UTF-8 | 1,279 | 2.578125 | 3 | [
"MIT"
] | permissive |
function blink (selector) {
var defaults = {delay: 500};
var options = $.extend(defaults, options);
$(selector).animate({opacity: 0}, 2, "linear", function () {
$(this).delay(800);
$(this).animate({opacity: 1}, 2, function () {
... | true |
7159c15b7e207ac74f8039e24300fb57d0db75d9 | JavaScript | ahsan8244/codeITSuisse2019 | /solutions/dep.js | UTF-8 | 1,843 | 3.125 | 3 | [] | no_license | let input={
"modules": ["m1","m27","m18","m31"],
"dependencyPairs": [
{"dependee":"m1","dependentOn":"m18"},
{"dependee":"m27","dependentOn":"m18"},
{"dependee":"m31","dependentOn":"m1"},
{"dependee":"m31... | true |
86e6eb09ed1e91274d1a8975cc98e7ee5d8d1afb | JavaScript | Alpine-Lemon/Standoff-2 | /Standoff-WhiteHatJr Project/sketch.js | UTF-8 | 1,304 | 2.875 | 3 | [] | no_license | var canvas, backgroundImage;
var gameState = 0;
var playerCount;
var database;
var form, player, game;
var player1a,player2a,player3a,player4a,player5a;
var player1b,player2b,player3b,player4b,player5b;
var player1apng,player2apng,player3apng,player4apng,player5apng,player1bpng,player2bpng,player3bpng,player4bpng... | true |
64422157533a6bf7a46739cabb8eac19e9288a15 | JavaScript | queridoamigo/querido-amigo | /homepage/js/game.js | UTF-8 | 12,312 | 2.984375 | 3 | [] | no_license | /* GAME */
/*
offsetCam = offsetFilm = camera and film roll coordinates;
score = game score;
name = player name;
nameDefault = default value for promt();
*/
//show highscores on start
$(document).ready(function() {
$.get( 'highlights.php', { record: 'start'}, function (result) {
$('#scoreList').append(result)... | true |
c8f5207d1ca40f9ee1068103ba234700694cd385 | JavaScript | 602147629/uguider | /server/server.js | UTF-8 | 4,846 | 2.65625 | 3 | [] | no_license | // server.js
var lastUpdateTime = 'clock';
var updateTime = function () {
lastUpdateTime = moment().format('MMMM Do YYYY, h:mm:ss a');
console.log(lastUpdateTime);
}
// methods
Meteor.methods({
'insertPost': function (title, url, source, user) {
// check if the link is already shared
if(isUniqueResult(url, 'Ot... | true |
5eb9f3f3eec88d153444e86c3cc4a457b670b961 | JavaScript | CaitlinBrooks/bcw-ZooDatabase | /app/Models/Lion.js | UTF-8 | 614 | 3.203125 | 3 | [] | no_license | import Warthog from './Warthog.js'
class Lion {
// WHAT ARE THE FORM FIELDS?
constructor(name, hairColor, gender, maneColor, weight) {
this.id = Math.random()
this.name = name || ''
this.hairColor = hairColor || ''
this.gender = gender || ''
this.maneColor = maneColor || ''
this.weight = we... | true |
9c74c5f4d80170acdd68b4bf77b79d7b96bb5080 | JavaScript | NoobNoobGRDW/EIA2 | /Aufgabe2/Aufgabe2.js | UTF-8 | 5,487 | 3.015625 | 3 | [] | no_license | /*
Aufgabe: 2
Name: Kuenz,Linus
Matrikel: 256331
Datum: 20.10.17
Hiermit versichere ich, dass ich diesen Code selbst geschrieben habe. Er wurde nicht kopiert und auch nicht diktiert.
*/
var Aufgabe2;
(function (Aufgabe2) {
window.addEventListener("load", init);
function init() {
let can... | true |
eda241f216aed8a7f37b486baeb1292954a51c3e | JavaScript | coded-textiles/coded-textiles.github.io | /sketches_19_20/burst_vectors/js/main_full_page_flow.js | UTF-8 | 778 | 2.859375 | 3 | [] | no_license | var inc = 0.01;
var scl = 20;
var speed = 0.0008;
var cols, rows;
function setup() {
canvas = createCanvas(window.innerWidth, window.innerHeight);
canvas.parent('sketch-container');
cols = floor(width / scl);
rows = floor(height / scl);
stroke(255);
strokeWeight(1);
}
function draw() {
bac... | true |
47fa0dd6763c3c1e8b7b819246cbe0d1d12c4599 | JavaScript | primehero/hostelManagement | /routes/user.js | UTF-8 | 1,237 | 2.53125 | 3 | [
"MIT"
] | permissive | var routes = require("express").Router();
var User = require("../models/user");
// INDEX route
routes.get('/', function(req, res) {
User.find({}, (err, foundUsers) => {
if (err)
req.flash('error', err);
res.render('user/index', { users : foundUsers });
});
});
// NEW route
routes.get('/new', functio... | true |
2e469cd07b442930e4edf2861e108a829b28001c | JavaScript | 0-mystogan/zadatak-tabela | /src/component/Input.js | UTF-8 | 1,866 | 2.640625 | 3 | [] | no_license | import React, { useContext, useState } from 'react';
import ZadatakContext from '../context/zadatak/zadatakContext';
import AlertContext from '../context/alert/alertContext';
const Input = props => {
const zadatakContext = useContext(ZadatakContext);
const alertContext = useContext(AlertContext);
const [red, setRe... | true |
38a49be7cc91691e1175f35ed85b4c7aa5dee5ca | JavaScript | tchken/geo-visualization | /js/chart1.js | UTF-8 | 8,941 | 2.65625 | 3 | [] | no_license |
//maximum meters global
const MAX_METERS=79;
//possible future sea levels for different greenhouse gas pathways
//https://www.climate.gov/news-features/understanding-climate/climate-change-global-sea-level#:~:text=Based%20on%20their%20new%20scenarios,above%202000%20levels%20by%202100.
//
//
//update the select button... | true |
77ca0c5c9ff9a510734cff469dc240d7a17b76f0 | JavaScript | evry-blockchain/sls-loan-front | /server/utils/prepare-single-data.js | UTF-8 | 333 | 2.9375 | 3 | [
"MIT"
] | permissive | module.exports = function(data) {
if(data === ']' || data === 'null' || data === null) {
return JSON.parse("[]")
} else {
return JSON.parse(data).map((item) => {
var temp = {};
for (var i in item) {
temp[i.charAt(0).toLowerCase() + i.slice(1)] = item[i];
}
return temp;
}... | true |
370b44159c69b4564208ac9f8dc63cce50bc15a2 | JavaScript | azfarsafri/azfarsafri.github.io | /backend.js | UTF-8 | 7,342 | 2.953125 | 3 | [] | no_license | //variabel const
//-----------------------------
const ON_PROGREES = "ON PROGRESS";
const ON_THE_WAY = "ON THE WAY";
const DELIVERED = "DELIVERED";
const IMG_ON_THE_WAY = "./Gambar/Animasi Delivery.gif";
const IMG_DELIVERED = "./Gambar/Animasi Burger.gif";
// Data-Structure
// ------------------------------
let food... | true |
fd21372dbf1cd4475d9385872cd9e6b89c13d472 | JavaScript | slecul/jquery-partie-4-exo-1 | /assets/js/exo1jq.js | UTF-8 | 2,434 | 3.734375 | 4 | [
"MIT"
] | permissive | $(function(){
//Créations de mes variables win/lose/tie.
var tie = 0;
var win = 0;
var lose = 0;
//je stocke mes var dans l'html pour pouvoir y acceder avec d'autres fonction.
$('#win').text(win);
$('#lose').text(lose);
$('#tie').text(tie);
//déclaration de ma fonction qui stocke la valeur saisie par ... | true |
329bf3b385404457042eedf0a3c09e733e5af7a7 | JavaScript | crystalboxesprivate/js-stuff | /node-api-postgres/src/index.js | UTF-8 | 877 | 2.71875 | 3 | [] | no_license | // based on
// https://blog.logrocket.com/setting-up-a-restful-api-with-node-js-and-postgresql-d96d6fc892d8/
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const port = 3000
app.use(bodyParser.json())
app.use(
bodyParser.urlencoded({
extended: true
})
)
a... | true |
388ba080e1a38e3d6fd00554135f67205afded01 | JavaScript | codegress/codegress | /static/js/challenge.js | UTF-8 | 600 | 3.109375 | 3 | [] | no_license | const fileSystem = require('fs');
var fileContentOne = fileSystem.readFileSync(__dirname+'/index.html');
var fileContentTwo = fileSystem.readFileSync(__dirname+'/index.html');
fileContentOne = String.fromCharCode.apply(null, fileContentOne);
fileContentTwo = String.fromCharCode.apply(null, fileContentTwo);
var oneArray... | true |
bcf98b8103be205863227a65d0e11cfa676fa613 | JavaScript | dimo-ivanov/adidas-hackathon-front | /src/helpers/auth.js | UTF-8 | 1,548 | 2.78125 | 3 | [] | no_license | export class Auth {
static authenticateUser (token, user) {
window.localStorage.setItem('token', token)
window.localStorage.setItem('user', JSON.stringify(user))
}
static isUserAuthenticated () {
return window.localStorage.getItem('token') !== null
}
static deauthenticateUser () {
window.loc... | true |
5f69c0523e8ec03d92b414b396709e01479a5f4a | JavaScript | prathick/codingchallenge | /coding-challenge/coding.js | UTF-8 | 2,321 | 3.015625 | 3 | [] | no_license | var courses=[
{
id:1,
course:"Programming in C"
},
{
id:2,
course:"Distributed Computing"
},
{
id:3,
course:"Database Systems"
},
{
id:4,
course:"Algorithms 1"
},
{
id:5,
course:"Algorithms 2"
},
{
id:6,
course:"Programming in Java"
},
{
id:7,
course:"Advanced Programming in Jav... | true |
6cdd9c331c242d1e96951d309d6779a165c90085 | JavaScript | wagtail/wagtail | /client/src/components/StreamField/blocks/FieldBlock.test.js | UTF-8 | 7,146 | 2.578125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-proprietary-license"
] | permissive | import $ from 'jquery';
import { FieldBlockDefinition } from './FieldBlock';
window.$ = $;
window.comments = {
getContentPath: jest.fn(),
};
// Define some callbacks in global scope that can be mocked in tests
let constructor = (
_widgetName,
_name,
_id,
_initialState,
_parentCapabilities,
_options,
) ... | true |
5f5deb4f736678f27c0cd87f571eeba2d4f97e1a | JavaScript | surbhiguptasai/React2021 | /May-React/Day10/step12-portals/src/index.js | UTF-8 | 2,088 | 2.53125 | 3 | [] | no_license | // import React, { Component } from 'react';
// import ReactDOM from 'react-dom';
// class PortalApp extends Component{
// render(){
// return ReactDOM.createPortal(<h2>Contents in Boxer Div Tag</h2>,
// document.getElementById("boxer"))
// }
// }
// class MainApp extends Component{
// ... | true |
575d4e8d1a6fe9b2d29eb17780de965e22e41df9 | JavaScript | Vijay-shankar-08/React-Practice | /src/components/Badminton/WinningComponent.js | UTF-8 | 1,938 | 2.953125 | 3 | [] | no_license | import React from "react";
import PropTypes from "prop-types";
function WinningComponent({ scores }) {
let sum = Object.entries(scores).map(([key, value]) => {
return value.reduce((a, b) => a + b);
});
let keys = Object.entries(scores).map(([key, value]) => {
return key;
});
let max;
for (let i = 0... | true |
bea49810f9eed46cd6f7e12879a106c9c90c7601 | JavaScript | lasryaric/hellobill-desktop | /ClientSideDownloader/zendesk.js | UTF-8 | 997 | 2.515625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | 'use strict';
function getiframe() {
return new Promise((yes,no) => {
yes(document.querySelector('iframe').src);
})
}
function download(date, offset, done, next) {
//date: 2016-01
offset = offset || 0;
const _ = window.__hellobill.utils._;
const moment = window.__hellobill.utils.moment;
const regSt... | true |
e73e9515e78a15afdffd59261405e3d9a596266e | JavaScript | kflu/btree.js | /lib/btree.js | UTF-8 | 8,464 | 3.140625 | 3 | [] | no_license | var assert = require('chai').assert;
/**
* BTree
* @constructor
* @param {int} minDegree minimum degree
*
*/
function BTree(minDegree, provider) {
this.minDegree = minDegree;
this.root = new BTreeNode(this, null);
this.provider = provider;
}
/**
* Insert data into the BTree
* @param {Object} key th... | true |
9cd738119fb300bd9c2d53a6400c7a3e990fdbba | JavaScript | moonman239/block2challenge | /utilities.js | UTF-8 | 1,476 | 2.90625 | 3 | [] | no_license | import {apiKey} from './gmapsapi.js';
function navigationPromise()
{
return new Promise((resolve,reject) =>
{
navigator.geolocation.getCurrentPosition(resolve,reject);
})
}
window.getLocation = async function()
{
document.getElementById("go").disabled = true;
const position = await navigati... | true |
a92d7124d0c50cb804edfea6fc57adcadf753065 | JavaScript | McDubzter/Connect4new | /js/app.js | UTF-8 | 2,527 | 3.546875 | 4 | [] | no_license | document.addEventListener('DOMContentLoaded', () => {
const squares = document.querySelectorAll('.grid div')
const result = document.querySelector('#result')
const newgame = document.querySelector('#newgame')
const displayCurrentPlayer = document.querySelector('#current-player')
let currentPlayer = 1
for ... | true |
d7f0bdb9f267fe6164a96c2c554408d51061595c | JavaScript | flashim/es6-babel-gulp | /src/app.js | UTF-8 | 89 | 2.59375 | 3 | [
"MIT"
] | permissive | const person = {
name: 'Ashim Saha'
};
const testString = `My name is ${person.name}`; | true |
d8ea61ee0a7ea4b3a07ea8116346cb5bce76faf3 | JavaScript | J0nasW/MA | /Archive/examples/gps_read.js | UTF-8 | 824 | 2.578125 | 3 | [] | no_license | const SerialPort = require("serialport");
const SerialPortParser = require("@serialport/parser-readline");
const GPS = require("gps");
const port = new SerialPort("/dev/ttyS0", { baudRate: 9600 });
const gps = new GPS();
const parser = port.pipe(new SerialPortParser());
gps.on('data', function(data) {
console.lo... | true |
9e3be8b7095922e1c49aca58c571cb29b85513e5 | JavaScript | Zhaox349/zhaox349.github.io | /JS/main.js | UTF-8 | 4,452 | 4.15625 | 4 | [] | no_license | //alert box//
console.log('hi everyone~');
alert('hi everyone!!');
/* Question 1 */
// A string consisting of your name //
let name = 'Chichi';
console.log(name);
// Your favorite number as an integer//
let MyFavNumber = 7;
console.log(MyFavNumber);
//Your favorite number as a string//
let num = 7;
String (num);
con... | true |
8bbb15efdefe37aefdab39ba0df7af00ff5ba132 | JavaScript | Killy85/evaluation-functional-js-3 | /src/exercise3.js | UTF-8 | 611 | 2.71875 | 3 | [] | no_license | const _ = require("lodash");
const meeteek = input => {
input.reduce(
(acc,value) =>{
acc[value.firstname] = input
.filter(val => value.sexPartnerApproved.includes(val.sex))
.map(x => {return { 'name': x.firstname, 'commonInterest' : common(value.interests, x.interests)} }
)
return ac... | true |
3f8a7a6de36ec2af76ac2804a936816972918e9e | JavaScript | rathoredeveshbly/Invoices | /src/Form.js | UTF-8 | 1,605 | 2.78125 | 3 | [] | no_license | import { useState } from "react"
const Form =(props)=>{
const [entry,setEntry]=useState({name:"",rate:"",quantity:"",discount:"",tax:""})
const handleChange=(e)=>{
const value = e.target.value;
setEntry({
...entry,
[e.target.name]: value
});
}
console.log(entry)
const handleSubmit=(e)=>... | true |
c359e54d108e46cc910212162907035e88dd2e41 | JavaScript | Imrikmar66/OldRPG | /js/class/Spell.js | UTF-8 | 4,147 | 2.53125 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | function Spell(name, sprite, spriteW, spriteH, spriteFrames, animeSpeed, type){
this.spellName = name;
this.spellSprite = sprite;
this.spellSpriteWidth = spriteW;
this.spellSpriteHeight = spriteH;
this.spellSpriteFrames = spriteFrames;
this.joueurSprite = '';
this.joueurSpriteWidth = 0;
this.joueurSpriteHeight ... | true |
783c877563e15ba64b576b560c3ac5d1c38e75ab | JavaScript | AlexHimchak/TriviaGame | /assets/javascript/app.js | UTF-8 | 2,389 | 3.203125 | 3 | [] | no_license | $(document).ready(function() {
var unanswered = 0;
var right = 0;
var wrong = 0;
var number = 10;
var temp = 2;
var temp2 = 2;
var temp3 = 2;
var intervalId;
$('#container').hide();
$("#stop").on("click", stop);
$("#resume").on("click", run);
$(".button").on("click", ... | true |
5ef4dc400d931924caac866fbee99fb21833c6b2 | JavaScript | rancho83a/JavaScriptEducation | /JS Applications/02 Ex Asynchronous Programming/02. JS-Applications-Asynchronous-Programming-Exercise-Resources/02.Bus-Schedule/appMy.js | UTF-8 | 785 | 2.875 | 3 | [] | no_license | function solve() {
const departBtn = document.getElementById('depart');
const arriveBtn = document.getElementById('arrive');
let url = 'http://localhost:3030/jsonstore/bus/schedule/';
let id = 'depot'
let span = document.querySelector('.info');
let info;
async function depart() {
c... | true |
eb6ef40244202fec8b41b039f4fb7d4d3c5f73d3 | JavaScript | mbrattonBSU/MichaelBratton | /MuncieEventsApp-master/pages/Home.js | UTF-8 | 3,999 | 2.640625 | 3 | [] | no_license | import React from 'react';
import {View, ActivityIndicator, Text, TouchableOpacity, FlatList} from 'react-native';
import EventRender from "../EventRenderer"
import TopBar from './top_bar';
import DateAndTimeParser from "../DateAndTimeParser"
import * as Animatable from 'react-native-animatable'
export default class H... | true |
2fb8e84003220eaff771158e12501c88e526b2c1 | JavaScript | adclleva/Exercise-Tracker-MEARN-Learning-App | /frontend/src/components/create-exercise.component.js | UTF-8 | 3,094 | 2.875 | 3 | [] | no_license | import React, { useState, useEffect, useRef } from 'react'
import { Redirect } from 'react-router-dom'
import DatePicker from 'react-datepicker'
import "react-datepicker/dist/react-datepicker.css"
/* This component allows us to add data to the database*/
function CreateExercise() {
const [username, setUsername] = us... | true |