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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
03bee2abe461ba870c7fde158a0234f63e8c93a8 | JavaScript | edexy/mpl | /middleware/userAuth.js | UTF-8 | 843 | 2.578125 | 3 | [] | no_license | const jwt = require("jsonwebtoken");
module.exports = (req, res, next) => {
try{
let token = req.headers.authorization.split(" ")[1];
const decoded = jwt.verify(token, "secret");
req.userData = decoded;
next();
}catch(error){
//check for valid session
if (req.s... | true |
b5227e32885d5a3d3d110d9e989422995b85b058 | JavaScript | Som3on3-3ls3/programon | /js/classes/Map - Copy.js | UTF-8 | 6,971 | 2.75 | 3 | [
"Unlicense"
] | permissive | function Map(nom) {
// Création de l'objet XmlHttpRequest du AJAX
var xhr = getXMLHttpRequest();
// Chargement du fichier
xhr.open("GET", './maps/' + nom + '.json', false);
xhr.send(null);
if(xhr.readyState != 4 || (xhr.status != 200 && xhr.status != 0)) // Code == 0 en local
throw new Error("Impossible de c... | true |
555788aa7d9f1c4cf1533387f2873585775d50f2 | JavaScript | sanchez182/virtualMenu | /src/store/reducers/requestReducer.js | UTF-8 | 823 | 2.640625 | 3 | [] | no_license | import { API_CALL_ERROR, API_CALL_START, API_CALL_SUCCESS } from "../actions/requestActions";
const initialState = {
error: false,
loadingRequest: false
};
export default function requestReducer(stateProps, action) {
const state = stateProps ? stateProps : initialState
switch(actio... | true |
550ba567771bef4990dab742f459c1137f9339e5 | JavaScript | delta94/Quan-Ly-Quan-Ca-Phe-ExpressJS | /publics/javascripts/admins/quan-li-chiTietNhapHang/main.js | UTF-8 | 3,094 | 2.59375 | 3 | [] | no_license |
$(document).ready(function () {
//Initialize Table
tableQuanLychiTietNhapHang = $('#tableQuanLychiTietNhapHang').DataTable({
columnDefs: [
{
targets: 0,
render: function (data, type, row, meta) {
let renderData = data;
... | true |
f13f3540ec831c94fce07dd12d35bd141a960d8f | JavaScript | vicb1/miscellaneous-notes | /website-resources/TableFilter-master/test/test-cell-parser.js | UTF-8 | 2,213 | 2.65625 | 3 | [
"MIT"
] | permissive | (function(win, TableFilter){
var tf = new TableFilter('demo', {
base_path: '../dist/tablefilter/',
col_0: 'select',
cell_parser: {
cols: [0],
parse: function(tf, cell) {
var chk = cell.getElementsByTagName('input')[0];
if (chk.checked)... | true |
5a58914c54322f293fd6142eda53e7949b6e42d9 | JavaScript | zeinamagdy/Full-Stack-Open-2019 | /part2/countries/src/App.js | UTF-8 | 2,011 | 2.984375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import axios from 'axios';
import Country from './Components/Country';
import CountryInfo from './Components/CountryInfo';
import Filter from './Components/Filter'
import './App.css';
const App = () => {
const [countries, setCountries] = useState([]);
const [resu... | true |
0af974e3d88e73582b96ac4d56ede1c0e5b37330 | JavaScript | kcarollee/Puzzle-Draft | /js/puzzleSetup.js | UTF-8 | 4,122 | 2.796875 | 3 | [] | no_license | // name simplify
// var puzzle_N = numberOfTilesPerRow;
// var none_col = noneColIndex;
// var none_row = noneRowIndex;
// var reset = rowNumReset;
function myInputEvent() {
if(document.getElementById("rowNum").value == "")
puzzle_N = default_N;
puzzle_N = document.getElementById("rowNum").value;
r... | true |
dbe196d9c35e2480c40dbebc0ef115137797e050 | JavaScript | AndrewKim0318/lighthouse-js-fundamentals | /last-index-of.js | UTF-8 | 865 | 4.0625 | 4 | [] | no_license | function lastIndexOf(array, value){
//check to see if the array is empty
if(array.length < 1){
return -1;
} else {
//check to see if value is within the array
let exist = false;
for(let i = 0 ; i < array.length ; i++){
if (array[i] === value){
exist = true;
break;
}
... | true |
62caff11f072a1ee6000ad59d023d40dc1ef0619 | JavaScript | monking/Canvas-Play | /js/CanvasPlay.js | UTF-8 | 851 | 2.625 | 3 | [] | no_license | /*
* author: Christopher Lovejoy <lovejoy.chris@gmail.com>
* copyright 2013 under an Attribution Creative Commons license
* http://creativecommons.org/licenses/by/3.0
*/
function CanvasPlay(options) {
Extends(options, {
canvas: null,
context: "2d"
});
CanvasPlay.prototype._super.apply(this, arguments);
if (... | true |
f54a59297419d8a64121a1d80d6aca1477f18c9a | JavaScript | DanielRomero1040/chat_productos_webSocket | /public/index.js | UTF-8 | 2,190 | 3.0625 | 3 | [] | no_license | const socket = io();
//------- chat socket client --------
socket.on("message_back", (data)=>{
console.log(data);
render(data);
});
const render = (data)=>{
let html = data.map( (element)=>{
return `
<p class="text-light"> <strong class="text-primary"> ${element.nombre} : </strong> ${ele... | true |
4dc602fb426c1a0f309d53c00cde1ab3c4cf1104 | JavaScript | ekrotenko/appium-wdio | /specs/calculator.spec.js | UTF-8 | 1,464 | 2.828125 | 3 | [] | no_license | const data = require(`${process.cwd()}/data/calculator/operators.data`);
const { firstOperand, secondOperand } = data;
const parser = require('parse-decimal-number');
const Calculator = require(`${process.cwd()}/pages/calculator`);
const calculator = new Calculator();
describe('Test main calculator operators', () => ... | true |
d2e555557f8bd62b3a60a6be0a200f7992647992 | JavaScript | AlexTheSchizo/ReptileWebpage | /script.js | UTF-8 | 1,406 | 2.65625 | 3 | [] | no_license | function openContent(event,topic){
var optioncontent, options;
optioncontent = document.getElementsByClassName("content");
for(var i = 0; i < optioncontent.length ; i++)
{
optioncontent[i].style.display = "none";
}
options = document.getElementsByClassName("option_choice");
... | true |
eb93b0d96cab1939a87e5df3612905b16798813e | JavaScript | CSE512-16S/a3-kylethayer-yhoonkim | /js/summary.js | UTF-8 | 2,130 | 2.578125 | 3 | [
"MIT"
] | permissive | function vl_spec(data, x_title, key, value) {
return {
"data": {"values": data},
"mark": "bar",
"encoding": {
"x": {"field":key, "type":"nominal", "sort":"unsort", "axis":{"title":x_title}},
"y": {"field":value, "type":"quantitative", "axis":{"title":"Number of Records"}}
}
};
}
functio... | true |
9f9af86ecd9182e847975cb456ab039924d11baf | JavaScript | nchintada/final-project | /routes/api/users.js | UTF-8 | 2,816 | 2.671875 | 3 | [] | no_license | // @author: Luke Bodwell
"use strict";
const express = require("express");
const User = require("../../models/User");
const passportConfig = require("../../config/passport-config");
const router = express.Router();
const {ensureAuthenticated, getUsername} = passportConfig;
/*
* Route: /api/users
* Method: GET
* ... | true |
47b526b7fa65d572dce1cd39fcae6e3085f8e852 | JavaScript | tarunjha1/trial_HTMLnJS | /readfromconsole.js | UTF-8 | 301 | 3.734375 | 4 | [] | no_license | //code reads from console and prints out a greeting to console with your name
let readconsolewa = require('readline').createInterface({
input: process.stdin,
output: process.stdout
})
readconsolewa.question(`What's your name?`, (name) => {
console.log(`Hi ${name}!`)
readconsolewa.close()
})
| true |
4b858692ec540f7469514eeaf2b047eeceddc3e6 | JavaScript | fcamilalima/exercicios-javacript | /funcao/cidadaoPrimeiraClasse.js | UTF-8 | 1,995 | 4.96875 | 5 | [] | no_license | /*
* Aula 70 - Função: cidadão de primeira linha.
*
* Função em JS é First-Class Object ou First-Class Citizen.
* High-Order Function.
* Função como dado.
* - Passar função como parâmetro.
* - Retornar uma função como resposta de uma outra função.
* - Criar uma função e armazená-la numa variável/constante.
* ... | true |
d22ca88caac4f80bfcd5d7f614db83704696b098 | JavaScript | marcoc08/cursoJSfriends | /Día 2/arreglos2.js | UTF-8 | 346 | 4.09375 | 4 | [] | no_license | const name = 'Marco';
console.log(`hola me llamo ${name}`);
//Ejercicio 2
const name2 = 'Armando';
if (name.length === name2.length){
console.log(`el largo de las palabras es el mismo`)
}else if(name.length > name2.length){
console.log(`la palabra más larga es ${name}`)
}else{
console.log(`la palabra m... | true |
e980ba33455b8252cf34715cd91aaecc50418d9f | JavaScript | superguigui/a-christmas-tale | /src/utils/Distributor.js | UTF-8 | 1,355 | 3.109375 | 3 | [] | no_license | var Point = function(x, y) {
this.x = x;
this.y = y;
};
var Distributor = (function(){
/* ===================================================
CONSTRUCTOR
=================================================== */
function Distributor() {
this.cellSize;
this.minDistSquare;
this.samplePoints;
}
Distributor.... | true |
61e85ca0df3eef6fe1e5795782bd801b1a72ffc5 | JavaScript | nicolasdao/sls-config-parser | /src/utils/error.js | UTF-8 | 5,706 | 2.90625 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* Copyright (c) 2017-2019, Neap Pty Ltd.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
const { validate } = require('./core')
const throwError = (message, extraData) => {
extraData = extraData ||... | true |
d4950f57e741f2148668a2bfea7ab30ca4a6b044 | JavaScript | qmacpit/phonebook-client | /src/reducers/reducers.js | UTF-8 | 1,744 | 2.625 | 3 | [
"MIT"
] | permissive | import { combineReducers } from 'redux';
import { ACTIONS } from '../actions/actions'
import { findIndexById } from '../utils';
var contactsBackup;
function backUp(contacts) {
console.log('backup');
console.log(contacts)
contactsBackup = contacts.slice(0);
return contacts;
}
function restore() {
console.... | true |
e911e63fde00fdc5ad73ae78410c76879006c30a | JavaScript | Jonwyp/to-do-list | /app.js | UTF-8 | 398 | 3.3125 | 3 | [] | no_license | function createToDoListItem() {
const input = document.querySelector("input[type=text]");
if (!input.value) {
return;
}
const li = document.createElement("li")
li.textContent = input.value
const ul = document.querySelector("ul")
ul.appendChild(li)
input.value = ""
}
const addButton = document.q... | true |
86a2556303670b931511aa3a325345f082de3326 | JavaScript | hanviki/hscble | /utils/common.js | UTF-8 | 562 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* 通用提示框
// * @param {string} msg 用户信息
// * @param {number} delay 延迟毫秒数
// * @param {string} icon=[success,loading,none] 图标 默认 none
// * @return {Promise}
*/
export const showToast = (options = '') => {
let option = {
delay: 1000,
icon: 'none',
msg: '',
success(){}
};
if ( typeof options == 'strin... | true |
74b2837f778eb903b9151b9aefabf4c1002627c8 | JavaScript | sky1o1/Material-ui- | /src/components/About.jsx | UTF-8 | 2,484 | 2.53125 | 3 | [] | no_license | import React, {useEffect, useState} from 'react';
import { makeStyles } from '@material-ui/core/styles';
import Card from '@material-ui/core/Card';
import CardActionArea from '@material-ui/core/CardActionArea';
import CardContent from '@material-ui/core/CardContent';
import Typography from '@material-ui/core/Typography... | true |
b90e24470b3f3c5be289e46568b395c70c89ed7a | JavaScript | alishvagadiya/Kaun-Banega-JS-Expert | /index.js | UTF-8 | 2,063 | 3.03125 | 3 | [] | no_license | var readlineSync = require("readline-sync");
var chalk = require('chalk');
var questions = [
{
question: "From below which is not a Pop up boxes available in JavaScript? ",
answers: ["Alert", "confirm", "prompt", "console"],
correctAnswer: "console"
},{
question: "Inside which HTML element do we pu... | true |
3f80e2ec673cef39495a32e8caa89e3e5eaf1261 | JavaScript | misterrPink1/justAnotherMERNBackend | /controllers/places-controllers.js | UTF-8 | 3,092 | 2.828125 | 3 | [] | no_license | const { v4:uuid } = require("uuid");
const { validationResult } = require('express-validator');
const HttpError = require('../models/http-error');
const getCoordsForAddress = require('../util/location');
//const { delete } = require("../routes/places-routes");
let DUMMY_PLACES = [
{
id: 'p1',
titl... | true |
ff94552cb015119fa1dc29fa53810d006b8edc42 | JavaScript | FreeStyleFEFU/JavaScript | /Москаленко/5 лаба/game.js | UTF-8 | 14,241 | 2.515625 | 3 | [] | no_license | var count=0; count1 = 0;
var command,command1;
var mas = [];mas1 = []; mas2 = []; mas3 = [];variable = []; c_var =[];apm = []; c_apm =[]; ed =[];id=[]; del = [];copy = [];dd = [];ddd=[];d=[];
var block,val1,val2,count3;
var val4=0;
var val3 =[];var srav =0;
window.onload = function()
{
block = document.cr... | true |
ae0206a1ffb21d5509a4a0f1780fc61ebf9b6e7f | JavaScript | g2huda/mineSweeper | /js/minesweeper.js | UTF-8 | 12,341 | 3.21875 | 3 | [] | no_license |
var timer;
//set difficulty levels
var DIFFICULTY = {
Easy: {
Columns: 9,
Rows: 9,
Mines: 10
},
Medium: {
Columns: 16,
Rows: 16,
Mines: 40
},
Hard: {
Columns: 30,
Rows: 16,
Mines: 99
}
};
var _currDifficulty = DIFFICULTY.E... | true |
c8cf385a3a1850d74ac2b1fdaed847d27625e0e1 | JavaScript | mpeyre93/codeQuiz | /script.js | UTF-8 | 6,880 | 3.5 | 4 | [] | no_license |
var startButton = document.getElementById("start-btn")
var nextButton = document.getElementById("next-btn")
var startScreen = document.getElementById("start-screen")
var endScreen = document.getElementById("end-screen")
var questionContainerEl = document.getElementById("question-container");
var questionEl = document.... | true |
6199ee49eca6ad3fa91dd7b6b7191cdb3bef61b8 | JavaScript | MohamedBakoush/ParkSystem | /client/javaScript/login.test.js | UTF-8 | 4,024 | 2.640625 | 3 | [] | no_license | 'use strict'
const { loginData, createSection, createForm,
createButton, loadLoginData, currentUser,
checkLoginOutput, checkLogin, grabEverything,
addEventListeners, prepareHandles, pageLoaded
} = require('./login'); // import functions from login
describe('login', function () {
cons... | true |
4f8c9c4337cf87cdcd621c470855f36cbee7c986 | JavaScript | ashcolecarr/Euler-in-JavaScript | /Problems 1-50/problem014.js | UTF-8 | 1,151 | 3.375 | 3 | [] | no_license | // Project Euler Problem 14
'use-strict';
var http = require('http');
const LIMIT = 1000000;
function getCollatzSequence () {
var final = 0;
var interim = 0;
var finalCount = 0;
var count = 0;
var currentNumber = LIMIT - 1;
while (true) {
// Skip even numbers since they will have shorter sequences.
... | true |
d665d8944ed4c058a59b80b2411c22ba54bcd2df | JavaScript | yoursmengle/iotdb-examples | /samples/hue_1.js | UTF-8 | 412 | 2.546875 | 3 | [] | no_license | /*
* hue_1.js
*
* David Janes
* IOTDB
* 2014-07-20
* "The 45 Anniversary of Apollo 11 Moon Landing"
*
* Set all lights to Magenta
*
* Demonstrates:
* - IOT.connect
* - ThingArray.set to set values of Things that may not exist yet
*/
"use strict"
var iotdb = require("iotdb")
iotdb
.iot()
... | true |
ed28af973a61080dba01eb9733501c75317ea9e7 | JavaScript | Abbosjon7788/github-lessons | /lesson-26/dars/js/main.js | UTF-8 | 2,883 | 3.28125 | 3 | [
"MIT"
] | permissive | var database = [];
var selectedBoard = -1;
var selectedBordForItem = -1;
var selectedItem = -1;
function showCard() {
document.getElementById('add-board').classList.toggle("d-none");
}
function addBoard() {
var boardTitle = document.getElementById('board-title').value;
if (boardTitle.length > 0) {
... | true |
a44f7b7d91869aac8864cb58aa06e195cf00efb3 | JavaScript | nickeax/cidr-helper | /classes/messaging.js | UTF-8 | 223 | 2.9375 | 3 | [] | no_license | export class Messaging {
msg;
cls;
out;
constructor(o, m, c) {
this.out = o;
this.msg = m;
this.cls = c;
}
display() {
this.out.innerHTML = `<span class ='${this.cls}'>${this.msg}</span>`;
}
} | true |
1379c364397ddf23b6f1cf8bd2c3c6e5604a8737 | JavaScript | informaticaeducacional/obama | /src/main/webapp/resources/js/planoDeAula/revisao.js | UTF-8 | 3,962 | 2.875 | 3 | [] | no_license | $(document).ready(function () {
var feedback;
var idPlano = $('#planoDeAula-id').val();
var urlValidacao = $('#url-revisao').val();
$(document).on('click','#btn-reajuste', function (){
feedback = $('#text-feedback').val();
limparConteudo();
$('#modal-revisao').append(htmlConfirm... | true |
40af17db6bc2b4ffc24452e682156a97b776a298 | JavaScript | marijnh/module-workshop | /2007/solution/js/app.js | UTF-8 | 591 | 3.1875 | 3 | [
"MIT"
] | permissive | // DEPENDS: ./paper.js ./exercises.js
!function() {
var paper = new Paper(document.getElementById("paper"))
var score = 0
paper.write("Math exercises. Go!")
function nextExercise() {
var exercise = getExercise(10 + score * 2)
paper.prompt(exercise.question, function(answer, answerNode) {
if (an... | true |
4ea1ad2d78ad10b50fbb280dccd74ecaec63078a | JavaScript | naibinh/gooddata-indigo-visualizations | /src/utils/color.js | UTF-8 | 1,205 | 2.671875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | export const DEFAULT_COLOR_PALETTE = [
'rgb(20,178,226)',
'rgb(0,193,141)',
'rgb(229,77,66)',
'rgb(241,134,0)',
'rgb(171,85,163)',
'rgb(244,213,33)',
'rgb(148,161,174)',
'rgb(107,191,216)',
'rgb(181,136,177)',
'rgb(238,135,128)',
'rgb(241,171,84)',
'rgb(133,209,188)',
... | true |
1175a59dd348ef774c4f184e1837bae4efa877c1 | JavaScript | MarioGogogo/uni-app-demo | /store/index.js | UTF-8 | 476 | 2.515625 | 3 | [] | no_license | /**
* 采用vuex 它是状态管理
*/
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state:{
historyLists:[]
},
mutations:{
SET_HISTORY_LISTS(state,historey){
state.historyLists = historey
}
},
actions:{
set_history({commit,state},historey){
//获取现在的数据
let oldLi... | true |
8ace9d94dc6de82abb8c1a4c978dcc8699c7fa47 | JavaScript | shirish-heller/DS-Algo | /Graphs/BFS.js | UTF-8 | 1,357 | 3.859375 | 4 | [] | no_license | class Graph {
constructor(nodes, edges) {
this.node = nodes;
this.edges = edges;
}
}
class Queue {
constructor() {
this.queue = [];
}
front() {
return this.queue[0];
}
enqueue(val) {
this.queue.push(val);
}
dequeue() {
return this.... | true |
dcdce22c807383243c50b4f466882ac07dfd517a | JavaScript | yufrances90/HackIn | /back-end/src/controllers/utilController.js | UTF-8 | 744 | 2.515625 | 3 | [] | no_license | const services = require("../services");
class UtilController {
getGoogleMapApiKey() {
return services.UtilService.getGoogleMapApiKey();
}
async getCoordinatesByAddress(address) {
try {
const res = await services.UtilService.getCoordinatesByAddress(address);
... | true |
b5c8fc24fd07b6e9db0286093d172bfc3bdda3bf | JavaScript | DanielSalazar1/Assignment3 | /Temperatures/CtoK.js | UTF-8 | 308 | 3.234375 | 3 | [
"BSD-3-Clause"
] | permissive | function cToK(c) {
var k = c + 273.15
return k
}
function performCalculation2(){
var inputElement = document.getElementById("celsiusValue");
var value = parseInt(inputElement.value);
var paragraphElement = document.getElementById("result2");
paragraphElement.innerHTML = cToK(value);
}
| true |
dabd5de93d5a4ffe0e7192ebf65b152542d5994d | JavaScript | ColoradoDemography/MS_Demog_Lookups | /routes/base_analysis.js | UTF-8 | 4,694 | 2.703125 | 3 | [
"MIT"
] | permissive | var validate = require("../modules/common_functions.js").validate;
var pad = require("../modules/common_functions.js").pad;
var sendtodatabase = require("../modules/common_functions.js").sendtodatabase;
var construct_delimited_string = require("../modules/common_functions.js").construct_delimited_string;
var request =... | true |
f5088ed6c61480f29512ad7e701a665e3c18eb28 | JavaScript | oguzozgen/react-second-example | /src/App.js | UTF-8 | 1,849 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
/**
* @desc The card that defines per person information
* @see components function component
* @param {@} props
*/
const Card=(props)=>{
return(
<div style={{margin:'3em'}}>
<img width="100" src={props.av... | true |
84e9ef84e808246dea2332ba5333534bb8c43eb5 | JavaScript | dmitrij-jazel/CA-Kaunas-april-2018 | /FILTER cars/js/script.js | UTF-8 | 2,286 | 3.3125 | 3 | [] | no_license | $("#btn_filter").click(function () {
// Input - Surinkti informacija is teksto laukeliu
let brand_text = $("#brandSelect").val();
// Logic - padaryti CARS filtracija
// Filtravimas!
let filteredCars = CARS.filter(function (car) {
return car.brand.toLowerCase() == brand_text.toLowerCase(); // Filtruojam pagal "... | true |
a0769c1cd8381164cf568b2332b9d4aae428c14f | JavaScript | 5ohyun/nodejs | /stat.js | UTF-8 | 831 | 4.125 | 4 | [] | no_license | const pi = 3.14;
const mean = (arr) => { // 배열을 받음??
if(arr.length === 0 ){
return 0;
}
let sum = 0;
for(let i = 0; i<arr.length; i++){
sum += arr[i];
}
return sum / arr.length;
};
// exports 하는 방법 4가지
//(1) add.js 에서 처럼 module.exports = add; 상수 지정해 exports
//(2-1)
// module.ex... | true |
5ba04db72c5f794ea0acd453e6097abf78191d9f | JavaScript | Casski/201892-Onderstijn-Cas-Term2 | /cointable/js.js | UTF-8 | 2,190 | 2.78125 | 3 | [] | no_license | /**
* Created by Cas on 14-11-2017.
*/
var input = document.getElementById("input");
var output = document.getElementById("output");
input.addEventListener('keydown', function(e) {
console.log(e.keyCode);
if (e.keyCode == 13) {
switch (input.value) {
case "1":
output.value = "you ... | true |
9b383a927496eb6fb8dbf3f1b70350d563312ef8 | JavaScript | TheWhykiki/Plg_Multiser | /plugins/fields/userwhykiki/assets/js/multiselect.js | UTF-8 | 570 | 2.53125 | 3 | [] | no_license | // A $( document ).ready() block.
jQuery( document ).ready(function() {
var parameters = Joomla.getOptions('parameters');
var fieldValues = parameters.values;
if(fieldValues != ''){
setMutipleValuesFromDatabase();
}
function setMutipleValuesFromDatabase(){
fieldValues = fieldValue... | true |
8ed62a124c6b45e4215630da769d9bc9a7597c65 | JavaScript | aragakerubo/Homework-Assignment-9-Template-Literals | /UI/templates/signup-page.js | UTF-8 | 1,898 | 2.546875 | 3 | [
"MIT"
] | permissive | let signupPage = `
<section id="signup-page">
<h2>
Sign Up!
</h2>
<div class="signup-form">
<form name="sign-up" id="signUpForm">
<ul class="form">
<li>
<label>First Name<span class="required">*</span>:</label>
<input type="text" name="fname" placeholder="Your First Name"... | true |
2dbd4e4f1b457940dd98ae80d3b5e92a34de0d2a | JavaScript | AmarSiddi/reactjs-expense-tracker | /src/Category/Category.js | UTF-8 | 1,102 | 2.578125 | 3 | [] | no_license | import React, { Component } from "react";
import AppNav from "../Utils/AppNav";
class Category extends Component {
state = {
isLoading: true,
Categories: [],
};
async componentDidMount() {
const headers = {
Authorization: "Bearer " + localStorage.getItem("store"),
};
await fetch(proces... | true |
de56bd9c2a1eca0fc6a11267b1f09b73c01d8031 | JavaScript | NordGus/js-basics | /02_basics/03_primitive_types/index.js | UTF-8 | 466 | 4.03125 | 4 | [] | no_license | // Primitives / Value Types
// This are:
// * String
// * Number
// * Boolean
// * undefined
// * null
// String Literal
let name = 'Mosh';
// Number Literal
let age = 30;
// let age = 30.0 is also valid
// Boolean Literal
let isApproved = true;
// let isApproved = false is also valid
// undefined value
let firstN... | true |
4c96d85870d68efa8165613b90ad249dffe76046 | JavaScript | ctrlplusb/easy-peasy | /tests/dynamic-store.test.js | UTF-8 | 2,565 | 2.5625 | 3 | [
"MIT"
] | permissive | import { action, createStore, computed } from '../src';
test('addModel', () => {
// ARRANGE
const store = createStore({
counter: {
count: 0,
increment: action((state) => {
state.count += 1;
}),
},
});
// ACT
store.addModel('router', {
path: '/',
push: action((state,... | true |
9000deaab531555282e486d82ce15324d5f83eea | JavaScript | Lougles/goit-js-hw-06 | /js/task-3.js | UTF-8 | 334 | 3.078125 | 3 | [] | no_license | // Получить массив имен пользователей по полу (поле gender).
import list from './users.js'
const getUsersWithGender = (users, gender) => {
return users.filter(({ gender }) => gender === gender);
};
console.log(getUsersWithGender(list, 'male')); // [ 'Moore Hensley', 'Ross Vazquez', 'Carey Barr', 'Blackburn Dotson' ] | true |
fff8f2839cb3ed6a1fd88fe232eae18f4ae37838 | JavaScript | joshiatharva/dfa-tool | /classes/SelfLink.js | UTF-8 | 1,917 | 2.921875 | 3 | [] | no_license | export default class SelfLoop {
constructor(a) {
this.node = a;
this.anchorAngle = 0;
}
draw(c) {
var startX = (this.node.y + this.node.radius);
var endX = (this.node.y + this.node.radius);
}
getEndPointsAndCircle() {
var circleX = this.node.x + 1.5 * node... | true |
b7db0508a6c5f9ffc15650b02ae6c43e230c0d34 | JavaScript | Jiasm/JS-Test | /15-toString,valueOf调用时机/main.js | UTF-8 | 659 | 3.46875 | 3 | [] | no_license |
var obj = {
toString:function(){
console.log('toString')
return Object.prototype.toString.call(this)
},
valueOf:function(){
console.log('valueOf')
return Object.prototype.valueOf.call(this)
}
}
console.log(obj); // toString valueOf
console.log(+obj);
console.log(obj=={});
console.log(ob... | true |
fb7aa3d1b3a1927fb4193d5f3ea40ee0d4ce1430 | JavaScript | Faye0211/Website-background-Management-System | /js/categoryFirst.js | UTF-8 | 2,962 | 2.984375 | 3 | [] | no_license | var letao;
$(function() {
letao = new Letao();
letao.getCategoryFirst();
letao.addCategoryFirst();
letao.getPage();
});
var Letao = function() {
}
var page = 1;
var pageSize = 5;
Letao.prototype = {
//查询一级分类列表的数据并渲染
getCategoryFirst: function() {
// 1. 请求查询一级分类的API
$.ajax({... | true |
b69553d50c6e73f0d7162d850bfd3f42e503c929 | JavaScript | 2001saurabh/portfolio | /src/components/contact/Contact.jsx | UTF-8 | 1,668 | 2.625 | 3 | [] | no_license |
import {useState} from "react";
import "./contact.scss";
import {db} from "../../fire";
const Contact = () => {
const [name, setName] = useState("");
const [email, setEmail] = useState("");
const [message, setMessage] = useState("");
const [loader, setLoader] = useState(false);
const handleSubmit = (e... | true |
1a3e562506d83e3b4f4ad681b3eae194e266fd98 | JavaScript | danbalducci/danbalducci.github.io | /sketch.js | UTF-8 | 838 | 2.921875 | 3 | [] | no_license |
var cap;
var img;
var offset = 0;
var easing = 0.05;
function setup() {
createCanvas(400, 400);
cap = createCapture(VIDEO);
cap.hide();
imageMode(CENTER);
}
function draw() {
background('#f7f5ef');
image(cap, mouseX, mouseY, 400, 400);
if (mouseX > 400) {
background('#5d7bb7');
image(cap, mouseX, mouseY, 40... | true |
6593e29206e0f25e84093ff3368f4c571261e6b0 | JavaScript | appswall/AmongUsWeb | /Chat/index.js | UTF-8 | 448 | 3.296875 | 3 | [
"MIT"
] | permissive | 'use strict'
let characterCollection = document.getElementsByClassName("colorWrapper");
let characterArr = [].slice.call(characterCollection);
let oldTarget = "";
characterArr.forEach(element => {
element.addEventListener("click", selectCharacter);
});
function selectCharacter(e){
if (oldTarget != ""){
... | true |
651e81b614b5f7879542341b60543ac46838b292 | JavaScript | MiningCow/tetris-inventory-test | /item.js | UTF-8 | 3,359 | 3.1875 | 3 | [] | no_license |
class Item {
constructor({ x, y, color, origin = {x: 0, y: 0}, shape }) {
this.shape = shape;
this.origin = origin;
this.x = x;
this.y = y;
this.color = color;
this.id = Date.now();
}
rotateLeft() {
let shape = this.shape;
let newShape = [];
let xMax = shape[0].length;
let... | true |
81eda8f3b1189cf67be73f83c711046148901bb3 | JavaScript | Simon0925/project01 | /js/rebus.js | UTF-8 | 5,159 | 3.078125 | 3 | [] | no_license | class Rebus extends HTMLElement {
constructor() {
super()
this.shadow = this.attachShadow({ mode: "closed" })
}
connectedCallback() {
}
static get observedAttributes() {
return ["markup", "css"]
}
attributeChangedCallback(attrName, oldVal, newVal) {
fetch... | true |
ab9038c3d17f7a926d6ba3c4b1cd03ae6e2f30e2 | JavaScript | warderer/clase-dev-app-web-03 | /08.ReproductorMusical/index.js | UTF-8 | 4,231 | 2.84375 | 3 | [] | no_license | // Alumnos: Vanessa Machuco, Alejandro Galindo
// Ingeniería en Diseño Multimedia - Universidad Autónoma del Carmen
let playlist = document.querySelector('.playlist');
let options = document.querySelector('.options');
function open_p() {
playlist.classList.toggle('active');
}
function sidebar() {
options.clas... | true |
7c262ab411a033841799d04084f583bb78b39a64 | JavaScript | bidiu/litemessage | /src/litenode.js | UTF-8 | 7,896 | 2.578125 | 3 | [
"MIT"
] | permissive | const WSClient = require('./wsc');
const { getSocketAddress } = require('./utils/network');
const { getCurTimestamp } = require('./utils/time');
if (BUILD_TARGET === 'node') {
// running in node
var EventEmitter = require('events');
var WSServer = require('./wss');
} else {
// running in browser
var EventEmi... | true |
e2e497b9a27021aa1ea3d3eaaabb57ab0392c53d | JavaScript | pramilakhanal/JESP-Wedding-Registry | /test.js | UTF-8 | 1,688 | 2.515625 | 3 | [] | no_license | var Nightmare = require("nightmare");
var expect = require("chai").expect;
var weddingRegistry = require("./models/wedding.js");
describe("Wedding Registry", function() {
// The default tests in mocha is 2 seconds.
// Extending it to 30 seconds to have time to load the pages
this.timeout(30000);
it("sh... | true |
ef8842432150ab4b4c03196480148cf12e4576ab | JavaScript | thinkful-ei19/Megan-DSA-Hashmaps | /linked-list.js | UTF-8 | 3,066 | 3.390625 | 3 | [] | no_license | 'use strict';
class _Node {
constructor(value, next){
this.value=value;
this.next=next;
}
}
class LinkedList {
constructor(){
this.head=null;
}
insertFirst(item){
this.head= new _Node(item, this.head);
}
insertBefore(item, putBefore){
if(this.head === null){
return this.inse... | true |
9187efe77051ef74b2024073ace18720e1a908b6 | JavaScript | Vimalraj21G/Angular-MP3-Player | /js/directives/dragAndDrop.js | UTF-8 | 3,381 | 2.765625 | 3 | [] | no_license | (function() {
var app = angular.module('mp3Player');
app.directive('draggable', function(){
return function($scope, $element) {
/**
* element[0] is the native JS object.
* Implies all HTML-Elements in scope
*/
var element = $element[0];
... | true |
c9bdffd5c89b08a806eaa10d7fdf428da66047f3 | JavaScript | Sadia-web/dynamic-grading | /script.js | UTF-8 | 2,353 | 3.6875 | 4 | [] | no_license | const banglaCalculate = document.getElementById('bangla-calculate');
const englishCalculate = document.getElementById('english-calculate');
const ictCalculate = document.getElementById('ict-calculate');
const totalCalculate = document.getElementById('total-calculate');
const banglaNumber = document.getElementById('ban... | true |
5a4527aa550e00300c644651db86490b85ee8702 | JavaScript | OnigiriJack/EJS | /ch1_3/fizzBuzz.js | UTF-8 | 448 | 2.96875 | 3 | [] | no_license | //Jack Fowler 3/13/18
//EJS for CC prepy
// I solved this one quickly, but I am sure there is a better way
//first output
let result = 1;
for (let count = 0; count < 100; count++){
if (result % 3 === 0 && result % 5 === 0){
console.log('FizzBuzz');
}
else if(result % 3 === 0) {
console.log('... | true |
dc3f5d294599a0b33240ef720b8d718d484db48a | JavaScript | even-lq/lq_fullstack | /js/js手写系列(es6用es5实现)/axios/axios.js | UTF-8 | 2,526 | 3.078125 | 3 | [] | no_license | // 拦截器
class InterceptorsManage {
constructor() {
this.handlers = []
}
use (fullfield, rejected) {
this.handlers.push({
fullfield,
rejected
})
}
}
class Axios {
constructor() {
this.interceptors = {
request: new InterceptorsManage(),
response: new InterceptorsManage()... | true |
852edca12721e941cc0c7c04648343fc2ecf4970 | JavaScript | danimoh/core | /clients/remote-core/server/AuthenticatedConnection.js | UTF-8 | 6,840 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | const Nimiq = require('../../../dist/node.js');
const WebSocket = require('ws'); // https://github.com/websockets/ws
require('../shared/HashMessageAuthenticationCode.js'); // gets bound to the Nimiq object
class AuthenticatedConnection extends Nimiq.Observable {
constructor(ws, authSecret) {
super();
... | true |
465d5571496d4230b46650edd49d25cd5af1c337 | JavaScript | scottbert/ObjectJS | /src/core/Events.js | UTF-8 | 3,513 | 2.84375 | 3 | [] | no_license | /*jslint bitwise: false, browser: true, windows: false, evil: false, white: false, plusplus: true */
/*globals ObjectJS:false,$:false, TestCase:false,assertEquals:false,expectAsserts:false,assertFunction:false,assertNoException:false*/
/**
* @author scottvanlooy
*/
(function (Oj) {
"use strict";
/** PRIVATE METHODS... | true |
ef3709d4620fc86e55a59581bfcd9973058e16ce | JavaScript | mstop4/tictactoeDB | /server/lib/dbHelpers.js | UTF-8 | 1,453 | 2.625 | 3 | [] | no_license | var db = require('../models');
var Game = db.Game;
addGame = (moves, winner) => {
// findOrCreate is bugged in Sequelize 4.8.0 + pg 7.2.0
Game.findOne({
where: {
moves: moves,
winner: winner.toUpperCase()
}
})
.then(game => {
// if game exists, update it
if (!game) {
return ... | true |
c0056b47048603781948b23e4ff8ca8defa21679 | JavaScript | ArthurTrauter/playground | /00-just-play/wordCount.js | UTF-8 | 327 | 2.734375 | 3 | [] | no_license | var ignore = /[\.,]/g,
separator = " ";
var wordCount = function (sentence) {
var wordCount = {},
words = sentence.replace(ignore, '').toLowerCase().split(separator);
for (var i in words) {
wordCount[words[i]] = wordCount[words[i]] + 1 || 1;
}
return wordCount;
}
exports.wordCount = word... | true |
e8728928a1734804df415c43e05ea2c940882dc3 | JavaScript | HigorSilvaRosa/challenge-accepted | /static/js/script.js | UTF-8 | 2,234 | 3 | 3 | [] | no_license | var locales = null;
var currentLocaleId = null;
$(document).ready(function () {
$('.modal').modal();
getLocales(function () {
var autoCompleteData = {}
for (var i in locales) {
autoCompleteData[locales[i]['name']] = null;
}
$('#search').autocomplete({
dat... | true |
1c9f394c2dacba2a31b549014ec8734301a11cc1 | JavaScript | AnyamahNdidi/counterAndBmiReactApp | /src/MainNav/Counter/Counter.js | UTF-8 | 1,055 | 2.640625 | 3 | [] | no_license | import './Counter.css'
import React, {useState} from 'react'
function Counter() {
const [counter, setCounter] = useState(0)
const increases = () =>{
setCounter(counter + 1);
}
const decrease = () =>{
setCounter(counter - 1)
}
const reset= () =>{
setCounter(0)
}
return (
<div className="counter... | true |
4726ee860b9a0c337304f9726da3e76f224339d2 | JavaScript | pkjq/node-red-contrib--cron | /cron-node.js | UTF-8 | 1,276 | 2.546875 | 3 | [
"MIT"
] | permissive | "use strict";
function CreateMsg() {
return {
payload: Date.now(),
};
}
module.exports = function(RED) {
function CronIn(config) {
const Cron = require('cron-pkjq');
RED.nodes.createNode(this, config);
try
{
let task = Cron.add(config.cronExpression,... | true |
612556f497f61adff1e346c1d3c738e8650726b0 | JavaScript | meetmehta26/mongo-Demo | /index.js | UTF-8 | 846 | 2.84375 | 3 | [] | no_license | const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/playground')
.then(() => console.log('connected to the mongo db'))
.catch(() => console.log("Error connecting to the db"));
const courseSchema = new mongoose.Schema({
name: String,
author: String,
tags: [String],
date: ... | true |
c7d92d9e8a73b345e89ebafb7a99e65ea5c8485b | JavaScript | fabioaguiar360/myWeatherApp | /src/components/weatherMainIcon.js | UTF-8 | 1,080 | 2.515625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { StyleSheet, Text, View, Image } from 'react-native';
import weatherApi from '../services/weatherApi';
import Icon from 'react-native-vector-icons/FontAwesome5';
export default function WeatherMainIcon() {
const [weatherIcon, setWeatherIcon] = useState({});... | true |
9718807072f16d9cc636431f2bab13ea00d057eb | JavaScript | spakerL/CSS3-bezier-online-editor | /js/beisaier.js | UTF-8 | 8,205 | 2.84375 | 3 | [] | no_license | var canvas=document.getElementById("canvas");
var ctx=canvas.getContext("2d");
canvas.width=400;
canvas.height=400;
var canvas1=document.getElementById("canvas1");
var ctx1=canvas1.getContext("2d");
canvas1.width=50;
canvas1.height=50;
canvas1.style.border="1px solid black";
var canvas2=document.getElementById... | true |
f6db12d6814988c916b880906970db3277fc71ce | JavaScript | mkothur/react-lifecycle | /src/components/Hack.js | UTF-8 | 571 | 2.8125 | 3 | [] | no_license | import React, {useEffect, useState} from 'react';
const Hack = () => {
const [count, setCount] = useState(0)
useEffect(() => {
// const parsedCount = Number(localStorage.getItem("count") || 0)
setCount(parsedCount)
}, []);
// useEffect(() => {
// localStorage.setItem("count", cou... | true |
1f8e02b0579b222ef80cbfb597b94835686c6c6a | JavaScript | waleed-401-advanced-javascript/data-structures-and-algorithms | /__test__/fifo-animal-shelter.test.js | UTF-8 | 3,232 | 3.296875 | 3 | [
"MIT"
] | permissive | 'use strict';
const AnimalShelter = require('../challenges/fifoAnimalShelter/fifo-animal-shelter');
describe('`AnimalShelter` class', () => {
it('Can successfully instantiate an empty animal shelter`', () => {
const as = new AnimalShelter();
expect(as).toBeDefined();
});
describe('`enqueue(animal)` met... | true |
ae3b0a51b5b81828a6c7bfe1f91480fa776803f8 | JavaScript | sola-da/LambdaTester | /experiments/promises/promiseRandom/test430.js | UTF-8 | 1,000 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* Created by marija on 22.02.18.
*/
var p1 = Promise.resolve(18);
var p2 = Promise.reject(17);
var callbackArguments = [];
var argument1 = {"157":"(","403":"","595":122,"":"",")":7.024657216925971e+307,"P!":""};
var argument2 = {"655":1.5102348299845583e+308,"":-100,"1.220902704214747e+308":"o&tJ","1.4... | true |
7d790f98c6529bbc94b3a255bcfbd4f3690993e6 | JavaScript | scub45t3v3/acceptable | /index.js | UTF-8 | 1,383 | 2.640625 | 3 | [
"MIT"
] | permissive | 'use strict';
// include dependencies
const {flatten} = require('underscore');
const mime = require('mime');
const debug = require('debug')('@scuba-squad:acceptable');
const acceptable = (...accept) => {
debug('build:acceptable(%o)', accept);
accept = flatten(accept)
.map((value) => {
value = `${value}`... | true |
bf1c045932c0113fc9e3a36709c0d7687a080771 | JavaScript | J-marchand/dev | /JS/J5 DRAGON SLAYER/Exercice/utilities.js | UTF-8 | 445 | 3.15625 | 3 | [] | no_license | 'use strict'; // Mode strict du JavaScript
/************************** FONCTIONS UTILITAIRES ************************ */
function getRandom(min, max)
{
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function requestInteger(message, min, max)
{
var number;
do
{
number = pa... | true |
71a6727f53ee8bb85eedae9d6f4d4082f038b381 | JavaScript | alanchang920/url-shortener | /shortener.js | UTF-8 | 612 | 3.515625 | 4 | [] | no_license | function sample(array) {
const index = Math.floor(Math.random() * array.length)
return array[index]
}
function shortener() {
const lowerCaseLetters = 'abcdefghijklmnopqrstuvwxyz'
const uppeerCaseLetters = lowerCaseLetters.toUpperCase()
const number = '1234567890'
let collecttion = []
collecttion = coll... | true |
154bddab6a390738002529d72214560334039cb0 | JavaScript | maserlin/DEMO | /WinCalculator.js | UTF-8 | 4,710 | 3.453125 | 3 | [] | no_license | /**
* This object is given the new reel positions as a mapping of symbols in view (column x row)
* and uses it to work out what if anything has been won.
* Sometimes all this information comes from the Server in a big XML or JSON chunk
* in which case you could use the DataParser to translate that into a game-frien... | true |
3156e1185bf2e13694dc0dbaf373ab33472e19b5 | JavaScript | Sriprog/Show-Hide-app | /src/components/ShowHide/index.js | UTF-8 | 1,214 | 2.71875 | 3 | [] | no_license | import {Component} from 'react'
import './index.css'
class ShowHide extends Component {
state = {isFirst: false, isLast: false}
ClickFirst = () => {
this.setState(prevState => ({isFirst: !prevState.isFirst}))
}
ClickSecond = () => {
this.setState(prevState => ({isLast: !prevState.isLast}))
}
re... | true |
36dd2f345237278dab62a5628c9d2af2d655ee16 | JavaScript | jkester1986/AoC2018 | /Day16p2.js | UTF-8 | 2,133 | 2.875 | 3 | [] | no_license | fs = require('fs');
fs.readFile('Day16p2.txt', 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
let directions = data.split('\n'),
register = [0,0,0,0];
directions.forEach((dir, i) => {
directions[i] = dir.split(' ').map(Number);
});
directions.forEach(dir => {
doDir(register, dir);
... | true |
f3d5c0dffdb31a9d7647ca9501276bbb7d6d80aa | JavaScript | rhysdoherty/my-first-repo | /if.js | UTF-8 | 2,672 | 4.15625 | 4 | [] | no_license | // practice if statements
//Rhys 13.08.19
//Weather
// let weather = 'sunny'
// if(weather == 'Sunny') {
// console.log('sunscreen')
// } else if (weather == 'rain'){
// console.log('No need for sunscreen')
// } else {
// console.log('no need for either')
// }
//Age
... | true |
7dd3093dfdd6dfc6a948deca3ad38f1e7e944710 | JavaScript | sebastianleivacamargo/fundamentos1 | /04/sketch.js | UTF-8 | 9,237 | 2.609375 | 3 | [] | no_license | //colores botones
var posXbot1 = 30;
var posYbot1 = 10;
var tambot1 = 20;
var posXbot2 = 60;
var posYbot2 = 10;
var tambot2 = 20;
var posXbot3 = 90;
var posYbot3 = 10;
var tambot3 = 20;
var posXbot4 = 120;
var posYbot4 = 10;
var tambot4 = 20;
var posXbot4 = 120;
var posYbot4 = 10;
var tambot4 = 20;
var posXbot5 = ... | true |
d8c13c45574e3b65f86ad7e6c670f9adda64ca8b | JavaScript | ZaynahGiti/TreeStructure-using-React | /src/reducers/index.js | UTF-8 | 1,480 | 2.84375 | 3 | [] | no_license | import { ADD_OBJECT, ADD_ARRAY, UPDATE, REMOVE_OBJECT, REMOVE_ARRAY, TOGGLE } from '../actions'
import { add, update, remove, desimplify } from 'simplifr'
export function reducer(state = {}, action){
const { path, value, key } = action
if (typeof path === 'undefined') {
return state
}
switch (action.type)... | true |
bac790c85d87861d9e216556b2efb506c47be61e | JavaScript | vovanmozg/html5drawing | /grid/gamerOneRandomMove.js | UTF-8 | 1,210 | 3.265625 | 3 | [] | no_license | function Gamer(matrix, x, y, oldColor) {
this.matrix = matrix;
this.x = x;
this.y = y;
this.oldColor = oldColor;
this.matrix.cells[this.x][this.y] = { r: 0, g: 100, b: 0 };
this.step = function (grid) {
const items = [[1, 0], [0, 1], [-1, 0], [0, -1]];
const item = items[Math.floor(Math.random() * ... | true |
fc30330fe014ef9a92453866855f3c9eaee7e710 | JavaScript | BrianValente/WAMOD-Themes-Website | /modules/dialog/script.js | UTF-8 | 1,824 | 3.25 | 3 | [] | no_license | var dialog = document.getElementById("dialog");
var dialogTitle = document.getElementById("dialog_title");
var dialogContent = document.getElementById("dialog_content");
var dialogCloseBtn = document.getElementById("dialog_buttons_close");
var dialogYesBtn = document.getElementById("dialog_buttons_yes");
var dialogNoBt... | true |
824ef8ef1a7babe0d62725ba7c01ee778f53debb | JavaScript | no-vac/SenselessFish | /src/fish.js | UTF-8 | 2,290 | 3.078125 | 3 | [] | no_license | const XOFFSET = 50;
const YOFFSET = 150;
const STEPS = 7;
const STEPTIME = 6000;
function createFish(username, isXmas) {
console.log(isXmas);
let randomId = Math.round(Math.random() * 1000);
let fishwrapperEl = document.createElement('div');
fishwrapperEl.classList.add('fishwrapper');
fishwrapperEl.setAttri... | true |
626693b19cf2f3291c72b088ef302df731fcbabc | JavaScript | luttingere/simpleXMLHttpRequest | /httpClient.js | UTF-8 | 1,283 | 2.65625 | 3 | [] | no_license | function enviarCorreo() {
var valorDelTexto = document.getElementById("dataAEnviar");
var email = document.getElementById("email");
console.log("Enviando Correo");
xhr = new XMLHttpRequest();
xhr.open('POST', 'http://54.202.10.0/reaxium_data_sender_node1/EmailService/send');
xhr.setRequestHeader... | true |
7f88623e801265036c0b5a1713eea61ed511fc13 | JavaScript | railslove/kickerapp-mobile | /src/components/ExampleComponent.js | UTF-8 | 1,527 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react'
import { TouchableOpacity, Text, View } from 'react-native'
import PropTypes from 'prop-types'
type Props = {
counter: PropTypes.string,
increment: PropTypes.func,
decrement: PropTypes.func
}
class ExampleComponent extends Component<Props> {
render() {
const { cou... | true |
2956022e5d1d52ba8c6b0a7a325693c4d1ff1c1b | JavaScript | akash-verma-18/Web-Dev-Theory | /Class-1/Memory/Example2.js | UTF-8 | 174 | 2.921875 | 3 | [] | no_license | //hoisting means memory allcation
//memory is allocated to function statement-function will be created in heap
fn();
function fn() {
console.log("Hello from fn");
}
fn(); | true |
16c2e30d7b498b89306e9f9231e2fbe7453fbecf | JavaScript | dwandrew/Code-practise | /JS/hackerank joined logger.js | UTF-8 | 370 | 3.203125 | 3 | [] | no_license | function joinedLogger(level, sep) {
// write your code here
let array = []
return function f(...messages){
messages.forEach(message =>{
if (message.level >= level){
array.push(message.text)
}
})
console.log(array.join(`${sep}`))
let string = ... | true |
3227d4e49ac280cc114c80bfcdadfd3831127333 | JavaScript | kemitchell/mathsync | /javascript/core/test/stream.js | UTF-8 | 2,545 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /* global describe, it */
'use strict';
var stream = require('../stream');
var assertSetEquals = require('./utils').assertSetEquals;
var assertSummaryContains = require('./utils').assertSummaryContains;
var Readable = require('stream').Readable;
var util = require('util');
function ArrayStream(items) {
Readable.c... | true |
91fd6742c8b548bb51c6bfaa9c7408b1c0fdf20d | JavaScript | aliceliu/randomzen | /server.js | UTF-8 | 2,008 | 2.765625 | 3 | [] | no_license | var express = require("express");
var pos = require('pos');
var request = require('request');
var app = express();
app.set("view engine", "ejs");
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
var home = function(req, res) {
//request({url:"https://archive.org/stream/ho... | true |
c363ba5006a7310f3c2d0cfe8bc0f211dd569305 | JavaScript | sdolard/node-netmon | /lib/plugin/script/console-log.js | UTF-8 | 710 | 2.578125 | 3 | [] | no_license | /*
TASK CONFIG EXAMPLE
{
"jobs": [
{
"cronTime": "* * * * * *",
"description": "Each seconds",
"enabled": true,
"task": [
{
"enabled": true,
"action": "script",
"description": "console log (cronTime tester)",
"config": {
"script": "console-log",
"log": "Hello world"
... | true |
dab605e79e9b5b67643a9e1a9604e47e19d3659f | JavaScript | MarkAYoder/BeagleBoard-exercises | /realtime/tempServer.js | UTF-8 | 3,706 | 2.546875 | 3 | [] | no_license | #!/usr/bin/node
// From Getting Started With node.js and socket.io
// http://codehenge.net/blog/2011/12/getting-started-with-node-js-and-socket-io-v0-7-part-2/
// This is a general server for the various web frontends
// buttonBox, ioPlot, realtimeDemo
"use strict";
var port = 9090, // Port to listen on
http = re... | true |