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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4c6c6d16f96d2f9649777dcdc99dd0ffb0cc363e | JavaScript | Reymdusk/GSReactNative | /components/UnitInfoComponent.js | UTF-8 | 1,866 | 2.703125 | 3 | [] | no_license | //TODO Basic Unit Detail structure
import React from 'react';
import { View, Text } from 'react-native';
import { Image, Card } from 'react-native-elements';
import { UNITINFO } from '../shared/unitInfo';
class UnitInfo extends Component {
constructor(props) {
super(props)
this.state = {
... | true |
6730aaca5361b686d947f3d03160c3b82f259466 | JavaScript | Hassan-Ib/comfy-with-react | /src/context/context.js | UTF-8 | 4,200 | 2.59375 | 3 | [] | no_license | import React, { useState, useEffect, useContext } from "react";
// import data from "./data";
import {
localCart,
destructureFetchProduct,
fetchProduct,
getLocalData,
} from "./helper";
// explore?access_token=W3UjDMEZRW869nRjFz0i9QwA7KdSZi6KWCirjeEVpJQ`
// create context
const ProductContext = React.createCo... | true |
cf34f94291737435f7e13bbc0e0f30799e980df6 | JavaScript | karihold/kari-holdcroft-js-frameworks-ma4.js | /src/components/RecipeList/RecipeList.jsx | UTF-8 | 1,009 | 2.65625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import SearchRecipe from '../SearchRecipe/SearchRecipe';
import RecipeItem from '../RecipeItem/RecipeItem';
function RecipeList({ baseUrl }) {
const [filter, setFilter] = useState('');
const [recipes, setRecipes] = useState([])... | true |
fa620cb31eb8eac056436b00ae93382cd59de4ac | JavaScript | jjspider277/weddings | /src/backend/ComunBundle/Resources/public/base/plugins/calendar/calendar.js | UTF-8 | 4,777 | 2.671875 | 3 | [
"MIT"
] | permissive | var Calendar = function () {
return {
//main function to initiate the module
init: function (array) {
Calendar.initCalendar(array);
},
initCalendar: function (eventos) {
for(var u=0;u<eventos.length;u++)
// eventos[u]["backgroundColor"]=A... | true |
0c8e88028bb0cbee10ec051a27609178f40dfdbe | JavaScript | erikaxelmeurk/Uniquiz | /src/js/useModelProp.js | UTF-8 | 382 | 2.765625 | 3 | [] | no_license | import {useEffect, useState} from "react";
function useModelProp (model, prop) {
/** Used to listen to changes in the model and update state */
const [propValue, setPropValue] = useState(model[prop]);
useEffect (function() {
return model.addObserver(() => setPropValue(model[prop]));
}, [model,... | true |
b7ebf1a350c82ddaf5efcfe61a1f7b852533113b | JavaScript | SamG06/streaming-service-clone | /src/js/components/HomePage.js/pieces/SearchSection.js | UTF-8 | 1,033 | 2.5625 | 3 | [] | no_license | import { searchData } from "../../../tools";
import { createMediaCard } from "./MediaSection/MediaCard";
export const SearchSectionHTML = /*html*/ `
<div class="search-section display-none">
<div class="search-results">
</div>
</div>
`;
const searchMedia = async (query) => {
const r... | true |
910eea99c6bb8f2d934edd58c6a97152709a68ae | JavaScript | elmauro/xd_game | /app/scripts/juego_pelota.js | UTF-8 | 1,281 | 2.90625 | 3 | [] | no_license | window.onload = function () {
// variables del juego
var game = new Phaser.Game(800, 400, Phaser.AUTO, 'game', {preload: preload, create: create, update: update});
//declaramos las variables globales del juego
var pelota;
var cursors;
function preload() {
game.load.image('pelota', '/im... | true |
373c3abd46c6bea6012464f51264a064d92201de | JavaScript | MelindaSW/coding-challenges | /javascript/freeCodeCamp/noRepeatsPlease.js | UTF-8 | 221 | 3.203125 | 3 | [] | no_license | // https://www.freecodecamp.org/learn/coding-interview-prep/algorithms/no-repeats-please
// permutations = !NrOfLetters / !nrOfRepeatingLetters!nrOfRepeatingLetters
// aab (2) aabb(8)
console.log((3 * 2 * 1) / (2 * 1))
| true |
a30330d194bec8737880d8a8358ba2943160a557 | JavaScript | baderfahoum17/Javascript | /chat_project/scripts/app.js | UTF-8 | 1,769 | 2.84375 | 3 | [] | no_license | const chatList = document.querySelector('.chat-list');
const chatform = document.querySelector('.new-chat')
const nameform = document.querySelector('.new-name');
const updatemssg = document.querySelector('.update-mssg');
const rooms = document.querySelector('.chat-rooms');
// console.log(nameform);
// console.log(form... | true |
1b235145920ebfdae8a5b71e78016892c1cfb5f4 | JavaScript | mikolertesx/bible-study-nuxt | /store/read.js | UTF-8 | 4,761 | 2.546875 | 3 | [] | no_license | import { BibleSizedCache } from '@/util/SizedCache'
import { booksInOrder } from '@/util/bibleBooks'
let source = null
const cache = new BibleSizedCache()
export const state = () => {
return {
currentBook: 'Psalms',
currentChapter: '119',
verses: [],
error: null,
loading: false,
}
}
export co... | true |
ae8dc852a3ef3d3996b88de8337e3d7b20bf4bfe | JavaScript | jonrodrigues24/fullstack-basics | /variables-and-data.js | UTF-8 | 424 | 3.796875 | 4 | [
"Apache-2.0"
] | permissive | /**
* Variables, Data Types, and Typing
*/
let wordData;
wordData = "Word list";
console.log(wordData);
let subTotal = 100;
let tax = subTotal * 0.07;
let totalWithTax = tax + subTotal;
let obj = {
key1: "Value 1",
key2: 4,
boolean: true,
obj2: {
obj2Key1: "value of inner object",
}
};
console.... | true |
9447480620bd94c73f61459e9092760a36c5ea37 | JavaScript | emanelewa/ide_javascript | /task 5/setbackground/js.js | UTF-8 | 378 | 2.9375 | 3 | [] | no_license | // variables
const btnButton = document.getElementById("myButton"),
pAll =document.querySelectorAll(".myP");
// Action (functions)
const pHandel = function (e) {
addBackground();
};
const addBackground = function(e){
for (let i = 0; i < pAll.length; i++){
pAll[i].classList.add("bg_white") ;
}
}... | true |
67ba8c09f426547ec983e05433cfef543e182a7d | JavaScript | kyleresnik/teamAppServer | /controllers/usercontroller.js | UTF-8 | 2,888 | 2.515625 | 3 | [] | no_license | // IMPORTS
require('dotenv').config();
const router = require('express').Router();
const sequelize = require('../db');
const bcrypt = require('bcryptjs');
const jwt = require('jsonwebtoken');
const User = sequelize.import('../models/user');
// const Profile = sequelize.import('../models/profile');
// const validateSess... | true |
f8637c1e3c033877a2bb16f45d61db73fbd7f22a | JavaScript | abdilatifbashir/questionFour | /solutions.js | UTF-8 | 4,505 | 3.796875 | 4 | [] | no_license | var faker = require('faker');
// Exercise 1 : Question 1
const transformQuestionOne = (input) => {
const obj = {}
if (!input || input.length === 0) return obj
for (let index = 0; index < input.length; index++) {
const arr = input[index]
const firstItem = arr[0]
const otherItems = ... | true |
0982979d7fa5acffa4b71483b3d9e7a2d0f3b9cb | JavaScript | NavyaAkanksha/mswd | /part1/1.6/App-1.6.js | UTF-8 | 1,255 | 2.8125 | 3 | [] | no_license | import React, { useState } from 'react'
const Button = ({txt, hndlclck}) => <button onClick={hndlclck}>{txt}</button>;
const App = () => {
const [good, setGood] = useState(0)
const [neutral, setNeutral] = useState(0)
const [bad, setBad] = useState(0)
return (
<div>
<h1>give feedback</h1>
... | true |
c972f54aae387281b9887e98da0c22d1ac8c4c01 | JavaScript | Liubov33/fl-9 | /FE_9_7_homework_control-flow/homework/src/js/task2.js | UTF-8 | 1,255 | 4.03125 | 4 | [] | no_license | let message = confirm('Do you want to play a game?');
while (message) {
var counter = 0;
var attemptsLeft = 3;
var nextAttempt = true;
var range = 6;
var price = 10;
var totalPrice = 0;
var tryAgain = 0;
var randomNumber = Math.floor(Math.random() * range);
const one = 1;
while... | true |
958a102b80d6f9b305b425e7e65bef9e44bd13c1 | JavaScript | MaxLau88/fsd-todo-app | /src/App.js | UTF-8 | 3,042 | 2.609375 | 3 | [] | no_license | import 'bootstrap/dist/css/bootstrap.css';
import {Col, Container, Row} from "react-bootstrap";
import {EntryInput} from "./components/EntryInput";
import {EntriesList} from "./components/EntriesList";
import {TodoListTitle} from "./components/TodoListTitle";
import {ListFilters} from "./components/ListFilters";
import... | true |
13a43a389752382c624d0666645aefb7c9085708 | JavaScript | romacardozx/ITicket | /api/src/controllers/stats.js | UTF-8 | 3,410 | 2.75 | 3 | [] | no_license | const { Tickets, Users, Events } = require("../db.js");
const { finder } = require('./events.js')
function removeDuplicates(originalArray, prop) {
var newArray = [];
var lookupObject = {};
for(var i in originalArray) {
lookupObject[originalArray[i][prop]] = originalArray[i];
}
for(i in l... | true |
121c289fccde0a7f9b86014b007bfbfc30c078a0 | JavaScript | jeffbinder/distancemachine | /public_html/activity.js | UTF-8 | 323 | 2.625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | function update_activity()
{
$.get("getactivity.php", function (data) {
$("#activity-area").html(data);
})
.fail(function() {
$("#activity-area").html("Error getting list of recent searches!");
});
}
$(function () {
update_activity();
window.setInterval(update_activity, 1000);
}... | true |
cb60493399e65122e0c6b19a9116253e9af34259 | JavaScript | jtmalinowski/game-off-2013 | /tests/server/map.js | UTF-8 | 13,473 | 2.78125 | 3 | [] | no_license | var assert = require('assert');
var should = require('should');
var _ = require('underscore');
var Map = require('../../server/map');
var Field = require('../../server/field');
var Player = require('../../server/player');
var Army = require('../../server/army');
describe('Map',function (){
it('should exist & constru... | true |
7817a16203ea70b82a86fc7e5caab522d47b9847 | JavaScript | chismitnick/JavaScriptKatas | /Basics/first.js | UTF-8 | 464 | 4.125 | 4 | [] | no_license | // A simple program to introduce the basic cooncepts of Javascript programming
// csamiselo@github.com December 2019
var number1 = 10;
var number2 = 20;
var sum;
var difference;
var product;
var quotient;
sum = number1 + number2;
difference = number1 - number2;
product = number1 * number2;
quotient = number1 / numbe... | true |
8c765df6dc356c3b04ad6f636ee066f4a7b09b93 | JavaScript | mrosas22/Ironhack-Class | /Module2/week3/awesome-project/routes/author-routes.js | UTF-8 | 993 | 2.671875 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
const Author = require('../models/author-model')
router.get('/authors/new', (req, res, next) =>{
res.render('author-views/new-author')
})
//<form action="/authors/create" method="post">
router.post('/authors/create', (req, res, next) =>{
/... | true |
67dce43c1ef7d7d357f5303172a0d45d6bf00466 | JavaScript | lauraebel/TechElevator-Lectures-and-Exercises | /module-4/03_JavaScript_Functions/lecture-final/lecture2.js | UTF-8 | 2,590 | 4.59375 | 5 | [] | no_license | // variable in global scope
let name = 'John';
function greeting(nameToGreet) {
console.log(nameToGreet);
}
/* Spread Operator */
function multipleWithSpread( x, y , z) {
return x * y * z;
}
let args = [1, 2, 3];
console.log( multipleWithSpread(...args) );
function addWithSpread(a, b, c) {
return a + ... | true |
b00d6ee1e9ede213cca2b54893a28c45a1018e5a | JavaScript | Nyambura254/Javascript_basics-lakehubloop4.0 | /odjects.js | UTF-8 | 1,250 | 3.890625 | 4 | [] | no_license | //expanded object functionality in E6
const my_class = {
stream: "green",
population: 25,
grade: "senior",
school: "jalaram"
}
//accessing values within js objects
my_stream = my_class.stream; //use dot notation to access object
console.log(my_stream);
//add new property to using dot notation
my_cla... | true |
c6a0574f721aeeea0e75df8bf70de16036c774ee | JavaScript | akyol/MIPS-Simulator | /js/main.js | UTF-8 | 7,248 | 3.203125 | 3 | [] | no_license | /**
* Abraham Lee, Tammy Vo, Jonathan Kim
* TCSS 472
* Project 1
*/
// program counter that is incremented by 4 everytime instruction is executed
var pc = 0;
// register id names to set and receive values from
var registers =
[
"zero", "v0", "v1", "a0", "a1", "a2", "a3",
"t0", "t... | true |
570b649c0a8700f61ba189d22090c51b0b0ac821 | JavaScript | andrewnaumann/wikipedia-viewer | /js/app.js | UTF-8 | 3,589 | 2.65625 | 3 | [] | no_license | $(document).foundation();
var API_ENDPOINT = 'http://en.wikipedia.org/w/api.php?';
var $searchButton = $('.search-button');
var $searchField = $('.search-query');
$searchButton.on('click', searchForArticles);
$searchField.keyup(function(event) {
if(event.keyCode === 13){
searchForArticles();
}
});
fu... | true |
a2ef7daa82529c7c1c746f9f3f161088af408d1d | JavaScript | Jacob-Friesen/unsafe_minifier | /app.js | UTF-8 | 3,606 | 2.890625 | 3 | [
"MIT"
] | permissive | // To Run: node main.js <flag(s)>
// To Run All: node main.js -g -t -m <your_file>
// flags:
// -h/help: Display how to use program (your here currently)
// -g/-generate: Generate the test data
// -t/-train: Train system on test data
// -m/-minify: Minify a file using the network trained
var _ = require('lod... | true |
475d79504bb5abe66742d112bf0b4e6fe9ee3fb1 | JavaScript | go-lani/algorithm | /study_insertion_sort.js | UTF-8 | 971 | 4.21875 | 4 | [] | no_license | // 삽입정렬
// 삽입정렬이란?
// 삽입 정렬은 두번째 인덱스 부터 시작
// 해당 인덱스(key 값) 앞에 있는 데이터(B)부터 비교해서 key 값이 더 작으면, B값을 뒤 인덱스로 복사
// 이를 key값이 더 큰 데이터를 만날때까지 반복 수행, 그리고 큰 데이터를 만난 위치 바로 뒤에 key 값을 이동
// 중복없는 난수 배열 만드는 함수
function randomArray(array, length) {
const n = Math.floor(Math.random() * (length * 2)) + 1;
if (array.length < leng... | true |
d35dd8c0c7de27e3cf4a8f4402fe29db932204db | JavaScript | dojo-react-workshop/jack_weisse | /react_playground/counter/src/index.js | UTF-8 | 1,305 | 3.03125 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
class Counter extends React.Component {
constructor(props) {
super(props);
this.state = {
count: props.count,
key: props.name
}
}
increment = ()=>{
let temp = this.state.count+1;
this.setState({
count:temp
});
}
decrement = ()=>... | true |
74a83fc6e7d748d9c689d3006ef98aa0b13f4db5 | JavaScript | zach-hu/srr_java8 | /PuridiomWeb/web/scripts/ajaxlookup.js | UTF-8 | 3,005 | 2.734375 | 3 | [
"MIT"
] | permissive | // We create the XMLHTTPRequest Object
var http = getHTTPObject();
var tableRecordFound = false ;
var tableUrlPath = "" ;
var tableOid = "" ;
var tableUid = "" ;
function getHTTPObject() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObje... | true |
b0aa8eaed88186c362e819fd7c4cc7bb05cbd530 | JavaScript | leonel122/test2 | /src/services/addresses/hooks/register-address.js | UTF-8 | 1,936 | 2.578125 | 3 | [
"MIT"
] | permissive | // Use this hook to manipulate incoming or outgoing data.
// For more information on hooks see: http://docs.feathersjs.com/api/hooks.html
const {
checkContext,
getItems,
replaceItems,
} = require("feathers-hooks-common");
const { NotFound, NotAcceptable } = require("@feathersjs/errors");
// eslint-disable-next-l... | true |
095d5742f516ecc024c9aea59751975442ca042d | JavaScript | 15200933050/React-Canvas | /src/js/BackgroundCanvas.js | UTF-8 | 2,596 | 3.234375 | 3 | [] | no_license | let cx = document.getElementById('canvas');
let ctx = cx.getContext('2d');
let lay = [15, 7];
let dots = [];//点
let lines = [];
let areas = [];//线
//构建
function construct() {
let m = lay[0];
let n = lay[1];
for (let i = 0; i < m; i++) {
for (let j = 0; j < n; j++) {
let dot = {
x: (cx.width / (... | true |
249b80d73a804dd49733128e989c0cb326e1ef1a | JavaScript | shraey96/gify-tree | /src/utils/giphyUIHelpers.js | UTF-8 | 1,965 | 2.71875 | 3 | [] | no_license | import { isMobile } from "./helpers"
/**
* @function getGifHeight
* @param {object} data
* @param {number} gifWidth
* @description Gets gif height based on gif width
* @returns {number}
*/
export const getGifHeight = ({ images }, gifWidth) => {
const { fixed_width } = images
if (fixed_width) {
const { wi... | true |
762a8d56327b9a587415b844565c062c6ed55524 | JavaScript | miguel-osuna/Web-Development-Course | /javascript/advanced_javascript/ECMAScript_Test/es8_test_exercise.js | UTF-8 | 1,068 | 4.625 | 5 | [] | no_license | // Solve the following problems
// 1. Line up the Turtle and the Rabbit at the start line:
const startLine = " ||<- Start line";
let turtle = "🐢";
let rabbit = "🐇";
// Adds " " characters enough to make a total of 9
turtle = turtle.padStart(7 + turtle.length, " ");
rabbit = rabbit.padStart(7 + rabbit.length, " ... | true |
6ed793cf5b29e4c2047b427995ee7ef119409234 | JavaScript | jeremythings/express-passport | /my-modules/setuppassport.js | UTF-8 | 5,286 | 2.78125 | 3 | [] | no_license | // load all the things we need
var LocalStrategy = require('passport-local').Strategy;
var db = require('../my-modules/db');
var bcrypt = require('bcrypt-nodejs');
console.log("passport - connection");
// expose this function to our app using module.exports
module.exports = {
setup: function(passport) {
// SE... | true |
2be5810da3c4e77b88fb870ba951ff0f63abaeed | JavaScript | sk220/canvasMiniGame | /src/background.js | UTF-8 | 1,633 | 2.875 | 3 | [
"MIT"
] | permissive | // backgroud
const background = new Image();
background.src = 'img/background/parallax-mountain_without_motion_bg.png';
function handleBackground(){
ctx.drawImage( background, 0, 0, canvas.width, canvas.height);
}
//clouds
const clouds = new Image();
clouds.src = 'img/background/parallax-mountain_0004_Clouds.png';... | true |
11bf71b51b7ea48147017c6eeca629d45e4d96e1 | JavaScript | antonmerkotun/project-ham | /script/script.js | UTF-8 | 3,798 | 2.796875 | 3 | [] | no_license | 'use strict'
// Our Services
const tabsListOurServices = document.querySelector('.our-services-menu');
tabsListOurServices.addEventListener('click', tabsOurServicesMenu);
function tabsOurServicesMenu(element) {
const data = element.target.dataset.type;
document.querySelector('.activeOurServicesText').classLi... | true |
65954312dd64c75a12da5da2bec82cc0f3243025 | JavaScript | ptcayetano/shoutbux | /js/landing.js | UTF-8 | 2,423 | 2.609375 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
Cookies.remove('id');
Cookies.remove('name');
Cookies.remove('username');
var login_id = '#signin-container',
register_id = '#register-container';
function toggleProcessing(id, show) {
if (show) {
$(id + ' .btn-signin').addClas... | true |
f6b09c97d255374c23777c379d86cce726a02f6d | JavaScript | danielhanold/DannySink | /Resources/windows/event_handling.js | UTF-8 | 1,993 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | W.EventHandling = function() {
var win = UI.Win({
title:'Event Handling',
backgroundColor:'#FFFFFF',
objectName:'window'
});
// Add a view with a yellow background.
var view = Ti.UI.createView({
backgroundColor:'yellow',
width:'80%',
height:'80%',
objectName:'view'
});
var ... | true |
8a83c98a28a762fc8fd2808bea8889bd70979392 | JavaScript | LazyBone2017/OAuth2-Server | /src/DBInterface.js | UTF-8 | 5,515 | 2.703125 | 3 | [
"MIT"
] | permissive | const mysql = require("mysql");
const util = require("util");
class DBInterface {
static instance;
constructor(mysqlConfig) {
if (DBInterface.instance) return DBInterface.instance;
this.mysqlConfig = mysqlConfig;
this.connectDB();
DBInterface.instance = this;
}
conne... | true |
aac2648ab753c11f394d4deb4a1fd8b31a56d30c | JavaScript | beuoon/DQN_Meteor | /DQN/ErrorLayer_MSE.js | UTF-8 | 492 | 2.671875 | 3 | [] | no_license | let ErrorLayer_MSE = function () {
}
ErrorLayer_MSE.prototype = {
calc: function (output, label) {
let error = [];
let layerSize = output.length;
for (let i = 0; i < layerSize; i++)
error[i] = 0.5 * Math.pow(label[i] - output[i], 2);
return error;
},
diff: function (output, label) {
l... | true |
e7dd75caa2fc139f583b77c176521d35ae902b52 | JavaScript | Pradeep6149/CS_546_group23_final_project | /public/js/employeeCreation.js | UTF-8 | 465 | 2.671875 | 3 | [] | no_license |
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
};
reader.readAsDataURL(input.files[0]);
}
}
let i = 0;
... | true |
fc045db3cd669d863062652757703ad711d4879f | JavaScript | kianev/JavaScript-Fundamentals-Exams | /31.01.2016/4. Minka.js | UTF-8 | 1,960 | 3.015625 | 3 | [] | no_license | function minka(input) {
let list = {};
for (let i = 0; i < input.length; i++) {
let [name, type, number, score, lines] = input[i].split(" & ");
let taskNumber = "Task " + number;
if(!list.hasOwnProperty(taskNumber)){
list[taskNumber] = {tasks: [], average: 0, lines: 0, score:... | true |
f9cacfd049e12f796ab32519472ad847a43c21aa | JavaScript | levinine/javascript-matf-2019 | /lecture_06/second-part-examples/sets2.js | UTF-8 | 166 | 3.09375 | 3 | [] | no_license | var set = new Set(['a','b','c','d','e']);
var iterator = set.values();
console.log(iterator.next());
var iterator2 = set.keys();
console.log(iterator2.next()); | true |
51df28bb1d0ba2019a1a7c26aff69c627f5d3868 | JavaScript | RookieXie/RightManage | /_output/Web/Ataw.WebSite/AtawStatic/lib/01Base/07Loader/kittyLoader.js | GB18030 | 3,771 | 2.625 | 3 | [] | no_license | //ָdata-main
(function () {
var loader = {
};
var packages;
var getPathToScriptTagSrc = function (scriptTagSrc) {
scriptTagSrc = "/" + scriptTagSrc.toLowerCase();
var scriptTags = document.getElementsByTagName("SCRIPT");
for (var i = 0; i < scriptTags.length; i++) {
v... | true |
a296726c333a52271ce17eb8853bf0b3d33101ad | JavaScript | flvanroekel/web-340 | /Week 7/chai-example/test/vanroekel-exercise-7.3.js | UTF-8 | 463 | 2.734375 | 3 | [] | no_license | /*
============================================
; Title: chai example
; Author: Faye Van Roekel
; Date: 20 September 2019
; Description: chai Example
;===========================================
*/
var fruits = require("../vanroekel-fruits");
var chai = require("chai");
var assert = chai.assert;
describe("fruits... | true |
6f2304f0ca2c2c3e6653441c2567327b4834de34 | JavaScript | khirshah/react_weather-app | /server/server.js | UTF-8 | 2,344 | 2.9375 | 3 | [] | no_license | 'use strict'
//---------------------- INIT ---------------------------------
const fetch = require('node-fetch')
//---------------------- express -------------------------
const express = require('express');
const app = express();
const PORT = process.env.PORT || 3030;
//-------------------- body parser ---------------... | true |
cd4372732cf7f90a31d8b520e6645e9dea7810dc | JavaScript | tranngocb/codeup-web-exercses | /js/switch.js | UTF-8 | 2,250 | 3.5 | 4 | [] | no_license | /**
* Created by bichtran on 4/10/17.
*/
var luckyNumber = Math.floor(Math.random()* 6);
var receipt = 60.00;
/* var luckyNumber = 1; */
var discountReceive = 0.00;
console.log(luckyNumber);
switch (luckyNumber) {
case 0:
console.log("Good luck for next time");
break;
case 1:
console... | true |
3f07c747687b292bfcc479a473d3680245f99c9d | JavaScript | ocedal9/algorithms | /al10/function.js | UTF-8 | 202 | 2.703125 | 3 | [] | no_license | function shuffle(a) {
var temp
for (let n = 0; n < a.length; n++) {
temp = Math.trunc(Math.random() * a.length)
;[a[n], a[temp]] = [a[temp], a[n]]
}
return a
}
module.exports = shuffle
| true |
399a738c17ca88a6344b24fcfe917c385e6af865 | JavaScript | YangChengTeam/dx | /dx.js | UTF-8 | 2,798 | 2.609375 | 3 | [] | no_license | const request = require("request")
const exec = require('child_process').exec;
function common(url, body) {
var promise = new Promise((r, j) => {
request.post({ url: url, body: body }, (e, resp) => {
if (e) {
j();
} {
try {
r(JSON.parse(resp.body));
} catch (e) {
... | true |
21c158837755073c3e229acfd9bc12625f8e7f52 | JavaScript | Dodomuk/Algorithms | /programmers/lv1/덧칠하기.js | UTF-8 | 709 | 3.625 | 4 | [] | no_license | function solution(n, m, section) {
const wall = Array(n + 1).fill(false);
let count = 0;
for (let index = 0; index < section.length; index++) {
if (!wall[section[index]]) {
count++;
wall.fill(true, section[index], section[index] + m);
if (section.every((e) => wall[e])) {
return coun... | true |
9ed69e0a62204c62bef4ef8852192ccd45933a56 | JavaScript | ehdcjf/solidity-sample-1 | /sample.js | UTF-8 | 1,685 | 2.734375 | 3 | [] | no_license | const Web3 = require('web3');
let connection = new Web3('http://127.0.0.1:8545');
connection.eth.getAccounts()
.then(data =>{
console.log(data);
})
connection.eth.getBalance('0x8Ae1B58a72067470583b9E3AA20EC59Baf9DFB93')
.then(data =>{
console.log(data);
})
const ABI_CODE =JSON.parse(`[{"inputs":[],"stateMutab... | true |
09b12e0093855aaad5d699923d0d48b2a3dffeb6 | JavaScript | StopTouchingMeElmo/Algorithms-VanillaJS | /VanillaJS/plugins_js/app_2.0/plugins/modal.js | UTF-8 | 8,334 | 3.046875 | 3 | [] | no_license | // Как праметр мы будем получать объект с опциями, которые будут настраивать будущее модальное окно
// В качестве результата, при вызове плагина, мы хотим получить экземпляр модального окна
// с которым мы можем производить манипуляции типа: открыть, закрыть, изменить контент, уничтожить модальное окно.
// метод $.moda... | true |
aa3ff91d0eefdb3b8a15077343146e46ff88104b | JavaScript | competentum/cg-slider | /test/e2e/move.js | UTF-8 | 776 | 2.625 | 3 | [
"MIT"
] | permissive | import { Selector } from 'testcafe';
const PAGE_URL = 'http://localhost:4000';
const SLIDER_VALUE = '#sliderValue_steps';
const SLIDER_BTN_BACK = '#stepBack'; // -5
const SLIDER_BTN_FORWARD = '#stepForward'; // +10
const getSliderValue = (selector) => Selector(selector).innerText;
fixture('Move API:')
.page(PAGE_U... | true |
28b127873daee92b7c5ffffd24ea757d284b9ca8 | JavaScript | darinchakalov/JavaScript-Fundamentals-2021 | /Programming Fundamentals Final Exam - Practice/03. Need for Speed III.js | UTF-8 | 2,715 | 3.34375 | 3 | [] | no_license | function solve(input) {
let numberOfCars = Number(input.shift());
let cars = {};
for (let i = 0; i < numberOfCars; i++) {
let [car, mileage, fuel] = input.shift().split("|");
if (!cars.hasOwnProperty(car)) {
cars[car] = {};
cars[car]["mileage"] = Number(mileage);
... | true |
cd588768e703bf84a4b272d867e0a84086e87511 | JavaScript | Bobslegend61/Alabs | /js/Classess.js | UTF-8 | 5,693 | 2.96875 | 3 | [] | no_license | class Employee {
constructor(firstname, lastname, age, profession, address, sex) {
this.firstname = firstname;
this.lastname = lastname;
this.age = age;
this.profession = profession;
this.address = address;
this.sex = sex;
}
}
class Department extends Employee {
... | true |
eb699fa39e90036f395f7c5fa53e4991843340f5 | JavaScript | pratyush63/sortello | /App.jsx | UTF-8 | 2,636 | 2.578125 | 3 | [
"MIT"
] | permissive | import React from "react"
import ApiKey from "./components/ApiKey.jsx"
import ColumnSelection from "./components/ColumnSelection.jsx"
import Choices from "./components/Choices.jsx"
import Results from "./components/Results.jsx"
import treeNodeFactory from "./model/treeNodeFactory"
class App extends React.Component {
... | true |
d4387cf36436ccef044654ed5b3e7863bb095d69 | JavaScript | Wenxiao-Li/Project_Sunflowers | /src/pages/Background/controller/sessionhistory/historyDAOManager.js | UTF-8 | 3,519 | 2.765625 | 3 | [
"MIT"
] | permissive | import { getSessions, Today } from '../../model/historyDAO';
let DisplayDate = [];
let DisplayLength = [];
let DisplayNum = [];
export const viewHistory = (querySnapshot) => {
let Month = new Map();
Month.set('Jan', '01');
Month.set('Feb', '02');
Month.set('Mar', '03');
Month.set('Apr', '04');
Month.set('... | true |
375db441a105d2146c9e40fb6ec5fedb1169adb0 | JavaScript | DARRENSKY/Web-Applications | /project4/components/example/exampleController.js | UTF-8 | 2,413 | 2.84375 | 3 | [] | no_license | 'use strict';
/**
* Defined a controller named 'ExampleController' that works with the view template
* exampleTemplate.html. We assume that cs142App has already been defined by
* the main.js controller. To access this view need to include the controller:
*
* <script src="components/example/exampleController.js... | true |
6e623ee0cd6b94aef7c7ff52f52e9c773ee43a8b | JavaScript | katylouise/pharmaSearch | /public/js/map.js | UTF-8 | 843 | 3.203125 | 3 | [] | no_license | var lat;
var lon;
function getLatLong(firstLine, postcode) {
$.get('https://maps.googleapis.com/maps/api/geocode/json', { address: firstLine + " " + postcode }, function(response) {
lat = response.results[0].geometry.location.lat;
lon = response.results[0].geometry.location.lng;
google.maps.event.a... | true |
913d1e34462e54163bea522c9d1a48e28336fa71 | JavaScript | lvidal-gs/Fatec-IES300---Back | /controllers/playersController.js | UTF-8 | 5,466 | 2.609375 | 3 | [] | no_license | const {ObjectID} = require("mongodb")
const { listAll, updateOne, deleteOne, findDocuments, findOne, insertOne } = require("../common/database/db")
const collection = "players"
exports.listPlayers = async (req, res) => {
try {
if(req.query!=null){
this.findPlayers(req,res)
}else{
... | true |
26759e21c2d2c081219734b310519df7649e90b9 | JavaScript | raysloks/curly-garbanzo | /connections.js | UTF-8 | 757 | 2.765625 | 3 | [] | no_license | function ConstantInput(value) {
this.value = value;
this.get = function () {
return this.value;
}
}
function ClearanceInput(position, range) {
this.position = position;
this.range = range * range;
this.get = function () {
let clearance = 0;
let dx = player.x - this.posit... | true |
15b26224fcddf25f7c50126ae17e2344b6c627b4 | JavaScript | indik47/DITS-JS-homework | /15-01-indexedDB/src/index.js | UTF-8 | 2,011 | 3.296875 | 3 | [] | no_license | const input = document.getElementById('new-task');
const btnAdd = document.getElementById('add-btn');
const tasksBoard = document.getElementsByClassName('tasks')[0];
/**
* Render single task to the list
* @param msg{string} - task text
* @param id{number} - task id
*/
function renderTask(msg, id, isResolved) {
... | true |
0aa43af76747b41ce3d39aa29932949e3fa55c1c | JavaScript | frankolindo/validUrl | /prompt.js | UTF-8 | 874 | 3 | 3 | [] | no_license | const fs = require('fs');
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
readline.question('Enter url file name: ', function(name){
let answer = fs.readFile(name, function read(err, data){
if (err){
throw err;
}
let urls = data.toString().sp... | true |
4e7d6577eace8461395a3b96d916738015bf7889 | JavaScript | ironhack-dev-squad-107/js-classes | /classes.js | UTF-8 | 2,485 | 3.890625 | 4 | [] | no_license | console.log("CLASSES.JS");
// Song
// ----
// Information about the song want to store
// (keys or properties of our song objects)
// - title
// - artist
// - duration
// - releaseDate
// - album
// - artPicture
// - label
// - producers
// - lyrics
// - genres
// Behaviors of songs
// (methods of our song objects)
/... | true |
7bbfc635784a17f2d923b379dd1a8f82a908d455 | JavaScript | missyjcat/js-algorithms-data-structures | /scripts/problems/exercises_chapter2.js | UTF-8 | 4,896 | 4.34375 | 4 | [] | no_license | /**
* Exercises from Data Structures and Algorithms in Javascript
* Chapter 2: Arrays
*/
/**
* ASSIGNMENT 1
* Create a grades object that stores a set of student grades in an object.
* Provide a function for adding a grade and a function for displaying the
* student’s grade average.
*/
var Grades = function(... | true |
b9192f182f3e12b2896075213e39e02a17545c55 | JavaScript | fathurzoy/expressmongo | /routers copy.js | UTF-8 | 1,344 | 3.109375 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const myLogger = function (req, res, next) {
console.log("LOGGED");
next();
};
router.get("/", myLogger, function (req, res) {
res.send("Hello World!");
});
router.get("/users ", function (req, res) {
const name = req.query.name; //query bu... | true |
bf50d3368696d9f73170c3ad58386836252f124d | JavaScript | yangwend/note | /Koa/koa-demos/learn-demos/demo20.js | UTF-8 | 792 | 3.421875 | 3 | [] | no_license | // 表单
// 表单就是 POST 方法发送到服务器的键值对
// koa-body :用来从 POST 请求的数据体里面提取键值对
const Koa = require('koa');
const koaBody = require('koa-body');
const app = new Koa();
const main = async (ctx, next) => {
const body = ctx.request.body;
if (!body.name) {
ctx.throw(400, 'name required');
}
ctx.response.bod... | true |
b7464607f194cd75e4015cb9d8af2cd227799ff1 | JavaScript | wxfeiang/WZXl | /1.0/js/face.js | UTF-8 | 5,382 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | // 今日抓拍量统计
//收入增长趋势
var face1 = echarts.init(document.getElementById("face1"));
// 指定图表的配置项和数据
option = {
title: {
text: "",
textStyle: {
fontSize: 14,
color: " #262626 ",
fontWeight: "normal"
},
padding: [20, 0, 0, 25]
},
tooltip: {},
xAxis: {
type: "category",
dat... | true |
c9cee561c0b9a58dd39e5d07c162f3256f62647c | JavaScript | nikinegi1998/Sorting-Algorithm-Visualizer | /js/bubble.js | UTF-8 | 901 | 3.1875 | 3 | [] | no_license |
async function bubble(){
const elem = document.querySelectorAll('.bar')
let size = elem.length;
for(let i =0; i<size-1; i++){
for(let j=0; j<size-i-1; j++){
elem[j].style.background = 'red'
elem[j+1].style.background = 'red'
if(parseInt(elem[j].style.height)>parseInt(elem[j+1].style.height)){
... | true |
4b5b311e6deaf8597beccb4dddcdb745fb1ff2e9 | JavaScript | Henrynunez112/Pursuit-Core-Web-Middleware-Lab | /frontEnd/index.js | UTF-8 | 525 | 2.671875 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", ()=>{
let button = document.querySelector("#button");
let input = document.querySelector("#input");
button.addEventListener("click", () =>{
axios.get(`http://localhost:3004/animal/${input.value}`).then(res=>{
input.innerText = ""
let ul = document... | true |
eac74d405f93ce65c5e844d8480ead02e1dd2dae | JavaScript | Dani9898/js-jsnacks-blocco-1 | /jsnack3/js/script.js | UTF-8 | 1,011 | 4.5 | 4 | [] | no_license |
// Il software deve chiedere per 10 volte all’utente di inserire un numero. Il programma stampa la somma di tutti i numeri inseriti.
// chiedere 10 volte all'utente un numero e salvare ogni numero in un array.
// creo array
const myArray = [];
// chiedere => prompt
// 10 volte => ciclo che finisce quando myArray.... | true |
da06af84ba8582731a0694fcf85f37cdb890c0a4 | JavaScript | liaoshanggang/MyGitHub | /wsweb/Blog1/WebRoot/js/remind.js | UTF-8 | 182 | 2.71875 | 3 | [] | no_license | function changeSec(){
$("myspan").innerText=parseInt($("myspan").innerText)-1;
}
var mytime = setInterval("changeSec()",1000);
function $(id){
return document.getElementById(id);
} | true |
2beb5931d2ed7fea89e71373ea5b8af3d3a21b4d | JavaScript | ritikrishu/Space-Invaders | /src/Aliens.js | UTF-8 | 3,230 | 2.8125 | 3 | [] | no_license | import * as PIXI from 'pixi.js'
import { parseColor } from './utils'
export default class Aliens extends PIXI.Container {
#color = parseColor('#00ff00')
#alienGraphics = []
#alienWidth = 50
#alienHeight = 50
#speed = 10
#direction = 1
#timerIds = []
constructor(app, bullets) {
s... | true |
93682b4a003a9a9194c4569b22163e4e96116f49 | JavaScript | wanderdust/flappy-bird | /js/bird.js | UTF-8 | 1,497 | 3.125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | var bird = {
width: 30,
height: 20,
positionX: 60, //Posicion X del bird.
positionY: 210, // guarda la posicion del pajaro en cada frame,
velocityY: 6, // Velocidad -y del pajaro. No cte.
velocityReset: 7.2, // Variable para resetear la velocidad.
changeColor: function(){
... | true |
2b3ba1799f9e49de4581b1710e888e0654518d57 | JavaScript | Darkorin/note-taker | /server.js | UTF-8 | 2,427 | 2.75 | 3 | [
"MIT"
] | permissive | const express = require("express");
const path = require("path");
const fs = require("fs");
const app = express();
const PORT = process.env.PORT || 3000;
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
app.use(express.static(path.join(__dirname, "/Develop/public/")))
// Routes
app.get("/", ... | true |
00f9639127791e7cff2ebab1a0d462deff8f23bc | JavaScript | JWales13/elnath-get-requests | /server/routes/quotes.js | UTF-8 | 908 | 2.78125 | 3 | [] | no_license | var express = require('express')
var router = express.Router();
var quotes_data = require('../modules/quotes-data');
var routeCounter=0;
router.get('/', function(req,res){
res.send('you can find quotes at quotes/random or quotes/first');
});
router.get('/random', function(req,res){
routeCounter++
console.... | true |
248ef1cfcc21a2f771cdd4c5df0d6b9063dd1fa2 | JavaScript | fabian202/bonappetit-mobile | /js/libs/Facebook-phonegap-login.js | UTF-8 | 1,138 | 2.640625 | 3 | [] | no_license | FB.Event.subscribe('auth.login', function (response) {
alert('auth.login event');
});
FB.Event.subscribe('auth.logout', function (response) {
alert('auth.logout event');
});
FB.Event.subscribe('auth.sessionChange', function (response) {
alert('auth.sessionChange event');
});
FB.Event.subscribe('auth.sta... | true |
ef7805664cd7bf3c42570a4f7604309dca4ea2f6 | JavaScript | airyhq-g2/airy-prototype | /src/static/js/navbar.js | UTF-8 | 809 | 2.90625 | 3 | [] | no_license | const basketToggler = document.getElementById('basket-toggler')
const hamburgerToggler = document.getElementById('hamburger-toggler')
const basketMenu = document.getElementById('basket-menu')
const hamburgerMenu = document.getElementById('hamburger-menu')
const elements = [
{
toggler: basketToggler,
menu: ba... | true |
2447f5d1395972d60366e8b2957dd20a3313f6a2 | JavaScript | kbjude/puzzle | /puzzle-html/puzzle.js | UTF-8 | 10,051 | 3.4375 | 3 | [] | no_license | class Box {
constructor(x, y) {
this.x = x;
this.y = y;
}
getTopBox() {
if (this.y === 0) return null;
return new Box(this.x, this.y - 1);
}
getRightBox() {
if (this.x === 3) return null;
return new Box(this.x + 1, this.y);
}
getBottomBox() {
... | true |
e34016b2f8fd81625535f3ab2a0e9f44224e46f6 | JavaScript | crolmo/Crols-Test-Platform | /crols-react/src/App.js | UTF-8 | 1,248 | 2.75 | 3 | [] | no_license | import React, { Component } from "react";
import axios from 'axios';
axios.default.withCredentials = true;
const server = 'http://127.0.0.1:8000';
class App extends Component {
constructor(props) {
super(props);
this.state = {
name: "",
age: 0
}
this.chang... | true |
e66b411dd55974bc6da32051b420df08ff982956 | JavaScript | maryna-yanul/meteor-hikes | /client/compatibility/map.js | UTF-8 | 6,845 | 2.875 | 3 | [] | no_license | // In the following example, markers appear when the user clicks on the map.
// Each marker is labeled with a single alphabetical character.
var labels = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var labelIndex = 0;
var map;
var allMarkers = [];
var positions = [];
Session.set('positions', []);
Session.set('meters', 0);
var initAu... | true |
c03ed600433f6d9957424be405443a8e307f875d | JavaScript | ietz/gwv | /15-puzzle/src/GameInputListener.js | UTF-8 | 706 | 2.53125 | 3 | [] | no_license | import $ from 'jquery';
import EventEmitter from 'events';
import {TRANSITION_DOWN, TRANSITION_LEFT, TRANSITION_RIGHT, TRANSITION_UP} from "./transitions";
const KEY_TRANSITIONS = {
"ArrowLeft": TRANSITION_RIGHT, // TRANSITION_LEFT,
"ArrowRight": TRANSITION_LEFT, // TRANSITION_RIGHT,
"ArrowUp": TRANSITION_DOWN, ... | true |
a557c7374719f786c071552fcfdf317cd423995c | JavaScript | trandinhmanh38/github-jiibj4 | /src/components/Checkbox/Checkbox.js | UTF-8 | 2,136 | 2.828125 | 3 | [] | no_license | import './Checkbox.css';
import {useState} from "react";
import Counter from "../Counter/Counter";
const Checkbox = () =>{
const[values, setValues] = useState({
coding: false,
music: false,
reading: false
});
const allSelected = values.coding && values.music && values.read... | true |
9cc42c92192362a79e374cd9777abc82b41d9583 | JavaScript | CS1951A-S21-Brown/hw6-dataviz-melw66 | /main.js | UTF-8 | 10,883 | 2.953125 | 3 | [] | no_license | // Add your JavaScript code here
const MAX_WIDTH = Math.max(1080, window.innerWidth);
const MAX_HEIGHT = 720;
const margin1 = {top: 40, right: 130, bottom: 40, left: 190};
const margin2 = {top: 40, right: 100, bottom: 40, left: 175};
const margin3 = {top: 40, right: 100, bottom: 150, left: 140};
const radius = 110;
//... | true |
e50daa03844cbbdf308706cf6165171f293ec591 | JavaScript | windldream/leetcode | /daily/numBusesToDestination.js | UTF-8 | 921 | 3.046875 | 3 | [] | no_license | /**
* @param {number[][]} routes
* @param {number} S
* @param {number} T
* @return {number}
*/
var numBusesToDestination = function (routes, S, T) {
let queue = []
const visited = new Set()
const graph = {}
for (let i = 0; i < routes.length; i++) {
for (let j = 0; j < routes[i].length; j++) {
if ... | true |
ee00c0ec493f3feff3fd814d45a609e1f6e93dfc | JavaScript | gragland/instatype | /src/js/components/input.js | UTF-8 | 1,413 | 2.625 | 3 | [
"MIT"
] | permissive | import React from 'react';
class Input extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
this.handleFocus = this.handleFocus.bind(this);
this.handleBlur = this.handleBlur.bind(this);
}
// TODO: Remove shouldComponentUpda... | true |
40d924ce5a27ae6c2b3e5a9391cdb730f90db4ff | JavaScript | Jellybean21/Node-js | /middlewares/flash.js | UTF-8 | 547 | 2.515625 | 3 | [] | no_license | module.exports = function (request, response, next){// trois paramètres dans cette fonction
if (request.session.flash){ // si il y a des infos dans la requete de la session alors on creer la variable locals.flash
response.locals.flash = request.session.flash
request.session.flash = undefined // ensuite on suprime ... | true |
0370edf196b6586593a2f68b506c55078253b17e | JavaScript | s-goodwin/guess-the-word | /js/script.js | UTF-8 | 6,656 | 3.859375 | 4 | [] | no_license | const guessedLettersElement = document.querySelector('.guessed-letters');
const guessLetterButton = document.querySelector('.guess');
const letterInput = document.querySelector('.letter');
const wordInProgress = document.querySelector('.word-in-progress');
const remainingGuessesElement = document.querySelector('.remain... | true |
5608b05ac5a524c8c25c8d7edecd71da755a2e00 | JavaScript | uhop/list-toolkit | /src/List.js | UTF-8 | 5,693 | 3.171875 | 3 | [] | no_license | class ListNode {
constructor() {
this.prev = this.next = this;
}
}
const pop = head => {
const rest = head.next;
head.prev.next = head.next;
head.next.prev = head.prev;
head.prev = head.next = head;
return {node: head, list: rest};
};
const extract = (from, to) => {
const prev = from.prev,
nex... | true |
2157d88d4288f78948d40cf365691e7bbaaa1aa7 | JavaScript | txhsl/TheWildDriving | /Applications/TheWildDriving/Web/js/Message.js | UTF-8 | 492 | 2.734375 | 3 | [
"MIT"
] | permissive | var Message = function(msg, id) {
var message = this;
this.age = 1;
this.maxAge = 300;
this.message = msg;
this.id = id;
this.update = function() {
this.age++;
}
this.draw = function(color) {
var messageItem = document.createElement('li');
messageItem.innerText = this.message;
messageItem.style.... | true |
da86c7f967aa99ef11d74572161596b037f08d5d | JavaScript | raulmoralesruiz/DWEC | /JS/date_timers/2/script.js | UTF-8 | 3,904 | 3.640625 | 4 | [] | no_license | /* Ejercicio 2:
Desarrolla una aplicación web que funcione de alarma.
Mostrar hora actual y preguntar al usuario a qué hora sonará.
Una vez que llegue a la hora introducida por el usuario,
debe preguntarle si quiere descansar un poco más y vuelva a mostrar el mensaje a los dos minutos. */
// Divs que contienen la f... | true |
0c975ec36494a6cfb230f06fb6c0ed3a489a4b08 | JavaScript | ximoxiyu/-offer-JS- | /41.1 数据流中的中位数.js | GB18030 | 572 | 4.15625 | 4 | [] | no_license | /**
Ŀ
жֵôλֵλмֵ
жżֵôλֵ֮мƽֵ
*/
let arr = []
function Insert(num)
{
// write code here
arr.push(num);
}
function GetMedian(){
// write code here
arr.sort((a, b)=>a-b);
let len = arr.length,
mid = Math.floor(len / 2);
if(len % 2) {
return arr[mid];
} else {
return (arr[mid -... | true |
83725698dbb7b9b499f630e92a5d7764d0d06ad2 | JavaScript | stefannyss/ProjetoJovemEmpreendedor | /js/animacao.js | UTF-8 | 534 | 2.90625 | 3 | [] | no_license | const target = document.querySelectorAll('[data-animacao]');
const ClasseAnimacao = 'animacao';
function AnimacaoScroll() {
const TopoJanela = window.pageYOffset + ((window.innerHeight * 0.85));
target.forEach(function (elemento) {
if ((TopoJanela) > (elemento.offsetTop)) {
elemento.classLi... | true |
64dc0200683cb724048d8a6fa7142c243a88b131 | JavaScript | RichieAHB/grapher | /index.js | UTF-8 | 1,464 | 2.640625 | 3 | [] | no_license | import Grapher from './Grapher';
// The evaluate parameter should be a function that evaluates a formula string,
// as provided by math.js or KAS.
export function graph(evaluate) {
return (params) => {
// Better way to do this! Loop thorug className.
const optionTypes = ['wrapper', 'step', 'startRange'];
... | true |
e32bf9283dfc09ac2d5ed9b8f51f09f449a02130 | JavaScript | aquinajose/poburnt | /src/utils/common.js | UTF-8 | 544 | 2.71875 | 3 | [] | no_license | export const gerUser =()=>{
const userStr = localStorage.getItem('user');
if(userStr){
JSON.parse(userStr)
}else return null;
};
// remove the token and user from the session storage
export const removeUserSession = () => {
localStorage.removeItem('token');
localStorage.removeItem('user');
... | true |
19c23629618f3d86f565a3c29896e40ad880696a | JavaScript | afleming1992/thirdyeargroup | /javascript/ticketingForms.js | UTF-8 | 6,829 | 3.28125 | 3 | [] | no_license | function validateForm()
{
var ticketCheck = ticketNumbers();
var postCodeCheck= postCodeValidation();
var cityCheck = cityValidation();
var firstNameCheck = firstnameValidation();
var addressCheck = addressValidation();
var surnameCheck = surnameValidation();
var emailCheck = emailValidation();
var countyCheck ... | true |
2a967d3ad988f3917fc8990f796dafc0658f3289 | JavaScript | osmangoninahid/spready | /services/createEnvVariables.js | UTF-8 | 1,610 | 2.578125 | 3 | [
"MIT"
] | permissive | "use strict";
const path = require("path");
const fs = require("fs-extra");
const { spawnSync } = require("child_process");
const templatesPath = path.join(__dirname, "..", "templates");
/**
* return the path of the directory
* @param {String} dirName the name of the project and dirname
*/
async function createEn... | true |
6bd1f9fb6dd45e07c1e06dacbd491c6992124062 | JavaScript | memoriza/Codeup-Web-Exercises | /public/js/while_loop.js | UTF-8 | 71 | 2.71875 | 3 | [
"MIT"
] | permissive | "use strict"
var i = 1;
while (i <= 10) {
console.log(i)
i += 1;
} | true |
563a166f14e86d97b8471085be8c406ffea7cace | JavaScript | jonoHawkins/get-in-di | /tests/DefinitionUsage/resolveProps.test.js | UTF-8 | 1,004 | 2.671875 | 3 | [] | no_license | const {
Container,
Def,
Ref,
Definition,
} = require('../..');
describe('definition.resolveProps', () => {
test(`resolves props that are references`, () => {
const container = new Container();
const foo = {};
const bar = () => { };
container.add('foo', new Def(foo));... | true |