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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
ff28ac6a9a7da089dd462f70b468ad1212aa82cf | JavaScript | Chris-uche/Movie | /src/App.js | UTF-8 | 1,288 | 2.578125 | 3 | [] | no_license | import React,{useState, useEffect} from "react"
import './App.css';
import featureEndpoint from './featureEndpoint';
import searchEndpoint from './searchEndpoint';
import Results from './Results';
const MovieApp=()=>{
const [movie, setMovie]= useState([]);
const [searchItem, setSearchItem] = useState("")
useE... | true |
150b720bc5bdc59c310af742f36a4af364d1e33b | JavaScript | Stardude/family-budget | /server/models/Account.js | UTF-8 | 665 | 2.625 | 3 | [] | no_license | class Account {
constructor (account) {
this.id = account.id || '';
this.name = account.name || '';
this.creationDate = account.creationDate || new Date();
this.modificationDate = new Date();
this.currency = account.currency || 'грн';
this.balance = account.balance ||... | true |
36ea00cafab86411a47af6302392e6afc8c27716 | JavaScript | xialei520/small-demo | /ES/es8.js | UTF-8 | 376 | 4.09375 | 4 | [] | no_license | // 1. Object.values
let arr = Object.values({a:1, b:2, c:3});
console.log(arr);
//2. Object.entries
console.log(Object.entries({a:1, b:2, c:3}))
// 3. padding
console.log('string'.padStart(10, 2))
console.log('string'.padEnd(10, 2))
// 4. Object.getOwnPropertyDescriptor()
let obj = {
name: '小王',
age: 12
}... | true |
4a8c6b059cb906f50d509e263a2ce6460f4e3e3f | JavaScript | ahale212/time2text | /2016-10-19-promises/promises.js | UTF-8 | 1,661 | 3.46875 | 3 | [] | no_license | 'use strict'
// Callback Hell
const fs = require('fs')
const myFile = './tmp.txt'
fs.readFile(myFile, 'utf8', (err, txt) => {
if (err) return console.log('Appending text failed: ', err)
txt = txt + '\nAppended something!'
fs.writeFile(myFile, txt, (err) => {
if(err) return console.log('Appending text fail... | true |
590cbcbc5f1d2ffc593d90e7957aa67387adbc5a | JavaScript | Fcou/Frontend-05-Template | /Week 06/dog_bite_people/dog_bite_people.js | UTF-8 | 313 | 3.125 | 3 | [] | no_license | class People {
constructor(){
this.HP = 100
}
hurt(damage){
this.HP -= damage
}
}
class Dog{
constructor(){
this.damage = 10
}
doHurt(){
return this.damage
}
}
const zhangsan = new People()
const duoduo = new Dog()
zhangsan.hurt(duoduo.bite())
| true |
85cbd04dfa10960b8cbf958164caddfa2b25996a | JavaScript | satyaram413/JavaScript_Concepts | /Async/syncApp.js | UTF-8 | 176 | 3.3125 | 3 | [] | no_license | //Sync Code Example
function otherFunction() {
console.log("We are in another function");
}
console.log("Start Building Things");
otherFunction();
console.log("END");
| true |
dba04e6a8651cfa265f199739df4d8dafb44f01c | JavaScript | feixiangingk/test_Bootstrap | /js/todo.js | UTF-8 | 1,230 | 3.453125 | 3 | [
"MIT"
] | permissive | var log = function(){
console.log.apply(console,arguments)
}
var el = function(sel){
return document.querySelector(sel)
}
var todoTemplate =function(todo){
var t = `<div class="todo-cell">
<button class="todo-delete">删除</button>
<span>${todo}</span>
</div>`;
return t
}
// var todoTemplate... | true |
26f12f8c84f7b50d8c85ad286c8238a51336bb45 | JavaScript | btheth/finterest | /client/src/components/views/partials/containerpicks.jsx | UTF-8 | 2,303 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Link } from 'react-router-dom';
class FlowerPicks extends Component {
constructor(props, context) {
super(props, context);
this.state = {
errors: {},
containerBoxes: [],
selected: -1,
loading: true
};
this.getContainers = t... | true |
d45416217172476e70aa418f76a6bbbf156b80d3 | JavaScript | aarv0/uvu_dgm_2760 | /Unit01/js/main.js | UTF-8 | 640 | 2.984375 | 3 | [] | no_license |
//document.getElementById('company').innerHTML = "Joe's Bed and Breakfast";
document.querySelector('#company').innerText = "Joe's Bed and Breakfast"
document.querySelector('header > h2').innerText = "Best B&B this side of Orem!"
let userName = prompt("What is your name?")
var askforName = prompt("Enter Your Name"... | true |
f5cc939de0040f7752bab2c3b21d4d3d7078607f | JavaScript | dingqilong/white-list | /2/74splice.js | UTF-8 | 842 | 3.234375 | 3 | [
"MIT"
] | permissive |
var computer = new Array("Doel", "Apple", "IBM", "HP");
document.write(computer);
document.write("<hr/>");
computer.splice(1, 0, "DELL");//begining from 1 index and remove 0 element and add (start) at index 1
document.write(computer);
document.wri... | true |
e17e73d749d23edf0cc92f5b0313ce740e1b5cc0 | JavaScript | makalasmith/MidtermMakalaSmith.appstudio | /forms/bucketList/bucketList.js | UTF-8 | 558 | 4 | 4 | [] | no_license |
/*
let bucketList = []
let doneWithList = false
let yesNo = ""
while (doneWithList == false){
yesNo = prompt("Do you have more that you want to add to your bucket list or do you want to see your bucket list? Enter: Add or See?")
if (yesNo == "Add"){
doneWithList = false
newItem = prompt("Enter th... | true |
5b9a4bcb6d318d28c09bd46d819243601a6effb3 | JavaScript | azakhartsov/javascript-2.0 | /unit_08/unit_08.js | UTF-8 | 12,471 | 3.703125 | 4 | [] | no_license | // Task 1
// Кнопка b-1 запускает функцию t1. Функция должна выводить в .out-1 строку вида (... это просто для сокращения здесь. Вы выводите все числа от 1 до 50. Все. Три точки мы не выводим!!!!!):
// 1_2_3_4_5_6_7_8_9_ ... 49_50_
// от 1 до 50 включительно. Разделитель - нижнее подчеркивание. Задача решается ... | true |
242db7e1dd609a8b9021d719156f2ef611dd346b | JavaScript | yceline-yu/color-boxes-react | /src/NewBoxForm.js | UTF-8 | 1,332 | 2.9375 | 3 | [] | no_license | import React, { useState } from "react";
/** NewBoxForm
*
* Props:
* -function to make new Box or update BoxList state
*
* State:
* -initialState { width: "", height: "", backgroundColor: "" }
* -{width, height, backgroundColor}
*
*/
function NewBoxForm({ addBox }) {
const initialState = { width: "", hei... | true |
a14105409a4067437bd845ea27e47461065abdf6 | JavaScript | Adialia/events-agrigator | /src/js/app/server/bot.js | UTF-8 | 1,064 | 2.75 | 3 | [] | no_license | // run scraping process
var Model = require('./model'),
Scraper = require('./scraper.js'),
request = require('request'),
debug = require('debug')('bot'),
cheerio = require('cheerio');
module.exports = function(){
var sourses = ['http://parter.ua',"http://dou.ua/calendar"];
sourses.forEach(runScraper);
}();
... | true |
c9b6272670fadd48c15ac834bc6360574f4ba2c5 | JavaScript | vukmirovic94/my-portfolio | /js/script.js | UTF-8 | 760 | 2.640625 | 3 | [] | no_license |
const navBtn = document.querySelector('#navbar-toggler');
const navDiv = document.querySelector('.navbar-collapse');
navBtn.addEventListener('click', () => {
navDiv.classList.toggle('showNav');
});
// stopping animation and transition during window resizing
let resizeTimer;
window.addEventListener('resize', () =... | true |
8d09297a60a93e785b9fbd166a9b6b26d645eb2b | JavaScript | chongdee/e-mall | /pages/search/search.js | UTF-8 | 1,434 | 2.6875 | 3 | [] | no_license | // pages/search/search.js
// 函数防抖 定时器
// 1 防抖 一般 作用在输入框中 防止重复输入 重复发送请求
// 2 节流 一般用在页面上拉和下拉
import request from '../../request/network'
Page({
data: {
goods: [],
//取消按钮是否显示
isShowCancelBtn: false,
// 输入框的值
inptVal: ''
},
TimeId: -1,
//输入框事件
onInput(e) {
... | true |
6a7a2d1b97be1d694d79db4149ad1fcef0145350 | JavaScript | milandungrani/React-Project | /src/component/ShowUser.js | UTF-8 | 2,580 | 2.71875 | 3 | [] | no_license | import React, { Component } from 'react'
import axios from 'axios'
import './ShowUser.css'
class ShowUser extends Component {
constructor() {
super()
this.state = {
Users: [],
Error: ''
}
}
componentDidMount() {
axios.get('http://localhost:8080/api/u... | true |
ad94ce325b4d1453f560302edddb251f724c3de2 | JavaScript | ahmed2929/Team-Incredible | /scripts/Vollmann-Akarakiri.js | UTF-8 | 267 | 2.828125 | 3 | [] | no_license | var myName , language, hngId, email;
myName = 'AKARAKIRI VOLLMANN';
hngId = 'HNG-00161';
language = "JavaScript";
email = 'vollmannakarakiri@icloud.com';
console.log('Hello World, this is ' + myName + ' with HNGi7 ID ' + hngId + ' and email ' + email + ' using ' + language + ' for stage 2 task.');
| true |
d4291b6f2c089c02f08f1500c43c043682ea4eeb | JavaScript | ElhamHamid/ElhamHamid.github.io | /Assignment8/simpsonLinkedList.js | UTF-8 | 691 | 3.328125 | 3 | [] | no_license | "use strict";
/* eslint-disable */
let maggie = {
value: "Maggie",
next: null
};
let lisa = {
value: "Lisa",
next: null
};
let bart = {
value: "Bart",
next: null
};
let homer = {
value: "Homer",
next: [bart, lisa, maggie]
};
let abe = {
value: "Abe",
next: [homer],
};
function... | true |
3d91c43bf51e9ac4b0bee1d01dab7602cd4b2e58 | JavaScript | OpenDevelopmentMekong/opendev-wptheme | /js/youtube_playlist.js | UTF-8 | 4,519 | 2.875 | 3 | [] | no_license | //
// YouTube JavaScript API Player With Playlist
// http://salman-w.blogspot.com/2009/10/youtube-javascript-player-with-playlist.html
// Revision 2 [2012-03-24]
//
// Prerequisites//
// 1) Create following elements in your HTML:
// -- a) ytplayer: a named anchor
// -- b) ytplayer_div1: placeh... | true |
192e3f59d95744e987f86db0f89b23aaba8d57f2 | JavaScript | tshelburne/json-schema-builder | /src/lib/Definitions.js | UTF-8 | 684 | 2.578125 | 3 | [] | no_license | import Keyword from './Keyword';
import Schema from './Schema';
export default class Definitions extends Keyword {
constructor(value) {
super();
this.value = value;
}
get value() {
return this._value;
}
set value(value) {
if (typeof value == 'object' && !Array.isArray(value)) {
for (l... | true |
0cdd92bdd78888f82eb4a672c4b827625a320a00 | JavaScript | idleplaythings/FieryVoid | /features/damage/model/DamageTile.js | UTF-8 | 1,824 | 2.796875 | 3 | [] | no_license | model.DamageTile = function DamageTile()
{
this.reset();
};
model.DamageTile.prototype.reset = function()
{
this._brush = 0;
this._texture = 0;
this._opacity = 255;
this._scale = 127;
this._position = {x:0, y:0};
this._holeSize = 0;
return this;
};
model.DamageTile.prototype.setOpacity = function(value) // ... | true |
069d4cc347b30767c489a708f86ca10f61c5f946 | JavaScript | michaelholm/Loreminator | /public/js/views.js | UTF-8 | 5,187 | 2.59375 | 3 | [] | no_license |
//window.app = window.app || { };
//
// window.app = { };
// app.controllers = { };
// app.collections = { };
// app.models = { };
// app.views = { };
window.Hero = Backbone.View.extend({
el: '.hero-unit',
events: {
"click a#wordAddBtn": "addWord",
"click a#dictionaryAddBtn": "show... | true |
1640a98e8708449f51a63024ffc688f6390c5201 | JavaScript | chaquen/payu_checkout | /js/index.js | UTF-8 | 2,272 | 2.71875 | 3 | [] | no_license | $(document).ready(function(){
var d=new Date();
var val =Math.random().toLocaleString().substring(2,6);
$('#referenceCode').val(d.getYear()+""+d.getMonth()+""+d.getDate()+""+d.getHours()+""+d.getMinutes()+"-"+val);
enviar_peticion();
$("#txt_impuesto").change(function(e){
cal_impuesto(this.value);
});
$... | true |
57222886c208ab409bc09a2928852beb07028ebd | JavaScript | ManuDeBuck/advent-of-code-2020 | /d11/seating.js | UTF-8 | 2,679 | 3.09375 | 3 | [] | no_license | const fs = require("fs");
function alterStateBis(old, update, adjacentPairs, i, j) {
if (old[i][j] === ".") return false;
const count = adjacentPairs.map(([a, b]) => {
let startI = i + a;
let startJ = j + b;
while (!(startI < 0
|| startI >= old.length
|| startJ ... | true |
de948f00ae3e9dd197ef2096a731ac2348147814 | JavaScript | nsalem-it/iabacus | /src/main-page/levelFilter.js | UTF-8 | 2,048 | 3.03125 | 3 | [] | no_license |
import React, { useState} from 'react';
import { Form,FormGroup , FormControl, Button } from 'react-bootstrap';
import RandomSerie from './random-Serie';
const LevelFilter = () => {const [filtre, setFiltre] = useState({
longueur: "",
min: "",
max: ""
});
const [serie,setSerie] = useState(createRandomList(0,0,0)... | true |
3175439994f5a342bd3e9e844a3608a411570138 | JavaScript | adam8810/smash-randomizer | /tests/index.spec.js | UTF-8 | 1,584 | 2.59375 | 3 | [] | no_license | const skill = require ('../index');
const handler = skill.handler;
const ChooseCharacterNumberIntent = require ('./ChooseCharacterNumberIntent');
const ChooseCharacterIntent = require ('./ChooseCharacterIntent');
const callback = {
fail: jest.fn (),
succeed: jest.fn ()
};
describe ('Smasher', () => {
beforeE... | true |
f8e4c6f4a41da225f2dd54bb6b123ea9e674d63f | JavaScript | katrinalander/ReactJs_ES6 | /src/utils/getDateTimeStringSpecial.js | UTF-8 | 578 | 3.15625 | 3 | [] | no_license | const getDateTimeStringSpecial = date => {
let dateParts = [
date.getMonth() +1,
date.getDate(),
date.getYear().toString().substr(date.getYear().toString().length - 2, 2),
date.getHours(),
date.getMinutes(),
date.getSeconds()
];
dateParts = dateParts.map(part... | true |
37eb1042a6c1030de8fe491d77a8f41f26ed62ce | JavaScript | ManaswiniKundeti/BurgerBuilder | /src/store/reducers/burgerBuilder.js | UTF-8 | 2,172 | 2.609375 | 3 | [] | no_license | import * as actionTypes from '../actions/actionTypes';
import { updateObject } from '../../shared/utility';
const initialState = {
ingredients : null,
totalPrice : 5,
error : false,
building : false,
authRedirectPath : '/'
};
const INGREDIENT_PRICES = {
salad : 0.5,
blackbeans : 1.2,
cheese : 0.3,
t... | true |
c58dcd6295d8763166a4deee441938f6d22e8df0 | JavaScript | ljohanaalvarez/BOG001-social-network | /src/Views/publications.js | UTF-8 | 7,257 | 2.671875 | 3 | [] | no_license |
import {footer} from './footer.js';
import {header} from './headerViews.js';
import {deletePost,onGetPosts,getPosts,upDatePosts,userId} from '../functionsFirebase.js';
// Operador Ternario: antes del signo pregunta se coloca la condición, luego del signo pregunta lo que va a retornar si se cumple la condición
//des... | true |
e785685aba155506c7c8756dc8362498d4544abb | JavaScript | wss2020/refactoring | /笔记重构/第10章 简化条件逻辑/10.5 引入特例(Introduce Special Case)/范例3-使用变换/范例3压缩版.js | UTF-8 | 1,341 | 2.75 | 3 | [] | no_license |
let data = {
name: "Acme Boston",
location: "Malden MA",
customer: {
name: "Acme Industries",
billingPlan: "plan-451",
paymentHistory: { weeksDelinquentInLastYear: 7}
}
};
//有时顾客的名字未知,此时标记的方式与前面一样:将customer字段标记为字符串"unknown"。
let data1 = {
name: "Warehouse Unit 15",
loca... | true |
167d60efb0aae70665161ba9e3e918f2110d6605 | JavaScript | Softwire/TechsmithsWebsite | /application-form.js | UTF-8 | 4,847 | 2.59375 | 3 | [] | no_license | function onLoadConfigureOtherDropdown() {
let showForOther = document.querySelectorAll('.show-for-other');
showForOther.forEach(e => e.classList.add('hidden'));
let howHeardDescription = document.querySelector('#inf_howhearddescription');
howHeardDescription.placeholder = howHeardDescription.datas... | true |
2081873adea215ee7356da5705ef9476b1778f79 | JavaScript | IreneBioque/Rick-and-Morty-Search-Engine | /src/services/api.js | UTF-8 | 578 | 2.703125 | 3 | [
"MIT"
] | permissive | const callToApi = (searchName) => {
return fetch(`https://rickandmortyapi.com/api/character/?name=${searchName}`)
.then((response) => response.json())
.then((dataApi) => {
const character = dataApi.results.map((data) => {
return {
name: data.name,
species: data.species... | true |
3cd96866a475c225b6eba979e29c31bf567d6a52 | JavaScript | carlitosalcala/r6db | /src/models/storage.js | UTF-8 | 392 | 2.609375 | 3 | [] | no_license | 'use strict';
var app = app || {};
(function () {
var STORAGE_ID = 'players-r6db';
app.storage = {
get: function () {
return JSON.parse(localStorage.getItem(STORAGE_ID) || '[]');
console.log("get.storage executed")
},
put: function (players) {
localStorage.setItem(STORAGE_ID, JSON.stringify(players))... | true |
fd27d2bc22e8ea1d69956ff94d5c8801d9d7a199 | JavaScript | therohit777/FinWallet | /src/Components/mainComponents/dashboard.js | UTF-8 | 1,639 | 2.65625 | 3 | [] | no_license | import Firebase from "firebase";
import { auth } from "../firebase/firebase";
import { useEffect, useState } from "react";
const Dashboard = () => {
const database = Firebase.database();
const [userdata, setUserdata] = useState({});
useEffect(() => {
auth.onAuthStateChanged((user) => {
if (user)... | true |
d58176d06205e7958bc3a90df9b13a3c7c82421f | JavaScript | tonix-tuft/js-utl | /src/modules/map-coordinates.js | UTF-8 | 3,366 | 3.4375 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2022 Anton Bagdatyev (Tonix)
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify,... | true |
af2aa1c38274d521784f9fd2a1177649d002eafe | JavaScript | ajunlonglive/EastWatch | /server/controllers/tempServiceController.js | UTF-8 | 2,472 | 2.8125 | 3 | [] | no_license | /*
This file creates a simple /trending response
for testing purposes. Once the trend services is working
this file can be retired
*/
const trend = async ctx => {
const { count } = ctx.query;
// if (!count) {
// ctx.throw(400, 'Badly formed request. Please include count');
// return;
// }
let thum... | true |
8f4d539f1414adcc67d54e589256340aa2057280 | JavaScript | perisdev/myNetflixApi | /controllers/registerController.js | UTF-8 | 1,559 | 2.828125 | 3 | [] | no_license | const registerController = (req, res) => {
const user = req.body;
const longitudPattern = /.{8,}/
if (!longitudPattern.test(user.password)) {
return res
.status(400)
.json({ message: `password too short`, cod: 0 });
}
const digitCharacters = /\d/;
if (!digitCharacters.test(user.password)... | true |
f17ea4cbe8f8da929ca9a5c1bbdc5e2b4999ec4b | JavaScript | KonovalovM/Airplane | /js/controls.js | UTF-8 | 1,260 | 2.765625 | 3 | [] | no_license | //створюємо блок з інформацією про керування
function control() {
controls = document.createElement("div");
controls.id = "controls";
gameField.appendChild(controls);
}
//створюємо кнопку для виведення інформації по керуванню
function btnControls() {
buttonControls = document.createElement("buttonContro... | true |
0e7998cbfa0fab0b326e695f0c19bcd68c51d91b | JavaScript | presw/PlayList | /react-client/src/components/App.jsx | UTF-8 | 3,408 | 2.671875 | 3 | [] | no_license | /* eslint-disable class-methods-use-this */
/* eslint-disable no-nested-ternary */
/* eslint-disable no-console */
import React from 'react';
import axios from 'axios';
import List from './List';
import Search from './Search';
import GameDetail from './GameDetail';
class App extends React.Component {
constructor(pro... | true |
951443145e961f206a3dd2f5d14e512600e3b3a2 | JavaScript | VinuriBandara/Tick-Value | /Root/js/script.js | UTF-8 | 464 | 2.671875 | 3 | [] | no_license | $(document).ready(function(){
$("#submit").click(function(){
var email=$("#email").val();
var password=$("#password").val();
if(email==""||password==""){
$("#success").html('<font style=color:red>Your Email or Password is Empty');
return false;
}else{
$.ajax({
url:"signup.php",
type:"POST",
... | true |
f54eff325e2ad6f87769b3fee9ff5d1c05bf17d4 | JavaScript | apiconz/portlet-iframe-bpm | /src/main/webapp/js/portletiframe.js | UTF-8 | 2,607 | 3.171875 | 3 | [] | no_license |
function detectHumanServiceHasFinished(iframe, callback) {
console.log("SE EJECUTA DETECCION DE HUMAN SERVICE FINALIZADO");
var inter = window.setInterval(function() {
if (iframe.contentWindow.document.readyState === "complete") {
//get the embedded document's body
var body = iframe.contentWindow.docume... | true |
eea39434285e627997b3cae028baec38f43131d9 | JavaScript | maleksandrov/aem-upload | /src/part-uploader.js | UTF-8 | 6,244 | 2.65625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | /*
Copyright 2020 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... | true |
11019ca106cbbcb6602baf8dd1fb6fb5e1a47c48 | JavaScript | carolinechong/react-seasons | /src/useLocation.js | UTF-8 | 576 | 3.03125 | 3 | [] | no_license | // HOOKS
import { useState, useEffect } from "react";
export default () => {
const [lat, setLat] = useState(null);
const [errorMessage, setErrorMessage] = useState("");
useEffect(() => {
window.navigator.geolocation.getCurrentPosition(
// Callback function #1
position => setLat(posit... | true |
6a73b85797b9b44093af723934c2fbba7ec136bf | JavaScript | aagp81/frontend-nanodegree-resume | /js/resumeBuilder.js | UTF-8 | 147 | 2.6875 | 3 | [] | no_license | var awesomeThoughts = "I am Adolfo and i am Awesome!";
var funThoughts = awesomeThoughts.replace("Awesome","Fun");
$("#main").append(funThoughts);
| true |
30a62ebc35107c5c84132f2654f003f376a63313 | JavaScript | J-Waddell/es6Awesomeness | /cheer.js | UTF-8 | 534 | 3.875 | 4 | [
"MIT"
] | permissive | var array = ['Give me a J!',
'Give me an O!',
'Give me an H!',
'Give me an N!',
'Give me a D!',
'Give me an O!',
'Give me an E!',
'What does that spell?',
'JOHN DOE!']
for (let elem of array) {
console.log(elem)
}
let letters = ['Give me a J!',
'Give me an O!',
'G... | true |
e038c8cb404aaf704b3b8888be2e891442361dcf | JavaScript | gloria-ho/NYCDA_SEI_Course | /week03_apr16/day14/workshop.js | UTF-8 | 3,225 | 4 | 4 | [] | no_license | // repl.it link:
// https://repl.it/@silverdragonia/2018-04-19
// create a class: circle
// one data attribute: radius
// two methods: getArea, getCircumfrence
// class circle {
// constructor(radius) {
// this.getArea = (3.14 * radius ** 2);
// this.getPerimeter = ( 2 * 3.14 * radius);
// }
// }
// let... | true |
b4d4e51411a93fb502faff0f07b90bcc87cfcddf | JavaScript | meir2017/BookLook- | /script.js | UTF-8 | 4,410 | 2.765625 | 3 | [] | no_license |
var size=0;
var myAPIKey="AIzaSyAaljk6lCARUKHv2eDVst8P403T0lNhfLs";
// var $ = require('jQuery');
var show_book =function(book) {
clearingVariable();
console.log(book+" the book ")
$('#picBook').empty();
if(book.volumeInfo.title!=undefined)
$('#titleBook').text(book.volumeInfo.title)
else
$('#titleB... | true |
6a6017cba2378791768895b98dd4fb0bbe3b1dc3 | JavaScript | carwallaby/level-up | /static/js/trend-factory.js | UTF-8 | 2,249 | 2.765625 | 3 | [] | no_license | 'use strict';
lvlup
.factory('TrendFactory', function() {
var trendFactory = {};
trendFactory.tallyCompletionsByDate = function(completions) {
var frequencies = {};
for (var i = 0; i < completions.length; i++) {
var naiveTimestamp = completions[i].timestamp.slice(0, -6);
... | true |
2e9af154da033c8b7e7e3d15644829050b20e98a | JavaScript | Yarikleon93/notes-test-task | /client/src/pages/NotesPage.js | UTF-8 | 1,608 | 2.609375 | 3 | [] | no_license | import React, { useState, useCallback, useEffect } from "react";
import { useHttp } from "../hooks/http.hook";
import { Link } from "react-router-dom";
export const NotesPage = () => {
const [notes, setNotes] = useState([]);
const { request } = useHttp();
const deleteNote = async(event) => {
event.preventDe... | true |
e57055e679e0ae047ed81a4dbb13835f977bdfb9 | JavaScript | AUSTINSOL/jsd4 | /labs/arrays/js/arrays.js | UTF-8 | 1,389 | 5.03125 | 5 | [] | no_license | //creates a new array
var a = [1,2,3,5,8,13,21];
var days = ["Mon", "Tue", "Wed"]
// add a new item to the array
a.push(34);
// removing one item from the array
var c = a.pop()
// Technique #1 forEach
//setup
var total = 0;
a.forEach(add);
//named function
function add(number, index) {
total = total + number;... | true |
bd7409cd524515ed45a11483feb58de246627afe | JavaScript | MalikHesham/Algos-DataStructures-JS | /sort.js | UTF-8 | 7,928 | 4.65625 | 5 | [] | no_license | /**
* In this file, commonly used sorting algorithms are compared having the same
* input array and tested using the console.time
*
* note : sorting is done in an ascending order
*/
// generates random numbers for testing the worst case in every sorting algorithm
let testArray = Array.from({ length: 1000 }, () =>... | true |
e71b46f3d85a67aef6d6d301cd352859aeee5873 | JavaScript | AllanDragoon/kd-tree-javascript | /kdTree.js | UTF-8 | 10,359 | 3.15625 | 3 | [
"MIT"
] | permissive |
var BinaryHeap = require('./binaryHeap.js');
/**
* KdTree's node definition.
*/
var Node = function (obj, dimension, parent) {
this.obj = obj;
this.left = null;
this.right = null;
this.parent = parent;
this.dimension = dimension;
};
var KdTree = function (points, distanceFunc, dimensions) {
... | true |
2843bcdfb93d8e20810864f2abb00eb22e36db9f | JavaScript | cgiovanii/web-moderno | /exercicios-js/fundamentos/funcao2.js | UTF-8 | 424 | 4.53125 | 5 | [] | no_license | // Função anonima
const imprimirSoma = function (a, b){
console.log(a + b)
}
imprimirSoma(2, 3)
// Armazenando uma função arrow em uma variável
const soma = (a, b) => {
return a + b
}
console.log(soma(2, 4))
// Retorno implícito
const subtracao = (a, b) => a - b
console.log(subtracao(10, 2))
// Exemplo de... | true |
723b0ca9a36c5a04fd63ffbff853d896667affab | JavaScript | EmilMitev/Telerik-Academy | /Node.js/Exam/Preparations/Preparation/server/data/events.js | UTF-8 | 2,324 | 2.546875 | 3 | [
"MIT"
] | permissive | var Event = require('mongoose').model('Event'),
constants = require('../common/constants');
var cache = {
expires: undefined,
data: undefined
};
module.exports = {
create: function(event, user, callback) {
if (constants.categories.indexOf(event.category) < 0
|| constants.initia... | true |
aa10ce7afca79cf78cb97a56b88e80aa9a3d6699 | JavaScript | khangvothuong456/flower-shop | /library/js/javascript.js | UTF-8 | 7,610 | 2.578125 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
// phần của modalBox đăng nhập
$("#dangnhap").click(function(){
$(".loginBox").fadeIn();
});
$(".fa-times").click(function(){
$(".loginBox").fadeOut();
});
// phần của SlideShow
var imgItem = $('#slideShow img').length;
var imgPos = 1;
... | true |
18462c77573b10786f3624da2562b64b3b7df2cd | JavaScript | KacperMitkowski/BooksApp | /WebAPI/Scripts/src/components/registerForm.js | UTF-8 | 3,801 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
export default class RegisterForm extends Component {
constructor(props) {
super(props);
this.state = {
errorMessage: null,
};
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmit(event) {
event.pr... | true |
54aa156aa37eaf4fa7ac8b00edf00e08d3d34e20 | JavaScript | Wayne-Bai/AST-normalize | /data/evanw/silvermath.js/src/core/demo.js | UTF-8 | 2,792 | 2.65625 | 3 | [] | no_license | function loadDemo() {
var container = new Container();
container.children.push(new Character('s', SERIF | ITALIC));
container.children.push(new Character('i', SERIF | ITALIC));
container.children.push(new Character('n', SERIF | ITALIC));
container.children.push(new Character('(', SANS_SERIF));
container.children... | true |
6f628c91db44caff65eb530d34ac6bbe8123fd73 | JavaScript | ravivastec/VastecOPM | /VastecOPMSP/Layouts/VastecOPMSP/ExpandCollapseQuickLaunch.js | UTF-8 | 1,741 | 2.703125 | 3 | [] | no_license | // Find all the top level links in the Quick Launch that have children
var topLevelLinks = $("div[id$='QuickLaunchMenu'] > ul > li:has('ul') > a");
// Prepend the little "twiddle" icon to each top level link
topLevelLinks.prepend("<span class='ms-commentexpand-iconouter ql-icon'><img alt='expand' src='/Comm/Comms2/_t... | true |
9511208b8dfe9d497573e0ee90c4c0d6471de799 | JavaScript | hoangdtcg/fish-game-full-and-animation | /Canvas (Lab)/Fish.js | UTF-8 | 1,676 | 3.46875 | 3 | [] | no_license | class Fish {
constructor(x, y, size, color, speed) {
this.x = x;
this.y = y;
this.size = size;
this.color = color;
this.speed = speed;
this.direct = "right";
this.image = "";
}
init() {
let fishIds = [1, 2, 3, 4];
let fi... | true |
6a32371c9fb30ffc1fe86f9b69d9b0c6574d2146 | JavaScript | idobyte/txAdmin | /core/components/DynamicAds.js | UTF-8 | 2,732 | 2.609375 | 3 | [
"CC0-1.0",
"MIT",
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | const modulename = 'DynamicAds';
import xss from 'xss';
import defaultAds from '../../dynamicAds.json';
import { verbose } from '@core/globalData';
import logger from '@core/extras/console.js';
import got from '@core/extras/got.js';
const { dir, log, logOk, logWarn, logError } = logger(modulename);
//Helper
const clea... | true |
7435abf8bf5de6d5e5924c492afb6398075116e3 | JavaScript | brian2694/vue-moment | /tests/vue-moment.spec.js | UTF-8 | 5,447 | 2.671875 | 3 | [
"MIT"
] | permissive | import Vue from 'vue/dist/vue'
import VueMoment from '../vue-moment'
import moment from 'moment-timezone'
Vue.use(VueMoment, {
moment,
})
let now = moment()
const tomorrow = moment().add(1, 'day')
const vm = new Vue({
template: '<div>{{ now | moment(...args) }}</div>',
data() {
return {
... | true |
c0afac8af970f0b51e29fa83babfaa3c5db7bc1f | JavaScript | PaulBNolan/Year3GameDevices | /Assignments/Lab4/gameOverScene.js | UTF-8 | 632 | 3.234375 | 3 | [] | no_license | /**
* The sub class for the GameOverScene
*/
class GameOverScene extends Scene
{
//The sub class constructor
constructor()
{
//The base constructor is called
super("Game Over");
//Color created
this.color = "rgb(240,100,150)";
}
/**
* The class render function
... | true |
c57a6b0e6dd617ed76fafab57fed3550e8908add | JavaScript | GitHub-wk/co-planning | /app/scripts/components/Solar.js | UTF-8 | 2,301 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | //Solar.js -- use to create a solar which can create shadow
import { MercatorProjection } from '../geo/MercatorProjection.js';
import { SolarAngle } from '../geo/SolarAngle.js';
var dist = 10000;
var axios = require('axios');
axios.get('../../index.html')
.then(function (response) {
//console.log(response);
... | true |
7dad10523066e5504998f7f7aff921a27c5d44ba | JavaScript | mekku/setup | /programs/markdown-niceify.js | UTF-8 | 1,871 | 2.59375 | 3 | [] | no_license | /* BEWARE: Quick'n'dirty script */
const fs = require("fs")
const remark = require("remark")
const visit = require("unist-util-visit")
const toString = require("mdast-util-to-string")
const argv = require("minimist")(process.argv.slice(2))
const Diff = require("diff")
require("colors")
function linksPure (input) {
... | true |
4c6a18d9fd9b64c62227e29801707d776ef242c6 | JavaScript | cvhnilicka/md-to-react | /index.js | UTF-8 | 11,694 | 3.3125 | 3 | [] | no_license | var fs = require('fs');
// BEGIN: CONSTANTS
const MD_DIR = './markdowns/'; // The markdown directory
const HEADER = "const " // The beginning of each react component to be created
// LINK
const REGEX_LINK_DEC = /\[.*?\]/g
const REGEX_LINK_NAK = /<.*?>/g... | true |
8169a2f6987931ee483138cac1372ea2d9dad036 | JavaScript | APORRAS1/MindMapJS | /pfc/recursos/array1-test.js | UTF-8 | 423 | 3.0625 | 3 | [] | no_license | var assert = require("assert");
var a;
beforeEach(function(){
a = [1,2,3];
});
describe('Array', function(){
describe('#indexOf()', function(){
it('debe retorna -1 si el valor no esta presente', function(){
assert.equal(-1, a.indexOf(5));
assert.equal(-1, a.indexOf(0));
});
it('debe ret... | true |
8d77f32748ff28b09147d308819a3a097daab7bc | JavaScript | davidlyons/models | /src/scenes/giraffe.js | UTF-8 | 1,037 | 2.515625 | 3 | [] | no_license | var Giraffe = function( dom ){
var scene = this;
ModelScene.call( scene, dom );
scene.name = 'Giraffe';
fbxLoader.load('models/bowwow/giraffe.fbx', function(fbx){
var giraffe = window.giraffe = fbx;
var body = giraffe.getObjectByName('giraffe');
body.material.shininess = 2;
giraffe.scale.setScalar( .07 )... | true |
76fc9da2c543a3bd4e5ad976a20c4e945f8b7136 | JavaScript | rumblesan/virgil | /src/test/arithmatic-shunter.test.js | UTF-8 | 1,007 | 2.65625 | 3 | [
"MIT"
] | permissive | import { ArithmaticShunter } from '../index';
const operatorPrecedences = {
'^': 15,
'*': 14,
'/': 14,
'%': 14,
'+': 13,
'-': 13,
'<': 11,
'<=': 11,
'>': 11,
'>=': 11,
'==': 10,
'!=': 10,
'&&': 6,
'||': 5,
};
const opGen = (op, left, right) => ({
op,
left,
right,
});
const tokGen = o... | true |
23aa3c4cbed98b9ac323ec9856b0fad01c801646 | JavaScript | aetelani/crayons | /ai/mcbot/ai.js | UTF-8 | 6,816 | 2.53125 | 3 | [
"MIT"
] | permissive | // Distributed under CC-BY license (c) 2016 Pekka Harjamäki
/* ex: set tabstop=4: */
"use strict";
var _ = require("lodash");
var position = require("../../position.js");
// Change botNames and teamName to your choice.
var botNames = [
"McBot",
"McOrNot",
"McIdler"
];
module.exports = function Ai() {
var en... | true |
299ba97088c0e836b73cbda5411b88d5ad0a444c | JavaScript | DhaliwalX/grok | /test/testing/test028.js | UTF-8 | 236 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | function f() {
return (42 + (0 == 1 ? 1 : 2));
}
function g(x) {
return (x + (0 == 1 ? 1 : 2));
}
function h(x) {
return ((x + 1) + (0 == 1 ? 1 : 2));
}
assert_equal(44, f());
assert_equal(45, g(43));
assert_equal(47, h(44)); | true |
65ec80aef7fe6c2f200e055a3f874f3af5e49137 | JavaScript | tyq340503/restaurant-square | /frontend/src/Restaurant/RestaurantListContainer.js | UTF-8 | 2,466 | 2.65625 | 3 | [] | no_license | import React, { Component } from "react";
import RestaurantList from "./RestaurantList";
class RestaurantListContainer extends Component {
constructor(props) {
super(props);
this.state = {
listOfMatchingRestaurants: [],
foundResults: false
};
document... | true |
1572454782717da17efe0c8798bc08d1a34ff5ea | JavaScript | tihawk/project-hiros | /server/battlefieldBoard/breadthFirst.js | UTF-8 | 2,163 | 3.1875 | 3 | [] | no_license | /* eslint-disable no-labels */
const helper = require('./helper')
class Node {
constructor (parent, position) {
this.parent = parent
this.position = position
this.cost = 0
}
isEqualTo (other) {
return this.position.x === other.position.x && this.position.y === other.position.y && this.position.z... | true |
2685570ffb85eb12bf6ea13a175eb8f74ab80336 | JavaScript | AndrzejZug/CharityProject | /src/main/webapp/resources/js/app.js | UTF-8 | 9,662 | 2.90625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function () {
/**
* Form Select
*/
class FormSelect {
constructor($el) {
this.$el = $el;
this.options = [...$el.children];
this.init();
}
init() {
this.createElements();
... | true |
a2d5094045974120592c5a67c8de948964e67bdc | JavaScript | krisw54/JavaScript | /snakeEyes.js | UTF-8 | 1,663 | 3.71875 | 4 | [] | no_license | let btnS = document.getElementById("btnStart");
let txtOutputSE = document.getElementById("outputSE");
let diceB = document.getElementById("d1");
let diceR = document.getElementById("d2");
let txtScore = 0;
let rndNum = 0;
let diceRNum = 0;
let diceBNum = 0;
let txtOutputT="";
btnS.addEventListener("click", start);
f... | true |
e708e7e03fa8b9d67b6f52e5b66e7ca7c61e2b27 | JavaScript | Ananya365/Project92 | /main.js | UTF-8 | 293 | 2.578125 | 3 | [] | no_license | function login(){
var player1 = document.getElementById("player_1_input").value;
var player2 = document.getElementById("player_2_input").value;
localStorage.setItem("Player 1",player1);
localStorage.setItem("Player 2",player2);
window.location="main_page.html";
} | true |
8f0d72b87cac29af15bdcf139e03405137ca8004 | JavaScript | jasobs10/LeagueofNumbers | /frontend/scripts/draw.js | UTF-8 | 13,879 | 2.765625 | 3 | [] | no_license | import {labels} from './helper';
class Draw {
constructor() {
this.list = "";
this.highlighted = [];
}
setAttributes() {
this.list.forEach((el) => {
el.color = '#' + Math.floor(Math.random()*16777215).toString(16);
this.setAverages(el);
});
this.list.sort((a, b) => (b.rank - ... | true |
42fb6b54e7da0edb74996bd808ea72849f45e978 | JavaScript | mciver83/ecommerce-reactjs-redux | /app/containers/BasketCardsRenderer/index.js | UTF-8 | 1,342 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
*
* BasketCardsRenderer
*
*/
import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import BasketCard from '../BasketCard'
export class BasketCardsRenderer extends React.Component { // eslint-disable-line react/prefer-stateless-function
renderItems(items) {
return Object.keys(i... | true |
5519a54c198f25d84658fc98e7843e93b57c9357 | JavaScript | rajjeet/try-react-concurrent | /src/section/12-deferred-state.js | UTF-8 | 1,410 | 2.734375 | 3 | [] | no_license | import React, { useCallback, useState, useDeferredValue, memo } from 'react';
const Experiment = ({ title, useDeferredText }) => {
const [text, setText] = useState("");
const handleChange = useCallback((e) => {
const value = e.target.value;
setText(value);
}, []);
const deferredText = useDeferredValue(... | true |
43e7db11c64ccd83d32fe09028bb0bf424491589 | JavaScript | khaueviana/inheritance-js | /inheritance-class.js | UTF-8 | 740 | 3.765625 | 4 | [] | no_license | class Bird {
constructor(type, color) {
this.type = type;
this.color = color;
this.eggs = 0;
}
fly() {
console.log(`${this.color} ${this.type} is flying`);
}
walk() {
console.log(`${this.color} ${this.type} is walking`);
}
lay_egg() {
this.e... | true |
bc8d3ea599cbdb8600fd61f16ca728c71236005c | JavaScript | alexwu727/webDeveloperBootcamp | /js/basics/practices/todo_list/app.js | UTF-8 | 1,457 | 3.671875 | 4 | [] | no_license | const todoList = []
while (true) {
let action = prompt("What would you like to do?")
if (action === "new") {
let newTodo = prompt("Ok, what is the new todo?");
todoList.push(newTodo);
console.log(`"${newTodo}" added to the list!`)
} else if (action === "list") {
if (!todoLis... | true |
0659e0674627c4040cf968dfb88c14f34db709b0 | JavaScript | GlebUliv/JS_1st_level | /user/user.js | UTF-8 | 1,309 | 3.34375 | 3 | [] | no_license |
let div = document.getElementById("user")
class User {
constructor(username, email, password, avatar, created){
this.username = username;
this.email = email;
this.password = password;
this.avatar = avatar;
this.created = created;... | true |
16c1e34a5feb83f8c2802b46794f4a65c625a42d | JavaScript | atmaSveRo/Learn1 | /array/indexMin.js | UTF-8 | 342 | 3.4375 | 3 | [] | no_license | export const indexMin = (array) => {
if (array.length === 0) {
return null
}
let minElem = array[0]
let minIndex = 0
for(let i = 0; i < array.length; i++) {
let element = array[i]
if (element < minElem) {
minElem = element
minIndex = i
}
}
... | true |
cf58d1339af3f17dc6765c2e9895e1f1c30656da | JavaScript | Yennhi2k/CONG_NGHE_WEB | /error-contact.js | UTF-8 | 2,130 | 2.9375 | 3 | [] | no_license | var ten = document.forms['form']['name'];
var tieude = document.forms['form']['title'];
var email = document.forms['form']['email'];
var thongdiep = document.forms['form']['message'];
var ten_error = document.getElementById('ten_error');
var tieude_error = document.getElementById('tieude_error');
var email_error = do... | true |
135c79f4cbf6edc4036c9ef9cbd289013a0fbb6a | JavaScript | dev-alexandre-lopes/curso_javascript | /02_logica/exe_05/exe_05.js | UTF-8 | 865 | 4.875 | 5 | [
"MIT"
] | permissive | // Escreva uma função que recebe dois valores e retorna o maior entre eles:
//Solução 1: Função Normal
function maiornumero(num1,num2){
if (num1 > num2){
console.log(`O número ${num1} é o maior`)
}else console.log(`O número ${num2} é o maior`)
return
}
let maior = maiornumero(8,5);
console.log(mai... | true |
2b71d58a1698dc8a3d3338d4de668d7f1a447248 | JavaScript | jacktulv/fend-project-memory-game | /js/app.js | UTF-8 | 4,653 | 3.53125 | 4 | [
"MIT"
] | permissive | /*
* Create a list that holds all of your cards
*/
//画HTML
$(drawGird);
function drawGird(){
$('.seconds').html(times);
$('.moves').html(count);
//定义卡片图标类型
const CardsType=['fa fa-diamond','fa fa-paper-plane-o','fa fa-anchor','fa fa-bolt',
'fa fa-cube','fa fa-leaf','fa fa-diamond','fa fa-paper-plane... | true |
bbd30ba86c492facc80bcd3b9a3279b24513f037 | JavaScript | TravisCon/cs313 | /web/Week08/server.js | UTF-8 | 1,028 | 2.71875 | 3 | [] | no_license | var http = require("http");
var url = require("url");
var server = http.createServer(onRequest);
var port = 8888;
var portURL = ("localhost:" + port + "/");
function onRequest(request, response) {
var returnedURL = url.parse(request.url).pathname;
console.log(returnedURL);
if (returnedURL == "/home"){
respo... | true |
aaa238984666eff3cce0a26ebd7915eedaa9d80e | JavaScript | prsnaoffl/PhotoShop-Clone-React | /src/App.js | UTF-8 | 3,483 | 2.59375 | 3 | [] | no_license | import React,{ useState } from 'react';
import "./App.css";
import Slider from './Components/Slider';
import SidebarItem from './Components/SidebarItem';
import * as htmlToImage from "html-to-image";
import * as download from "downloadjs";
const DEFAULT_OPTIONS =[
{
name:"Brightness",
property:"brightness",
... | true |
5ded322462fd8e96543b1749d0a68679c4a09e7c | JavaScript | Dawkey/dawkey.github.io | /demo/polygon-learn/polygon.js | UTF-8 | 2,966 | 2.890625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded",function(){
var svg_radius = 100;
var svg_width,svg_height,svg_x,svg_y;
svg_width = svg_height = svg_radius*2 + 10;
svg_x = svg_y = svg_radius + 5;
//把半径转化为相应x,y坐标
function to_coordinate(radius,index,total){
var angle = Math.PI*2/total*index;
var x ... | true |
0cd79f7c474278031703995d5a09ccf7fcc5c9eb | JavaScript | antoniobp/monedas-sim | /front/operaciones/operaciones.controller.js | UTF-8 | 3,113 | 2.65625 | 3 | [] | no_license | (function () {
'use strict';
angular
.module('app')
.controller('OperacionesController', OperacionesController);
OperacionesController.$inject = ['UserService', '$routeParams', '$location', '$rootScope', 'FlashService'];
function OperacionesController(UserService, $routeParams, $locati... | true |
efcfc20e5854c64ffbfacb9ecfff53b83163659e | JavaScript | micahalgard/javascript | /leap/scripts8.js | UTF-8 | 3,363 | 3.6875 | 4 | [] | no_license | var Cipher = function () {
};
Cipher.prototype.encode = function(str){
var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
var end = Math.floor((Math.random() * 25) + 1);
var start = Math.floor(Math.random() * Math.floor(end))
var key1 = alphabet.slice(start, end);
var key... | true |
a572a49aba1b263652d80afdc1240c7a9db02928 | JavaScript | motleysixxx96/CBCLabs | /Navbar-project lab 1/Navbar-Project/2 new folders/popup.js | UTF-8 | 361 | 3.015625 | 3 | [
"MIT"
] | permissive |
console.log("popups.js loaded");
let answer = prompt("Restaurant bill is");
//console.log("The user is "+answer+".")
let tip = answer*.15;
alert("Tonights bill is "+tip+",")
/*Your first task today
Create a program that asks for the
cost of dinner
and calculates the tip
and displays the tip in an alert window
a t... | true |
d51b33615ccd219cfa88d1254afbd8b730f1dc70 | JavaScript | BalAlexDec/CondenotchProjects | /Día_4_Bucles/dia4.js | UTF-8 | 6,345 | 3.46875 | 3 | [] | no_license | function reto1(){
for(i=0;i<10;i++){
console.log(i+' ');
}
for(i=0; i<10;i++){
if(i%2==0){
console.log(i+' ');
}
}
let cont=0;
while(cont<10){
cont++;
console.log(cont+' ');
}
let y=0;
while(y<10){
... | true |
42066645afdd34a45375af081e688a808458f1cd | JavaScript | sllabres/sllabres | /sllabres/GameOfLife/GameThree.js | UTF-8 | 2,986 | 2.953125 | 3 | [] | no_license | "use strict";
function Game() {
var gridSize = 2500;
var gridWidth = Math.sqrt(gridSize);
var grid = new Grid(new RandomSeedGenerator(new DrawWrapper()).generateSeed(gridSize), new NeighbourhoodWatch(gridWidth));
var camera, scene, renderer;
var geometry, material;
var width = window.innerWi... | true |
a17a6e7dd2dd0eebffdd5953089bc13960836977 | JavaScript | ropello/javascript-hide-and-seek-bootcamp-prep-000 | /index.js | UTF-8 | 1,342 | 3.5625 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | function getFirstSelector(selector) {
var firstElement = document.querySelector(selector);
//querySelector returns the first element of the provided selector
return firstElement;
}
function nestedTarget () {
//var elementId = document.getElementById('nested');
//var nestedElement = document.querySelectorAll... | true |
704434e06ae85e2914da9da314e47fa9c0b15a77 | JavaScript | gabrielreisn/csm40-s73-trabalho-final | /src/Item.js | UTF-8 | 770 | 2.859375 | 3 | [] | no_license | class Item{
constructor(fetch, type){
this.id = null
this.nome = null
this.fetch = fetch
this.c = type
}
setObjectToFetch(obj){
this.fetch.setObjeto({
...obj,
c: this.c,
id : this.id,
pedido: this.pedido,
produto: this.produto,
qtd: this.qtd
})
}
... | true |
ea275148192d96bb1144318af9149147b98eeb97 | JavaScript | LordKayBanks/SRS-videoplayer | /src/components/playlist.js | UTF-8 | 8,771 | 2.515625 | 3 | [] | no_license | import './playlist.scss'
import React, { Component } from 'react'
import axios from 'axios'
import { drop } from '../player/drag'
import { parseYoutubeUrl } from '../utility/youtube'
import playlistCreator from '../utility/playlistCreator'
import { uuid } from 'uuidv4'
import PlaylistItem from './playlistItem'
class... | true |
a1afd6844a1db30550603711f914833aa691ee76 | JavaScript | kunalashar25/learn-typescript | /language_fundamentals/classes_and_interface/interfaces/creating_first_interface/app.js | UTF-8 | 261 | 3.5 | 4 | [] | no_license | // Used to describe structure of an object
// Only exist in TS
// Can use it as a custom type
var user1;
user1 = {
name: 'Kunal',
age: 29,
greet: function (phrase) {
console.log(phrase + ": " + this.name);
}
};
user1.greet('Welcome..');
| true |
f38787b5249593463ea65cebc617b9ae35aefd25 | JavaScript | mgable/codeeval | /moderate/overlapping_rectangles.js | UTF-8 | 822 | 3.375 | 3 | [] | no_license | "use strict";
var fs = require("fs");
fs.readFileSync(process.argv[2]).toString().split('\n').forEach(function (line) {
if (line !== "") {
console.info(parse(line));
}
});
// -2,2,2,-2,0,0,1,1
function parse(line){
var arr = line.split(",").map(function(item){return parseInt(item);}),
rectangl... | true |
5e6c977814abf76455673d2c8872da313b76333b | JavaScript | jlh040/Node-Intro-Exercises | /step3.js | UTF-8 | 1,861 | 3.34375 | 3 | [] | no_license | const fs = require('fs');
const axios = require('axios');
function cat(path) {
fs.readFile(path, 'utf8', (err, data) => {
if (err) {
console.log(`Error reading ${path}:`, err);
process.exit(1);
}
else {
console.log(data);
}
})
}
async functio... | true |