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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
81cfa876a4c5ef25185cce179e4bcda5ec6b9710 | JavaScript | Elen-pollyc137/Curso-de-Javascript | /Array/filter1.js | UTF-8 | 445 | 3.09375 | 3 | [] | no_license | const produto = [
{nome:'Notebook', preco:2400, fragil: true},
{nome:'iPad Pro', preco:4199, fragil: true},
{nome:'Copo de Vidro', preco:12.49, fragil: true},
{nome:'Copo de Plastico', preco:18.99, fragil: false}
]
console.log(produto.filter(function(p){
return p.preco
}))//o filter te a importancia de fitrar infor... | true |
0be3a1cabe5ca3e8025881c67a09e8da4ab22682 | JavaScript | xavi-c/slider_d3 | /js/calculate.js | UTF-8 | 270 | 2.75 | 3 | [] | no_license | function calculate(interes, deuda, meses) {
//original kilian's formula
interes = interes / 100;
var result = (deuda * interes * Math.pow(1 + interes, meses)) / (Math.pow(1 + interes, meses) - 1);
return result;
}
//module.exports = calculate;
export {calculate};
| true |
b86b284e1e4dc5fb38a76656a91671ffc4d7d5ba | JavaScript | ThatMattG/return | /IterativeClickable.js | UTF-8 | 388 | 2.703125 | 3 | [] | no_license | class IterativeClickable extends GraphicRectangle {
constructor(object, xStart, yStart, width, height, fillColor, strokeColor) {
super(xStart, yStart, width, height, fillColor, strokeColor);
this.object = object;
}
handleClickDown() {
this.object.next();
}
get curr() {
return this.object.cu... | true |
d98c4d113493354af1dcbadfe30ca1c106bcd685 | JavaScript | SirLich/khan-academy-clones | /new-games/syndrome-dash/syndrone-dash.js | UTF-8 | 1,690 | 3.234375 | 3 | [] | no_license |
var justjumped = 0;
var smallJump = 0;
var guy_x = 175;
var guy_y = 280;
var s1 = 1;
var s2 = 1;
var rect_hight = 40;
var rect_width = 20;
var speed = [];
var snowball = 100;
var y = [];
var x = [];
var type = [];
for (var i = 0 ; i < snowball ; i += 1){
y.push (300);
x.push (150*i);
type.push (floor(rando... | true |
b963c8820de0724960374fd88439a5bb9ee76765 | JavaScript | Chocobe/-Study-Algorithm-Solve | /백준/03_for문/11_X보다_작은_수.js | UTF-8 | 916 | 3.359375 | 3 | [] | no_license | const fs = require("fs");
const readline = require("readline");
let lineNum = 0;
let maxDigit = 0;
const dataArr = [];
const answerArr = [];
const rl = readline.createInterface({
input: fs.createReadStream("./dev/stdin"),
output: undefined,
});
rl
.on("line", line => {
parseData(line);
})
.on("close", ... | true |
9b8db0d53f99027793dd3e8082f62287c7420e62 | JavaScript | china-liji/Rexjs | /source/map/super-call.js | UTF-8 | 6,033 | 2.640625 | 3 | [
"MIT"
] | permissive | // 父类调用相关
!function(CallExpression, OpeningCallTag){
this.SuperCallExpression = function(extractTo){
/**
* 父类调用表达式
* @param {Context} opening - 起始标签上下文
* @param {ECMAScriptStatement} statement - 当前语句
*/
function SuperCallExpression(opening, statement){
CallExpression.call(this, opening, statement);
this... | true |
636b9453fd1a3e8c989d86c70eb888ee47f73564 | JavaScript | Edu12x/hackathon12 | /scripts/dropdown.js | UTF-8 | 617 | 2.59375 | 3 | [] | no_license | export default class Dropdown {
constructor(element) {
this.element = element;
this.button = this.element.querySelector("button");
this.ul = this.element.querySelector("ul");
this.button.onmouseenter = function () {
this.closest("div").classList.add("is-active");
};
this.button.onmousele... | true |
24959cb554ab05b4d83fe5f74fe251b0835e48a6 | JavaScript | myawilliams11/Anagram | /file.js | UTF-8 | 786 | 4.09375 | 4 | [] | no_license | document.getElementById("findButton").onclick = function () {
var typedText = document.getElementById("input").value; // "dog"
console.log("typedText is " + typedText);
var alphabetizedTypedText = alphabetize(typedText); // "dgo"
console.log("alphabetizedTypedText is " + alphabetizedTypedText)
d... | true |
fa3d12110847b2f590a573e883918b112ba6cf67 | JavaScript | KevDev90/playstore-exercise | /test/app.test.js | UTF-8 | 3,355 | 2.546875 | 3 | [] | no_license | const app = require('../app');
const expect = require('chai').expect;
const request = require('supertest');
const store = require('../playstore.js');
describe('playstore GET /app endpoint', () => {
it('return all the apps', () => {
return request(app)
.get('/app') // invoke the endpoint // send the query... | true |
ba15876d10cac286b4e8ee9947134b22dceeda99 | JavaScript | Acex187x/learn-czech-grammar | /src/Helpers/getRandomCzechWords.js | UTF-8 | 2,967 | 2.90625 | 3 | [] | no_license | import { findAllByTestId } from '@testing-library/react';
import firebase from 'firebase/app';
import 'firebase/functions';
import selectRandom from './selectRandom'
function hasDuplicates(array) {
return (new Set(array)).size !== array.length;
}
async function getRandomCzechWords() {
const timer = new Date(... | true |
bfa7c9443e81b5f717b505595e5c2cdddf8e5164 | JavaScript | EINNNA/bamazon | /bamazonCustomer.js | UTF-8 | 1,921 | 3.09375 | 3 | [] | no_license | //PACKAGES
var mysql = require("mysql");
var inquirer = require("inquirer");
//CONNECTION
var connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: "asdfgh",
database: "bamazon"
});
//VARIABLES
connection.connect(function (err) {
if (err) throw err.messa... | true |
c6dda7a2fdb58f000a9bbb26d572e1cb4e74f56e | JavaScript | aegiz/react-simple-boilerplate | /src/routes/Homepage/index.js | UTF-8 | 1,366 | 2.53125 | 3 | [] | no_license | import React from "react";
import "./styles.css";
import PropTypes from "prop-types";
import Header from "../../components/Header";
import Form from "../../components/Form";
import CTA from "../../components/CTA";
class Homepage extends React.Component {
static propTypes = {
history: PropTypes.object,
};
st... | true |
becd977e8fbdd4756d7579ae9545ba5d7f774536 | JavaScript | b3540/code2014-codegolf | /main.js | UTF-8 | 2,434 | 3.109375 | 3 | [] | no_license | /* Ticker表示する文字の定義
* =====================================*/
var string_c = [
'_***__',
'*___*_',
'*_____',
'*___*_',
'_***__'
];
var string_o = [
'_***__',
'*___*_',
'*___*_',
'*___*_',
'_***__'
];
var string_d = [
'****__',
'*___*_',
'*___*_',
'*___*_',
'... | true |
7bdcdc1d2323f1f1dbd33a21747c159eff3401d5 | JavaScript | daramedeiros/challengesHR | /ProblemSolving/InsertionSortPart1.js | UTF-8 | 1,647 | 4.6875 | 5 | [] | no_license | /**
* Sorting
* One common task for computers is to sort data. For example, people might want to see all their files on a computer sorted by size. Since sorting is a simple problem with many different possible solutions, it is often used to introduce the study of algorithms.
* Insertion Sort
* These challenges will co... | true |
95db06aa8fee52f5471302de91240970cc64171c | JavaScript | monkeydunkey/SkypeBot | /brain.js | UTF-8 | 2,666 | 2.9375 | 3 | [] | no_license | const fs = require('fs');
const commandRegexPatt = /-\S+/g; // This regex pattern is used to extract the command from the message
var oConfig = JSON.parse(fs.readFileSync('config.json', 'utf8')),
oScriptLists = {};
function commandExtractor (command){
return command.match(commandRegexPatt);
}
// Cleans the commm... | true |
1cce3558cde93834ff96e40eeb5684ab8c57b72a | JavaScript | loyti/GitHubRepoAssingment | /MEAN/jsAd/fibonacci.js | UTF-8 | 310 | 3.25 | 3 | [] | no_license | function fibonacci() {
var prev = 0;
var curr = 1;
function incrimentor() {
console.log(curr);
var temp = prev;
prev = curr;
curr = curr + temp;
}
return incrimentor
}
var fibCounter = fibonacci();
fibCounter();
fibCounter();
fibCounter();
fibCounter();
fibCounter();
fibCounter();
| true |
f45d75e0408d7c48f37c814f319841c969644fa4 | JavaScript | wearethewinds/web-audio | /src/js/Recorder/Play.js | UTF-8 | 649 | 2.734375 | 3 | [] | no_license | import DomService from '../Services/DomService';
import RenderLoopService from '../Services/RenderLoopService';
const template = '<button>►</button>';
class Play {
constructor (onPlay) {
this.html = DomService.createNodeFromString(template);
this.isPlaying = false;
this.html.onclick... | true |
8420dd527fda151f8e2641f8f7e5c512b9236e9c | JavaScript | noroutine/harmony-practice | /mem_db/sync.js | UTF-8 | 2,278 | 2.53125 | 3 | [] | no_license | var _ = require('lodash')
function _observe(obj, channel) {
Object.observe(obj, function (changes) {
console.log('Changes', changes)
pubnub.publish({
channel: channel,
message: changes
})
})
}
Object.prototype.patch = function(c) {
return _patch.call(this, c... | true |
73697822b5f018663a4d633adbfec86315a601f7 | JavaScript | 1010101012101/angular-website-builder | /app/libs/utils.js | UTF-8 | 391 | 2.671875 | 3 | [] | no_license | define([], function () {
'use strict';
// utils is a collection of utility functions that can be used everywhere
var utils = {};
utils.getURLParam = function (param) {
var url = decodeURIComponent(window.location.href);
var reg = new RegExp('[?&]' + param + '=([^&#]*)', 'i');
var string = reg.exec... | true |
82a716f0559c450782235da0521305bbb56191e2 | JavaScript | hlo2109/pixijs_gamer_car | /pixijs_gamer_car_4/assets/js/functions.js | UTF-8 | 3,900 | 3.125 | 3 | [] | no_license | function jugador() {
var anchoPersonaje = 36;
var altoPersonaje = 66;
var posx = (renderer.width / 2) - (anchoPersonaje / 2);
var posy = (renderer.height - altoPersonaje) - 20;
let texture = util.frame(Cars, 0, 0, anchoPersonaje, altoPersonaje)
var img = util.sprite(texture);
img.x = posx;
img.y... | true |
778e9242446c8c21d25dd4a8519e5a2fd51b1e25 | JavaScript | manuel-m/efficiel-frontend | /apps/vuejs02/js/components/customers/customers.js | UTF-8 | 612 | 2.734375 | 3 | [] | no_license | const customers = {
data: [],
done: false,
fetch: _customer_fetch,
get: _customer_get,
error: ''
};
export default customers;
function _customer_fetch() {
return axios
.get('customers.json')
.then(function(response_) {
customers.data = response_.data;
})
... | true |
a5cf65ace7bfb0fee38bb9935b2b66e7042f6835 | JavaScript | dmix/contrastream | /src/helpers/contra-dirs.js | UTF-8 | 3,070 | 2.625 | 3 | [] | no_license | import λ from 'ramda'
import fs from 'fs-extra'
import rimraf from 'rimraf'
import path from 'path'
import Glob from 'glob'
import Logdown from 'logdown'
import Baobab from 'baobab'
// Directories -----------------------------------------------------
const log = new Logdown({prefix: 'CONTRA:dirs'})
export function a... | true |
c39a6a246c7f278c954b818d7da7467a249f969c | JavaScript | mounvip1525/Custom-Countdown | /script.js | UTF-8 | 4,561 | 3.21875 | 3 | [] | no_license | const inputContainer=document.getElementById('input-container');
const countdownForm=document.getElementById('countdown-form');
const datePicker=document.getElementById('date-picker');
const countdownContainer=document.getElementById('countdown-container');
const countdownElTitle=document.getElementById('countdown-tit... | true |
1e81ca65a75d85021a78374634014f3be0e0e5bc | JavaScript | AlessandroDico/js-fizzbuzz | /soluzione2/soluzione2.js | UTF-8 | 1,378 | 3.8125 | 4 | [] | no_license | /*
Scrivere un programma che stampi tutti i numeri da 1 a 100 con queste regole:
al posto dei multipli di 3, deve stampare "Fizz"
al posto dei multipli di 5, deve stampare "Buzz"
al posto dei multipli sia di 3 che di 5, deve stampare "FizzBuzz"
*/
// SOLUZIONE PER CSS E HTML
var final_container = [];
fo... | true |
d030592cb03d986324a7864ef7f93d5e24e4dc73 | JavaScript | josh-deprogram/cake-form-assesment | /public/js/app.js | UTF-8 | 1,083 | 3.046875 | 3 | [] | no_license | require("../css/style.css");
const validateInput = require('./validateInput');
(() => {
console.log('%cHello UsTwo Cakez', 'background: #371b42; color: #ffffff; font-weight:300; padding:4px; font-size:15px');
console.log('%cinfo@deprogram.io', 'background: #7a4bff; color: #ffffff; font-weight:300; padding:4px... | true |
34e274b1e1436a17645ca1fe1fe75dc44452efe8 | JavaScript | Stefan-Stefanov/SoftUni | /Programming-Basics/exams/Supplies-for-School.js | UTF-8 | 305 | 3.21875 | 3 | [] | no_license | function solve(pen, markers, cleaner, discount) {
pen = Number(pen) * 5.80;
markers = Number(markers) * 7.20;
cleaner = Number(cleaner) * 1.20;
discount = Number(discount) / 100;
let total = pen + markers + cleaner
console.log(`${(total - (total * discount)).toFixed(3)}`);
}
solve("2", "3", "2.5", "25") | true |
68504f19914c3206dccfbf28f7e1adeba5069f68 | JavaScript | mp27/laravel-blog-portfolio | /public/js/quill-custom.js | UTF-8 | 2,419 | 2.609375 | 3 | [
"MIT"
] | permissive | var quill = null;
function selectLocalImage() {
const input = document.createElement('input');
input.setAttribute('type', 'file');
input.click();
// Listen upload local image and save to server
input.onchange = () => {
const file = input.files[0];
// file type is only image.
... | true |
87c09dcce462dffdd7358eb9d1eed3b64dbd44d8 | JavaScript | Peter01011973/crwn-clothing | /src/redux/cart/reducer.js | UTF-8 | 928 | 2.65625 | 3 | [] | no_license | import { CartActionTypes } from './types';
import { addItemToCart, reduceItemQuantity } from './utils';
const INITIAL_STATE = {
hidden: true,
cartItems: []
}
const cartReducer = (state = INITIAL_STATE, action) => {
const { type, payload } = action;
switch (type) {
case CartActionTypes.TOGGLE_C... | true |
ea488a834988d0796ad2d419776d9fdc000c56cd | JavaScript | alcial01/alcial01.github.io | /WordLadder/ladder.js | UTF-8 | 6,804 | 3.21875 | 3 | [] | no_license | //Stack class
Stack=function(){
this.aStack=new Array()
}
Stack.prototype.push=function(item){
this.aStack.push(item)
}
Stack.prototype.pop=function(){
if(!this.isEmpty()) { return this.aStack.pop(); }
else {
return false
}
}
Stack.prototype.isEmpty = function() { return (this.aStack.lengt... | true |
847b7869ea74b2e282b24f9f2ec0ccc8bc98b5fc | JavaScript | nanson/rzwebsys7 | /common/widgets/html5uploader/assets/uploader.js | UTF-8 | 12,383 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | (function ($) {
/**
* Валидатор файлов
* @param params
* @constructor
*/
var FileValidator = function(params) {
this.params = {
size: 0,
ext: []
}
$.extend(this.params, params);
}
FileValidator.prototype.getExt = function(name) {... | true |
15fd0e5949162c3e24b548cda4d0fff741e94cb6 | JavaScript | polar/buspass-admin | /app/assets/javascripts/GeoLocationController.js | UTF-8 | 4,069 | 2.59375 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | /**
* GeoLocationController
*
* This class is used to get a location from a map.
*
* *NOT_USED*
*
* @param options
* @constructor
*/
BusPass.GeoLocationController = function (options) {
$.extend(this,options);
};
BusPass.GeoLocationController.prototype = {
/**
* Attribute:
* This attribute c... | true |
b74a93a1fc2766742b352a780edc6d3e3062a50d | JavaScript | realhee/prgms-example | /day49_1.js | UTF-8 | 637 | 3.53125 | 4 | [] | no_license | // day 49_1
// N으로 표현
function solution(N, number) {
const set = new Array(8).fill().map(() => new Set());
for(let i=0; i<8; i++){
set[i].add(Number(N.toString().repeat(i+1)));
console.log(set[-1])
for (let j=0; j < i; j++) {
for(const arg1 of set[j]){
f... | true |
54a6ae6346f8d9bc454738b12eb3b95017978c6f | JavaScript | Karen1704/Programming-3 | /class.Grass.js | UTF-8 | 1,002 | 2.921875 | 3 | [] | no_license | const Base = require("./class.base.js")
module.exports = class Grass extends Base {
constructor(x, y) {
super(x,y);
this.directions = [
[this.x - 1, this.y - 1],
[this.x, this.y - 1],
[this.x + 1, this.y - 1],
[this.x - 1, this.y],
[this... | true |
17588be44a14bc16e0953afcdb701b9bc49c4da4 | JavaScript | vlagos/Parte1 | /CONVERTIR MONEDA/js/main.js | UTF-8 | 4,164 | 2.625 | 3 | [
"MIT"
] | permissive | window.onload = function() {
document.getElementById("peso").focus();
};
function Convertir()
{
document.getElementById("error_form").innerHTML = "";
var Peso=+document.getElementById("peso").value;
var combo1 = document.getElementById("cbxTipo1");
var combo2 = document.getElementById("cbxTipo2");
var monedaDe =... | true |
4bc4164601445a7ac7d1779e7911676dadad182a | JavaScript | Kudzi34/code-test | /src/arrays.test.js | UTF-8 | 3,799 | 4.1875 | 4 | [] | no_license | const people = [
{
name: "Fred",
age: 27,
interests: ["bowling", "golf"]
},
{
name: "Wilma",
age: 25,
interests: ["running", "cinema"]
},
{
name: "Barney",
age: 28,
interests: ["bowling", "running", "swimming"]
}
];
// Expla... | true |
7a1c6960553ef031fe2d56dad3e8ceabc3bcaa17 | JavaScript | rayssantos/estagio | /front/assets/js/autores.js | UTF-8 | 2,903 | 3.125 | 3 | [] | no_license | // Classe pessoa
function Autor(objAutor) { // criei um objeto que contem os dados que eu vou ultilizar da tabela do banco
var self = this;
//criar uma funcao para tornar os values observaveis pois so as colunas estavam como observavei
self.nome = ko.observable(objAutor.nome);
self.idAutor = ko.observable(objAuto... | true |
c697048b5f90027e76f7f06ae01b7474d7b42240 | JavaScript | ARK-369/JS-jQuery | /tests.js | UTF-8 | 728 | 2.875 | 3 | [] | no_license | var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
var canvasWidth = canvas.width;
var canvasHeight = canvas.height;
var longSide = 250;
var sortSide = 50;
var positionX = (canvasWidth - longSide)/2;
var positionY = (canvasHeight - sortSide*3)/2;
context.fillStyle = 'rgba(255,0,... | true |
c34aae8649d779254d0a7f585c450fac8e5c2584 | JavaScript | dtan/calipso | /themes/calipso/public/js/cleanslate-core.js | UTF-8 | 2,998 | 2.625 | 3 | [] | no_license | /*!
* cleanslate core
*
* javascript module loader
*
*/
cleanslate = {
log : function(){
try {
console.log.apply('',arguments);
} catch(e) {
cleanslate.backlog.push(arguments);
}
},
backlog : [],
init: function(){
// TABS
// introduced for admin form tabs, but general-p... | true |
7e3bbb76032a40b90db05286bc191a81c81be95f | JavaScript | sukhvirnotta/golden-shoe-app | /backend/routes/products.js | UTF-8 | 1,097 | 2.59375 | 3 | [
"MIT"
] | permissive | const router = require('express').Router();
let Product = require('../models/product.model');
router.route('/').get((req, res) => {
Product.find()
.then(products => res.json(products))
.catch(err => res.status(400).json('Error: ' + err));
});
router.route('/add').post((req, res) => {
const id ... | true |
ecc3be3d1614f033be5a53e56f034d607e60a75a | JavaScript | maorusso/react-playground | /src/RandomColorSquare/RandomColorSquare.js | UTF-8 | 613 | 3.078125 | 3 | [] | no_license | import { useState } from "react";
import "./RandomColorSquare.css";
export default function RandomColorSquare() {
const [color, setcolor] = useState("black");
function randomNum(max) {
return Math.round(Math.random() * max);
}
function randomRGBColor() {
const R = randomNum(255);
const G = randomNum(255);
... | true |
6829b77f324e36d5f6736c9f15b155416c79ed70 | JavaScript | tristanoneil/chat-server | /src/gabriel.js | UTF-8 | 1,422 | 2.8125 | 3 | [] | no_license | var Gabriel = function() {
this.app = require('express')();
this.httpServer = require('http').createServer(this.app);
this.io = require('socket.io').listen(this.httpServer);
//
// Setup socket.io events.
//
this.io.sockets.on('connection', function(socket) {
// Listen for the event send:message which... | true |
d30d7230c8e357936779987acdaf45f0e3fd9d23 | JavaScript | khushboosinghrecs/web__development | /loop.js | UTF-8 | 97 | 2.53125 | 3 | [] | no_license | for(let rep=1; rep<=10; rep++)
{
console.log(rep);
}
let dice=Math.trunc(Math.random()*6)+1;
| true |
7523303f325bce4807c5f0fe80f421b87753bee6 | JavaScript | kibibyte7/Xenova-rewrite | /commands/Games/inviteguilde.js | UTF-8 | 3,126 | 2.71875 | 3 | [] | no_license | const Command = require("../../modules/Command.js")
class Inviteguilde extends Command {
constructor(client){
super(client, {
name:"inviteguilde",
description:"Inviter quelqu'un dans sa guilde une guide.",
category:"Game",
usage:"inviteguilde <@mention>",
aliases:["iguilde"]
})
}
run(message, args, level, con)... | true |
819cbeb6981a5eb1c10174afd70c53476b03d7b1 | JavaScript | Gerwinnz/flourjs | /src/flour/flour.bind.js | UTF-8 | 4,855 | 2.59375 | 3 | [] | no_license |
var flour = flour || {};
/*
|
| Our flour.bind name space, everything goes in 'ere
|
*/
flour.bind = {};
flour.bind.binders = {};
flour.bind.binderNames = [];
flour.bind.query = '';
flour.bind.prefix = 'flour';
/*
|
| Add a binder method to our object
|
*/
flour.addBinder = function(name, binder)
{
flour.... | true |
23ca0efe0fe435a4b161b8fa0a93c85b477355ad | JavaScript | dlindstrm/DH2642 | /lab4/js/services/BigOvenRestService.js | UTF-8 | 2,279 | 2.84375 | 3 | [] | no_license | var BigOvenRestService = function() {
var apiKey = "H9n1zb6es492fj87OxDtZM9s5sb29rW3";
var endpoint = "http://api.bigoven.com/";
var searchRequest = null;
var getRequest = null;
this.search = function(titleKeyWord, anyKeyword, callback) {
var _this = this;
this.searchRequest = $.getJSON(
endpo... | true |
21f3ca8e2abcffa8e2ea79f4e6ea6c28b7a8eb7d | JavaScript | vedrana-bradasevic/myFacebook | /js/newsfeed.js | UTF-8 | 24,605 | 2.921875 | 3 | [] | no_license |
window.onload = function () {
// This function loads users,statuses, status comments and prints statuses.
loadDataFromServer();
// Loads only profile image from logged in user.
loadProfileImage();
// Loads only information from logged in user.
loadGeneralInfo();
}
function loadDataFromServer()... | true |
6d0ddc74e8a218b464890aef78ecf29082eb8732 | JavaScript | kshitijgandhi95/algorithms-in-js | /data-structures/linked-list.js | UTF-8 | 2,857 | 3.96875 | 4 | [] | no_license | class Node {
constructor (val) {
this.val = val;
this.next = null;
}
}
class LinkedList {
constructor () {
this.head = null;
this.tail = null;
}
addNodeAtLast (val) {
let node = new Node (val);
if (!this.head) {
this.head = node;
}... | true |
ed80746dc297ab45bb3c39baaffeb8da71dc7ca1 | JavaScript | qwop/userscript | /monolith/51/167963.user.js | UTF-8 | 1,080 | 2.640625 | 3 | [] | no_license | // ==UserScript==
// @name Google Play Store - Retinalizer
// @namespace http://dragonwork.me/
// @version 1.0
// @description Makes the Google Play Store retina-friendly. Doubles the size of all images where possible.
// @match play.google.com/*
// @copyright 2013+, DragonWork
// ==/U... | true |
8380beb13fc1b42a864b5657a556e29b1ef0f868 | JavaScript | DemonFox900/Astronaut | /sketch.js | UTF-8 | 2,253 | 3.0625 | 3 | [] | no_license | var background
var astronaut
var edges
function preload(){
bathAnimation= loadAnimation("images/bath1.png" ,"images/bath2.png")
brushImage=loadImage("images/brush.png")
drinkAnimation=loadAnimation("images/drink1.png","images/drink2.png")
eatingAnimation=loadAnimation("images/eat1.png","images/eat2.png")
gymA... | true |
234514e362e60ab334a050b888e69775b54f717c | JavaScript | Neilson09/lab-07-pokedex | /js/pokemon-table.js | UTF-8 | 1,082 | 3.28125 | 3 | [] | no_license | import html from './html.js';
const tableBody = document.getElementById('pokedex-body');
function makeRow(pokemon) {
return html `<tr>
<td>${pokemon.pokemon}</td>
<td>${pokemon.type_1}</td>
<td>${pokemon.type_2}</td>
<td>${pokemon.attack}</td>
<td>${pokemon.defense}</td>
... | true |
ecae124b08fdcdae8f965028cd1fbee4e49a78f5 | JavaScript | yuryiva/authors | /backend/tellStoryForm/delFiles.js | UTF-8 | 691 | 2.515625 | 3 | [] | no_license | const rimraf = require("rimraf");
const path = require("path");
const fs = require("fs");
const uploadsDir = __dirname + "/uploads/";
const delFiles = () =>
fs.readdir(uploadsDir, function (err, files) {
files.forEach(function (file, index) {
fs.stat(path.join(uploadsDir, file), function (err, stat) {
... | true |
a806d105cccb0e51c0942430fa61770186140db0 | JavaScript | aaman007/FetchAPISandbox | /script.js | UTF-8 | 5,837 | 2.875 | 3 | [] | no_license | $('#getText').on('click', getText);
$('#getUsers').on('click', getUsers);
$('#getPosts').on('click', getPosts);
$('#getContestList').on('click', getContestList);
$('#addPost').on('submit', addPost)
$('#contestList').on('submit', userContestList)
$('#rankList').on('submit', organizationRankList)
function getT... | true |
5274ce62b5b9fa70dc6972568a61af4e2c7a10f5 | JavaScript | subhammittal/mittal-subham-web-dev | /assignment/services/widget.service.server.js | UTF-8 | 4,585 | 2.671875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* Created by SubhamMittal on 6/5/16.
*/
module.exports = function(app) {
var dummyWidgets = [
{ "_id": "123", "widgetType": "HEADER", "pageId": "321", "size": 2, "text": "GIZMODO"},
{ "_id": "234", "widgetType": "HEADER", "pageId": "321", "size": 4, "text": "Lorem ipsum"},
{ "_id": "3... | true |
f3a2ced5165f5cb641dcd2d70af89fe146e57281 | JavaScript | esther-v/sweet-escape-api | /src/models/model.js | UTF-8 | 1,138 | 2.546875 | 3 | [] | no_license | const database = require('../config/database');
exports.getUserByEmail = (requestBody, callback) => {
database.query("SELECT * FROM users WHERE email = ?;", [requestBody.email], (error, result) => {
if (error) {
callback(error, null);
return;
}
callback(null, result)... | true |
c2679cfa73e5ce9e955e98699efceb406698262c | JavaScript | mooniker/react-copyright-notice-component | /src/CopyrightYearSpan.test.js | UTF-8 | 3,983 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import React from "react";
import { render, unmountComponentAtNode } from "react-dom";
import { act, shallow } from "react-dom/test-utils";
import CopyrightYearSpan, { coerceYear } from "./CopyrightYearSpan";
let container = null;
beforeEach(() => {
// setup a DOM element as a render target
container = document.c... | true |
4ae174f8e2e001481efd23fc3fe0aeead30bf9f6 | JavaScript | KernelPanicAUS/SpaceX-API | /src/builders/history-sort.js | UTF-8 | 499 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive |
// Prevent incorrect input
const lowerCase = require('lower-case');
/**
* Builds Mongo sort object to set document order
* @param {Object} query Koa querystring object from ctx.request
* @return {Object} Mongo compatible sort object
*/
module.exports = (q) => {
const query = {};
if (lowerCase(q.order) === '... | true |
b77aaf7f70b8bd57063168bb78ede29e57a4fbba | JavaScript | jeff-gosselin/gif-app | /src/App.js | UTF-8 | 3,315 | 2.796875 | 3 | [] | no_license | import React, { Component } from "react";
import { SearchPage } from "./components/SearchPage";
import { FavsPage } from "./components/FavsPage";
import { Switch, Route } from "react-router-dom";
import axios from "axios";
import { baseURL } from "./config";
import "./App.css";
class App extends Component {
state = ... | true |
6cbfae3d110df367982acbfe9f4b43b2423e46bf | JavaScript | mmfarley/js-pokemon-search-practice-assignment-houston-web-100818 | /src/index.js | UTF-8 | 1,855 | 3.34375 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', () => {
const pokemonSearchForm = document.querySelector('#pokemon-search-form')
const pokemonContainer = document.querySelector('#pokemon-container')
const pokemonSearchInput = document.querySelector('#pokemon-search-input')
const render = function(){
fetch(... | true |
87767420b852301a7c86645ed286910d93e783f2 | JavaScript | menoriascarlo13/exam | /wng_1_2/js/script.js | UTF-8 | 4,056 | 2.859375 | 3 | [] | no_license | window.onload = function () {
var totalImgArray = [];
// var apiKey = "a2793d43-d786-45fa-aa78-7097b57038e9";
var wasAddCard = false;
var wasInitial = true;
function addEventCard() {
var ele = document.getElementsByClassName('cards');
for (var i = 0; i < ele.length; i++) {
... | true |
25c4bcb46df26a5c765d29bb770fcac0715cc1c8 | JavaScript | EroldKoil/rsclone | /Contra Clone/src/index.js | UTF-8 | 5,177 | 2.53125 | 3 | [] | no_license | import Player from './player';
import PointJS from './pointjs_0.2.0.9';
import mainMenu from './mainmenu';
import getLanguageObject from './multilang';
import Options from './options';
import Sound from './sound';
import Joystick from './joystick';
function resize() {
let width = window.innerWidth;
let height = wi... | true |
cc00ae1ef4969df0ab6eb96a1bd7d3aabfde907e | JavaScript | drawwithcode/2018-01-Diphladenia | /sketch.js | UTF-8 | 3,963 | 2.609375 | 3 | [] | no_license | function setup() {
// define artboard size
createCanvas(500,500);
}
function draw() {
colorMode(RGB);
background(241,139,91);
//bgmovement
fill(255,255,255,20);
quad(0, mouseY, 60, mouseY, 60, 500, 0, 500);
quad(110, mouseY, 170, mouseY, 170, 500, 110, 500);
quad(330, mouseY, 390, mouseY, 390, 500, 330, 500)... | true |
72f11257f67718ff699c3fa25143978c24fbfd7a | JavaScript | Danielcv/Proyecto-de-Seminario-de-Sistemas | /SuperTriviador/multiroom-chat-seed-master/handlers/roomHandler.js | UTF-8 | 1,343 | 2.640625 | 3 | [] | no_license | function RoomHandler(io) {
"user strict";
var that = this;
this.addUserToRoom = function(client, callback) {
client.join("'"+client.room+"'");
that.notifyNewUser(client, function(){});
callback('user-added', true);
};
this.removeUserFromRoom = function(client, callback) {
client.leave("'"+client.room+"... | true |
f3ffb7cde7957441166cf561710316dc034aecf7 | JavaScript | ahmed-fenni/warmUp | /warmUp14.js | UTF-8 | 691 | 3.625 | 4 | [] | no_license | // Style your code and explain it step by step before jumping to code :D
// Read carefully, focus and test your code :) ... /\ HaPPy HaCkInG /\
//create a function isSubset that should take two arrays and determine whether the second array is a subset of the first array.
//For example:
// array: [ 1, 2, 3, 4 ], sub:[... | true |
5a3157d529beba4cee41b57546dbb2530bc53cbf | JavaScript | AlexSerodio/billing-cycle | /backend/src/config/server.js | UTF-8 | 1,074 | 2.53125 | 3 | [] | no_license | const port = 3003
const bodyParser = require('body-parser')
const express = require('express')
const server = express()
const allowCors = require('./cors')
const queryParser = require('express-query-int')
/* para toda requisicao que chegar no formato urlencoded,
* use o bodyParser para interpreta-la */
server.use(b... | true |
b0e96813631fb277655f6577661567bf16d69cca | JavaScript | arnovanstaden/Tickity-Tackity | /src/components/Game/Game.js | UTF-8 | 6,093 | 2.609375 | 3 | [] | no_license | import React from "react";
// Components
import Board from "../Board/Board";
import O from "../Marks/O";
import X from "../Marks/X";
// Styles
import "./game.scss";
// Images
// Helpers
import * as Gameplay from "../../helpers/gameplay";
class Game extends React.Component {
constructor(props) {
super(p... | true |
7c1263e809ab1fec8e6950fc69c6e3ba7a98a4a8 | JavaScript | X-Strange/iss | /myWebSocketWebClient/js/widgets/wLog.js | UTF-8 | 2,016 | 2.71875 | 3 | [] | no_license | $.widget("jws.log",{
_init:function(){
w.log = this;
w.log.logVisible = true;
w.log.eLog = w.log.element.find("#log_box_content");
w.log.eBtnHide = w.log.element.find('#show_hide_log');
this.registerEvents();
},
registerEvents: function(){
//adding click functions... | true |
d5b0a4aa558ac2a84c3abbc33711e6f97d383f8f | JavaScript | Unterof/teachmeskills-practise-js-fe24 | /lesson-01/exercise-05.js | UTF-8 | 755 | 4.78125 | 5 | [] | no_license | // Exercise 05: Write a JavaScript program that will return 1 if the array is sorted in ascending order, -1 if it is sorted in descending order or 0 if it is not sorted.
const isSorted = (arr) => {
let arrSortedAsc = arr.slice();
let arrSortedDesc = arr.slice();
arrSortedAsc.sort();
arrSortedDesc.sort((a, b) ... | true |
9f5f64b8656c5017deecc8bcbf612120c282bd2e | JavaScript | margon91/practica1SRI | /public/javascripts/cliente.js | UTF-8 | 2,064 | 2.796875 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
var socket = io.connect('10.10.2.189:3000');//Establezco un socket con el servidor en este caso como es la misma máquina localhost
var bOcupadas = [];
socket.on('connect',function() {
console.log('Conectado con socket');
});
socket.on('butacasOcupadas', function(bu... | true |
da4bc1d3c6068f0ad8bcef26a154909ac07923bb | JavaScript | zwcloud/three.js-demos | /01_custom_shader/main.js | UTF-8 | 3,589 | 2.734375 | 3 | [
"MIT"
] | permissive | var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
camera.position.z = 5;
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setPixelRatio( window.devicePixelRatio );
document.body.a... | true |
b6ead030e88f92ee091c95e4b51f526858761e7a | JavaScript | karibou12/karibou12.github.io | /scripts/map.js | UTF-8 | 2,077 | 2.953125 | 3 | [] | no_license |
// On initialise la latitude et la longitude de Troyes (centre de la carte)
const lat = 46.5203285;
const lon = 6.0235486;
let macarte = null;
//liste de villes
let villes = {
"Morbier": {"lat": 46.5363166, "lon": 6.0169531, "city": "Morbier"},
};
// Fonction d'initialisation de la carte
function initMap() {... | true |
25eeb26db96a0ef522789e3133fa611dad33f1c4 | JavaScript | PaulaMarcella/react-examples-training | /starter-code/src/components/SignupPage.jsx | UTF-8 | 3,971 | 2.625 | 3 | [] | no_license | import React, { Component } from "react";
import Form from "react-bootstrap/Form";
import Button from "react-bootstrap/Button";
const validEmailRegex = RegExp(
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
);
... | true |
dd8f3aab97fb38781cd3cd374375478520ceca91 | JavaScript | yonib05/mechanic-api | /app/models/appointment.js | UTF-8 | 1,993 | 2.515625 | 3 | [
"MIT"
] | permissive | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const AppointmentSchema = new Schema({
name: {
type: String,
required: 'Kindly enter the name'
},
type: {
type: String,
enum: ['sedan', 'suv', 'van', 'bus'],
default: 'sedan'
},
start_time... | true |
6d64279cddb2533d39da54c25530de26f276800d | JavaScript | djoverbeatz29/nfl-playoff-odds | /doRound.js | UTF-8 | 549 | 2.640625 | 3 | [] | no_license | export default function doRound(bracket) {
for (const key of ['AFC', 'NFC']) {
const roundObj=bracket[key];
currTeams = roundObj.current_teams;
currTeams.sort((a,b)=>a.seed>b.seed?1:-1);
while (currTeams.length > 0) {
const [home, away]=[currTeams.shift(), currTeams... | true |
a367d0d2cf846ea337a779d68e616bad220bfeff | JavaScript | HeathMeyette/asangma.github.io | /popup-prototype/tests/unit/esri/views/ui/Component.js | UTF-8 | 2,523 | 2.578125 | 3 | [] | no_license | define([
"dojo/dom-class",
"dojo/dom-construct",
"esri/views/ui/Component",
"intern!bdd",
"intern/chai!assert",
"intern/order!sinon"
],
function(
domClass, domConstruct,
Component,
bdd,
assert,
sinon
) {
bdd.describe("esri/views/ui/Component", function() {
bdd.it("accepts DOM nodes", f... | true |
d22200f1adcf5613b9b25f446987d813dc5da66e | JavaScript | luisrj1495/MasterCodingInterviewUdemy | /LetCode/Intersection of Two Arrays II.js | UTF-8 | 491 | 3.390625 | 3 | [] | no_license | /**
* @param {number[]} nums1
* @param {number[]} nums2
* @return {number[]}
*/
var intersect = function(nums1, nums2) {
const set = new Set()
const intersection = []
for (let num1 of nums1) {
set.add(num1)
}
for (let num2 of nums2) {
if (set.has(num2)) {
intersection... | true |
b1edf819de73d961c1f03cebb7b39c96bb90025b | JavaScript | PlVasilev/JS-Fundamentals | /Advanced/Exercises/EXAM/solution.js | UTF-8 | 1,050 | 2.703125 | 3 | [] | no_license | $(selector).html(form)
let totalItems = 0;
let totalPrice = 0;
if (totalItems <= 150) {
$('.custom-select').on('input', function () {
$('#submit').prop('disabled', false)
});
$('#submit').on('click', function () {
let productName = $('.custom-select').val();
let price = Number($('#p... | true |
fdd4c4d3260fc83b433f91498a7eba9d02b9887c | JavaScript | riajahmedras/my-first-app | /src/App.js | UTF-8 | 1,531 | 2.796875 | 3 | [] | no_license | import logo from './logo.svg';
import './App.css';
function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<ProductShow product ={Products[0]}></ProductShow>
<ProductShow product ={Products[1]}></ProductShow>
... | true |
0ae6f949f5fc5556448b84a0032e1aa715c261a5 | JavaScript | me3enov/mia | /scr/components/MenuItem.js | UTF-8 | 2,523 | 2.828125 | 3 | [] | no_license | //export class to default layer
export default class MenuItem {
//constructor for the "MenuItem" class
constructor(settings) {
//handle click to links function init
this._openWork = settings.openWork;
//template selector
this._templateSelector = settings.selector;
//data variables
this._da... | true |
3659d39b0b16f96f425519fdcdce7aff6bff6524 | JavaScript | MaxBocharnikov/ToDoList | /js/handlers.js | UTF-8 | 2,471 | 3.28125 | 3 | [] | no_license | // В данном файле все обработчики событий
(function () {
// Функция изменяем значение аттрибута done
function doneToggle(item) {
item.parentNode.getAttribute('done') === 'true' ? item.parentNode.setAttribute('done', 'false') : item.parentNode.setAttribute('done', 'true')
}
// Функция-обработчик... | true |
1a941bc8a6247e73accc069b128ba7b89c703c9d | JavaScript | anasahmed700/frontend-web-PIAICQ1 | /JavaScript/scripts/31datetime.js | UTF-8 | 2,701 | 4.09375 | 4 | [] | no_license | rightnow = new Date();
console.log("Date Object;", rightnow);
var dateString = rightnow.toString();
console.log("Date String:", dateString);
var theDay = rightnow.getDay();
// var theStringDay = dateString.getDay(); **TypeError on string
console.log("getDay() returns number 0-6 as sun-sat:", theDay);
// to... | true |
d93928a37ce72866102486a0f4df3cb2691f40e2 | JavaScript | 1807-Capstone/radius | /server/db/models/check-in.js | UTF-8 | 1,411 | 2.53125 | 3 | [
"MIT"
] | permissive | const Sequelize = require('sequelize');
const User = require('./user');
const Restaurant = require('./restaurant');
const db = require('../db');
const CheckIn = db.define(
'check-in',
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true
},
COORDINATES: {
type: ... | true |
7952294efae84e512c9f5bf6f5b0d3244195fcb4 | JavaScript | kikonen/svelte_jumper | /src/Input.js | UTF-8 | 866 | 2.5625 | 3 | [] | no_license | import {bindMethods} from './bindMethods.js';
export default class PhysicsEngine {
constructor(dispatch) {
bindMethods(this);
this.keys = {
left: false,
right: false,
up: false,
down: false,
};
this.keyMapping = {
nop: 'nop',
ArrowLeft: 'left',
ArrowRight: ... | true |
304ec9104ee9461b3e92593a21c42e091d1019ed | JavaScript | elena-dev/encryption-utils | /example.js | UTF-8 | 540 | 2.796875 | 3 | [
"MIT"
] | permissive | const Encryption = require('./');
const encryptionUtils = new Encryption('insert_your_32_characterKey_here','insert_your_12_character');
// ====================
let encrypted_string = encryptionUtils.encryptAes256cbc('blabla');
console.info('encrypted_string Aes256cbc',encrypted_string);
let decrypted_string = en... | true |
b0ec44a68a039346ab8bc6741cd3fcf30c94a99a | JavaScript | summerfieldlab/Flesch_etal_Neuron | /Experiments/Humans/part1_arena/js/expt_eval.js | UTF-8 | 558 | 2.65625 | 3 | [] | no_license | /* **************************************************************************************
Shows evaluation of participant's performance at end of experiment
(c) Timo Flesch, 2016 [timo.flesch@gmail.com]
Summerfield Lab, Experimental Psychology Department, University of Oxford
*****************************************... | true |
1d85d3494649adb357388b5aad4b6af95abd102b | JavaScript | ibrahimBougaoua/frontEndBooksLand | /src/components/abonnement.js | UTF-8 | 2,905 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import Nav from "./nav";
import { Link } from "react-router-dom";
import axios from 'axios';
// handle button click of login form
async function author() {
try {
const response = await axios.get('http://127.0.0.1:5001/book/abonnements/user/' + localStorage.getItem('... | true |
fc821e597c9fc40e7387c3b977cd5a0d7929dced | JavaScript | janily/frontend-store | /array/3uni.js | UTF-8 | 323 | 3.515625 | 4 | [
"MIT"
] | permissive | const ocean = ['🐙', '🦀', '🦀', 1, 2, 3, 1, 2];
console.log([...new Set(ocean)])
const narr = ocean.filter((item, index) => {
return ocean.indexOf(item) === index
});
console.log(narr)
const rarr = ocean.reduce((unique, item) =>
unique.includes(item) ? unique : [...unique, item], []);
console.log(rarr)
| true |
852282262aae734d187c25a424d678571e61c841 | JavaScript | RayJustin/HotOrColdApp | /js/app.js | UTF-8 | 1,845 | 3.640625 | 4 | [] | no_license |
$(document).ready(function(){
/*--- Display information modal box ---*/
$(".what").click(function(){
$(".overlay").fadeIn(1000);
});
/*--- Hide information modal box ---*/
$("a.close").click(function(){
$(".overlay").fadeOut(1000);
});
});
// Set random number & count //
var randomNum =... | true |
fdc06ecc55286725851701b9dcb350c0a1b9aab3 | JavaScript | edsonrjunior/Javascript | /fundamentos/strings.js | UTF-8 | 569 | 3.921875 | 4 | [] | no_license | const escola = "Cod3r"
console.log(escola.charAt(4))
//Não retorna erro
console.log(escola.charAt(5))
//Retorna o valor da tabela ASC (Unicode)
console.log(escola.charCodeAt(3))
//Retorna o valor que está no indice
console.log(escola.indexOf(3))
//Vai até o indice 3 mas não imprime o indice 3
console.log(escola.su... | true |
a3cbcb07c73151d2e1711b1fb7821119344f1618 | JavaScript | ijacksondesign/shower-thoughts | /utils/dateFormat.js | UTF-8 | 198 | 2.578125 | 3 | [
"ISC"
] | permissive | const moment = require('moment');
module.exports = (timeStamp) => {
const formattedTimeStamp = moment(timeStamp).format("dddd, MMMM Do YYYY, h:mm:ss a");
return formattedTimeStamp;
}; | true |
3f02f71ce5852ebd4137b383a5ce404358e2f3b8 | JavaScript | STAR-RG/entente | /seeds/mozilla/non262/expressions/binary-literals.js | UTF-8 | 2,314 | 3.078125 | 3 | [
"MIT",
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | // Any copyright is dedicated to the Public Domain.
// http://creativecommons.org/licenses/publicdomain/
//-----------------------------------------------------------------------------
var BUGNUMBER = 894026;
var summary = "Implement ES6 binary literals";
//print(BUGNUMBER + ": " + summary);
/**************
* BEGIN... | true |
2f5614ca9190a661703b585a64b7a4fb0209907f | JavaScript | AmaadRafi/pilot | /indexOLD.js | UTF-8 | 420 | 2.734375 | 3 | [] | no_license | $(function () {
$('#nameform').on('submit', function(evt){
// Reverse name + popup
var name = $('#fname').val() + " " + $('#lname').val();
alert(name.split("").reverse().join(""));
// display jumbotron - fix this
$("#jumbotext").text(name);
$(".jumbotron").removeClas... | true |
7b6468e510a4302846de375d7616ef52cf7101c3 | JavaScript | OusmanaTraore/globalNkowledge | /my_node_server/javascript/function/functions.js | UTF-8 | 440 | 3.453125 | 3 | [
"MIT"
] | permissive | function sayHello(name, age) {
document.write(`${name} a ${age} ans`);
// return `${name} a ${age} ans`;
}
// document.write(sayHello(Ali, 45));
// Fonction qui change le texte d'un paragraphe
const changeText = () => {
const p = document.querySelector("p");
p.textContent = "I was changed with an inline even... | true |
370ebda43754c18f9d8ee6ecbe48eced8154cae8 | JavaScript | perfilyev/data-structures-and-algorithm | /src/bubble-sort.js | UTF-8 | 335 | 3.109375 | 3 | [] | no_license | const bubbleSort = arr => {
for (let fixed = 0; fixed < arr.length; fixed++) {
for (let current = 0, next = 1; current < arr.length - fixed; current++, next++) {
if (arr[current] > arr[next]) {
[arr[next], arr[current]] = [arr[current], arr[next]];
}
}
}
return arr;
}
module.export... | true |
58ff96f6cf75ef967b1a50f7df625a4e6769478a | JavaScript | assassinoNz/A-Guide-to-JavaScript | /Activities - Questions/Activity(5) - If, Else, Switch.js | UTF-8 | 1,257 | 4.3125 | 4 | [] | no_license | //PART 1
//Build a program that prints the "grade" for the following requirement using if-else if-else structure
//*. There are "score" and "grade" variables declared for you
//1. If score >= 60 then grade = "D"
//2. If score >= 70 then grade = "C"
//3. If score >= 80 then grade = "B"
//4. If score >= 90 then grade = "... | true |
72ed356c6ae435ce2c4918870a6dcfaffafa8693 | JavaScript | Hurly77/lessons | /Finals/portfolio-twind/Profile-Card-master/script.js | UTF-8 | 720 | 2.609375 | 3 | [
"MIT"
] | permissive | //Init tooltips
tippy('.link', {
placement: 'bottom',
});
//Toggle mode
const toggle = document.querySelector('.js-change-theme');
const body = document.querySelector('body');
const profile = document.getElementById('profile');
toggle.addEventListener('click', () => {
if (body.classList.contains('text-gray-900')) {... | true |
e65388d067791d441ee453a5799e224e25d58f0f | JavaScript | stubblsc/angular_attack2017 | /public/src/Step.js | UTF-8 | 378 | 3.390625 | 3 | [] | no_license | // step contains information regarding whether a note should
// be played at a particular moment in time
function Step(note, time) {
this.time = time;
this.note = note;
this.active = false;
}
Step.prototype.reset = function() {
this.active = false;
}
// step::toggle toggles the active state of the step
Step.proto... | true |
80d6ec4a0aad3fd97dbd2e15ab32ac5114937457 | JavaScript | GustavoD13/MedidorPro | /src/routes/Medidor.js | UTF-8 | 1,792 | 2.671875 | 3 | [] | no_license | const medidorRoutes = require('express').Router();
// Require Item model in our routes module
var Medidor = require('../models/Medidor');
// Defined store route
medidorRoutes.route('/add').post((req, res, next) => {
var medidor = new Item(req.body);
medidor.save()
.then(medidor => {
res.status(200).... | true |
260d88deedf14011943f7565e1fa5473beeac250 | JavaScript | kduane/geometric-classes-js | /public/js/Square.js | UTF-8 | 505 | 3.515625 | 4 | [] | no_license | class Square {
constructor(side, x, y) {
this.side = side;
this.x = x || 0;
this.y = y || 0;
this.width = side;
this.height = side;
}
area() {
return this.side * this.side;
}
perimeter() {
return this.side * 4;
}
contains(x, y) {
if ((this.x - (this.side / 2)) <= x &&
... | true |
9578c4281038f6ebebbf468bd8eee51a6ddcddba | JavaScript | alyssamichelle/MDD | /app/assets/javascripts/admin.js | UTF-8 | 2,087 | 2.71875 | 3 | [] | no_license | bookies.controller('adminController', ['$rootScope','$scope', 'firebaseCollection', function ($rootScope,$scope, firebaseCollection){
firebaseCollection('Schedule/Future',1000).then(function(future){
$scope.scheduleArray = future;
});
var beginningOfMonth = Date.create().beginningOfMonth();
if (!begi... | true |
7c1c5672702041c77eb2b41c50afe841ab8239cd | JavaScript | onionfun/fullstacklab | /server.js | UTF-8 | 1,396 | 2.9375 | 3 | [] | no_license | const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const methodOverride = require('method-override');
require('./db/db');
const morgan = require('morgan');
app.use(morgan('common')); //can use "short"
//middleware lives in the middle of a request, intercepts request, c... | true |