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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fd8e3474e918416dd7224ab8b30c96428539c83b | JavaScript | alpersonalwebsite/private-blockchain | /server/index.js | UTF-8 | 970 | 2.703125 | 3 | [
"MIT"
] | permissive | const express = require('express');
const bodyParser = require('body-parser');
class BlockAPI {
constructor() {
this.app = express();
this.initExpress();
this.initExpressMiddleWare();
this.initControllers();
this.validateJSON();
this.start();
}
initExpress() {
this.app.set('port', 80... | true |
470cde07af8e21cf3843d3295a789f1c3dc78528 | JavaScript | kywbaek/sorting-algorithms | /quick-sort/quick-sort.js | UTF-8 | 835 | 3.796875 | 4 | [] | no_license | function quickSort(arr){
let n = arr.length
if (n<=1) {
return arr
}
let pivot = arr[n-1]
let pivot_index = n-1
let check_index = 0
while(check_index<pivot_index) {
if (arr[check_index]>pivot){
arr[pivot_index] = arr[check_index]
arr[check_index] = ar... | true |
42c7f4ebbb34cc466fba48eda789838928f7dd76 | JavaScript | m4r00p/chess | /app/scripts/polyfill.js | UTF-8 | 4,086 | 2.609375 | 3 | [] | no_license | define([], function() {
'use strict';
/**
* console.*
*/
(function() {
var method;
var noop = function() {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profi... | true |
f780972f2a50546a6b620db75ea1f6d6c9173c82 | JavaScript | TabishAjaz/javascript_01 | /code.js | UTF-8 | 1,573 | 3.578125 | 4 | [] | no_license | //var n1=parseInt(0);
//var n2=parseInt(0);
//var firstBox=document.getElementById("one");
//firstBox.addEventListener("click",function(){
//alert("you clicked"+firstBox.id);
//});
//var add1=document.getElementById("buttn1");
//add1.addEventListener("click",function (){
//alert("the sum is "+(n1+n2));
//}); ... | true |
7d54f11ea6432a525ecd8b6b0c6c8aa42695ee2b | JavaScript | mikeoberdick/talent-source-group | /js/d4tw.js | UTF-8 | 2,010 | 2.625 | 3 | [] | no_license | //Automatically generate filler content height to ensure footer is on bottom of the page
jQuery(document).ready(function() {
jQuery('#js-heightControl').css('height', jQuery(window).height() - jQuery('html').height() +'px');
});
//Change color of side tabs after srolling past the header
jQuery(document).on('scroll', ... | true |
cfc4a65b42549e503327cc0f319e481d76b59e5a | JavaScript | Dsoungpa/Endless_Runner | /src/scenes/Title.js | UTF-8 | 2,819 | 2.546875 | 3 | [] | no_license | class Title extends Phaser.Scene {
constructor() {
super('titleScene');
}
preload(){
// load audio
this.load.audio('sfx_select', './assets/audio/KeyboardAudio.wav');
this.load.image('sky', './assets/img/Sky.png');
this.load.image('mainmenu', './assets/img/MainMenu.png');
... | true |
f96eaf58046ebe6b3cb3a26fcd655477a359bfdc | JavaScript | cherry-cloud/Pursuit-Core-Web-Hangman | /gameFiles/humanPlayer.js | UTF-8 | 604 | 3.546875 | 4 | [] | no_license | const readline = require("readline-sync");
class HumanPlayer {
constructor(name) {
this.name = name;
}
getMove() {
return readline.question("Please enter a letter: ").toLowerCase()
}
displayBoard(board) {
let output = "";
for (let i = 0; i < board.length(); i++) {
... | true |
9057d03aa2e194945f0772aa720364b598bc13b3 | JavaScript | Collinsboss18/currency-rates-api | /src/services/Response.js | UTF-8 | 654 | 2.75 | 3 | [] | no_license | /**
* @author Collins Charles (abadaikecollins@gmail.com)
* @action Handles api response
*/
class Response {
/**
* @description Method that handles response data
* @param base Currency base gotten from exchange api
* @param data Date updated gotten from exchange api
* @param rates Object's
* @returns Obj... | true |
a873d10694a9a232b005bcca89ee78b315256987 | JavaScript | OTL/otl-ros-pkg | /otl_util/otl_web/roomba.js | UTF-8 | 6,951 | 2.5625 | 3 | [] | no_license | var connection = null;
var log_canvas = null;
var image_topic = '/usb_cam/image_raw';
function updateImage(vel_x, vel_z) {
if ( vel_x < 0.0 ) {
document.upper.src="img/upper2.png";
document.lower.src="img/lower.png";
} else if ( vel_x > 0.0 ) {
document.upper.src="img/upper.png";
document.lower.s... | true |
daf1a73c41c67a39c163839f1aaeab0097b8f28c | JavaScript | talentwebdev/diaskedazw | /public/js/user-pages/partnerprofile/statistics.js | UTF-8 | 642 | 2.5625 | 3 | [] | no_license | (function($){
'use-strict';
// ***************************
// fetch visits on partner profile
// ***************************
function fetchVisitsNum()
{
$.get( "fetchaddpointsnotifications", {sender: 12})
.then( function( data ) {
console.log( "fetchaddpointsnotifica... | true |
a676c71cf2fbb0edc481772e37413aae7063efed | JavaScript | mmts12/Cardly | /src/store/reducers/boardReducer.js | UTF-8 | 923 | 2.640625 | 3 | [] | no_license | const initialState = {
boards: [],
selectedBoard: {}
}
export function boardReducer(state = initialState, action) {
switch (action.type) {
case 'SET_BOARDS':
return { ...state, boards: action.boards }
case 'ADD_BOARD':
return { ...state, boards: [...state.boards, act... | true |
1220f8abf20466c698fab448bb65a04f64433c0d | JavaScript | YaroslavHolovatskyi/Scrumban | /Scrumban/ClientApp/src/components/FeatureReactComponents/AddFeature.jsx | UTF-8 | 2,824 | 2.78125 | 3 | [] | no_license |
import React, { Component } from 'react';
import DatePicker from 'react-datepicker';
export class AddFeature extends React.Component {
constructor(props) {
super(props);
this.state = {
name: 'Default Name',
description: 'Default Description',
priority: 1,
... | true |
ea4078267251cf1ab6f6288cd7a7852e3c2dbe9f | JavaScript | KingScooty/dh-legacy | /node/public/javascripts/src/scrollPos.js | UTF-8 | 1,444 | 2.703125 | 3 | [] | no_license | 'use strict';
// Amemend scroll pos so the nav never shift position by event above it.
// Modularise this file.
var target = document.querySelector('.event');
var current_event_height = 0;
var pageInitialised = false;
var getInitialEventHeight = function getInitialEventHeight() {
return window.dh_el_event_current_h... | true |
e7d662f91645e84157ae4ecab5a1d48a21ed6909 | JavaScript | Adam-Ross/baicProgrammaticSkills | /3.algorithms/sorting/selection.js | UTF-8 | 331 | 3.859375 | 4 | [] | no_license | // Selection sort, smallest item in list
function selectionSort(arr) {
let smallest = arr[0];
let temp;
for (let i = 0; i < arr.length; i++) {
for (let j = 0; j < arr.length; j++) {
if (arr[j] < smallest) {
smallest = arr[j];
}
temp = arr[i];
arr[i] = smallest;
}
}
ret... | true |
8dcc8e8c53c9a01c78ec55654de788a36b9e58f3 | JavaScript | specter01wj/Book-JavaScript_Data_Structures_and_Algorithms | /jsds-master/Problems/Trees/checkIfSubtree.js | UTF-8 | 1,358 | 3.90625 | 4 | [
"MIT"
] | permissive | function isSameTree(root1, root2) {
if (root1 == null && root2 == null) {
return true;
}
if (root1 == null || root2 == null) {
return false;
}
return root1.value == root2.value && isSameTree(root1.left, root2.left) && isSameTree(root1.right, root2.right)
}
function checkIfSubTree(r... | true |
f7f04fd091285ba1420220f28149ff31f74abe10 | JavaScript | MakeLove69/base64-emoji | /index.js | UTF-8 | 1,698 | 2.796875 | 3 | [
"MIT"
] | permissive | 'use strict'
var mime = require('./mime')
var emojis = require('./emojis')
var EMOJI_BYTE_SIZE = 4
exports.encode = function (obj, buf, offset) {
if (typeof obj === 'string') obj = new Buffer(obj)
else if (!Buffer.isBuffer(obj)) throw new Error('Invalid argument! Expected string or Buffer')
if (!offset) offset... | true |
60ee6dc35fb55097fca0077b4054c76bceacb045 | JavaScript | mgask2017/bookmarker-app | /main.js | UTF-8 | 3,349 | 3.59375 | 4 | [] | no_license | // Listen for the form submit
document.getElementById('myForm').addEventListener('submit', saveBookmark);
//Save Bookmark
function saveBookmark(e){
var siteName = document.getElementById('siteName').value; //.value get the data entered into the form
var siteURL = document.getElementById('siteURL').value;
if(!valid... | true |
dea080b29538237104751e3497c52ba9c02fb045 | JavaScript | p2pu/github-course | /jekyll_course_bootstrap/static/js/githubcourse.js | UTF-8 | 5,561 | 2.65625 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | // Return course page at given path
function get_course_page(token, user, repository, path, callback) {
var deferred = $.Deferred();
var github = new Github({
token: token,
auth: 'oauth'
});
var repo = github.getRepo(user, repository);
repo.contents('gh-pages', path, function(err, re... | true |
8218d18e627063c9d83c98b556afaf12ade32fed | JavaScript | aishahassan98/JavaScript-Complete | /JS/Zeller's Algorithm/main.js | UTF-8 | 1,069 | 4.09375 | 4 | [] | no_license | /*
D (0-31)
M (1-12)
Y (1999) Whole year
*/
/* In zeller formula, the month starts from March so March=1, April=2, Dec=10, Feb=12 etc*/
function Zeller(D, M, Y){
var Day = "";
if (M < 3)
{
M = M + 12;
Y = Y - 1;
}
var YF = Math.floor(Y / 100);
var YL = Y - (100 * YF);
... | true |
c6b2a75d17337fd59a3cccc104cadb7893a0d7cc | JavaScript | supvenka/JavaScriptSamples | /if.js | UTF-8 | 328 | 3.40625 | 3 | [] | no_license | var totalTrains=12;
var trainsOperational = 8;
for(var trainNumber= 1 ; trainNumber <= totalTrains; trainNumber++)
{
if(trainNumber <= trainsOperational)
{
console.log("Train #" + trainNumber + " is running");
}
else
{
console.log("Train #" + trainNumber + " isNot Operational");
}
... | true |
b67a76e73957a6df534fd5b83a8c08eccc27a183 | JavaScript | torococo/BABYLON_NEW | /PeerJS/Helpers/Helpers.js | UTF-8 | 2,505 | 2.953125 | 3 | [] | no_license | "use strict"
var mergeSortedArr=function(Arr1,Arr2,comp){
var Arr1L=Arr1.length;
var Arr2L=Arr2.length;
var result=[];//new Array(Arr1+Arr2);
var i2=0;
var i1=0;
while(i2<Arr2L&&i1<Arr1L){
if(comp(Arr1[i1],Arr2[i2])<0){
result.push(Arr1[i1]);
i1+=1;
} else{
result.push(Arr2[i2]);
... | true |
5461a0f6056b6aec3b7566c235911e9a967201f5 | JavaScript | hpierre74/book-author | /src/modules/toaster/toaster.provider.js | UTF-8 | 1,480 | 2.546875 | 3 | [] | no_license | import React, { useState } from "react";
import { ToasterContext } from "./toaster.context";
const ToasterProvider = ({ children }) => {
const [toast, setToast] = useState({
visible: false,
content: null,
variant: "info",
options: {}
});
const setVisible = visible => setToast({ ...toast, visible ... | true |
8c05ec48912fdb23f4980f9f62b0885d2e585bbc | JavaScript | AMogy/School-Work | /Greentreejs.js | UTF-8 | 184 | 2.796875 | 3 | [] | no_license | function isFormValid(form) {
if (form.userInfo.value == "") {
alert("Error: Input is empty!");
form.userInfo.focus();
return false;
}
return true;
} | true |
ffa970824fb8373a25bca26ab3a86f76d5e00b77 | JavaScript | vivihumpheys/T9-JS-extra | /aula-03/arrow-functions/exercicio-03.js | UTF-8 | 277 | 3.8125 | 4 | [] | no_license | /* Reescreva a função abaixo utilizando
Arrow Function */
/*function objetoUsuario (id, nome) {
return {
id: id,
nome: nome
}
}*/
const objetoUsuarioArrowFunction = (id, nome) => ({ id: id, nome: nome })
console.log(objetoUsuarioArrowFunction(123, 'jessica')) | true |
f7b9f530bc38b0fc6275991990ea1b2b60fc09a8 | JavaScript | Raane/HoldKjeft | /src/MatrixLayer.js | UTF-8 | 888 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* * @constructor
* */
function MatrixLayer(layer) {
this.shaderPass = new THREE.ShaderPass(SHADERS.matrix);
this.shaderPass.uniforms.width.value = 1.0;
this.shaderPass.uniforms.height.value = 1.0;
this.shaderPass.uniforms.onoff.value = 1.0;
}
MatrixLayer.prototype.getEffectComposerPass = function() {
... | true |
7c3c889ca4345d64678b79e78f5a486c337a332a | JavaScript | repetere/promisie | /build/utilities/queue.js | UTF-8 | 4,392 | 2.859375 | 3 | [
"MIT"
] | permissive | const IS_PENDING = Symbol('isPending');
const IS_FULFILLED = Symbol('isFulfulled');
const IS_REJECTED = Symbol('isRejected');
const IS_PAUSED = Symbol('isPaused');
function fulfill(value, resolve) {
if (typeof this.timeout === 'number' && this.timeout > 0) {
const timeout = setTimeout(() => {
th... | true |
fde57f4e68b82d9a620be85ff5e10219d99c542f | JavaScript | taferk/Quiz | /QuizApp/models/models.js | UTF-8 | 3,015 | 2.59375 | 3 | [] | no_license | var path = require('path');
var crypto = require('crypto');
var Sequelize = require('sequelize');
// Recabamos todos los datos de inicialización del tipo de BBDD
// de las variables de entorno (fichero '.env' en local), que en
// local tendrán un valor (SQLite) distinto de remoto (PostgreSQL)
var url = (process.env.D... | true |
622c0a9a3e3fb70fb15b043487146fe5e1bffd27 | JavaScript | o7planning/webexamples | /node-ecmascript/number/number-object-example2.js | UTF-8 | 132 | 3.09375 | 3 | [] | no_license |
let aa = new Number(100);
let bb = aa;
// aa, bb: Same address?
var sameAddress = aa === bb;
console.log( sameAddress); // true
| true |
a4caa720b1a9c6d268d643423b11b9c6e3940550 | JavaScript | holidaycheck/penpal | /lib/errorSerialization.js | UTF-8 | 895 | 2.515625 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deserializeError = exports.serializeError = void 0;
/**
* Converts an error object into a plain object.
* @param {Error} Error object.
* @returns {Object}
*/
var serializeError = function serializeError(_ref) {
var name = _re... | true |
8b927fee96441779938560ad0f3179b980df75a1 | JavaScript | oguching/number-picker | /test/test.js | UTF-8 | 1,645 | 3.078125 | 3 | [
"MIT"
] | permissive | var test = require('tape')
var numbers = require('../index.js')
test('test equality of input numbers', function(t){
t.equal(numbers(45, 'en'), '45', 'Number 45 should be equal to string 45')
t.equal(numbers(-45, 'en'), '45', 'Number -45 should be equal to string 45')
t.equal(numbers(4.5, 'en'), '4.5', 'Number 4.5 s... | true |
a97ff6cdfd18e0700c62260328232cb0dfd3889a | JavaScript | MaAnShanGuider/react-study | /react-demo/src/react-事件.js | UTF-8 | 611 | 2.875 | 3 | [] | no_license | var React = require('react');
var ReactDom = require('react-dom');
var Wocao = React.createClass({
render(){
return (
<div>
<input type="text" ref='xixi'/>
<p ref='haha'>张学友啊</p>
<button onClick={this.myMethod}>点击我</button>
</div>
)
},
myMethod(){
// this.refs是一个集合,里面成员... | true |
580cdff55e9aef9f88c5709908e9c938f60ff46b | JavaScript | yasminisa/ART151_GEN-DESIGN | /sketch.js | UTF-8 | 3,377 | 3.28125 | 3 | [] | no_license | // **********************************************************************************
// NAME: HAJARA-YASMIN ISA
// DATE: FEBUARY 7 2021
// FILE: PROJECT 1 GENERATIVE DESIGN
// COURSE: ART 151 UIC
// **********************************************************************************
//
// *****************... | true |
591164aa6909dfa8905e5fb712fc48d0582a412f | JavaScript | plirof/DopeWars-remake | /js/angulardope.js | UTF-8 | 37,015 | 2.515625 | 3 | [
"MIT"
] | permissive | if (!String.prototype.format) {
String.prototype.format = function () {
var args = arguments;
return this.replace(/{(\d+)}/g, function (match, number) {
return typeof args[number] != 'undefined' ? args[number] : match;
});
};
}
// dealer names
var maleFirstNames = ['Aidan', ... | true |
704315bde98e73f1185a5744c769d89f1fe65071 | JavaScript | 5nahalf/prime_peer_js_02 | /prime_peer_js_02.js | UTF-8 | 588 | 3.59375 | 4 | [] | no_license |
function People(name, empNum, pay, dept){
this.name = name;
this.empNum = empNum;
this.pay = pay;
this.dept = dept;
this.magic = function() {
return this.pay + this.dept / this.empNum + this.name;
};
this.log = function() {
console.log(this.magic());
};
}
var array = [];
for(i = 0; i <=20; i++){
var ob... | true |
1ef34c3d692166c91602917338dd96e183d8bd63 | JavaScript | itReverie/itr-react-redux-normalizr | /src/components/Title/Title.js | UTF-8 | 697 | 2.78125 | 3 | [
"MIT"
] | permissive | import React, { PureComponent } from "react";
import PropTypes from "prop-types";
import styled from "styled-components";
// Create a Title component that'll render an <h1> tag with some styles
//styled.h1 is a function that when call return a react component that renders and H1
// You can now call functions with `` ... | true |
1d5c11849c7eed1dc8004cff40aa88fd6ccd451a | JavaScript | namih/MathOnLine | /statics/js/evaluacion.js | UTF-8 | 7,497 | 2.890625 | 3 | [
"MIT"
] | permissive | var arrayEvaluacion=[];
var id_tema=0;
var inicio=0;
var timeout=0;
function empezarDetener(elemento){
if(timeout==0){
// Obtenemos el valor actual
inicio=new Date().getTime();
// Guardamos el valor inicial en la base de da... | true |
2fb7495219ac315a8dfbabb4aa126d0d1052dd53 | JavaScript | VaibhavSaini19/ML-K-Means-Clustering-Interactive | /KMeans.js | UTF-8 | 1,322 | 3.265625 | 3 | [] | no_license | class KMeans{
constructor(){
this.k = 3;
this.points = [];
this.centroids = [];
this.setK();
}
addPoint(pt){
this.points.push(pt);
}
setK(k=3){
this.k = k;
this.centroids = [];
for(let i=0; i<this.k; i++){
let c = new Point(random(0, width), random(0, height));
this... | true |
bcd9bb771ce181a8b3ecd0656cf1fdc1bc6948f2 | JavaScript | Veer-Khatri/Whole_Javascript_Tuts | /strings _in_JS.js | UTF-8 | 1,233 | 4.25 | 4 | [] | no_license | const namee = "veer";
const greet = "namaste master"
console.log(`${greet} ${namee}`);
let concatinatedstring = "we concatenated ->";
concatinatedstring = concatinatedstring.concat("THIS");
console.log(concatinatedstring);
// console.log(concatinatedstring.length);
// console.log(concatinatedstring.toLowerCase());
// c... | true |
5c7a0ade5e0eef16e2ca3f12e9fd55c316b2ba81 | JavaScript | matthewkeil/lab-dom-ironhack-cart | /starter-code/js/index.js | UTF-8 | 3,201 | 3.28125 | 3 | [] | no_license | function getCart() {
return document.getElementById('cart');
}
function calculateItem(itemNode) {
const unitPrice = parseFloat(itemNode.getElementsByClassName('unit-price')[0].innerHTML);
const qty = parseFloat(itemNode.getElementsByTagName('input')[0].value || 0);
const subTotal = unitPrice * qty;
itemNode... | true |
0b8bdff5275198580cbfcb3a5b45b0c08d934ffc | JavaScript | ky-koz/JavaScript_Projects | /JavaScript_Projects_2/js/javaScript_2.js | UTF-8 | 278 | 2.984375 | 3 | [] | no_license | function validate_form() {
var x = document.forms["form_1"]["fname"].value;
var y = document.forms["form_1"]["lname"].value;
var z = document.forms["form_1"]["pnumber"].value;
if (x == "" || y == "" || z == "") {
alert("Name must be filled out");
}
} | true |
ca36da57c302b8c0054202ac79e552481e82f9fb | JavaScript | g-anka/module11_homework | /Задание_5.js | UTF-8 | 407 | 3.953125 | 4 | [] | no_license | // Напишите функцию, которая принимает два натуральных числа x и n и возвращает x в степени n. Иначе говоря, умножает x на себя n раз и возвращает результат. Используйте Arrow Function синтаксис.
const funcNumbers = (x, n) => console.log(x**n);
funcNumbers(2, 4);
| true |
c5a6d805bead00d86ea836a80101dbf7a2260fba | JavaScript | edersonrpd/convertmymoney | /lib/convert.test.js | UTF-8 | 373 | 2.75 | 3 | [] | no_license | const converter = require('./convert')
test("converts 4 to 4", () => {
expect(converter.convert(4,4)).toBe(16)
})
test("converts 0 to 4", () => {
expect(converter.convert(0,4)).toBe(0)
})
test("toMoney converts to float", () => {
expect(converter.toMoney(2)).toBe("2.00")
})
test("toMoney converts string", () ... | true |
a15994601abd4f08bd599467d46084e205a96364 | JavaScript | panyongkang/panyongkang.github.io | /mypages/GreedySnake/js/lucky.js | UTF-8 | 1,809 | 2.84375 | 3 | [
"MIT"
] | permissive | let getEle = document.getElementsByClassName.bind(document);
let pointer = getEle('pointer')[0];
let result = getEle('result')[0];
let lights = Array.prototype.slice.call(getEle('light'));
let onRotation = false; // 记录当前是否正在旋转,如果正在旋转,就不能继续点击了
let reward = ['谢谢参与', '导航网站制作名额', '谢谢参与', '免费科学翻墙账号', '博... | true |
c5029c9eefc876601ef450636caab799d7e2d628 | JavaScript | htet-waiyan/ical-generator | /src/event.js | UTF-8 | 26,743 | 2.796875 | 3 | [
"MIT"
] | permissive | 'use strict';
const moment = require('moment-timezone');
const ICalTools = require('./_tools');
const ICalAttendee = require('./attendee');
const ICalAlarm = require('./alarm');
const ICalCategory = require('./category');
/**
* @author Sebastian Pekarek
* @class ICalEvent
*/
class ICalEvent {
constructor(dat... | true |
b907376b72e64bdf64f983d5da694d6f9c858318 | JavaScript | BenjaminDagg/troolr_challenge | /troolr-dagg/src/components/ProfileList/ProfileList.js | UTF-8 | 2,691 | 3.140625 | 3 | [] | no_license | import React, { Component } from 'react';
import { ProfileTile} from "../ProfileTile/ProfileTile";
import './ProfileList.css';
import {CategoryTypes} from "../../models/CategoryTypes";
/*
This component recieves array of profile objects, creates
a ProfileTile component for each one, then displays them in
a grid
-props... | true |
9080a64e6a42a2472d07bd8e5fdd49723b29c9f8 | JavaScript | ctgtc/JavaScript-lessons | /JS-lesson-6/src/js/main.js | UTF-8 | 2,106 | 2.703125 | 3 | [] | no_license | 'use strict';
let start = document.getElementById('start'),
budgetValue = document.getElementsByClassName('budget-value'),
daybudgetValue = document.getElementsByClassName('daybudget-value'),
levelValue = document.getElementsByClassName('level-value'),
expensesValue = document.getElementsByClassName('... | true |
5b7eb42264c88a52916a938b3c4bb2ee1264c7a5 | JavaScript | 13146933369/BootstrapLogin | /js/login.js | UTF-8 | 861 | 2.734375 | 3 | [
"MIT"
] | permissive | $(function () {
var loginHead =$(".loginHead ul li");
var loginFormContent = $(".loginForm .loginFormContent")
var loginHeadLeng = loginHead.length
var loginFormContentLeng = loginFormContent.length
for(var i=0;i<loginHeadLeng;i++){
loginHead[i].index = i;
$(".loginHead ul li").click... | true |
b5ab8c4125dc95e2bb9ac05f07ba13c811b9ae23 | JavaScript | snowbot3/wall-site | /cmd/js/views.js | UTF-8 | 1,935 | 2.625 | 3 | [] | no_license | import * as view from './view.js';
import { css, doms, dom, elem } from '/wall/js/all.mjs';
// css.
// would rather this in 'view.js' and simplified
export function json(json) {
const divLine = dom`div class=view-json-line`;
console.log('view json function');
let temp = JSON.stringify(json, null, 2);
... | true |
4aa132f8e17c064754f2afb538b47127af6da47c | JavaScript | Sumanth290/my-react-big | /src/play/promises.js | UTF-8 | 423 | 3.125 | 3 | [] | no_license | const promise = new Promise( (resolve,reject) => {
setTimeout(() => {
// resolve("Resolved !!!!!!!!");
// resolve({
// obj1 : "eadg sdg",
// obj2 : 35
// });
reject("Rejected !!!!!!!!")
},3000);
});
console.log("before");
promise.then((data) => {
co... | true |
fc13c43e43acf733b917cd159725453421b1c70d | JavaScript | newying61/node-module-patch-source-loader | /test/entry.js | UTF-8 | 105 | 2.78125 | 3 | [
"MIT"
] | permissive | import isarray from 'isarray';
const test = [];
if (isarray(test)) {
console.log('test is Array');
}
| true |
b1689325022737171017d41ff81d92d803022997 | JavaScript | 23jonathan23/curso-javascript-funcional-reativo | /funcional/higher_order_function.js | UTF-8 | 484 | 4.15625 | 4 | [] | no_license | //Funções que operam em outras funções,
//tomando-as como argumentos ou retornando-as,
//são chamadas de higher-order functions.
function execute(fn, ...values) {
return function (initialText) {
return `${initialText} ${fn(...values)}`
}
}
function sum(a, b) {
return a + b
}
function mult(a, b) {
return ... | true |
195c115fba8ec61a972751f15a9bc64c4d41e409 | JavaScript | psuvillager/polymer-starter | /src/reducers/shop.js | UTF-8 | 3,290 | 2.875 | 3 | [] | no_license | import { GET_PRODUCTS, ADD_TO_CART, REMOVE_FROM_CART, CHECKOUT_SUCCESS, CHECKOUT_FAILURE } from '../actions/shop.js';
import { createSelector } from 'reselect';
const INITIAL_STATE = {
products: {},
cart: {},
error: ''
};
const shop = (state = INITIAL_STATE, action) => {
switch (action.type) {
case G... | true |
eb542795d696d1ae101edc9ff987d0302125482e | JavaScript | TroyMcl/chatterbox-client | /client/scripts/messagesView.js | UTF-8 | 1,403 | 2.890625 | 3 | [] | no_license | var MessagesView = {
$chats: $('#chats'),
initialize: function() {
},
renderMessage: function(data) {
//Remove previous messages
MessagesView.$chats.empty();
var room = RoomsView.roomName;
var string = '';
//Check each message object has text, and is part of the correct room
for (var... | true |
8d206deae8a926dcdce53c2068f39068e029a074 | JavaScript | viswanathreddyvangala/Interviewstuff | /Interviewstuff/JS_CONCENPTS/ShallowVSDeep.js | UTF-8 | 1,680 | 3.828125 | 4 | [] | no_license | //Object with obly primitives
var obj1 = {
name:"Viswa",
age:'20',
iswon:true
}
// Object with primitive and non primitive
var obj2 = {
name:"Viswa",
age:'20',
iswon:true,
tech:['Angular','NodeJs','JS'],
... | true |
889d26da305c3289889c01e2cecc5097fdf94742 | JavaScript | nanyanchao/number-calc | /test/sub.handle.test.js | UTF-8 | 1,320 | 2.546875 | 3 | [] | no_license | let {sub,subNum
} = require('../src/sub_handle')
var assert = require('assert');
describe('handle sub',function(){
it('sub -1 -1=-2',function(){
assert.equal(sub(-1,1),-2)
})
it('sub 0-0=0',function(){
assert.equal(sub(0,0),0)
})
it('sub 8-1=7',function(){
assert.equal(su... | true |
cce818fefe98295c0e6e7871890397d8defd3323 | JavaScript | madruga665/contacts | /src/components/ContactList/index.jsx | UTF-8 | 628 | 2.765625 | 3 | [] | no_license | import React from 'react'
import { useEffect, useState } from "react";
export default function ContactList() {
const [contacts, setContacts] = useState([]);
const fetchContacts = async () => {
const response = await fetch("http://localhost:3001/contacts");
const data = await response.json();
setContact... | true |
0ce0a258663ae5a9e894ac7983eeef9a6b26fd75 | JavaScript | Swastik-WhitehatJR/Project-27-Version-2.0 | /sketch.js | UTF-8 | 4,753 | 2.625 | 3 | [
"MIT"
] | permissive | const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
const Constraint = Matter.Constraint;
var bobObject1, bobObject2, bobObject3, bobObject4, bobObject5;
var roofObject, rope1, rope2, rope3, rope4, rope5;
var walltop;
var sideRight, sideLeft;
var ball1, bal... | true |
8e66337de10e82e5d9bd3d9cb4597591eddb0ad6 | JavaScript | celestino1987/calendario-citas | /src/components/CalendaryApp.js | UTF-8 | 3,424 | 2.75 | 3 | [] | no_license | import React, { useState, useEffect, useContext } from 'react';
import moment from 'moment';
import 'moment/locale/es';
import '../style/CalendaryApp.css';
import { useHookCite } from '../hooks/useHookCite';
import { DaysContext } from "./context/DaysContext";
export const CalendaryApp = () => {
const { days, setD... | true |
8072196c0b5b5d28b33fe707fcf8497c0275e483 | JavaScript | konapun/orbital-frame | /packages/orbital-frame-core-commands/src/choose.js | UTF-8 | 590 | 2.640625 | 3 | [] | no_license | import { take, shuffle } from 'lodash'
function choose () {
return {
name: 'choose',
synopsis: 'choose [CHOICE] ...[CHOICES]',
description: 'Choose one or more values from multiple choices',
options: {
n: {
alias: 'number',
description: 'Take n choices',
type: 'number',
... | true |
08e52d742bffa85f4e30777d3cf881e067b300e3 | JavaScript | raffecat/manglr-v0 | /refs/loader.js | UTF-8 | 17,826 | 2.546875 | 3 | [
"MIT"
] | permissive | (function(){
function forEach(seq,fn) { for (var i=0,n=seq&&seq.length;i<n;i++) fn(seq[i],i); }
var nextUid = 1, uid = function(){ return 'u'+(nextUid++) };
//function removeElem(parent, node) { parent.removeChild(node) }
function clearElem(node, c) { while (c=node.firstChild) node.removeChild... | true |
5b56db93b14bcfbc69b5ad2bd7b89e11a867d949 | JavaScript | RAposhian/Afternoon-react-day4 | /afternoon-project/src/Components/UserData.js | UTF-8 | 877 | 2.546875 | 3 | [] | no_license | import React from 'react';
import "../UserData.css"
const UserData = props => {
return (
<div>
<h1 className="Name">{props.user.name.first} {props.user.name.last}</h1>
<div className="first-list">
<p><span className="list-item">From:</span> {props.user.city}, {props.user.country}... | true |
f3c531647180d778575647a1ae84673d0a231296 | JavaScript | HiteshVadoliya/the-learning-guide | /assets/plugins/countdown.js | UTF-8 | 1,572 | 3.5 | 4 | [] | no_license | (function($){
var date = new Date(),
month = date.getMonth();
day = date.getDate(),
weekDay = date.getDay(),
hours = {
start: new Date(date.getFullYear(), month, day),
end: new Date(date.getFullYear(), month, day)
};
// weekDay var [0 = sun, 1 = mon, 2 = t... | true |
92caa2caad6a65a1b2fc869d3a1812fe7a13d8ef | JavaScript | PacktPublishing/React-and-React-Native | /Chapter06/rendering-jquery-ui-widgets/main.js | UTF-8 | 736 | 2.5625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import { render } from 'react-dom';
import MyButtonContainer from './MyButtonContainer';
// Simple button event handler that changes the
// "disabled" state when clicked.
function onClick() {
this.data = this.data
.set('disabled', true);
}
render((
<section>
{ /* A simple butto... | true |
a319b07d698cfb4cc2ebe6df1579233d468e951e | JavaScript | cpetry/NormalMap-Online | /javascripts/filters.js | UTF-8 | 9,280 | 2.625 | 3 | [
"MIT"
] | permissive | /*
* Author: Christian Petry
* Homepage: www.petry-christian.de
*
* License: MIT
* Copyright (c) 2014 Christian Petry
* 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... | true |
be8618bae78f52bd6391de083dd6efa6d5178f0f | JavaScript | stipsan/ioredis-mock | /src/commands/zrange-command.common.js | UTF-8 | 6,170 | 2.53125 | 3 | [
"MIT"
] | permissive | import orderBy from 'lodash.orderby'
export function slice(arr, start, end) {
return arr.slice(start, end === -1 ? undefined : end + 1)
}
function normalizeCountToIndex(offset, count, array) {
if (count < 0) {
return -count > array.length ? 0 : array.length + count
}
return offset + count
}
export functi... | true |
64ae8c57c23fa2aafe69626053674d76c1441b6f | JavaScript | KandidatPriceHistory/pricehistoryapp | /src/server/assets.js | UTF-8 | 1,003 | 2.703125 | 3 | [] | no_license | const jsReg = /\.js(\?v=\w*)*$/;
const cssReg = /\.css(\?=\w*)*$/;
export function getAssets(stats) {
return {
scripts: getAssetOfType('js', stats),
stylesheets: getAssetOfType('css', stats)
};
}
function getAssetOfType(type, stats) {
const reg = type === 'js' ? jsReg : cssReg;
const v... | true |
b94981a711c4db1b65bb217aa62ac3711a19de30 | JavaScript | lachomh/curso_react | /gif_finder_app/src/components/AddCategory.jsx | UTF-8 | 782 | 2.765625 | 3 | [] | no_license | import React, {useState} from 'react';
const AddCategory = ({setCategorias, categorias}) => {
const[inputValue, setInputValue] = useState();
const handleInputChange = (e) => {
setInputValue(e.target.value);
};
const handleSubmit = (e) => {
e.preventDefault();
if(categorias.includes(inp... | true |
bcc62d2e03ff9b51aaf8368b06b2588eb6eb5e9e | JavaScript | jassem-lab/game-bullet | /js/first.js | UTF-8 | 931 | 3.140625 | 3 | [] | no_license | var boxLeft= 0;
var boxBottom = 0;
var bulletBottom = 0;
var box = document.getElementById("box");
var bullet = document.getElementById("bullet");
document.addEventListener("keydown" , function(e){
if(e.keyCode== 39) // rightArrow
{
boxLeft +=150;
box.style.left = boxLeft;
}
else if(... | true |
040ae8caa61189d599095513aa3b2bb291ca7dc6 | JavaScript | dinhkt/ee613_project | /movie-seat-booking/src/Login.js | UTF-8 | 1,713 | 2.59375 | 3 | [] | no_license | import React, { useState } from "react"
const Login = () => {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
const handleLogin = () => {
if (username =="tuyen" && password=="123"){
window.localStorage.setItem("username", username)
... | true |
efb4f527d12c111f5695ddb198eed474caa51da9 | JavaScript | SDKuldell/D3-Brush-And-Zoom | /AreaChart.js | UTF-8 | 2,077 | 3.03125 | 3 | [] | no_license | // input: selector for a chart container e.g., ".chart"
export default function AreaChart(container) {
// initialization
const margin = { top: 20, left: 50, right: 20, bottom: 20 };
const totalWidth = 650;
const totalHeight = 500;
const width = totalWidth - margin.left - margin.right,
height = totalHeight... | true |
16fe8527e6af01d6f2323568e2b75f77e35cc69a | JavaScript | ddnatu/ddnatu.github.io | /src/pages/Birthday.js | UTF-8 | 1,669 | 2.515625 | 3 | [] | no_license | import React from 'react'
import axios from 'axios'
import moment from 'moment'
//const accessToken = 'eyJhbGciOiJSUzI1NiIsImtpZCI6IjY1NmMzZGQyMWQwZmVmODgyZTA5ZTBkODY5MWNhNWM3ZjJiMGQ2MjEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vbmF0dWt1bHZydXR0YW50LWM2NjM5IiwiYXVkIjoibmF0dWt1bHZydXR0YW50LW... | true |
51d799fd4a716942d5ea752cac1c8824496fc918 | JavaScript | krlakwa/sky-jump-notes | /calculateDistancePoints.js | UTF-8 | 1,126 | 3.3125 | 3 | [] | no_license | const calculateDistancePoints = (distance, hillSize, kPoint) => {
if (hillSize !== 'normal' && hillSize !== 'large' && hillSize !== 'flying') {
console.log('Hill size must be one of: normal, large, flying');
return;
}
if (distance < 0 || kPoint < 0) {
console.log('Distance and kPoint cannot be smalle... | true |
6d0702683594940d16b5f232259b6366d8a4af0e | JavaScript | slokuliyana/property_mgmt | /admin/assets/admin/layout/scripts/validation/addapparel.js | UTF-8 | 2,198 | 2.609375 | 3 | [] | no_license |
//to validate add color category
function addapparel(){
$('input[type=text],input[type=number], input[type=file], select,textarea').each(function() {
if($(this).val() !== "")
$(this).css({ 'border-color' : '#00ba09','background-image':'url(http://localhost/mtc/assets/js/images/valid.png)','background-repeat': ... | true |
105317a38f0cfefe113a9a02944330b040b2078f | JavaScript | githublengua/curso | /js/spec/06_recorrer_objetos.js | UTF-8 | 880 | 3.90625 | 4 | [] | no_license | /**
* @description //recorre un objeto a tantos niveles como contenga y crea un string con la información
* @param {objet} obj
* @returns {string}
*/
//la key es el nombre que se le pone a un objeto este tiene valores que se leen
function objetToSring(obj) {
let cadena = ''
for (const key in object) {... | true |
41850bc6abcbd4dc0564187bd1cfa345de53df4b | JavaScript | schneiderik/easy-press | /assets/js/product-collection.js | UTF-8 | 2,324 | 2.671875 | 3 | [] | no_license | import products from './../../data/products.json';
import quantityStore from './quantity-store';
import utils from './utils';
import ProductModel from './product-model';
class ProductCollection {
constructor (options={}) {
this.onUpdate = options.onUpdate || utils.func.noop;
this.models = products.map(attri... | true |
57e57c24f0b649f2cfcf969bf8c1918e9d5d8c94 | JavaScript | lavadpr/JS-Object-english-2019-10-11-10-3-8-880 | /main.js | UTF-8 | 221 | 3.15625 | 3 | [] | no_license | var user = {};
user.name = "John";
user.surname = "Mike";
user.name = "Peter";
delete user.name;
var fruit = {
apple: 20,
pear: 20,
peach: 10
};
var sum = 0;
for (let i in fruit) {
sum += fruit[i];
}
console.log(sum);
| true |
283f9b052ecd34df094666841cb863927bb1a26e | JavaScript | khoa165/productivity | /client/src/utils/loadScript.js | UTF-8 | 326 | 2.96875 | 3 | [] | no_license | // Dynamically load JavaScript file.
const loadScript = (url) => {
let script = document.createElement('script'); // Create script tag.
script.type = 'text/javascript';
script.src = url; // Loaded by url.
document.getElementsByTagName('head')[0].appendChild(script); // Append to head.
};
export default loadSc... | true |
1f9404493c4d63a0467ba44e1d6c43fc90d971b4 | JavaScript | paul1680/More-Js | /object.js | UTF-8 | 301 | 2.828125 | 3 | [] | no_license | const student = [
{id: 20, name: 'Pori'},
{id: 56, name: 'zayed'},
{id: 290, name: 'Salman'},
{id: 890, name: 'Ash'},
];
const n = student.map(s => s.name);
const id = student.map(s => s.id);
const b = student.filter(s => s.id > 100);
console.log(n);
console.log(id);
console.log(b);
| true |
cbcf58672c493fa7ce485acd9ef47d38d43bab79 | JavaScript | SrinivasSankoji/Javascript | /index.js | UTF-8 | 461 | 4 | 4 | [] | no_license | console.log('Welocome to Javascripts');
let age=21; // Number
let firstName='Bhaumik'; // string
let student=true; // boolean
age=age+1;
console.log('Hello',firstName); // Bhaumik
console.log('You are',age,'Old'); // 10
console.log('Are you Student',student); // true
document.getElementById("p1").innerHTML = fir... | true |
5c7c5916c8569dc65f119306a36176d439f38d33 | JavaScript | sebastianO1995/iis-htaccess-converter | /index.js | UTF-8 | 2,287 | 3.265625 | 3 | [] | no_license | let result = document.getElementById('result');
let input = document.getElementById('input');
let matchTag_re = /<match url="(.*?)".*>/
let actionTag_re = /<action .* url="(.*?)".*>/
let ruleBegin = /<rule .*>/
let ruleEnd = /<\/rule>/
function convert() {
let lines = input.value.split('\n');
let ... | true |
1964934880a019334164d4454446011c7970ffe2 | JavaScript | nghiapham137/React_Expenses | /src/App.js | UTF-8 | 987 | 2.8125 | 3 | [] | no_license | // import ExpenseItem from "./components/ExpenseItem";
import React, { useState } from "react";
import Expense from "./components/Expenses/Expense";
import NewExpense from "./components/NewExpense/NewExpense";
const INITIAL_EXPENSES = [
{
id: 1,
title: "Toilet Paper",
amount: 123.34,
date: new Date(2... | true |
7457db82540018df4922f9bbacb5869d5a4d01f9 | JavaScript | larryg727/myPicSlider | /js/mySlider.js | UTF-8 | 2,409 | 3.046875 | 3 | [] | no_license | /**
* Created by larryg on 5/12/17.
*/
"use strict";
$(document).ready(function () {
"use strict";
var initial = 1; //sets initial frame being shown
var slideVar = "#slide-"; //variable for slides
var current = initial; // tracks current slide
var speed = 2800; // sets speed for auto play of sl... | true |
f527a9d86e11ce70cffeeb0bb4e95048e47f7404 | JavaScript | alexqgon93/Javascript-Ubiqum | /Task 2/senatemain.js | UTF-8 | 2,646 | 3.40625 | 3 | [] | no_license | let senate_data=document.getElementById("senate_data");//
let members = data.results[0].members;
//we create function that will an array
document.getElementById("selector").addEventListener("change",tablefiltered);
//create an array that will have the values of the checkbox clicked
let list = [];
let gent = data.resu... | true |
57a23ab645457da10ec0c769b5171853d28f68df | JavaScript | UigeoMun/baseCode | /src/containers/add/AddFormContainer.js | UTF-8 | 988 | 2.53125 | 3 | [] | no_license |
import React, { Component } from 'react'
import { Grid } from '@material-ui/core';
import { type Todo } from '../../lib/data/todo';
import AddForm from '../../components/add/addForm';
class AddFormContainer extends Component {
state : Todo = {
id : "",
name : "",
content : "",
... | true |
8ffcd8e36558ad383b653d882a6d1652053d6a39 | JavaScript | anyLetters/english-v2 | /src/reducers/sort.js | UTF-8 | 473 | 2.546875 | 3 | [] | no_license | import { CHANGE_SORTKEY, TOGGLE_ALPHABETICAL_ORDER } from '../actions';
const initialState = {
sortKey: 'asc',
sortByABC: false
};
export default function reducer(state = initialState, action) {
switch (action.type) {
case CHANGE_SORTKEY:
return { ...state, sortKey: action.sortKey };
... | true |
90154fbf94bc7cef14da2b6f319d0635343fe091 | JavaScript | MesayBeyene/GoogleBooksSearch | /client/src/pages/Search.js | UTF-8 | 1,976 | 2.5625 | 3 | [] | no_license | import React, { Component } from "react";
import Navbar from "../components/Navbar/Navbar";
import Header from "../components/Header/Header";
import BookSearch from "../components/BookSearch/BookSearch";
import ResultBox from "../components/ResultBox/ResultBox";
import api from "../utils/api";
// import Textbox from ".... | true |
c24fdf8f50d5ece91859a711151edd0750d10108 | JavaScript | igoroctaviano/DesafioTenfold | /test.js | UTF-8 | 1,721 | 3.828125 | 4 | [] | no_license | var alien = ['isk', 'vev', 'xesh', 'leth', 'cresh', 'dorn', 'mern'];
var roman = ['I', 'V', 'X', 'L', 'C', 'D', 'M'];
function getDecimal(roman) {
if(roman == 'I')
return 1;
if(roman == 'V')
return 5;
if(roman == 'X')
return 10;
if(roman == 'L')
return 50;
if(roman == 'C')
return 100;
if(roman == 'D')
... | true |
f7ecaacd29e763a0ffb4b90b4deecc92bef493cf | JavaScript | acyang123/Soundcloud-Rapper-Game | /keyboardControl.js | UTF-8 | 891 | 2.75 | 3 | [] | no_license | var CONTROLS = {
rapper : {
up : false,
down : false,
left : false,
right : false
}
};
document.addEventListener('keydown', function(event) {
switch (event.key) {
case "ArrowUp":
CONTROLS.rapper.up = true;
break;
case "ArrowDown":
CONTROLS.rapper.down = true;
break... | true |
beae35258b5327fec82966de73a2bc7604de8300 | JavaScript | sharad-24/SilverSpoonBakers | /app/containers/Admin/Categories/actions.js | UTF-8 | 9,403 | 3.03125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | /*
* Admin Categories Actions
*
* Actions change things in your application
* Since this boilerplate uses a uni-directional data flow, specifically redux,
* we have these actions which are the only way your application interacts with
* your application state. This guarantees that your state is up to date and nobo... | true |
2cd69101442dc69b745122c86a3ee79b5d023308 | JavaScript | matthewLeFevre/CIT366Projects | /AllEventsTicketing/Set.js | UTF-8 | 3,031 | 3.21875 | 3 | [] | no_license | function Set() {
this.intersection = function(listA, listB) {
var resultList = [];
/*-------------------------------Insert your code here -------------------------------------*/
if (listA === null || listB === null) {
return null;
}
for(let i = 0; i < listA.length; i++) {
le... | true |
070a9dc481f1715e62331f101dae800ab978c1cd | JavaScript | Shmiddty/pxlr | /src/lib/pxls.js | UTF-8 | 4,079 | 2.859375 | 3 | [
"MIT"
] | permissive | import { bfs } from "../util/search";
export function rect([cx, cy], height, width = height) {
const out = [];
for (let y = 0; y < height; y++) {
for (let x = 0; x < width; x++) {
out.push([
Math.floor(cx - width / 2 + x),
Math.floor(cy - height / 2 + y),
]);
}
}
return out;... | true |
db443918301371a5e4722867baa2dde80365a0cd | JavaScript | nkhil/coffeeNotes | /spec/note-spec.js | UTF-8 | 348 | 2.625 | 3 | [] | no_license | describe('Note', () => {
it('can instruct to create a note', () => {
let note = new Note();
expect(note.title != undefined).toEqual(true);
});
it('can record the title and body of a note', () => {
let note = new Note('note1', 'body');
expect(note.title()).toEqual('note1');
expect(note.body())... | true |
e0c32d94902abdd734a221224a902ed07922e45a | JavaScript | Nolnocn/Eden | /client/src/page/signin.js | UTF-8 | 552 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | "use strict";
var app = app || {};
// Handles serializing the sign in form and sending it to the server for validation
$( document ).ready( function() {
$( "#loginSubmit" ).on( "click", function( e ) {
e.preventDefault();
if( $( "#user" ).val() == '' || $( "#pass" ).val() == '' )
{
... | true |
52a8099e7d160d276cd9c6314f12a12570ea91e1 | JavaScript | birl-hri/gesture-recognition-for-human-robot-interaction | /source/control-center/utils/jsonToCsv/server.js | UTF-8 | 857 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | 'use strict';
/**
* Author: Aravinth Panchadcharam
* Email: me@aravinth.info
* Date: 30/06/15.
* Contributors:
*/
var classLabel = 3;
var csv = require('fast-csv'),
fs = require('fs'),
data = require('../../../../data/test/json/' + classLabel + '.js');
var csvStream = csv.createWriteStream({headers: true}),... | true |
a0619bdea423eb9219895d79bba05b31b02b36b0 | JavaScript | elioo/exercices-javascript | /mapArray/main.js | UTF-8 | 3,351 | 3.453125 | 3 | [] | no_license | // Algo that generate rectangles in the canvas
// Find canvas and set context
var canv = document.getElementById("canvasOne");
var canvctx = canv.getContext("2d");
// Setup variables
var mapArray = [] // Contains arrays with booleans values
var initialise = {
// Create the map with red rectangles
"rects": f... | true |
3ec6fc6fa9c76ed523e3b37f5f9c95a1bbb86cf1 | JavaScript | AniYoncheva/Telerik | /JavaScript/JavaScript Fundamentals/7.Using Objects/2.removeelements.js | UTF-8 | 275 | 3.96875 | 4 | [] | no_license | // Remove elements
var arr = [1,2,1,4,1,3,4,1,111,3,2,1,'1'];
Array.prototype.remove = function(digit) {
var length = arr.length;
for (var i = 0; i < length; i+=1) {
if (arr[i] === digit) {
arr.splice(i, 1);
}
}
}
console.log(arr);
arr.remove(1);
console.log(arr); | true |
52b4b9dea49b9d62d3bee440b13879006c7406c0 | JavaScript | Curry3O/headWeb | /漫谈大前端/js/原生JS/es6/Proxy/proxy使用场景3.js | UTF-8 | 986 | 3.203125 | 3 | [] | no_license | //访问日志
//对于那些调用频繁、运行缓慢或占用执行环境资源较多的属性或接口,开发者会希望记录它们的使用情况或性能表现,这个时候就可以使用 Proxy 充当中间件的角色,轻而易举实现日志功能:
let api = {
_apiKey: '123abc456def',
getUsers: function () { /* ... */ },
getUser: function (userId) { /* ... */ },
setUser: function (userId, config) { /* ... */ }
};
function logMethodAsync(timestamp, m... | true |
4a03c634d5f6ed492cb4fa84d4b6feba17ecb7a5 | JavaScript | aliligator/GestionPresence | /GestionDePresence/web/js/jsFaireAppel.js | UTF-8 | 16,263 | 2.75 | 3 | [] | no_license | /**
* onload Initialiser la page d'appel.
* @returns {undefined}
*/
$(function () {
var xhr = new XMLHttpRequest();
var load = 1;
xhr.open("GET", "servletAppel?load=" + load);
xhr.onload = function () {
if (xhr.status === 200) {
//formation
... | true |
2b4547db13becff2ed5a6c60e4c52c08b69e4a64 | JavaScript | ticklepoke/A-Tale-Of-Three-Lists | /reactive-sequence/fix-script-urls.js | UTF-8 | 796 | 2.625 | 3 | [
"MIT"
] | permissive | // Note: this code just hijacks any `node_modules` script URLs and
// remaps them to external https:// equivalents, if this page is
// loaded in an http/https instead of file context.
(function IIFE(){
var scripts = document.getElementsByTagName("script"),
curScript = scripts[scripts.length - 1], src,
scriptURLs... | true |
5b2b5e4179a69c527e41a73c1e27804e137ba842 | JavaScript | DeZZar/dragmate | /common.js | UTF-8 | 1,363 | 3.125 | 3 | [
"MIT"
] | permissive | /* Returns the document element matching
* a given ID value
*/
var $id = function (id) {return document.getElementById(id); };
/* Returns a node list or array of all elements with
* a given class name
*/
var $cls = function (cls) {
if (document.getElementsByClassName) {
return document.getElementsB... | true |