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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b499e4e3d447d23e38f75329d004be053301b1e2 | JavaScript | AashuGaming/VirtualPet | /sketch.js | UTF-8 | 567 | 2.953125 | 3 | [] | no_license | var dog;
var sadDog;
var happyDog;
var milk, milkImage;
function preload(){
sadDog=loadImage("Images/Dog.png");
happyDog=loadImage("Images/happy dog.png");
milk=loadImage("Images/Milk.png");
milkImage=loadImage("Images/milkImage.png")
}
function setup() {
createCanvas(1000,400);
dog=cr... | true |
c2f326a294080df434f2aa3c8059889347e78da9 | JavaScript | arjel1/shy | /bot.js | UTF-8 | 4,671 | 2.578125 | 3 | [] | no_license | const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'NTgyNTY1MDY4MTg1Nzk2NjEw.XOw-Qg.yOk4LBgQOm3ILKZ63rcUCXgJqnE'
var PREFIX = '+';
bot.on('ready', () =>{
console.log('this bot is online');
bot.user.setActivity('+help' , { type: 'PLAYING'}).catch(console.error);
})
bot.on... | true |
b85ac59594abf15d4a733131ab170664e00cb11e | JavaScript | IgorKonovalov/expressiveJS_tests | /chapter4-Higher_Functions/examples/abstract-functions.js | UTF-8 | 3,157 | 3.921875 | 4 | [] | no_license | // примеры абстрактных функций
// функция, принимающая в качестве аргумента действие
function forEach(array, action) {
for (var i = 0; i<array.length; i++)
action(array[i])
}
forEach([1,2,3,4,5], console.log);
// передача функции в качестве аргумента
var numbers = [1,2,3,4,5],
sum = 0;
forEach(numbers, ... | true |
efd84faa29eccd10e85d0cd27d25d9583cf5fbf8 | JavaScript | stefism/Projects | /JS Advanced-May 2021/02-Arrays And Nested Arrays/nonMutatedArrayMethods.js | UTF-8 | 1,164 | 3.65625 | 4 | [] | no_license | let cars = ["BMV", "Audi", "Opel"];
let cars2 = ["Honda"];
let allCars = cars.concat(cars2);
console.log(allCars); //['BMV', 'Audi', 'Opel', 'Honda']
let joinedCars = allCars.join(); //Произвежда един стринг от всички елементи на масива, като дефолтно ги разделя със запетая.
console.log(joinedCars); //"BMV,Audi,Opel,... | true |
cb1130f3306867b51576e3023b36c2a718d6aa9d | JavaScript | bart112233/raspberrycoffee | /webServer/test/05_transactionPurposesTests.js | UTF-8 | 5,704 | 2.515625 | 3 | [
"MIT"
] | permissive |
var index = require('./index');
var async = require('async');
describe('Transaction purposes', function() {
//clean up
after(function (done) {
async.series([
function (callback) {
myQueryExecutor
.setQuery('DELETE FROM transactionPurpos... | true |
52ea5727cb54484dfb9ab5761178aa66903b4162 | JavaScript | HDykins/Calendar-jQuery-MVC | /js/calendar-dom-view.js | UTF-8 | 2,654 | 2.875 | 3 | [] | no_license | var CalendarDOMView = (function () {
var calendarDatesArray = Model.appendAndPrependToDateArray();
var arraysOfRowsObject = createRowArrayObject(calendarDatesArray);
function createRowArrayObject(calendarDatesArray) {
arraysOfRowsObject = {};
for (var i =3; i<9; i++) {
arraysOfRowsObject["row... | true |
f0c0a7a0137c20c6dd778819cf69a92b363bb5c4 | JavaScript | cohortSix/project | /exercise2_Assignment/nicksonExercise2.js | UTF-8 | 1,919 | 4.03125 | 4 | [] | no_license | //defining a function with two parameters test 1 and test2
function tests(test1,test2)
{
// assigning a variable greater to a tenary/conditional operator.
let greater = test2>test1?test1:test2
//
return greater
}
tests(10,20);
//definig a function with a name coursework and parameter cswork.
function cours... | true |
f3016d3b3a5987fc717e0a971e7341bf0afb557a | JavaScript | oToToT/BBS-Push | /basic.js | UTF-8 | 1,246 | 2.828125 | 3 | [] | no_license | function times (str,num) {
var i = 0;
var temp = "";
while(i<num){
temp += str;
i++;
}
return temp;
}
function change () {
if(!document.getElementById("copy").checked){
document.getElementById("copyArea").style.display = "none"
document.getElementById("linkArea").style.display = "block"
}els... | true |
9d989385b493b127f7378cfab00e49bbba7e52a0 | JavaScript | Tanujabshelke/color-flipper | /src/ColorPicker/Color.js | UTF-8 | 961 | 2.890625 | 3 | [] | no_license | import React from "react";
import { useState } from "react/cjs/react.development";
import "./Color.css";
function Color() {
let myColor = document.querySelector(".color");
// console.log(myColor.nodeValue);
const [color, setColor] = useState();
const handleClick = () => {
let a = Math.floor(Math.random(... | true |
9b4e360f84946278b85fd343f00bdb1beb74be5f | JavaScript | ivanbokii/staffgrid | /public/tests/staffgridSpec.js | UTF-8 | 5,744 | 2.875 | 3 | [] | no_license | //this test suite contains tests for both grid and pager
describe('app', function() {
var elm, scope;
var testData = [
{"age":67,"city":"Campden","country":"PY","firstName":"James","id":"KOJILUBIHR","lastName":"Thompson","postalCode":"10687"},
{"age":98,"city":"Burrton","country":"CI","firstName":"Matthew"... | true |
0ed2c41f2ad3be0063a14f7bd73961d5dc2cb606 | JavaScript | sparklie3/morningnews | /getNews.js | UTF-8 | 532 | 2.859375 | 3 | [] | no_license | module.exports.getNewsType = function(input){
switch (input) {
case 'insurance':
return new Promise(function(resolve,reject){
resolve(input);
}).catch(function(err){
return err;
});
case 'thought':
return new Promise(fun... | true |
fee93c8085eb36a19b83e8113586a922fdb6156a | JavaScript | baselnasrini/1DV525_Introduction-to-web-programming | /mn223dn-exercise/lnu-it/src/js/app.js | UTF-8 | 377 | 2.875 | 3 | [
"MIT"
] | permissive | let linkElement = document.createElement('link')
linkElement.setAttribute('href', 'css/style.css')
linkElement.setAttribute('rel', 'stylesheet')
let headerTag = document.querySelector('HEADER')
headerTag.appendChild(linkElement)
console.log(headerTag)
let aTag = document.querySelectorAll('A')
for (let i = 0; i < aT... | true |
c283676fbcc81b15ffe1ce860a60170f54cb377c | JavaScript | ayamflow/FlowUtils | /entities/Kin.js | UTF-8 | 760 | 3.28125 | 3 | [] | no_license | // class for handling kinematics (moving arms, legs, scarf...)
var Kin = function(x, y, width, height, color)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
this.color = color;
this.theta = 2.5;
this.thetaDirection = 1;
};
Kin.prototype = {
update: function(c)
{... | true |
259423201fca5e818130ee8504a301de580f7e33 | JavaScript | hertwing/codewars_my_solutions | /JavaScript/5 kyu/math_issues.js | UTF-8 | 330 | 3.0625 | 3 | [] | no_license | Math.round = function(number) {
if (number % 1 >= 0.5 && number % 1 < 1) number++;
number -= number % 1;
return number;
};
Math.ceil = function(number) {
if (number % 1 != 0) {
number -= number % 1;
number += 1;
}
return number;
};
Math.floor = function(number) {
number -= number % 1;
return n... | true |
c8e14c9270608469abed8527586b76202daceb25 | JavaScript | KoizumiSinya/NodeJsStudy | /NodeJS_Chaoshiyong/12_stream/code01_readable_basic.js | UTF-8 | 437 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | //创建可读流
var fs = require("fs");
var rs = fs.createReadStream("../files/123.txt");
rs.setEncoding("utf8");
rs.on("readable", () => {
console.log("readable event ...");
});
rs.on("data", (chunk) => {
console.log("data event ...");
});
rs.on("error", () => {
console.log("error event ...");
});
rs.on("end", ()... | true |
9acd96934a0ea51ede2f6393aa8256cb02148ce1 | JavaScript | cdkirkwood/algos | /max-sum-increasing-sub.js | UTF-8 | 1,401 | 3.828125 | 4 | [] | no_license | function maxSumIncreasingSubsequence(array) {
let returnArr = [array[0], [array[0]]]
let sums = [array[0]]
for (let i = 1; i < array.length; i++) {
let curGreatest = array[i]
sums[i] = -Infinity
let curArr = []
for (let j = 0; j < sums.length; j++) {
let curSum = array[i] + sums[j]
i... | true |
d067b1b474a17e5311ea3c39298cdb0be76f3005 | JavaScript | Venkat-juju/firstSample | /scripts.js | UTF-8 | 1,856 | 3.46875 | 3 | [] | no_license | function CountRows() {
var totalRowCount = 0;
var rowCount = 0;
var table = document.getElementById("studentTable");
var rows = table.getElementsByTagName("tr")
alert(typeof(rows));
for (var i = 0; i < rows.length; i++) {
totalRowCount++;
if (rows[i].getElementsByTagName("td").le... | true |
29841728cda04ffc2b1715c2bf0fc756768af720 | JavaScript | muesingb/react-events-in-detail-lab | /src/components/CoordinatesButton.js | UTF-8 | 725 | 3.046875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import React from 'react';
class CoordinatesButton extends React.Component {
createArray = (e) => {
let coordinatesArray = [e.clientX, e.clientY]
this.props.onReceiveCoordinates(coordinatesArray)
}
render() {
return (
<button onClick={this.createArray} >CoordinatesB... | true |
bb317d28c3911266c5c9dee196a92d06255be5ea | JavaScript | utarsuno/quasar_source | /libraries/front_end_old/data_structures/linked_lists/base/linked_list_base.js | UTF-8 | 8,500 | 2.734375 | 3 | [
"MIT"
] | permissive | $_QE.prototype.LinkedListBase = function() {};
$_QE.prototype.LinkedListBase.prototype = {
__init__ll: function() {
this._node_head = null;
this._node_tail = null;
this._length = 0;
this._length_positive = 0;
this._length_negative = 0;
this._cac... | true |
9d25079dc800d7b8fe68f54ed422e5d61a2402fe | JavaScript | thalesfsp/key-renamer | /benchmark.js | UTF-8 | 2,033 | 2.765625 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
* @author Thales Pinheiro
* @since 10/07/2011
* @copyright Thales Pinheiro
* @requires assert
* @requires lodash
* @requires key-renamer
* Key-renamer benchmark
*/
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const keyRenamer = require('./bin/key-renamer');
// ... | true |
2d4193357eb76c3a2a3c6d2928e0879060509126 | JavaScript | plotly/chrome-extension | /content.js | UTF-8 | 4,092 | 2.59375 | 3 | [] | no_license | (function() {
'use strict';
// ---external global dependencies
/* global chrome:false */
var dataExtensions = [
'xls',
'xlsx',
'csv',
'tsv',
'm',
'mat',
'mdb',
'h5',
'hdf',
'hdf5'
];
var linkList,
linkCont... | true |
31c84cd1f6b97ecaf61a8b962dbfb16d0f1187f7 | JavaScript | trieuminhha1991/trieuminhha1991.github.io | /BOM/bt.js | UTF-8 | 1,631 | 2.953125 | 3 | [] | no_license | // Thực hiện các hành động bên trong khi tài liệu html của trang web được load xong và cây DOM được tạo thành
// Thực hiện các hành động bên trong khi click vào các nút số
let dapan=["A","B","C","D","A"];
let b=[];
function C1(button){
let a=document.querySelectorAll(".c1");
for (var i = 0; i < a.length; ... | true |
d31d29825f2bc860a87b27bbe69366a80fd973e8 | JavaScript | malatalo/ai-flappy | /ai/flap.js | UTF-8 | 1,840 | 3.109375 | 3 | [] | no_license | class flap {
constructor(brain, pr, pg, pb){
this.y = height / 2;
this.x = width / 4;
this.size = 32;
this.gravity = 0.7;
this.lift = -12;
this.velocity = 0;
this.score = 0;
this.fitness = 0;
this.birdBrain = null;
... | true |
52e6b0480459a27050b4ebb9f74d8da76569ec91 | JavaScript | tmattmac/twitter-image-bot-platform | /server/helpers/sortFilesByDate.js | UTF-8 | 171 | 2.609375 | 3 | [] | no_license | function sortFilesByDate(files) {
files.sort((a, b) => {
return b.metadata.timeCreated > a.metadata.timeCreated ? 1 : -1;
});
}
module.exports = sortFilesByDate;
| true |
8f1a5b7eb412086ad5a41e0f7ea45703e3014f34 | JavaScript | TRIPTYK-ACADEMY/nodejs-ia-2021 | /jour-2/exercice-2/index.js | UTF-8 | 1,187 | 3.125 | 3 | [] | no_license | /**
* Importez la liste de contacts du module contacts.js
* Bouclez sur ces contacts et déclenchez un évènement 'error' lorsque le contact n'a pas d'email
* à la fin de la boucle, déclenchez un évènement 'end'
*
* Lorsque l'évènement error est émis, affichez un joli message d'erreur en couleur
* Lorsque l'é... | true |
a568e690cb25b59969eb9adf0835572e4b21dae0 | JavaScript | prernasilakari/OrderingApp | /controller/admin.js | UTF-8 | 2,490 | 2.578125 | 3 | [] | no_license | const Product = require('../model/product')
//To get the add Product page of admin
exports.getAddProduct = (req, res, next) => {
if (!req.session.isLoggedIn) {
return res.redirect('/login')
}
res.render('admin/add-product', {
})
}
//To add new Products
exports.addProduct = (req, res, next) =... | true |
f2161c5cdfa36fcb931e47f0c1101aaf86cdf7d6 | JavaScript | cjinae/bot_ui | /app/assets/javascripts/script.js | UTF-8 | 3,056 | 2.546875 | 3 | [] | no_license | $(document).ready(function(){
var url = "http://localhost:8071/motion-control/update";
// $("li").click(function(e){
// e.preventDefault();
// $("li").removeClass("action");
// $(this).addClass("controls");
// });
// switch
// case
// JQ for Key Down
$(document).keydown(function(e) {
// $('.tu... | true |
7e2d81d7c9d00d9e13dc883cae85fe0929af2dee | JavaScript | Ryan104/virtual-thru-hiker | /config/passport.js | UTF-8 | 1,960 | 2.59375 | 3 | [
"MIT"
] | permissive | /** passport.js **
* middleware for suppling the authentication module
* with the google Oauth2 strategy.
*/
const GoogleStrategy = require('passport-google-oauth2').Strategy;
const db = require('../models');
module.exports = function(passport){
passport.serializeUser(function(user, done) { // session managemen... | true |
24712ee38b94d393d7676afa40bd7b96e8925a5a | JavaScript | PWAckerman/fantastic-computing-machine-react | /src/selectors/tagSelector.js | UTF-8 | 584 | 2.875 | 3 | [] | no_license | // import { createSelector } from 'reselect'
// function getEntries(state){
// return state.entries
// }
//
// const tagSelector = createSelector([ getEntries ],(entries) => {
// return entries.map((entry)=>{
// entry.tags = entry.text.match(/#[a-z]*/ig);
// return entry;
// })
... | true |
7c2021660899e143f95fb388d4dd2ab799aeb5c5 | JavaScript | 330482405/MOki_feiniu | /js/cyx/goodsSearch.js | UTF-8 | 810 | 2.734375 | 3 | [
"MIT"
] | permissive | //关于预搜索
let mInput = document.querySelector("input");
let oCover = document.querySelector(".cover");
let oSection = document.querySelector("section");
let oArticle = document.querySelector("article");
function showCover(){
$(oCover).addClass('covershow');
}
function closeCover(){
$(oCover).removeClass('covershow')... | true |
46d9cbf9e824cac263ca21cb949624d1645c5d51 | JavaScript | KyungMoChoi/MCDelivery | /Final_MCDelivery/WebContent/assets/js/checkForm.js | UHC | 850 | 2.5625 | 3 | [] | no_license | function checkLogin()
{
var idCtrl = document.getElementById('inputID');
var id = idCtrl.value;
var pwCtrl = document.getElementById('inputPW');
var pw = pwCtrl.value;
if(id == "" || pw ==""){
alert("Please Check your ID or Password");
return;
}
}
function join()
{
window.open("../member/jo... | true |
107f50499d9369b306775938a56a7395843b00db | JavaScript | BrightlySoftware/autodude-webdriver | /lib/pages/BasePage.js | UTF-8 | 2,038 | 3.140625 | 3 | [
"MIT"
] | permissive | class BasePage {
/**
* Create a BasePage
* @param {object} expectedValues - an object containing sets of key value pair of expected values that can be referenced
* @param {object} options
* @param {string} options.baseUrl - the baseUrl of a web page (e.g. https://www.google.com)
* @param {... | true |
4e12cd14fef98ee54c67a2721ae24058843fb9f3 | JavaScript | kayschulze/galactic-calculator | /spec/galatic-calculator-spec.js | UTF-8 | 2,566 | 3.5625 | 4 | [] | no_license | import { GalacticCalculator } from "./../js/galactic-calculator.js";
let day = 7;
let month = 7;
let year = 1978;
let birthday = new Date();
birthday.setDate(day);
birthday.setMonth(month);
birthday.setFullYear(year);
let human = new GalacticCalculator(birthday);
describe("GalacticCalculator", function() {
it('sho... | true |
bc6e3f0aee5dc706ee4d4d84e65e4049c8e042c4 | JavaScript | ryan97-au/Social-App | /js/view_feed.js | UTF-8 | 2,588 | 3.09375 | 3 | [] | no_license | // toggles the comment section from hidden to visible and shifts the post left when the comments are viewable
function feedBtnClickChoose(){
alert('feedBtnClickChoose');
// hide nav buttons
document.getElementById("postNavigationButtons").style.display = "none";
// diplay emoji/ comment buttons
document.ge... | true |
6b9006b22553b2a40cd79122f139ae9f11355fce | JavaScript | bryant1410/ShowMeTheMoney | /app.js | UTF-8 | 3,414 | 2.734375 | 3 | [] | no_license | // Setup basic express server
var express = require('express');
var request = require("request");
var feed = require("feed-read");
var bodyParser = require("body-parser");
var get_data = require("./data/get_data.js");
var analyze = require('Sentimental').analyze,
positivity = require('Sentimental').positivity,
... | true |
0fdd93869bfbc81bfdf907fbd427b57a6ed471d4 | JavaScript | kylestev/rsjs | /lib/analyzer/Analyzer.js | UTF-8 | 1,049 | 2.78125 | 3 | [] | no_license | var util = require('../util');
var Analyzer = function (tree) {
this.classes = [];
this.body = tree['body'];
this.identifiedClasses = {};
if (this.body === null || this.body === undefined) {
throw new Error('Error Creating analyzer. Failed to find body')
}
for (var key in this.body) {
var child = this.body... | true |
d15127ec41f560bfda93b7ae98447f1e05c7a54e | JavaScript | Breno-N/homeless | /backend/app/controllers/PessoaProcuradaAcao.js | UTF-8 | 1,232 | 2.546875 | 3 | [] | no_license | const dao = require('../dao/PessoaProcuradaAcaoDAO');
class PessoaProcuradaAcao {
async insert(req, res, next){
let acoes = req.body.acoes;
if(!acoes || !acoes.length){
res.json( (req.pessoaProcurada.atualizada ? req.pessoaProcurada.atualizada : req.pessoaProcurada.id) );
} else {
let pess... | true |
4d50da438a94994d426eae4e482344c0053c6436 | JavaScript | momentum-morehouse/js-customer-database-kieranblanks | /main.js | UTF-8 | 3,143 | 3.296875 | 3 | [] | no_license | import customers from './customers.js'
let container = document.getElementById("profileContainer")
console.log(container);
for (let customer of customers) {
let article = document.createElement("article"); //however many are in the loop, build an article
article.classList.add("hide-child", "relative", "ba",... | true |
fe4eab3d64fb9485b8c434557a48a8fc4df32353 | JavaScript | puwiii/Frontendmentor | /bookmark-landing-page-master/archivo/app/scripts/faq.js | UTF-8 | 560 | 3 | 3 | [] | no_license | let faqs = document.querySelectorAll('.faq__label');
faqs.forEach(faq => {
faq.addEventListener('click', ()=>{
let faqParent = faq.parentElement;
if (faqParent.classList.contains('open')) faqParent.classList.remove('open')
else {
closeFaqs();
faqParent.... | true |
add4c121efbcc2d1b881c6fcbac0d35c785f10a5 | JavaScript | surabhi05june/reactwithbabel | /src/App.js | UTF-8 | 1,893 | 3.15625 | 3 | [] | no_license |
const { useState, useEffect } = React
const UserDetails = () => {
const [state,setState]=useState({users:[]})
const fetchUsers=() =>{
// Where we're fetching data from
fetch(`https://randomuser.me/api`)
// We get the API response and receive data in JSON format...
.then(respo... | true |
0c9cc6eecc7d04773bc4215b9e48afa95cc0bf11 | JavaScript | JackHowa/phase-0-tracks | /js/explore.js | UTF-8 | 510 | 4.3125 | 4 | [] | no_license | // pseudocode
// Make a new program that takes a word
// Measure how long that word is
// FOR each letter
// Take the letter's position at the end
// Assign that letter to its new position next in line in front
// Show the new word after if then
var stringReverser = function(word) {
var new_word = ""
for (v... | true |
a513a2a4f45cba0fde60bb8bfe677678d44ef6d8 | JavaScript | kevinyee1993/W5D5-WRK | /timing.js | UTF-8 | 1,214 | 3.9375 | 4 | [] | no_license | class Clock {
constructor() {
let date = new Date();
this.hours = date.getHours();
this.minutes = date.getMinutes();
this.seconds = date.getSeconds();
// this.printTime(this.hours, this.minutes, this.seconds);
// 1. Create a Date object.
// 2. Store the hours, minutes, and seconds.
/... | true |
702760004ce5389089e2057ba0139835d2abd2b8 | JavaScript | hyeryahn/Todo | /resources/js/settings.js | UTF-8 | 3,765 | 2.890625 | 3 | [] | no_license | window.onload = function () {
const hueBackTop = document.getElementById('hue-backTop');
const saturationBackTop = document.getElementById('saturation-backTop');
const lightnessBackTop = document.getElementById('lightness-backTop');
const hueValueBackTop = document.getElementById('hueValue-backTop'... | true |
3386edd524cc1abaa85086313e2512a6b2a96967 | JavaScript | pichistelrooy/2019 | /TP2-3/js/functions.js | UTF-8 | 353 | 3.3125 | 3 | [] | no_license | function deleteRow()
{
var table = document.querySelector(".myTable");
table.deleteRow(-1);
}
function insertRow()
{
var table = document.querySelector(".myTable");
var row = table.insertRow(-1);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.innerHTML = 'Header 1';
... | true |
0c72685c3b1053e6a24d4100032c14b715fce612 | JavaScript | KatLargman/DI_BOOTCAMP | /Week3/Day1/Ex_XP/ex2/java.js | UTF-8 | 498 | 3.25 | 3 | [] | no_license | let listn = document.getElementsByClassName("list");//1
listn[0].lastElementChild.textContent = "Richard"
for(let i = 0; i<listn.length; i++) //2
{ listn[i].firstElementChild.textContent = "Kate"}
for(let i = 0; i <listn.length; i++) //3
{
let newLi = document.createElement("li");
let node = document.create... | true |
f890c1b6d0685a5d9b8931ac2a5c8a7d68711fe1 | JavaScript | VarnaLab/organic-frontend-template | /public/scripts/lib/organic-plasma-multimatch/roiterator.js | UTF-8 | 910 | 2.84375 | 3 | [
"MIT"
] | permissive | 'use strict';
define([], function () {
function Iterator(array, startIndex) {
/* jshint maxstatements: 10 */
var index = startIndex || 0;
this.val = function () {
return array[index];
};
this.hasPrev = function () {
return index > 0;
};
this.prev = function () {
... | true |
49848fdadbb90bd48083a7281feb6311810d3357 | JavaScript | ryoyakawai/assistant_factaboutgoogle | /functions/response.js | UTF-8 | 2,815 | 2.921875 | 3 | [] | no_license | // NOT IN USE
const response = function () {};
response.prototype = {
// Function to send correctly formatted Google Assistant responses to Dialogflow which are then sent to the user
init: function(app, response) {
this.app = app;
},
sendGoogleResponse: function (responseToUser) {
if (t... | true |
b090b260f77225bef4cef3377a68d46fbed81ebe | JavaScript | Abelsp04/javascript-dom--exercises | /exercises/09-Remove-DOM-Element-part-two/index.js | UTF-8 | 117 | 2.59375 | 3 | [] | no_license | let list = document.querySelector("#parentLI");
let child = list.childNodes[3];
child.parentNode.removeChild(child);
| true |
f951d03858aa3bd0aafcfe7938eca1b803d13a4d | JavaScript | merlin-201/Blood-bank | /static/js/hospitals.js | UTF-8 | 6,090 | 2.578125 | 3 | [] | no_license | /*Hospital Ssection */
$(".tag h2").click(function(){
var mkm= $(this).attr('target');
$(`#div${mkm}`).show();
$(`#div${mkm}`).nextAll().hide();
$(`#div${mkm}`).prevAll().hide();
});
console.log($("#hospitals").outerHeight());
/*Chat box*/
$(".sendIcon").click(sendData);
function sendData(){
let message... | true |
81ed943f22a71c940be048888b12045042155ab5 | JavaScript | octoi/vannila-js-note-app | /js/App.js | UTF-8 | 1,635 | 2.734375 | 3 | [
"MIT"
] | permissive | import NotesView from './NotesView.js';
import NotesAPI from './NotesAPI.js';
export default class App {
constructor(root) {
this.notes = [];
this.activeNote = null;
this.view = new NotesView(root, this._handlers());
this._refreshNotes();
}
_refreshNotes() {
const ... | true |
4be349145daffc7e6a3c6ba0027e2aba245d9f12 | JavaScript | DilyanTsenkov/SoftUni-Software-Engineering | /JS Basics/01 More Exercises Simple Operations and Calculations/06. Fishland.js | UTF-8 | 474 | 3.359375 | 3 | [] | no_license | function fishland(input1, input2, input3, input4, input5) {
let mackerelPrice = Number(input1)
let spratPrice = Number(input2)
let bonitoKg = Number(input3)
let scadKg = Number(input4)
let musselsKg = Number(input5)
let bonitoPrice = mackerelPrice * 1.6
let scadPrice = spratPrice * 1.8
l... | true |
9a23a4a520512deb9be7c1c882a8e3916bbd718b | JavaScript | mmair-kang/mvision | /src/components/Timer.js | UTF-8 | 4,962 | 2.78125 | 3 | [] | no_license | import React, { Component } from 'react';
/* mmair Component */
class Timer extends Component{
constructor(props){
super(props);
this.state = {
timer: {
date : '',
week : '',
am : '',
time : ''
}... | true |
d5eb3322268e93a554291b4b211f910a547ec207 | JavaScript | superbinbin/hw2020 | /1.js | UTF-8 | 3,527 | 3.234375 | 3 | [] | no_license |
let tasks = [];
function renderEditor() {
let inputEl = document.querySelector("#default-todo-panel .todo-editor > input");
let addTask = () => {
if (inputEl.value.length === 0) {
return;
}
let newTask = {
title: inputEl.value,
done: false,
... | true |
caa53c84d86fba9534d088bccf7769c511629596 | JavaScript | tmarrs/hb-interpolate-helpers | /testdata/testHelpers.js | UTF-8 | 648 | 3.03125 | 3 | [
"MIT"
] | permissive | 'use strict';
var testHelpers = exports;
// Your private helper methods go here.
function fullName(name) {
return (name.first + ' ' + name.last);
}
function prefix() {
return ('Mr.');
}
/* Put all your helper methods in the helpers object - it's an Object Literal in JS.
Your helper method name goes on the ... | true |
6151c590b328ff16f4894e06da263438c7202af4 | JavaScript | lifeonmarspt/vasteroids | /js/player-system.js | UTF-8 | 2,803 | 2.515625 | 3 | [] | no_license | import AFRAME from 'aframe'
import polar2cartesian from "./polar2cartesian.js";
import normal_random from "./normal-random.js";
AFRAME.registerSystem('player', {
schema: {
lives: {type: 'number', default: 5},
spawnSpeed: {type: "number", default: 5000},
spawnSpeedMultiplier: {type: "number", default: 0.9... | true |
9c3f8bbbbd8bb77fe10468825fde2bbb978140bf | JavaScript | chiraggupta21/a76erdyufw | /eBox/validate.js | UTF-8 | 997 | 3.203125 | 3 | [] | no_license | function validate(){
var name = document.forms[0]["name"].value;
if(name.length != 0){
if(name.length >=2 && name.length<=30){
if(name.search(/[0-9]/g) == -1){
if(name.search(/[^a-z]/i) == -1){
... | true |
eb01ad12b11d69879c53e2d75ecb7c019655b505 | JavaScript | JesseMcBrennan/promises-prework | /promises.js | UTF-8 | 1,282 | 3.953125 | 4 | [] | no_license | const testNum = (num) => {
return new Promise(function(resolve, reject) {
if (num > 10) {
resolve('Your number is greater than 10, good job!')
} else if (num < 10) {
reject('Your number is less than 10')
} else {
resolve('You got it!')
}
})
}
const makeAllCaps = (words) => {
retur... | true |
6c1a3d5ad33a4914eccf828efa2b40241fa1a94d | JavaScript | phlsa/oh-behave | /js/oh-behave.js | UTF-8 | 7,484 | 2.6875 | 3 | [] | no_license | var Behave = {
initialize: function() {
//Behave.browserPrefix = "-webkit-"; // insert actual browser prefix via script
//Behave.generateBrowserPrefix();
},
// Common Interface:
// First parameter is the element, second is an object with options
animate: function( elem, anim, opts ) {
opts = Behave.default... | true |
054fb63d8a2e40e2d8c54e4f6ee2a197f312c1b6 | JavaScript | mdaffafikri/node-test | /http.js | UTF-8 | 396 | 2.6875 | 3 | [] | no_license | const http = require('http');
const server = http.createServer( (req, res) => {
if (req.url === '/') {
res.write('Hello World')
res.end()
}
if (req.url === '/about') {
res.write('about')
res.end()
}
});
// server.on('connection', (socket) => {
// console.log("Connec... | true |
19cda65492ce8dd1f8f8e451503800156cdc89ae | JavaScript | kavi-saralweb/jsl | /test/samples/ta/auth-module.js | UTF-8 | 1,510 | 2.828125 | 3 | [] | no_license | /* The example authentication module */
function authModule () {
var users = {
'mohan' : { pwd : 'xyzw', ctr : 0 },
'shyam' : { pwd : 'abcd', ctr : 0 },
'venkat' : { pwd : 'pwra', ctr : 0 },
'joe' : { pwd : 'iuwe', ctr : 0 },
'harry' : { pwd : 'njnd', ctr : 0 },
'azam... | true |
515a831101c271a0935d976bfc706c0793f5edf0 | JavaScript | haoting1123/im | /client/PC/src/renderer/utils/date.js | UTF-8 | 2,067 | 2.90625 | 3 | [] | no_license | /**
* 日期格式化
* @param date
* @param fmt
* @returns {*}
*/
export function formatDate (date, fmt) {
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
... | true |
bfeb973ead394fdf3dc70200d2516312dd0ddd87 | JavaScript | gkma/loandunk | /src/client/components/Checks/Checks.jsx | UTF-8 | 1,870 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
const Checks = ({ toggle }) => {
const [checkOne, setCheckOne] = useState(false);
const [checkTwo, setCheckTwo] = useState(false);
const [checkThree, setCheckThree] = useState(false);
useEffect(() => {
const timerOne = setTimeout(() => {
setCheckOn... | true |
5cfbf73eacb879e7cc52ed910b73ce5c860e44ba | JavaScript | jinghua000/shadow-fns | /src/nAry.js | UTF-8 | 619 | 2.984375 | 3 | [
"MIT"
] | permissive | import _curry2 from './internal/_curry2'
/**
* Pass the first `n` parameters to supplied function and ignore others
*
* @param {Number} n
* @param {Function} fn
* @return {Function}
* @since 0.1.0
* @category Function, curry2
* @see unary, binary
* @sign Number -> ((a, b, ..., z) -> result) -> ((a, b, ..., ... | true |
74e4f4f5853fab694ed4c66d63c3123a4a33a8ef | JavaScript | 15700353375/Arya | /JavaScript/发布订阅者模式.js | UTF-8 | 1,827 | 4.0625 | 4 | [] | no_license | /* 发布订阅者的本质是 emit发布 触发on */
class EventEmitter {
constructor() {
// 事件对象,存放订阅的名字和事件
this.events = {}
}
// 订阅事件
on(eventName, callback) {
if (!this.events[eventName]) {
this.events[eventName] = [callback]
} else {
//一个名字可以订阅多个事件函数
this.events[eventName].push(callback)
}
}... | true |
fa8b192a0e3be040feb1c542112b2bea0b30d57c | JavaScript | kobingo/kogame.js | /src/sprite.js | UTF-8 | 1,506 | 2.640625 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | var ko = (function (ko) {
ko.Sprite = function (image) {
ko.Node.call(this);
if (image) {
this.setImage(image);
}
this.onDraw = function () {
if (!this.image) {
return;
}
ko.graphics.drawSprite(this);
};
};
... | true |
487d23e7974dba2504f59fcbe8f4013ee6f92f5d | JavaScript | malinovskiy-alex/AutoStation | /js/views/orders.js | UTF-8 | 993 | 2.53125 | 3 | [] | no_license | /**
* Created by malinovsky on 9/4/2014.
*/
var app = app || {}
app.OrdersView = Backbone.View.extend({
el: '.container',
events: {
'click #add': 'addOrder'
},
initialize: function (initialOrders) {
this.collection = new app.OrderList(initialOrders);
this.render();
this... | true |
dca1bb1ed50a003502d58d6dca432c11f0779a78 | JavaScript | Rayxan/MyNotes | /refazendo o GoStack 6.0/ES6/SPREAD.js | UTF-8 | 385 | 3.71875 | 4 | [] | no_license | //SPREAD
const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];
const arr3 = [...arr1, ...arr2];
console.log(arr3 + "\n");
//--------------------------------------
//Outro exemplo de SPREAD
const usuario = {
nome: 'Raylan',
idade: 19,
empresa: 'Topster',
};
const usuario2 = {...usuario, nome: 'Jojo'};
// o SPR... | true |
640c4560eb7b81cee333d64c76d42ae94e00c970 | JavaScript | colwem/mixed-radix | /test/lib/index.js | UTF-8 | 7,096 | 2.875 | 3 | [] | no_license | 'use strict';
const chai = require('chai'),
expect = chai.expect,
mixedRadix = require('../../lib'),
assert = require('assert'),
_ = require('lodash');
let radices = [4,3,2];
describe('exposed API', function() {
describe('mixedRadix()', function() {
it('creates object', function() ... | true |
ac09ecc8c1c8fd97d7e0fb5b777d3515670dbdbb | JavaScript | vietduc1210/homework_ss4 | /problem5_3.js | UTF-8 | 879 | 3.140625 | 3 | [] | no_license | let store = [];
let item1={
itemName: "Xiaomi portable charger 20000mah",
brand: "Xiaomi",
price: 428,
color:"White",
category: "charger"
}
let item2={
itemName: "VSmart Active 1",
brand: "VSmart",
price: 5487,
color:"Black",
category: "phone"
}
let item3={
itemName: "Iphone ... | true |
e2da9205215df86ba073a483629044b49a2f2ae0 | JavaScript | sergiovelo17/lab-javascript-memory-game | /starter-code/src/memory.js | UTF-8 | 742 | 3.359375 | 3 | [] | no_license | // $(document).ready(function () {
class MemoryGame {
constructor(card){
this.cards = card;
this.pickedCards =[];
this.pairsClicked = 0;
this.pairsGuessed = 0;
}
shuffleCards() {
for(let i = this.cards.length-1; i >=0; i--){
let rando = Math.floor(Math.random() * (this.cards.length-1));
... | true |
f595eada7c746ec95d2a4fb0fdc9c560ceaf78d3 | JavaScript | joseph-yp-kim/algorithm_datastructures | /test/event_constructor_tests.js | UTF-8 | 1,100 | 2.8125 | 3 | [] | no_license | const expect = require('chai').expect;
const Event = require('./../src/event_constructor');
describe('Event Constructor', () => {
let event;
beforeEach(() => {
event = new Event();
});
it('should have a subscribe, unsubscribe, and emit method', () => {
expect(event).to.have.property('subscribe');
... | true |
16cac75927dc13efd7fdedf0db5bbfe1e6af74d5 | JavaScript | iyanuaransiola/kanopyMovie-Task | /js/app.js | UTF-8 | 1,440 | 2.984375 | 3 | [] | no_license | // let movieOne = document.querySelector("#movieOne");
// let movieTwo = document.querySelector("#movieTwo");
// let movieThree = document.querySelector("#movieThree");
// let movieFour = document.querySelector("#movieFour");
// let movieFive = document.querySelector("#movieFive");
// let movieSix = document.querySelec... | true |
2abdcf2793950ffa6b29b90baeca8f985f5e7371 | JavaScript | dankelly989/HelloWorld | /HelloWorld/Scripts/SolitaireScript.js | UTF-8 | 3,685 | 3.265625 | 3 | [] | no_license | function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("name", ev.target.getAttribute("name"));
}
function drop(ev) {
var name = ev.dataTransfer.getData("name");
var moveCard = document.getElementsByName(name)[0];
var card = getlastCard(ev.target);
if ((p... | true |
0d460ece471c3d5f02745c5c5ec4a5a4a6139927 | JavaScript | lagranovskiy/timetracker-server | /app/controller/BookingController.js | UTF-8 | 5,089 | 2.609375 | 3 | [] | no_license | /**
* Bookings Controller
*
* Controlls booking services
*
**/
var async = require('neo-async');
var newrelic = require('newrelic');
var _ = require('underscore');
var EventEmitter = require("events").EventEmitter;
var Booking = require('../model/Booking');
var BookingModel = require('../model/BookingModel');
var ... | true |
06c5e54c792c75d8ac1f6a3d6e23f8195523cb27 | JavaScript | abdurrahman16/my-app | /src/components/Cart/Cart.js | UTF-8 | 888 | 2.765625 | 3 | [] | no_license | import React from 'react';
const Cart = (props) => {
const cart = props.cart;
const total = cart.reduce( (total, prd) => total + prd.price, 0);
// let total =0;
// for (let i =0; i< cart.length; i++){
// const product = cart[i];
// total = total+ product.price;
// } // bangla syst... | true |
4d0f7b5773dca59afb72267a9354052ee79d6d5a | JavaScript | UQ-UQx/graph | /www/js/upload.js | UTF-8 | 2,542 | 2.71875 | 3 | [
"MIT"
] | permissive | var graph = query_graph;
/**
*
* Basic file upload feature
*
*/
$(function(){
$('#drop a').click(function(){
// Simulate a click on the file input button
// to show the file browser dialog
$(this).parent().find('input').click();
});
// Initialize the jQuery File Upload plugin
... | true |
4362985a0860377efcfbbc667e4947ca27005573 | JavaScript | GamboaDd27/weekly-pay | /modules/Time.js | UTF-8 | 997 | 3.265625 | 3 | [
"MIT"
] | permissive | //Class declaration
class Time {
constructor(timeString) {
var t = timeString.split(":");
this.hour = parseInt(t[0]);
this.minutes = parseInt(t[1]);
this.timeString=timeString;
}
}
Time.prototype.isBiggerThan=function(other) {
return (this.hour > other.hour) || (this.hour === other.hour)... | true |
138e4d88be518775a6972cb70e9d9272870fbdc1 | JavaScript | karthiksiva555/complete-javascript-course | /9-forkify/starter/src/js/index.js | UTF-8 | 8,312 | 2.859375 | 3 | [] | no_license | import Search from "../models/Search";
import {elements, loadSpinner, clearSpinner, elementStrings} from '../views/utils';
import * as searchView from '../views/searchView';
import Recipe from "../models/Recipe";
import * as recipeView from '../views/recipeView';
import * as shopListView from '../views/shopListView';
i... | true |
a12d17151de3be90ea7d38fd99874e08afc59d13 | JavaScript | abrown28/NodeTrek | /public/javascripts/entity.js | UTF-8 | 4,332 | 2.78125 | 3 | [] | no_license | (function() {
var em = {};
// global on the server, window in the browser
var root = this;
if (typeof module !== 'undefined' && module.exports) {
module.exports = em;
}
else {
root.em = em;
}
// need a way to reuse ids
var nextEntityId = 1;
var deletedIds = [];
// u... | true |
1524b826fa905537a53f6ac4366b6b10430145c5 | JavaScript | lxynox/scaffold-react-component | /conflicter.js | UTF-8 | 1,293 | 2.859375 | 3 | [
"MIT"
] | permissive | const {pathExists} = require('fs-extra')
const detectConflict = require('detect-conflict')
const prompt = require('inquirer').prompt
function Conflicter() {
let batch // force batch update(overwrite/backup/skip)
/**
* Check if in-mem file contents collides with the on disk file
*
* @param {Object} ... | true |
f2b431bc83c3674eadd4fe0175947fc05cb86f45 | JavaScript | StaceyWhitmore/cat-crud-blog-with-redux-rails-api | /src/store/configureStore.js | UTF-8 | 703 | 2.515625 | 3 | [] | no_license | import { createStore, applyMiddleware } from 'redux'
import rootReducer from '../reducers/rootReducer'//the rootReducer wraps all the reducers into one
import thunk from 'redux-thunk' //so we can `applyMiddleware(thunk)`
//the Thunk middleware, which will allow us to construct our action creators in a very special way
... | true |
914b1162de3913166b2eaa76fafbf3cd73bedaf9 | JavaScript | kkinaman/practice_interview_questions | /Coding/parseCSV.js | UTF-8 | 4,855 | 3.65625 | 4 | [] | no_license | /*
A CSV (Comma-Separated Values) file is a file that represents tabular data in a simple, text-only manner.
At it's simplest, a CSV file contains rows of data separated by newlines, and each field is separated by commas.
This parser needs to not only handle CSVs using commas to delimit fields, but it also needs to h... | true |
aad53700167c97b6a53c01384590df6fda4c268a | JavaScript | JoeRoussy/scholarship-site | /app/components/custom-utils/index.js | UTF-8 | 3,145 | 3.03125 | 3 | [] | no_license | import { ObjectId } from 'mongodb';
export const required = (param, customMessage) => {
if (typeof customMessage === 'string') {
throw new Error(`could not find required param: ${param}. ${customMessage}`);
} else {
throw new Error(`${param} is required`);
}
}
export class RuntimeError ext... | true |
659a84f0bde5ccba0496b4a1f7bb57ddf4137c48 | JavaScript | LilliamHaro/twitter-30-04 | /main.js | UTF-8 | 1,886 | 2.8125 | 3 | [] | no_license |
$(document).ready(function() {
var name = 'Oikawa Tooru';
var user = '@theGreatKing'
var tweetText = $('#textarea')
var tweetBtn = $('#btn');
var box = $('#tweet-box');
var LIMIT = 144;
tweetText.focus();
$('#char').text(LIMIT);
tweetText.on('keydown', function(event) {
// cambié el value... | true |
097ebcd6d56aade9d777fc5f533a33a7444d1e40 | JavaScript | zxhycxq/DataStructures-Algorithms-JavaScript | /repeated-substring-pattern.js | UTF-8 | 219 | 2.734375 | 3 | [] | no_license | /*
* 重复的子字符串 - 力扣(LeetCode) https://leetcode-cn.com/problems/repeated-substring-pattern/
*
* */
var repeatedSubstringPattern = function(str) {
var reg=/^(\w+)\1+&/
return reg.test(str)
};
| true |
f2b723286665b64f0f6c08895d44bbcc949be1e5 | JavaScript | c9y7ip/ezpark-mobile | /src/components/Main/Dashboard/ScanScreen.js | UTF-8 | 3,340 | 2.515625 | 3 | [] | no_license | // Code below are using expo-barcode-scanner
import React, { useState, useEffect } from 'react';
import { Text, View, StyleSheet, Button } from 'react-native';
import styled from 'styled-components/native'
import { BarCodeScanner } from 'expo-barcode-scanner';
import { useNavigation } from '@react-navigation/native';
... | true |
e3ea278000da6a48ab13b1fbe63d77ec9abd7058 | JavaScript | MohamedHassan499/Algorithm-Visualizer | /board.js | UTF-8 | 2,127 | 3.46875 | 3 | [] | no_license | const boardDimensions = { // some enum
NUM_ROWS: 30,
NUM_COLUMNS: 60,
}
let positionStart = {
row: undefined,
column: undefined,
},
positionEnd = {
row: undefined,
column: undefined,
}
function createBoard() {
const table = document.getElementById("board")
table.innerHTML = ""
for ... | true |
22ee1a2ef39a5fd46206fda35490a5f422d99613 | JavaScript | Giulia-Caldato/app-vue | /script.js | UTF-8 | 736 | 2.8125 | 3 | [] | no_license | /* global Vue */
const app = new Vue({
el: '#app',
data: {
currentImageUrl: null,
favourites: []
},
methods: {
loadImage: async function() {
const response = await fetch("https://picsum.photos/200/300/");
const asJson = await response.json();
this.currentImageUrl = asJ... | true |
38ba4e6c19db562fa72b1c8278c49ad82fb517bd | JavaScript | namitamanohar/flowers | /scripts/retailerList.js | UTF-8 | 2,495 | 2.65625 | 3 | [] | no_license | import { useRetailers } from "./retailersDataProvider.js";
import retailerComponent from "./retailer.js";
import { useDistributors } from "./distributorsDataProvider.js";
import { useNurseries } from "./nurseryDataProviders.js";
import { useDistributorNursery } from "./distributorNurseryDataProvider.js";
import { useFl... | true |
f9163e5cbd734aec851710fecd7e7b07439cacdc | JavaScript | E-Shelton98/Rails-Tunr-Frontend | /src/components/Favorites.js | UTF-8 | 746 | 2.53125 | 3 | [] | no_license | import React from 'react'
export const Favorites = (props) => {
let addedFaves = ""
if (props.favorites) {
addedFaves = props.favorites.map((favorites, index) => {
return (
<>
<div className ="favContainer"key={index}>
<p classNa... | true |
2e6034b9fc5a649ef91116608ebdd210ed9f491a | JavaScript | Danilpascenko802/JS_HOMEWORK_2020 | /module_1/tusk-6.js | UTF-8 | 189 | 3.109375 | 3 | [] | no_license | let total_t8 = 0;
let input = +prompt("enter num");
while (input){
input = +prompt("Another one number");
total_t8 = total_t8 + input;
console.log(total_t8)
}
alert(total_t8);
| true |
52959895a95e2ad881806e2b529786f7e49ea00b | JavaScript | cosmos-29/js-advanced | /ht4/dist/js/validator.js | UTF-8 | 1,170 | 3.203125 | 3 | [] | no_license | class FormList {
constructor() {
this.name = '';
this.mail = '';
this.phone = '';
this._init();
}
_init() {
document.querySelector('.form-validate').addEventListener('submit', e => {
e.preventDefault();
this.filter(document.querySelector('.check-field... | true |
caea3d14928fde0829dbe1e6701dec35a9a2347e | JavaScript | DecenterApps/CryptoBubbles | /server/server.js | UTF-8 | 5,667 | 2.515625 | 3 | [] | no_license |
const app = require('express')();
const http = require('http').Server(app);
const io = require('socket.io')(http);
const gameManager = require('./game-manager');
const PORT = process.env.PORT || 60000;
let currPlayers = {};
let dots = {};
let lobby = [];
let scoreboard = {};
const GAME_WIDTH = 2000;
const GAME_HEI... | true |
14bc079cd3adc602f3bffd3e8171a257ef677ea0 | JavaScript | Yvonnemartinez/html-apuntes | /javascript/4.6.convertir-strings-a-numbers/main.js | UTF-8 | 784 | 4.5 | 4 | [] | no_license | const numero1="1";
console.log(typeof numero1);//indica por consola que es un string
//convertir un string a un número entero
console.log(Number.parseInt(numero1));//saca por consola en 1 pero ya como string sino como entero int
const numero2="5.2";
console.log(Number.parseFloat(numero2));//saca por consola el 5.2 per... | true |
a55cec0047aea51bd8164cb92f5225b5e88b593b | JavaScript | joelmeiller/fhnw-ws3-javascript-introduction | /examples/js/jQueryExamples.js | UTF-8 | 1,708 | 3.3125 | 3 | [] | no_license | const loadScripts = function ($) {
const runFirstExamples = () => {
// Select DOM element
const h1Element = $('h1')
// Get the first element
const firstElement = $('p').first()
// Set text of element
firstElement.text('jQuery changed me after clicking the button')
... | true |
c81014facf8f4a7d129276844d9c17587868595e | JavaScript | ShayanJavadi/yeller | /public/js/app.js | UTF-8 | 3,431 | 2.53125 | 3 | [
"MIT"
] | permissive | //ajax delete yell call
$(document).on('click', '.deleteYell', function (e) {
var id = $(this).attr("data-id");
// prevent the page from submitting like normal
e.preventDefault();
$.ajax({
url: 'http://localhost/TwitterClone/public/delete/'+id,
type: 'POST',
dat... | true |
89b7f115e6837fd24604e89af909d6010d016afd | JavaScript | jerus1403/budget-app | /app.js | UTF-8 | 11,216 | 3.015625 | 3 | [] | no_license | // BUDGET CONTROLLER
var budgetController = (function () {
var Expense = function (id, description, value) {
this.id = id;
this.description = description;
this.value = value;
this.percentage = -1
};
Expense.prototype.percentageCal = function (totalIncome) {
if (totalIncome > 0) {
this.p... | true |
602c97b43d3cadd693ddd0c03f02463b13092d62 | JavaScript | marianocamara/CursoIngresoJS | /2-InstruccionIf/jsInstruccionIF (3).js | UTF-8 | 807 | 3.015625 | 3 | [] | no_license | function Mostrar()
{
//tomo la edad
var edad;
edad = (document.getElementById("edad").value);
if (edad>=18)
{
alert ("Es mayor de edad.");
}
else
{
alert ("Es menor de edad.")
}
//esto es para que no me de un alert si ingreso un string
var edad;
ed... | true |
4ba0a0d5587c1f7cf8f9e0a5183db686787ac6a5 | JavaScript | lexie-kaia/web_toy_box | /index.js | UTF-8 | 5,340 | 2.75 | 3 | [] | no_license | import { projects, tags } from './projects.js';
const projectList = document.querySelector('.js-project-list');
const filterList = document.querySelector('.js-filter-list');
const generateProjectCards = () => {
projects.forEach((project) => {
const { title, summary, url, thumbnailUrl, tags, keyFeatures, referen... | true |
3a129281cd357d038fc8d399e1d9bf8444c70cc5 | JavaScript | atiluj/University | /SEM5/WEPPO/lista04/zadanie_03/zadanie_03.js | UTF-8 | 269 | 2.640625 | 3 | [] | no_license | console.log(`\njesteśmy w pliku zadanie_03.js`);
console.log('spróbujmy włączyć moduł do kodu')
const g = require("./modul");
console.log(`wrocilismy do pliku zadanie_03.js`);
function f()
{
return "Udało się!";
}
module.exports = f;
console.log(g()); | true |