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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f964d0478de4a750321ba8a17fe3955ec955a613 | JavaScript | MonaTem/galvanize-react-crud | /src/UpdateProductForm.js | UTF-8 | 1,118 | 2.609375 | 3 | [] | no_license | import React from 'react';
class UpdateProductForm extends React.Component {
constructor(props) {
super(props);
this.state = {
name: props.product.name,
priceInCents: props.product.priceInCents
};
this.handleSubmit = this.handleSubmit.bind(this);
this.handleChange = this.handleChange.... | true |
6dd4cf6a25fe4ebb8ab4661acb411658fe4c9d4c | JavaScript | o-todorov/SoftUni | /JS Advanced/Exercises/04.DOM-Introduction/08. Generate Report/report.js | UTF-8 | 1,002 | 3.125 | 3 | [] | no_license | function generateReport() {
let heads = Array.from(document.querySelectorAll('table thead th input'))
.map((x, i) => [x.getAttribute('name'), i, x.checked])
.filter(x => x[2])
.reduce((obj, [name, index]) => {
obj[name] = index;
... | true |
7b92ca97f2643044ce273ed1afa2815a27c8abde | JavaScript | jeet-mahesh-shirodkar/10_Days_Of_Javascript | /06_switch.js | UTF-8 | 1,970 | 4.34375 | 4 | [] | no_license | /**
* Task
Complete the getLetter(s) function in the editor.
It has one parameter: a string, s, consisting of lowercase English alphabetic letters (i.e., a through z).
It must return A, B, C, or D depending on the following criteria:
If the first character in string s is in the set {a,e,i,0,u}, then return A.
If th... | true |
0d5b90f1647bb6f2f6f9281bf38de90598d78cfa | JavaScript | dsgreve/js-bootcamp | /basics/numbers.js | UTF-8 | 313 | 3.453125 | 3 | [] | no_license | let age = 30
//remember My Dear Aunt Sally - order of operations
let dogYears = (age + 1) / 7
console.log(dogYears);
let totalQuestions = 30;
let questionsCorrect = 18;
let percentage = Math.ceil((questionsCorrect / totalQuestions) * 100);
console.log("You're percentage on the test is " + percentage + "%");
| true |
042f4d390e5d088f7c10d6c5ae60e5dab9a55040 | JavaScript | georanma/postcss-debug | /webdebugger/src/theming/index.js | UTF-8 | 1,054 | 3.234375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Those are the availably themes
// and the values are the CSS class names you have to set on the <body> to
// use the theme
const THEME_RED = ''
const THEME_DARK = 'dark__theme'
const LS_THEME_KEY = 'theme'
let activeTheme = THEME_RED
function setTheme (theme) {
const prevTheme = activeTheme
activeTheme = them... | true |
8bd6b554cba8bcff70763db7ee1f6330c4826207 | JavaScript | pranavipranitha/Assignments | /java.js | UTF-8 | 1,622 | 2.78125 | 3 | [
"MIT"
] | permissive | function mylogin(){
var val1 = document.getElementById("username").value;
var val2 = document.getElementById("password")
if(/^[2][2][1][7][1][0][3-4][0][0-5][0-9][0-9][0-9]$/.test(val1)){
if(val2 == "LS123@"){
window.alert("LOGIN SUCESSFULL");
window.open("home.html","+... | true |
fab527ac7c55854eaa8e1034b47af2366b4866bc | JavaScript | anun05/Work-schedule-hw | /assets/script.js | UTF-8 | 1,188 | 2.953125 | 3 | [] | no_license | var dT = moment();
$("#dateTime").text(dT.format("dddd, MMMM Do YYYY"));
var textInput = document.querySelectorAll("#Input");
var saveBtn = document.querySelectorAll("#keep-btn");
function textTable() {
for (var i = 0; i < 19; i++){
$('#keep-btn' + i).click(savedData);
}
};
textTable()
function ... | true |
159591d649f25cc643ef47affe498c689817d65f | JavaScript | badeggg/magicCubeReal | /lib/server.js | UTF-8 | 2,296 | 2.640625 | 3 | [] | no_license | //2015/8/24 start
//本模块文件负责后台接口支持(中间件)
exports.check = function(obj){
//用于验证username,email是否被已被占用;如果username和password同时都被提供了,则用于验证登录
//参数obj是一个对象,包含着实际的有用的参数
/*例:{
* req: req,
* res: res,
* db: db,
* username: 'username',
* email: 'email address@gmail.com',
* password: '123456',
* callback: func
* }
*/
var re... | true |
eb524f8326c868e0c82657f09a6dfdf9e8d660cf | JavaScript | ianobermiller/react-style | /lib/__tests__/applyStyles-test.js | UTF-8 | 4,945 | 2.625 | 3 | [
"MIT"
] | permissive |
jest.dontMock('../applyStyles');
function fakeStyle(className, style, isCompiled) {
return {
className: className,
style: style,
isCompiled: function() { return isCompiled; }
};
}
describe('applyStyles', function() {
it('applies compiled styles', function() {
var applyStyles = require('../appl... | true |
ff39cf0f50ea4fd745a5002892f08ea540c6ecfa | JavaScript | Cermic/Shellshock | /website/js/projectile.js | UTF-8 | 3,585 | 2.921875 | 3 | [] | no_license | //Global Member Variables//
var m_damage;
var m_hitRadius;
var m_lifespan;
var m_sprite;
var isAlive;
var currentLifetime;
var explosionEmitter;
var trailEmitter;
var m_explosionCount;
var m_explosionParticleKey;
var m_trailParticleKey;
var damagedone;
var snailHit;
//Contructor//
function Projectile(damage, hit... | true |
3cdb29af71fdea84da30f6d972ac036c77119e5c | JavaScript | charliewhyman/rockpaperscissors | /script.js | UTF-8 | 3,154 | 4 | 4 | [] | no_license | let resultArray = ['ROCK', 'PAPER', 'SCISSORS'];
let playerScore = 0;
let computerScore = 0;
let computerSelection = computerPlay();
//create a results div and display the score
const container = document.querySelector('.container');
const content = document.createElement('div');
content.classList.add('content');
con... | true |
5adf76efa51be56350de3f8169ed4a16a3e78919 | JavaScript | ztavruz/cerebly.xyz | /templates/beznevroza/assets/js/playPauseAudioAdmin.js | UTF-8 | 388 | 2.53125 | 3 | [
"MIT"
] | permissive | function togglleState(event){
event = event || window.event
var target = event.target || event.srcElement
var audioTg=document.getElementById('audio'+target.id);
if(target.className==="admin-pause-button"){
target.className="admin-play-button";
audioTg.pause();
}
else{
ta... | true |
84e4ecf0b51eba73b9ebe4a64a00dbb718ddd90b | JavaScript | PiotrDabkowski/Js2Py | /tests/test_cases/built-ins/Array/S15.4.5.1_A2.1_T1.js | UTF-8 | 1,108 | 3.1875 | 3 | [
"MIT"
] | permissive | // Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: >
If P is not an array index, return
(Create a property with name P, set its value to V and give it empty attributes)
es5id: 15.4.5.1_A2.1_T1
description: P in [429496... | true |
9df9a7c6817678efd44859c184ca9d7355a63f7b | JavaScript | dmswl27/node-practices | /project-ex02/app-ex01.js | UTF-8 | 227 | 2.53125 | 3 | [] | no_license | /*
douzone-busan-eunji.js 모듈 테스트
*/
const dzMath = require('../douzone-busan-eunji/douzone-busan-eunji');
console.log(dzMath.sum(1,2,3,4));
console.log(dzMath.max(-1,-2,-3,-4));
console.log(dzMath.min(-1,2,-3,4)); | true |
9c464bf614e32683b78e2ff3864ccc231d23dd55 | JavaScript | MariusRumpf/max31865 | /examples/index.js | UTF-8 | 617 | 2.796875 | 3 | [] | no_license | const MAX31865 = require('../index');
const sensor = new MAX31865();
async function startReading() {
const raw = await sensor.readRtd();
console.log(`Raw RTD value: ${raw}`);
const resistance = await sensor.getResistance();
console.log(`Resistance: ${resistance} Ω`);
const tempC = await sensor.getTemperat... | true |
adaa6557de23a8fab729dd3ef31e1a47c12da7d5 | JavaScript | aysa-wlh13/personal-project | /server/controllers/patientController.js | UTF-8 | 716 | 2.515625 | 3 | [] | no_license | module.exports = {
getPatient: (req, res) => {
const db = req.app.get('db');
const {firstname, lastname} = req.session.user
let name = `${firstname} ${lastname}`
console.log(typeof name)
db.get_patient(name).then(result => {
res.status(200).send(result)
})... | true |
6f1eadec9206483ff1482898c8dee4fe5913bbc8 | JavaScript | EmanuelJunior/Contenidojavascript | /Junior Level/15 Metodos de array Javascript/codigo.js | UTF-8 | 11,125 | 4.65625 | 5 | [] | no_license | /*METODO DE ARRAY*/
/*
NombreArray.pop() -> Este metodo de array funciona para borrar el ultimo elemento
de nuestro array creado. EJEMPLO
let frutas = ["Banano","Naranja","Guanabana"];
let resultado = frutas.pop(); -> Esto lo que hara es borrar el elemento
de nuestro array llamado -> "Guanabana"
Osea que si miramos ... | true |
4a8df9bd9c551221dc455b25e0bcea994d4225fd | JavaScript | Fazerting/Poisson | /mini.js | UTF-8 | 8,829 | 2.703125 | 3 | [] | no_license | var express = require('express'); // Serveur web
//app = express();
var app=express().use(express.static(__dirname + '/public'));
//app.listen(8080);
server = require('http').createServer(app);
io = require('socket.io').listen(server); // Utilisation des sockets, techno de transfert d'infos entre client et serveur
//se... | true |
1aeecb8afb9e376dd4929ba99d25fcb1adfe1e10 | JavaScript | matijaOne/WebDiP_student_project | /js/matljesca.js | UTF-8 | 4,567 | 3.4375 | 3 | [
"MIT"
] | permissive |
var predaja1=false;
var element=document.getElementById("naziv_proizvoda");
var element2=document.getElementById("opis_proizvoda");
var element3=document.getElementById("datum_proizvodnje");
var element4=document.getElementById("vrijeme");
var element5=document.getElementById("kolicina");
var element6=document.getEle... | true |
5e334046931cf2ba6f31f335ca01f450650f2010 | JavaScript | Arquisoft/viade_es5a | /src/model/friend/friend.js | UTF-8 | 337 | 2.703125 | 3 | [
"MIT"
] | permissive | export default class Friend {
webId = '';
/**
*
* @param {String} webId
* @param {String} name
* @param {Image} image
*/
constructor(name, image) {
this.name = name;
this.image = image;
}
getIdentifier() {
if (this.name && this.webId)
return `${this.name}_${this.webId}`;
return ... | true |
e3cf23893b7780a776a60f17bad6b98a9766e99a | JavaScript | edgemony-coding-bootcamp/codingbootcamp-2 | /02-11-2021/objects.js | UTF-8 | 513 | 3.453125 | 3 | [
"MIT"
] | permissive |
// Creo un oggetto vuoto con {}
const movie = {
title: "Free Guy",
year: 2021,
director: "Shaun Levy",
cast: ["Ryan Raynolds", "Jodie Comer"],
details: {
cameos: true,
isFunny: true,
realistic: false
},
genre: "comedy",
duration: 115,
};
console.log('Oggetto:', movie);
console.log('Sing... | true |
78acda8dcb4c4c86bf6fb33f4775da4ab7b35896 | JavaScript | ivailopapazov/TelerikAcademy | /JavaScript-Fundamentals/Exam-Preparation/3.ClojureParsing.js | UTF-8 | 2,534 | 3.296875 | 3 | [] | no_license | function Solve(input) {
var operands = {};
input = input.map(getExpressionArray);
var expression = '';
var result;
for (var i = 0; i < input.length - 1; i++) {
expression = input[i][0];
if (input[i].length == 2) {
var innerExp = evaluateExpression(input[i][1]);
if (innerExp === 'zero') {
return 'D... | true |
f720bc1f3c12b52f20c06a26bdc4b7e73ca363ed | JavaScript | eddiecityu/T-Academy-1 | /Homeworks/JavaScriptUIandDOM/Canvas/bounceLines.js | UTF-8 | 2,399 | 3.5625 | 4 | [] | no_license | var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var x = 0,
y = 120,
leftBoundary = 0,
topBoundary = 0,
rightBoundary = canvas.width,
bottomBoundary = canvas.height,
direction = 'DR',
countCrashedInBoundary = 0,
color = '',
fixedY,
fixedX;
/... | true |
722bb9bbf7ddd3b2206f564eebe8c2c236641bc9 | JavaScript | coicoin/JavaScript | /get_salary.js | UTF-8 | 154 | 3.046875 | 3 | [] | no_license | function getSalary(rate, days) {
days = days || 22;
return rate * days;
}
getSalary(3, 10); // 30
getSalary(1); // 22
getSalary(2, 0); // 44 | true |
d9806a63dacfcad3aea769bbc57edb0fa65fa1d4 | JavaScript | Ajver/cscandemo | /EXPORT/tagger-can/demo-js-app.js | UTF-8 | 1,260 | 2.875 | 3 | [] | no_license |
window.addEventListener('load', () => {
// Called 20 times per second
window.setInterval(() => {
if(window.gatewayToJS.hasEvent()) {
do {
const event = window.gatewayToJS.popEvent();
onEvent(event.name, event.data);
}while(window.gatewayToJS.hasEvent());
window.gatewayToJS.clearEventsArra... | true |
4fd2d9c7ef763fc80d16166395575149a8fea44c | JavaScript | s12he/webpack-demo | /src/a.js | UTF-8 | 413 | 2.828125 | 3 | [] | no_license | // a模块需要使用d.js模块的cal方法,所以在使用之前先将该模块导入进来
var moduleD=require("./d");
// a模块
var anum=10;
function init(){
// 在这里调用来自d.js模块的cal方法
moduleD.cal(5111);
console.log('我来自a.js');
}
// node.js中暴露访问接口的方式,将该模块的方法通过mudule.exports暴露给外部使用
module.exports= {
init
}
| true |
72507a35360101af32544908ca08a98fc92448ad | JavaScript | luopeng95/goweb | /2020.4.1/练习/查询数组返回对象.js | UTF-8 | 899 | 4.09375 | 4 | [] | no_license | let find1 = arr => {
let obj = {}
let num = arr.map(e => e);
// console.log(num)
for(let i = 0; i < num.length; ++i){
let count = 1;
for(let j = num.length - 1; j > i; --j){
if(num[i] === num[j]){
++count;
num.splice(j, 1);
}
... | true |
0f774524b502c10c44f0f47f9a3e34c0a88debd0 | JavaScript | indocomsoft/CS1101S-indocomsoft | /Contests/contest-7.1.js | UTF-8 | 973 | 3.3125 | 3 | [
"BSD-2-Clause"
] | permissive | // Source Week 5, curve
// Your submission here
function julius_curve_contest_0(){
// draw_connected_squeezed_to_window 200
return function(t){
var t2 = t * 2 * math_PI;
return make_point(16 * math_pow(math_sin(t2), 3),
13 * math_cos(t2) - 5 * math_cos(2 * t2) - 2 * ma... | true |
165a641593dd4c881ce37c8a425fd59a3fb74ac3 | JavaScript | wallaceyuan/2018Learning | /39.react/diff.js | UTF-8 | 2,298 | 3.375 | 3 | [] | no_license | /**
* 在dom diff中如何识别和处理key
*/
const REMOVE = 'REMOVE';
const INSERT = 'INSERT';
class Element {
constructor(tagName, key, children) {
this.tagName = tagName;
this.key = key;
this.children = children;
}
render() {
let element = document.createElement(this.tagName);
e... | true |
d6568aff8eb942518a1f9dd62bbe45b5ec2cc5e7 | JavaScript | Homamjabir/II1302-Projects_and_Project_Methods | /web-app/src/UserAccount/UserAccount.js | UTF-8 | 2,612 | 2.78125 | 3 | [] | no_license | /*
Author: Sebastian
Co-Authors:
*/
import * as firebase from 'firebase';
import Observable from './Observable';
import CONFIG from '../Database/configFirebase';
import UserDB from '../Database/UserDB';
/**
* Handles the user authentication
*/
class UserAccount extends Observable {
constructor(props) {
sup... | true |
97ccbcbebb17cecdfa537518034ff19856d44350 | JavaScript | igrolom/country-side | /js/script.js | UTF-8 | 1,149 | 3.21875 | 3 | [] | no_license | "use strict";
// Reveal sections
const allSections = document.querySelectorAll(".section");
const revealSection = function (entries, observer) {
const [entry] = entries;
// console.log(entry);
if (!entry.isIntersecting) return;
entry.target.classList.remove("section--hidden");
observer.unobserve(entry.targe... | true |
65e8fd182de4d0b197c2cf6e56b68219b606a776 | JavaScript | OlegTch/goit-js-hw-07 | /js/task-02.js | UTF-8 | 1,111 | 3.765625 | 4 | [] | no_license | const ingredients = [
'Картошка',
'Грибы',
'Чеснок',
'Помидоры',
'Зелень',
'Приправы',
];
// console.log(ingredients);
const listEl = document.querySelector('ul#ingredients');
const elements = ingredients.map(ingredient => {
const itemEl = document.createElement('li');
itemEl.textContent = ingredient;
... | true |
ec365959859339662b870ba0e119a99a039b77af | JavaScript | KaribelBT/practica-javascript | /clase 18 - 25/js/script25.js | UTF-8 | 404 | 3.515625 | 4 | [] | no_license | let numero1 = parseInt(prompt ("Ingrese el primer número:"));if (numero1 > 10) {
numero1 = parseInt(prompt ("Ingrese un nuevo número:"));
if (numero1 > 100) {
alert ("A");
} else {
alert ("B");
}
} else {
numero1 = parseInt(prompt ("Ingrese un nuevo número:"));
if (numer... | true |
35b37062480df6b67b716549114a21d6e5b3fb8b | JavaScript | frontend-studios/callisto-4 | /resources/js/src/app/components/customer/AddressSelect/ShippingAddressSelect.js | UTF-8 | 1,389 | 2.515625 | 3 | [] | no_license | var CheckoutService = require("services/CheckoutService");
Vue.component("shipping-address-select", {
template: "<address-select v-on:address-changed=\"addressChanged\" address-type=\"2\" :address-list=\"addressList\" :selected-address-id=\"selectedAddressId\"></address-select>",
props: ["addressList", "sele... | true |
3026f9faefc24d43a9145a8908d616d0cf9bc274 | JavaScript | ibrikk/salebase | /helpers/dbHelpers.js | UTF-8 | 4,374 | 2.703125 | 3 | [] | permissive | //TYPES OF QUERIES:
//Get top products overall
//Get top products for a given month
//Get top vendor (the one who has the most order_items)
//Get top month
module.exports = (db) => {
//Get all items based on item id
const getItems = () => {
const sql = { text: `SELECT * FROM items;` };
// const sql = { te... | true |
cbc3814964ddfa29197a92cd5c76a986e39a7ec2 | JavaScript | opws/copldots | /index.js | UTF-8 | 5,455 | 2.8125 | 3 | [
"MIT"
] | permissive | function copldotsCloneContractedPropertiesLayer(properties, opts) {
return {
type: 'object',
properties: copldotsClonePotentiallyCondensedProperties(properties, opts),
minimumProperties: 1
};
}
function copldotsClonePotentiallyCondensedProperties(source, opts) {
var clone = {};
var keys = Object.ke... | true |
357944c53838525a7d19f7c0f86823b5dc0d2076 | JavaScript | elsa-dev-full/canvas-animation-muscular | /js/tentacles.js | UTF-8 | 49,665 | 2.5625 | 3 | [] | no_license |
/**
* Copyright (C) 2012 by Justin Windle
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, ... | true |
5c2ba72c0140e9ee71d7853fa78c75efa5724342 | JavaScript | SRBusiness/backbone-tasklist | /src/views/task_view.js | UTF-8 | 1,520 | 2.859375 | 3 | [
"MIT"
] | permissive | import Backbone from 'backbone';
import Task from '../models/task';
const TaskView = Backbone.View.extend({
// this will run any time you create a new instance
initialize(params) {
this.template = params.template;
// listens for change events and calls renders and redraws the view when it hears a change e... | true |
1c0712bc87166263e4a2495436a55a61f933fe3e | JavaScript | sbarroso/MongoDbForNodeJsDev | /Week2/homeworks/hm2-4.js | UTF-8 | 661 | 3.640625 | 4 | [] | no_license | /*
Homework: Matching a specific array element
What is the title of the first movie returned for a query that selects all movies listing "Sweden" second among countries of origin.
Please copy and paste the title from the document in which it appears. Do not include the quotes around the title in your answer.
(You may ... | true |
1e8b4fd64a55d7d7fc4fb0adb462a4ef3face384 | JavaScript | zsvorenova/worldMap | /js/logic_world_ZSV_NEW.js | UTF-8 | 13,047 | 3.046875 | 3 | [] | no_license | // 1. define variables needed
// svg size
var width = 960,
height = 480;
//var svg = d3.select('svg');
// define svg location on the website
var svg = d3.select("#worldMap")
.append("svg")
.attr("width", width)
.attr("height", height);
// var for projection type
var projection = d3.geoNaturalEarth1();... | true |
718b18383f1db80c5d035325af252472f0fb733e | JavaScript | theotestaccount/mturktest | /js/iq1.js | UTF-8 | 1,165 | 3.046875 | 3 | [] | no_license | // Initialize Firebase
firebase.initializeApp(firebaseConfig);
$(".submit-btn")[0].addEventListener("click", writeTest1AnswerToFirebase);
var answerButtons = document.getElementsByName("answerButtons");
var id;
var answer;
var isRight;
$(document).ready(function() {
getID()
});
function getID() {
id = localSto... | true |
5d31400fa18dcd144d5d38f5c39c31b618d94058 | JavaScript | SalsabeelJaafreh/check_point1 | /back-end/controllers/jobController.js | UTF-8 | 706 | 2.859375 | 3 | [] | no_license | var job=require('../models/Job.js')
// Create a new job in the database
exports.createJob = function (req, res) {
// TODO
var info=req.body;
var jobinstance=new Job({
company:info.company,
title:info.titile,
description:info.description,
postedDate:info.postedDate,
salary:info.salary
})
jobinst... | true |
a6e87a6ff83b5b52133302b9d193c5751fc29e0e | JavaScript | tudautroccuto741/basis-boutique-FE- | /public/resources/views/loginForm/vadilator.js | UTF-8 | 4,640 | 2.984375 | 3 | [] | no_license | // Viết mã JS tại đây
function Validator(options){
var selectorRule = {};
function getParent(element, selector) {
while(element.parentElement){
if(element.parentElement.matches(selector)){
return element.parentElement;
}
element = element.parentElement;
}
}
var formEleme... | true |
4bbc585b723f6341029365a3c0ac939532caedea | JavaScript | dav1app/mixzoid | /src/3d/components/hud.js | UTF-8 | 898 | 3.078125 | 3 | [
"Unlicense"
] | permissive |
import { Texture, Mesh, MeshBasicMaterial, PlaneGeometry, Group } from 'three'
export class HUD {
constructor () {
const hudCanvas = document.createElement('canvas')
// Get 2D context and draw something supercool.
const hudBitmap = hudCanvas.getContext('2d')
const fontSize = 20
hudBitmap.fillSt... | true |
9af2af3e14da5c049ac7df10a25ac9f50a48d0f5 | JavaScript | MJ-0001/google-books-search | /client/src/pages/Home.js | UTF-8 | 3,273 | 2.734375 | 3 | [
"MIT"
] | permissive | import React, { useState, useRef } from 'react';
import Book from "../components/Book";
import { Container, Row, Col } from '../components/Grid'
import { FormBtn } from "../components/Form";
import API from '../utils/API';
function Home() {
const [books, setBooks] = useState([]);
const findBooks = (query) => {
... | true |
a0f269898bdfacd617f35e7c4964ca3db0ee0369 | JavaScript | Uni-Portal/portalCode | /public/assets/search.js | UTF-8 | 1,844 | 2.703125 | 3 | [] | no_license | const users = [];
try {
for (var i = 0; i < $(".teacher").length; i++) {
let email = document
.querySelectorAll(".teacher-email")
[i].innerHTML.split("@");
let domain = email[1].split(".");
let modifiedEmail = email[0] + domain[0] + domain[1];
const u = {
name: document
.quer... | true |
b275a16386f1d09fa3f05e19ae98926c77d2b589 | JavaScript | andresfm8/HTN2021 | /client/src/components/qr-code/QrCode.js | UTF-8 | 394 | 2.578125 | 3 | [] | no_license | import QRCode from "qrcode";
import { useEffect, useState} from "react";
const QRCodeGenerate = ({link}) => {
const [src, setSrc] = useState("");
useEffect(() => {
QRCode.toDataURL(link).then((data) => {
setSrc(data);
})
}, [link]);
return (
<div>
QR Code:
<img src={src} />
... | true |
6b1d1b87ccf946ed9a3761ede5bfbe7167d7abdb | JavaScript | twynsicle/ti-fastbuild | /lib/zip.js | UTF-8 | 1,287 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | 'use babel';
/* eslint-disable no-undef */
const fs = require('fs');
const Promise = require('bluebird');
const JSZip = require('jszip');
export default class Zip {
constructor(path, console) {
this.path = path;
this.console = console;
}
async load() {
try {
let data = await this.readFile();
this.zip... | true |
b10c8d65f92c7e47710e14346529a1820ebb2517 | JavaScript | matheusbronca/reactdogs | /src/context/UserContext.js | UTF-8 | 2,151 | 2.59375 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { TOKEN_POST, TOKEN_VALIDATE_POST, USER_GET } from '../services/api';
export const UserContext = React.createContext();
export const UserStorage = ({ children }) => {
const [data, setData] = React.useState(null);
const [login, setLogin] = React.useState(null);
const [loading, s... | true |
f588123bf9a7c8da68944dd290c83a2ce499350d | JavaScript | HotJuly/SZ200610 | /3.微信小程序/02.代码/wechat-init/pages/index/index.js | UTF-8 | 3,939 | 2.890625 | 3 | [] | no_license | Page({
data:{
/*
数据流
Vue ->单向 ->双向数据绑定v-model
<input v-model="msg">
两个过程:
:value="msg"
当input内容发生变化的时候,修改msg
input||change
onchange="event=>this.msg=event.target.value"
React ->单向
小程序 单向数据流
*/
msg:"我是初始数据",
... | true |
878be6bb3eb12abfb21b7ad23fdcdc0b16de94f8 | JavaScript | elenasonn/di-2019 | /2.mapping-time/work 2/sketch.js | UTF-8 | 412 | 3.3125 | 3 | [] | no_license |
function setup() {
// set the width of the box
createCanvas(720, 400)
}
function draw () {
// gray box in the background
background(145)
//rectangle orange
fill (244, 109, 30)
rect(40, 50, 40, 50);
rect(100, 60, 50, 60);
fill (134, 289,111)
rect(80, 90, 80, 90)
rect(49,50,40,80)
fill(289,548,28... | true |
e9807ff56385e529738d14e70d1f633d9247522f | JavaScript | newzjw/h5c3-bootstrap-pages | /js/wjs.js | UTF-8 | 6,000 | 2.765625 | 3 | [] | no_license | $(function () {
/*动态轮播图*/
banner();
/*移动端产品区块的页签*/
initMobileTab();
/*初始工具提示组件*/
$('[data-toggle="tooltip"]').tooltip();
});
var banner = function () {
/*1.获取轮播图数据 使用ajax技术 */
/*2.根据数据动态渲染,根据当前设备(判断屏幕宽度)选择数据 */
/*2.1 准备数据*/
/*2.2 把数据转换成html格式的字符串
(三种方法:1.动态创建元素,2.字符串拼接,3.... | true |
7ef35c64a3dab950edafabbaa9f6e450d7fecc0b | JavaScript | GrifUndersun/what-the-fuxx | /blind.js | UTF-8 | 204 | 3.140625 | 3 | [] | no_license | let el = document.getElementById('xxx');
let text = el.innerHTML;
setInterval(function ()
{
text = text[text.length - 1] + text.substring(0, text.length - 1);
el.innerHTML = text;
}, 300); | true |
46e07e443e5ce19bb8582aff39aa2e016a1cb498 | JavaScript | liaoleejun/marklib | /src/main/util/Util.js | UTF-8 | 12,403 | 2.75 | 3 | [
"MIT"
] | permissive | /* global Node, NodeList, Element */
/**
* @type {string}
*/
export const ATTR_DATA_ORIGINAL_INDEX = 'data-original-index';
/**
* @type {string}
*/
export const DATA_IS_SELECTION = 'data-is-selection';
/**
* @type {string}
*/
const SERIALIZE_SEPARATOR = ";";
import { ATTR_DATA_ORIGINAL_OFFSET_START } from '../R... | true |
4396effd202bb26fb3006ae2920c179027f3d143 | JavaScript | mcfa77y/sequenceBundle | /src/main/resources/META-INF/web-resources/javascripts/visualizationSettingsController.js | UTF-8 | 2,357 | 2.515625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$(function() {
'use strict';
$("#applyChangesButton").click(function(event) {
if (!Utils.isDataReady()) {
return false;
... | true |
30a2b6f6ebd867d31baf99711722c725de867c7c | JavaScript | sahatasianturi/h8-p0-w5 | /excercise5.js | UTF-8 | 427 | 3.546875 | 4 | [] | no_license | function attack(damage) {
return damage - 2
}
function damageCalculation(numberOfAttacks, damagePerAttack) {
var totalDamage = 0
var i = numberOfAttacks
while (i > 0) {
totalDamage += attack(damagePerAttack)
i--
}
return totalDamage
}
// TEST CASE
console.log(damageCalculation(... | true |
201b79d2a3d17f7c04af58c33b933614ebc502e0 | JavaScript | jrobinson01/radjs | /src/collection/Collection.js | UTF-8 | 9,290 | 2.890625 | 3 | [] | no_license | var pkg = rad.getPackage("collection");
pkg.Collection = rad.event.EventDispatcher.extend({
_className:"Collection",
name:"Collection",
_debug:true,
data:[],//raw data array
sorts:[],//our sort functions
_sortInterval:null,//timeout to minimize sort actions
//key for our objects. When using indexOf() and ... | true |
a4533da5432c8786b57f18fd21e1b66b1343b219 | JavaScript | UrthWyrm/Express | /NPM/Colors/server.js | UTF-8 | 1,682 | 3.296875 | 3 | [] | no_license | // Create a socket application that presents the user with 3 buttons for color options.
// When a user clicks on one of the color options, all currently connected socket users should have their entire background change to that color.
// BONUS: As soon as a new user connects to our server, update their color with the ... | true |
b5e83a7b90a1fea50b9150e56671c195bede5bae | JavaScript | overlord1126/tank | /hero.js | UTF-8 | 1,230 | 2.921875 | 3 | [] | no_license | class Hero extends Tank {
constructor(opts){
super();
Object.assign( this.def,opts );
}
init(){
this.creatDiv();//创建
this.move();//执行移动
this.loadAndFire();//按下j可发射
this.switchDir();//移动作用
}
reborn(){
var t = new Hero({
bgColor:"green",
isMoving:false,
x:0,
type:1,
y:450,
});
t.init... | true |
a795b24588a1d43334075a0f2b02fd0eae48d225 | JavaScript | jan-berge-ommedal/aktivitetsplan | /src/ducks/rest-reducer.test.js | UTF-8 | 3,443 | 2.625 | 3 | [
"MIT"
] | permissive | /* eslint-env mocha */
import { expect } from 'chai';
import { createActionsAndReducer } from './rest-reducer';
const {
reducer,
actionTypes,
selectData,
selectStatus,
} = createActionsAndReducer('test');
describe('rest-reducer', () => {
describe('reducer metode', () => {
describe('med act... | true |
faf0e407c35936afd1a195f3b1aa139e1c2640e6 | JavaScript | korylyons/hw3 | /sketch-4.js | UTF-8 | 643 | 2.59375 | 3 | [] | no_license | function setup () {
createCanvas(200,200)
background(255)
function draw ()
iNSERT THINF FROM TEXTBOOK
/*
for (var x1 = 20; x1 < 80; x1 = x1 + 10) {
for (var y = 100; y < 20; y = y - 10) {
for (var x2 = 180; x2 < 120; x2 = x2 - 10) {
line (x1, y, x2, y)
//^^only for top half
}
}
}
... | true |
f2e10ece5fb3b55732a74cf0bc531f5ba1e39a6d | JavaScript | MIClavelTe/react-my-app | /src/components/NameForm/index.js | UTF-8 | 551 | 2.640625 | 3 | [] | no_license | import React from 'react';
class NameForm extends React.Component {
state = {
value: ""
};
handleChange = (event) => {
this.setState({value: event.target.value});
};
handleSubmit = (event) => {
event.preventDefault();
}
render () {
return (
<fo... | true |
49d3058438bfa7b62839e2f642d0c651f57ad8de | JavaScript | 2bdulra7manRea/megashopy | /src/pages/products/productSearch.js | UTF-8 | 2,177 | 2.71875 | 3 | [] | no_license | import { useEffect, useState } from "react";
import { useParams } from "react-router-dom"
import { combineReducers } from "redux";
import CardComponent from "../../components/card";
import { search_items } from "../../networks/productsApi";
export default function Search(){
let param=useParams();
let [items , setI... | true |
c44ee4f5556e030f167bd0196410f6356c7497ec | JavaScript | DrSchizo/Phaser-3-ES6-topdown-and-sidescrolling-game-boilerplate | /src/core/scene/Preload.js | UTF-8 | 3,103 | 2.6875 | 3 | [] | no_license | /*
* Boot scene from Tilemap & File Pack Project Template by B3L7
* https://github.com/B3L7/phaser3-tilemap-pack/blob/master/src/scenes/Preload.js
* Not currently used
*/
export default class Scene_Preload extends Phaser.Scene {
preload(){
const width = this.cameras.main.width;
const height = this.camer... | true |
f9f44396365a0c7a1f7199a19292d9e9908410bb | JavaScript | jestmz/proyecto-plus | /Salas/js/reservacion.js | UTF-8 | 3,777 | 3.171875 | 3 | [] | no_license | $(document).ready(function () {
var actual = new Date();
function mostrarCalendario(year, month) {
var now = new Date(year, month - 1, 1);
var last = new Date(year, month, 0);
var primerDiaSemana = (now.getDay() == 0) ? 7 : now.getDay();
... | true |
6dc2103518a9fd1dedbbdae6ee10ffc931a4a880 | JavaScript | buWenCangS/jsLearn | /test.js | UTF-8 | 14,504 | 3.75 | 4 | [] | no_license | // -------------------------------根据关注的点不同, 只在乎has-a的话就 只需要确定是否存在类似的东西就ok了
// alert('ie浏览器......1 ');
var Duck = {
sound: function () {
console.log('鸭子 嘎嘎叫');
}
}
var Chicken = {
sound: function () {
console.log('小鸡 也会嘎嘎嘎');
}
}
function animalSound() {
this.sound();
}
animalSound... | true |
4664d0c12cfe0efa3cc6508e71300450a2c44d93 | JavaScript | jayarray/ffmpeg-async | /convert.js | UTF-8 | 1,681 | 2.921875 | 3 | [] | no_license |
let LINUX = require('linux-commands-async');
let LOCAL_COMMAND = LINUX.Command.LOCAL;
//---------------------------------------
// ERROR
function SrcDestValidator(src) {
if (src === undefined)
return 'undefined';
else if (src == null)
return 'null';
else if (src == '')
return 'empty';
else if (sr... | true |
f925fcd6596978d9d10202ffa0131efce70b2b42 | JavaScript | gliviu/atom-favorites | /spec/favorites-spec.js | UTF-8 | 2,882 | 2.625 | 3 | [
"MIT"
] | permissive | 'use babel'
import common from '../lib/common'
const DELIM=common.CONFIG_DELIMITER
describe("Favorite config parser", ()=>{
it("parses regular favorites with no properties", ()=>{
const config = common.parseFavoriteConfig('/path1 /path2/p4/x.js')
expect(config.isTopic).toBe(false)
expect(config.hasKeymap)... | true |
96e55a55160d091920082dae5e52082bdbc8516b | JavaScript | KoukiHama/obniz | /dist/src/obniz/libs/io_peripherals/ad.js | UTF-8 | 2,256 | 2.609375 | 3 | [
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | "use strict";
/**
* @packageDocumentation
* @module ObnizCore.Components
*/
Object.defineProperty(exports, "__esModule", { value: true });
const ComponentAbstact_1 = require("../ComponentAbstact");
/**
* @category Peripherals
*/
class PeripheralAD extends ComponentAbstact_1.ComponentAbstract {
constructor(obni... | true |
728c1185947613a71b61fe3cd335475eed05326f | JavaScript | Shubidumdu/hyper-focus-time | /src/components/CustomContainer.js | UTF-8 | 1,295 | 2.546875 | 3 | [] | no_license | (function () {
const template = document.createElement('template');
template.innerHTML = `
<style>
:host section{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background: #021859;
padding: 5rem;
border: 5px sol... | true |
06421840ddacca0ff4327850ebbfb5d09c1f0975 | JavaScript | tianhai82/key-value-store | /memstore.js | UTF-8 | 1,537 | 2.875 | 3 | [] | no_license | /* eslint-disable import/extensions */
import isValidTimestamp from './isValidTimestamp.js';
export default class KVStore {
constructor() {
this.store = {};
}
setValue(key, value) {
const now = new Date();
const timestamp = Math.round(now.getTime() / 1000);
if (typeof key === 'string') {
c... | true |
12acc839fb8e3b799c79c3541462e4ebd68b4fde | JavaScript | GamesZentral/allegro.js | /lib/model/category.js | UTF-8 | 661 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict';
function Category(apiCategory, client) {
if (!client) {
throw new Error('Client instance required');
}
this._client = client;
this._id = apiCategory.catId;
this._name = apiCategory.catName;
this._parentId = apiCategory.catParent;
}
Category.prototype = {
get id() {
... | true |
2175558299fc46bfcd35c48903c75f16d3ade1cc | JavaScript | princesoni1989/SetCronJob | /example/group.js | UTF-8 | 1,203 | 2.65625 | 3 | [
"ISC",
"MIT"
] | permissive | var setCronJob = require('../index');
var cronJob = new setCronJob('xxxxxxxx');
//list group
cronJob.group.list(function (err, result) {
printResult(err, result);
});
//Get group
var params = {
id: 'xyz'
};
cronJob.group.get(params, function (err, result) {
printResult(err, result);
});
//Add group
var... | true |
51496f7003e47dd0eb648060ec6501d6d9776b41 | JavaScript | rendiekoprasatiawan/dasar-pemrograman-web | /8 JAVASCRIPT (BEGINNER TO ADVANCED)/4 JAVASCRIPT-LANJUTAN/arrow-function-dengan-this/script.js | UTF-8 | 3,883 | 4.09375 | 4 | [] | no_license | // konteks dari this jika kita menggunakan arrow function. kita tahu ketika menggunakan function entah itu function expression atau function declaration itu di dlam function memiliki konteks this
// nah itu jika kita mengubah sebuah function expression menjadi arrow function maka konteks thisnya itu menjadi berbeda
//... | true |
5e548de00e7e2a547e7706aadef7a93cb19ebc97 | JavaScript | carlosruizdelavega/sicionline | /src/main/webapp/recursosWeb/particular/citaMedica/js/inicioCitaMedica.js | UTF-8 | 8,948 | 2.59375 | 3 | [] | no_license | /**
* Funcion que permite ejecutar las operaciones especificadas, cuando se ha cargado completamente el DOM
*/
$(document).ready(function(){
//cargar tabs
$("#tabs").tabs();
//mostrar tab Datos del Paciente y Cita
fnMostrarTabPacienteyCita(0);
});
function fnRegistrarCitaMedica(){
cModal("divModalRegistrar... | true |
84fb8763c0ec28e481a5c583b01adbb38843a540 | JavaScript | mike19941215/Webapps_FinalProject | /test/test.js | UTF-8 | 7,260 | 2.953125 | 3 | [] | no_license | var assert = require('assert');
var board_set = 9;
var rule = {
canvassize:280,
boardsize:240,
unitlength:30,
rad:15,
widthsize:20
};
var chess = {
x:0,
y:0,
who:1,
iswin:false,
chesswin:false,
stepcount:0,
chessstepX:new Array(board_set*board_set),
chessstepY:new Array(board_set*board_set),
checkloc:fals... | true |
a332edff2b9624499ed96cef08093138bdf9c681 | JavaScript | hourofci/lessons | /supplementary/js/custom.js | UTF-8 | 3,993 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | requirejs.config({
"baseUrl": "../../supplementary/js",
"shim": {
"jquery.md5": ["jquery"]
}
});
requirejs(['jquery','jquery.md5'],
function ($) {
// Retrieve info variables
var user_agent_hash = $.md5(navigator.userAgent);
var lesson = location.href.split('/')[8]; // "template";
... | true |
064b0681c08d4f78cd58f3a338b102f40d3a00bc | JavaScript | jbortnick/Champions | /mechanics/renderer.js | UTF-8 | 20,295 | 2.515625 | 3 | [] | no_license |
/**
* Renderer handles rendering a map file to the canvas
* @param {stage} gamestage EaselJS stage
* @constructor
*/
function Renderer(gamestage) {
this.activeObjectsContainer = new createjs.Container();
this.backgroundContainer = new createjs.Container();
this.complexObjects = [];
this.container = new createj... | true |
7c78f2f2da4a9f6045d212a6043f73b6a6556dfa | JavaScript | FloresAnibal/EJERCICIOS-ALGORITMOS | /TP14/TP14E9.js | UTF-8 | 1,148 | 3.78125 | 4 | [] | no_license | /*Sobre lo desarrollado para el ejercicio anterior (Punto 8) incorporar métodos que
permitan obtener los nombres de los pacientes que tienen una deuda mayor al promedio
general de deuda del consultorio.*/
function informe(nombres, deudas){
let promedioGral = 0.0; //donde voy a guardar mi promedio
let... | true |
40809437db16aa9a26ff7f5a133be71b7fba6f1e | JavaScript | bdelespierre/space-invaders | /js/lib/game.js | UTF-8 | 4,697 | 2.71875 | 3 | [] | no_license | import Inputs from '/js/lib/inputs.js';
import Canvas from '/js/lib/canvas.js';
import Cannon from '/js/lib/cannon.js';
import Invader from '/js/lib/invader.js';
import State from '/js/lib/states/state.js';
import Menu from '/js/lib/states/menu.js';
import Config from '/js/app/config.js';
import Grid from '... | true |
9aa7ba889ac111f30ec5333e22cab64ccbcc6425 | JavaScript | thaitao2702/git | /Tekstorm 12-11/js/a.js | UTF-8 | 360 | 3.03125 | 3 | [] | no_license | function add(a, b , cb){
setTimeout(function() {
if(typeof a != 'number' || typeof b != 'number')
{
return cb('tham so phai la kieu number',undefined);
}
cb(undefined,a+b);
}, 1000);
};
add(3,4,function(err,result){
if(err)
{
return console.log(err);
... | true |
fedfcb89954d12be6f06e1d43005eb877c705a5f | JavaScript | catatsuy/Hatena-Intern-Exercise2012 | /exercise2-1/template.js | UTF-8 | 608 | 2.9375 | 3 | [] | no_license | var Template = function(input) {
this.source = input.source;
};
Template.prototype = {
render: function(variables) {
return this.source.replace(/{%\s*([^%\s}]+)\s*%}/g, function(m0, m1){
return Util.htmlspecialchars(variables[m1]);
});
}
};
// 名前空間の汚染を防ぐ
var Util = {
htmlsp... | true |
61a1dc9d294451c38242dfe653ff830c70846d09 | JavaScript | nmdoliveira/sales_funnel | /app/webpacker/src/js/reducers/drag.js | UTF-8 | 1,901 | 2.6875 | 3 | [] | no_license | import {
DRAG_START,
DRAG_END,
DRAG_ENTER,
DRAG_LEAVE,
DRAG_FINISH,
DROP_START
} from "../actions"
const initialState = {
dragging: false,
id: null,
from: null,
to: null,
height: null,
enters: {},
status: "none"
}
const drag = (state = initialState, action) => {
let previousCount, newCount... | true |
f2d34b5bb120142cc042ccb8b799f421810f8602 | JavaScript | Lucascg16/sitesCursoJs | /ex-analisadorDeNumeros/script.js | UTF-8 | 1,623 | 3.734375 | 4 | [] | no_license | var lista = document.getElementById('lista')
var vet = []
var res = document.getElementById('res')
var num = document.getElementById('num')
function add() {
var n = Number(num.value)
if (isNumero(n) && !inLista(n, vet)) {
vet.push(n)
var item = document.createElement('option')
item.text... | true |
0b4c7adf1e03294763342c0846fd91be5625c19c | JavaScript | Syammed2429/E-Commerce | /cart.js | UTF-8 | 3,197 | 3.03125 | 3 | [] | no_license | let noProducts = document.querySelector('.error')
let totalValue = document.getElementById("total");
let dataDiv = document.getElementById("datadiv");
let cartData = JSON.parse(localStorage.getItem("ecart"));
let lengthDiv = document.getElementById("numofitems");
let total = 0;
function displayProducts() {... | true |
9dfb231d86fe8ed0760d015a063a93179d90576b | JavaScript | htanjo/stealth | /src/js/app/stealth.stage.js | UTF-8 | 6,488 | 2.859375 | 3 | [] | no_license | /**
* Class for Stage.
* @author htanjo
*/
define([
'three'
], function () {
/**
* Create a stage.
* @class Stage
* @augments THREE.Object3D
*/
var Stage = function (mapOffset, mapSize, blockMap) {
var chipSize = 100,
groundTexture = 'img/ground_00_... | true |
f70511d8f871d822e60287456ffd3175375c019e | JavaScript | SManneh/Mongo | /public/js/app.js | UTF-8 | 1,309 | 3.015625 | 3 | [] | no_license | const displayKudos = function () {
$.get('/api/kudos/')
.then(function (data) {
render(data);
});
}
const getUsers = function () {
$.get('/api/user/')
.then(function (data) {
console.log(data)
for (let i = 0; i< data.length; i++){
$('#sender').append(`<optio... | true |
4c0ecb8d1b1c1d1170678d47f246374b0bc8608a | JavaScript | davidkelley/serverless-tiler-x-y | /handler.js | UTF-8 | 513 | 2.703125 | 3 | [] | no_license | 'use strict';
export const tile = (event, context, cb) => {
try {
var {lat, lng, zoom} = event.query;
var tiles = Math.pow(2, parseInt(zoom));
var diameter = Math.pow(2, Math.PI);
var y = Math.floor(tiles * (Math.PI - (Math.log(Math.tan(0.25 * Math.PI + 0.5 * (parseFloat(lat) * Math.PI / 180.0))))) /... | true |
5164015e9840627c181e952a6f2755be6beef346 | JavaScript | bobholt/johnny-five-examples | /01.Basics/DigitalReadSerial/digitalReadSerial.js | UTF-8 | 894 | 3.421875 | 3 | [] | no_license | /*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the serial monitor
This example code is in the public domain.
*/
var five = require( 'johnny-five' );
var board = new five.Board();
// The board's pins will not be accessible until
// the board has reported that it is ready
board.... | true |
b5adb7fb109acfe3d7018af4f09c59170f8ace68 | JavaScript | ingotr/1036557-cinemaddict-10 | /src/models/comment.js | UTF-8 | 691 | 2.890625 | 3 | [] | no_license | export default class Comment {
constructor(data) {
this.id = data[`id`];
this.author = data[`author`];
this.comment = data[`comment`];
this.date = data[`date`] ? new Date(data[`date`]) : null;
this.emotion = data[`emotion`];
}
toRAW() {
return {
'id': this.id,
'author': this.a... | true |
9d04656d4ae9cbc90eaaa01e8dc523ebaa6ade7c | JavaScript | fahico98/Empresa_de_refrigeracion | /Js/scriptEmpleados.js | UTF-8 | 11,646 | 2.53125 | 3 | [
"MIT"
] | permissive |
var paginaActual = 1;
var empleadoEnEdicion = null;
var arregloEntradas = {
"Nombre" : $("#entradaNombre"),
"Apellido" : $("#entradaApellido"),
"Documento" : $("#entradaDocumento"),
"Telefono" : $("#entradaTelefono"),
"Cargo" : $("#entradaCargo"),
"Sueldo" : $("#entradaSueldo"),
"Usuario" : $("#... | true |
6e1c4a85dc8ddae04be0f95e1e995f374fe627aa | JavaScript | jmq2134/DevMapper2 | /public/assets/js/addcomp.js | UTF-8 | 3,072 | 2.859375 | 3 | [] | no_license | $(document).ready(function() {
console.log("addcomp loading");
// Getting references to the add new tenant inputs
var siteName = $("[name=siteName]");
var address = $("[name=address]");
var owner = $("[name=owner]");
var entered = $("[name=entered]");
var sold = $("[name=sold]");
var b... | true |
fd47b257ca346c1d58319d608cec6b43340a1c70 | JavaScript | Sudipta065/wikipedia-viewer | /script.js | UTF-8 | 1,258 | 3.109375 | 3 | [] | no_license | function submit() {
event.preventDefault();
let searching = document.querySelector('.search-input');
let searchInput = searching.value;
fetchResult(searchInput);
}
const form = document.getElementById('form');
form.addEventListener('submit', submit);
function fetchResult(searInput) {
const urlApi = `https://... | true |
9f0a283b974e5b84ac212d8daca7c776adcf3f10 | JavaScript | Tobiaqs/videocollege_dl | /videocollege_dl.es5.js | UTF-8 | 5,781 | 2.59375 | 3 | [] | no_license | "use strict";
(function () {
function download(payload, callback) {
fetch("/Mediasite/PlayerService/PlayerService.svc/json/GetPlayerOptions", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(payload),
credentials: "include"
}).then(function (response) {
... | true |
385241773275a18f53a5039d67cc86063c52e013 | JavaScript | Aeroglyphic/weather-api-nodejs | /lib/weather-alerts-detail.js | UTF-8 | 1,693 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /**
* from: https://callforcode.weather.com/doc/v3-weather-alerts-detail/
*
* Weather Alerts Detail (v3) - The Weather Alert Details API provides
* the details for a single requested event for weather watches,
* warnings, statements and advisories issued by the NWS (National
* Weather Service), Environment Canada... | true |
c4b89ff428d5809795d5aaed2dae6cf7356997a6 | JavaScript | danulqua/uber-partners | /src/js/script.js | UTF-8 | 903 | 3.015625 | 3 | [] | no_license | const menu = document.querySelector(".menu"),
hamburgerBtn = document.querySelector(".hamburger"),
menuLinks = menu.querySelectorAll(".menu_link");
document.body.addEventListener(
"click",
(e) => {
if (e.target === hamburgerBtn || e.target.tagName === "SPAN") {
return;
}
... | true |
f7751f35924b40dbcb92e87c779b706bbd0289ac | JavaScript | rmclaren77/AudVidTherapy | /View/sketch.js | UTF-8 | 1,972 | 2.734375 | 3 | [] | no_license | var song;
var toggleButton;
var amp;
var width, height, widthCenter, heightCenter;
var fft;
var playing;
var frameCount;
function setup() {
count = 0;
width = displayWidth;
height = displayHeight*.6;
widthCenter = width/2;
heightCenter = height/2;
fft = new p5.FFT();
createCanvas(width, height);
amp =... | true |
0b4215d2e4b45a9588c4339068e83e76e4cbdac9 | JavaScript | shadowprompt/daozhao_vue_ssr | /src/utils/index.js | UTF-8 | 3,834 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
*
* @param res
*/
export const httpSuccess = (res) => res.status === 200;
/**
*
* @param time
* @param format
*/
export const timeStampFormat = (time, format) => {
if (!time) {
return '';
}
const t = new Date(+time);
const tf = (i) => (i < 10 ? '0' : '') + i;
return format.replace(/yyyy|MM|dd|... | true |
a1c48e12996f745cbc0674e27bbbc6b4425303d6 | JavaScript | CoolCool/phpguide | /static/scripts/qna.js | UTF-8 | 788 | 2.515625 | 3 | [] | no_license |
var qna =
{
answerSent : function(xhr)
{
if( $('#message').val() == '') xrh.abort();
qna.disableSubmitButton();
},
displayAnswer : function(data)
{
qna.appendAnswer(data);
qna.clearAnswerText();
qna.incrementAnswersCounter();
qna.enableSubmitButton();
},
enableSubmitButton ... | true |
477bb2d882a81a21ff3e16d667cd88ad10e317fa | JavaScript | renga1987/Full_Stack_Dev | /ES6/Promises.js | UTF-8 | 1,159 | 3.671875 | 4 | [] | no_license | //Javascript executes code line by line without any pauses. No pausing in JS
//No sleep like pause for 3 ms.
// We have setTimeOut method where we can set some time delay..
//If there is a consle.log(data) after a external call which returns "data" we may have undefined returned
//if it takes long time to return.
//Pro... | true |