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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8f5c9c9635d0256348375c47ff171ba8a030f916 | JavaScript | bSathursan/Nodejs-SendMail | /form/src/contactform.jsx | UTF-8 | 3,182 | 2.5625 | 3 | [] | no_license | import React from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import axios from 'axios';
class Form extends React.Component {
state={
name:'',
email:'',
subject:'',
message:'',
sent:false
}
handleName=(e)=>{
this.setState({
n... | true |
bd4b7b46d75a77ccbbd50afd8edc85ee42de0840 | JavaScript | fidg37/966601-technomart-25 | /js/popup-cart.js | UTF-8 | 1,244 | 2.703125 | 3 | [] | no_license | var cart = document.querySelector(".modal-cart");
var cartLink = document.querySelectorAll(".buy-button");
var overlay = document.querySelector(".overlay");
var cartClose = cart.querySelector(".modal-close");
var continueButton = cart.querySelector(".continue");
for (var i = 0; i < cartLink.length; i++) {
cartLink[... | true |
abee2284b0b4b8f0eb89487f31b17eb382efe60c | JavaScript | mattgaskey/kean-galleries | /themes/custom/galleries/storybook-src/script-runner.js | UTF-8 | 8,817 | 2.890625 | 3 | [] | no_license | /**
* This script sets up the automatic execution of each pattern `.js` file whenever
* its corresponding Twig template is newly rendered in Storybook. It works with
* Webpack's hot-module-replacement API to detect all such pattern-scripts and to
* manage their execution as needed (so DO NOT `import` the `.js` file... | true |
14def69092f0fdf6f448899dd73632cdfc14df96 | JavaScript | fernandezluciano/Homebanking-Acamica | /FernandezLuciano-HomeBanking/js/homebanking.js | UTF-8 | 10,041 | 3.265625 | 3 | [] | no_license |
//Declaración de variables
var nombreUsuario = "Luciano Fernández";
var codigoDeSeguridad = "2040";
var saldoCuenta = 10000;
var limiteExtraccion = 3000;
var sumarAlSaldo = function(ingreso) {
saldoCuenta += ingreso;
actualizarSaldoEnPantalla();
}
var restarAlSaldo = function(egreso){
saldoCuenta -= egreso;
... | true |
c9984a390c35fc3157d5397ae0f96c1c5da4ea76 | JavaScript | arrian/traffic-simulator-api | /traffic.js | UTF-8 | 1,783 | 2.53125 | 3 | [] | no_license | var client = require('mongodb').MongoClient,
url = require('./config').mongo.url,
_ = require('lodash'),
data;
var uuid = require('node-uuid');
function connect() {
return new Promise((resolve, reject) => {
client.connect(url, (err, db) => {
if(err) {
console.log('Can\'t connect to database');
reject... | true |
0e6ee9bda32d2553af814eeea23a778af148fac3 | JavaScript | ani03sha/FCC-FrontEndLibraries | /04-React/react42.jsx | UTF-8 | 2,969 | 3.90625 | 4 | [] | no_license | /**
* Before moving on to dynamic rendering techniques, there's one last way to use built-in JavaScript
* conditionals to render what you want: the ternary operator.
*
* The ternary operator is often utilized as a shortcut for if/else statements in JavaScript.
*
* They're not quite as robust as traditional if/els... | true |
a66e8ec431411626fbd42756c6bb426f9820c7d9 | JavaScript | singh-anita/practicejs | /functionalobject.js | UTF-8 | 1,254 | 4.15625 | 4 | [] | no_license | var pizza = function () {
this.crust = 'thin';
this.toppings = 3;
this.hasBaccon = true;
};
var pizzaA = new pizza();
var pizzaB = new pizza();
// console.log(pizzaA)
// console.log(pizzaB)
// pizzaB.crust = 'medium';
// console.log(pizzaB)
// console.log(pizzaB instanceof pizza)
// console.log(pizzaB.const... | true |
5afd18a62bad7fd04a4e3b4c77f90036bb2c7ee1 | JavaScript | caooss/calculadora_js_funcional | /js/calc.js | UTF-8 | 389 | 3.3125 | 3 | [] | no_license | function botao(num){ //mostrar os números do visor
var salvar=document.calc.visor.value;
document.calc.visor.value=salvar+num;
}
function limpar(){
document.calc.visor.value="";
}
function calcular(){ //calcular usando eval
var conta=document.calc.visor.value;
var calculo = eval(conta);
var re... | true |
32542182dbe810b4bcdb44bc8bd6d9004a436800 | JavaScript | PrincessStevenson/GroupProject | /Cooking_starter/client/src/containers/main_container.js | UTF-8 | 1,315 | 2.609375 | 3 | [] | no_license | import React from 'react';
import { useState, useEffect } from 'react';
import RecipeService from '../services/receipesServices';
import RecipeList from '../components/recipeList';
import IndividualRecipe from '../components/individual_recipe_comp';
import './main_container.css';
const MainComponent = () => {
con... | true |
044435d33714b7dbd0e80a05dfa86c3725164b63 | JavaScript | mooncryption/steem-price-widget | /main.js | UTF-8 | 11,034 | 2.609375 | 3 | [] | no_license | // main.js
// created by @mooncryption on STEEM
var prices = { "bittrex": 0, "poloniex": 0, "coinMC": 0 };
var basecur = 0; var numbasecurs = 3; var change24 = "";
var doneloading = false;
var curtostring = ["USD", "BTC", "SBD"];
var btcpricesum = 1; var btcbittrex = 1; var btcpoloniex = 1;
var sbdpricesum = 1;
var pr... | true |
5f134eeda3bee877b0a49757c4fe50469a6064e2 | JavaScript | jlorenzor/redux-polling | /src/API/blockchair.js | UTF-8 | 1,241 | 2.859375 | 3 | [] | no_license | const createUrl = (endpoint = '') => (params = '') =>
`${process.env.REACT_APP_BLOCKCHAIR_API_URL}${endpoint}`.concat(params);
const bitcoinStatsEndpoint = createUrl('bitcoin')();
const API_CALLS = {
fetchStats: createUrl('stats'),
fetchBitcoinStats: createUrl('stats/bitcoin'),
createUrlWithoutParams: (x) => c... | true |
a6a11a2f29f48a588c4152bac10310ec67aa3831 | JavaScript | jalfgit/classexample | /viz.js | UTF-8 | 1,188 | 2.953125 | 3 | [] | no_license | // this contains the logic code for my viz
var revenue = {
x: sales.month,
y: sales.revenue,
mode: 'lines',
type: 'scatter'
};
Plotly.newPlot('revenue', [revenue]);
var cost = {
x: sales.month.slice(-3),
y: sales.cost.slice(-3),
type: 'bar'
};
var layout = {
title: 'cost by mo... | true |
dc0d10ce150c9b5cd689cbb7bd5cade0c8a0e26b | JavaScript | mirabiliamagazine/mirabilia | /styles/bauhaus/bauhaus.js | UTF-8 | 953 | 2.703125 | 3 | [] | no_license | function bauhaus(html_final){
var loaded_document_edited = html_final;
changeCSS("bauhaus.css")
var h = document.createElement("DIV");
h.classList.add("circle");
loaded_document_edited.appendChild(h);
var f = document.createElement("DIV");
f.classList.add("squ... | true |
a3272116d5c52284a2564da92e97d8a09fe99e8f | JavaScript | naeema-19/hacktober-test | /app.js | UTF-8 | 659 | 2.765625 | 3 | [] | no_license | const menuBtn = document.querySelector('.fa')
const hamburger = document.querySelector('.fa-bars');
const close = document.querySelector('.fa-close')
const nav = document.querySelector('#navbar')
hamburger.addEventListener('click', (e) => {
nav.classList.toggle('show')
if (nav.classList.contains('show')... | true |
a91f1e8dea5e86aed4dfb0f82ebf30eb43ee86ef | JavaScript | Tim-byte-afk/1255571-keksobooking-21 | /js/map.js | UTF-8 | 6,348 | 2.515625 | 3 | [] | no_license | 'use strict';
const START_X = 570;
const START_Y = 375;
const PRICE_TYPE = {
middle: {
min: 10000,
max: 50000
},
low: {
min: 0,
max: 10000
},
high: {
min: 50000,
max: 999999999
}
};
const MAX_COUNT = 5;
const MAX_COUNT_CHECKS = 5;
const BASE_FILTER_VALUE = `any`;
const map = docu... | true |
b800164066c59e80e08beb8a2aef26359c7c6f01 | JavaScript | puyol105/CryptoPRC | /cryptoAPI/src/api/exchanges.js | UTF-8 | 964 | 2.515625 | 3 | [
"MIT"
] | permissive | const express = require('express');
const router = express.Router();
const Exchanges = require('../controllers/exchanges');
// Checkar os controllers e models
router.get('/:slug', function(req, res){
Exchanges.listExchange(req.params.slug)
.then( dados => {
res.json(dados)
})
.catch( e => res.sta... | true |
29257c1d9f73a24dee3ec972d0fb80a1184bf89c | JavaScript | hgparker/full_stack_project | /frontend/reducers/answers_reducer.js | UTF-8 | 829 | 2.53125 | 3 | [] | no_license | import {RECEIVE_ANSWERS, RECEIVE_ANSWER, REMOVE_ANSWER} from "../actions/answer_actions";
import {RECEIVE_QUESTION} from "../actions/question_actions";
const answersReducer = (oldState = {}, action) => {
Object.freeze(oldState);
switch (action.type) {
case RECEIVE_ANSWERS:
return action.pay... | true |
7fee089fd59a2a03ba3ebffc4dc6831710329be2 | JavaScript | spint414/spint414.github.io | /Game/Lesson3/Lecture/main.js | UTF-8 | 3,477 | 3.6875 | 4 | [] | no_license | const scoreEle = document.getElementById('score');
const containerEl = document.getElementById('container');
// Khai báo biến
let score = 0;
let num = 20;
let arrayPoints = [];
// Đối tượng
const board = {
width: 1000,
height: 600,
color: '#ffda79',
};
let boss = {
width: 80,
height: 80,
col... | true |
5da50cb0e2ed4f22cf3f170f98fed1d38a5a7b9a | JavaScript | criticalmash/assemble-midden | /test/dest/midden-client.js | UTF-8 | 615 | 2.765625 | 3 | [
"MIT"
] | permissive | /**
* Client side scripts for midden.js
* Adds hide/reveal functionality to
* midden-* elements
*/
/* globals window, document */
(function(window, undefined) {
function toggleNest(e){
var nest = this.parentNode.querySelector('.midden-nest');
nest.classList.toggle('midden-show');
}
// find all
... | true |
45c30c16368eb3c48fc1e0d713d9371fd0de2311 | JavaScript | jakubstankowski/freecodecamp-javascript-course-solution | /INTERMEDIATE ALGORITHM SCRIPTING/Sum All Odd Fibonacci Numbers.js | UTF-8 | 581 | 3.875 | 4 | [] | no_license | function fib(n) {
if (n < 2) {
return [1];
}
if (n < 3) {
return [1, 1];
}
var a = fib(n - 1);
a.push(a[n - 2] + a[n - 3]);
return a;
}
function sumFibs(num) {
if (num <= 1) {
return 1;
}
const array = fib(num);
const arrayLessNumberFilter = array.f... | true |
196ceb2b4a26ed36c41db402ba2702ebc2ab7d5f | JavaScript | shearytan/D3-learning-files | /Extra/scale/01/01-scaleLinear/js/main.js | UTF-8 | 845 | 3.171875 | 3 | [] | no_license | var data = [1, 2, 3, 4, 7.5, 9, 10];
var svg = d3.select("#chart-area")
.append("svg")
.attr("width", 1000)
.attr("height", 1000)
var myScale = d3.scaleLinear()
.domain([0, 10])
.range([0, 400])
var colorScale = d3.scaleLinear()
.domain([0, 10, 0])
.range(['green', 'pink', 'blue'])
var t... | true |
65c3df3f95d8bc165b6d181af2fe2b43a1a5bf74 | JavaScript | scolsen/plunder | /test/meta-test.js | UTF-8 | 2,705 | 2.578125 | 3 | [] | no_license | var assert = require('assert');
const plunder = require('../plunder');
const fs = require('fs');
const example = fs.readFileSync(__dirname + '/example_data/uber.json');
const j = JSON.parse(example);
describe('Meta', function(){
describe('#keys()', function(){
it('Should return the keys of the json object.', ... | true |
6a6712205fc25f2545532b7008e4c064698a6ee6 | JavaScript | tilleyarthur/repomen-oop | /tests/Employee.test.js | UTF-8 | 517 | 2.96875 | 3 | [] | no_license | function Employee(name, id, email)
this.name = name;
this.id = id;
this.email = email;
this.getrole = getrole;
Employee.prototype.getName = function () {
return `${this.name} 'Name'`;
};
test
Employee.prototype.getId = function () {
return `${this.id} is ${this.zero}
}`;
};
test
Employee.prototype.getEmail = f... | true |
3ba0f21b698c4a7ca005afc34e774aaa7121615a | JavaScript | j0d0nn/rideshare | /js/giveride.js | UTF-8 | 1,630 | 2.640625 | 3 | [] | no_license | var GiveRide = {
confirm: function() {
$('#formdata').hide();
$('#confirmdata').show();
var seats = $('#seats').val();
$('#summary').html('<h1>OK, we\'ll jot you down for ' + seats + ' available ' + (seats > 1 ? 'seats' : 'seat') + ' at the location below. Cool?</h1> \
<input type="button" id="save" val... | true |
09c263c88a675f1d489575c157351943085e7a76 | JavaScript | TobiahRex/LC_CustomAPI2.0 | /server.js | UTF-8 | 2,400 | 2.734375 | 3 | [] | no_license | 'use strict';
const PORT = 3000;
const http = require('http');
const fs = require('fs');
const path = require('path');
const MathAPI = require('./APIservices/math.js');
const DateAPI = require('./APIservices/date.js');
const StockAPI = require('./APIservices/stock.js');
const server = http.... | true |
f7ab26eaafc6bb3dae0ef24f7e53311f29c62c5c | JavaScript | SeanMcP/onkey-event-manager | /src/validate.js | UTF-8 | 573 | 2.796875 | 3 | [
"MIT"
] | permissive | import isObject from 'isobject'
export function areValidFunctions(keyActionMap) {
for (const key in keyActionMap) {
if (typeof keyActionMap[key] !== 'function') {
throw TypeError(`The value for '${key}' must be a function`)
}
}
}
export function areValidParams(keyActionMap) {
if (!isObject(keyActi... | true |
fde0713bcb0952c400ed2dd68350d8a298809e62 | JavaScript | VictoriaTheBrave/game | /src/components/modal-dialog/victory/victory-modal.js | UTF-8 | 882 | 2.6875 | 3 | [] | no_license | import './victory-modal.css';
import { ENTER } from '../../../helpers/utils';
const template = `
<div class="overlay"></div>
<div class='victory-modal'>
<p>Ты победил! Пора сразиться со следующим монстром</p>
<button class="victory-ready">Я готов!</button>
</div>
`;
function drawVictoryModal() {
docum... | true |
71c73ab52a3a5ef4dd2da9504cc16d6375460a3c | JavaScript | nathanojnabetse/Portfolio | /js/script.js | UTF-8 | 3,305 | 3.171875 | 3 | [] | no_license | //===================================== DARK THEME =========================
const themeButton = document.getElementById('theme-button')
const darkTheme = 'dark-theme'
const iconTheme = 'uil-sun'
// PREVEIOSLY SELECTED TOPIC (checking from local storage)
const selectedTheme = localStorage.getItem('selected-theme')
con... | true |
f4657fd9906f25e7ab17ff4e70864ff0d199b020 | JavaScript | ColinJWatts/Reaper | /js/plants/corn/corn.js | UTF-8 | 1,299 | 2.875 | 3 | [] | no_license | Corn.prototype = Object.create(Plant.prototype);
Corn.prototype.key = 'cornPlant';
Corn.prototype.constructor = Corn;
Corn.prototype.spreadThresh = 8;
Corn.prototype.spreadRate = 16;
Corn.prototype.spawnThresh = 4;
Corn.prototype.spawnRate = 30;
Corn.prototype.tag = 'corn';
Corn.prototype.spawnMob = Scarecrow;
//x and... | true |
3712ab29c49e785b7b806b211516305e2b659d2b | JavaScript | kegoba/AI-online-course | /src/common/helpers/helper.js | UTF-8 | 182 | 2.625 | 3 | [
"MIT"
] | permissive | const trimString = (value, size = 40) => {
if(value){
value = value.length > size ? value.substring(0, size)+ '...' : value
}
return value;
}
export {trimString} | true |
13fb3c9d8b5179f47ecb1961992f7df0a678bb7e | JavaScript | DHUK98/GroupDev | /web_app/static/javascript/station_utils.js | UTF-8 | 1,286 | 2.9375 | 3 | [] | no_license | // method to be used to sort the stack from lowest to highest [1,2,3,...,n]
function sortFunction(a, b) {
if (a[0] === b[0]) {
return 0;
} else {
return (a[0] > b[0]) ? -1 : 1;
}
}
function convert_cluster_jsons(current_data) {
for (let i = 0; i < current_data.length; i++) {
con... | true |
c2413e0565011c116e61355abec20978476c4912 | JavaScript | kevinhhoang/facerecognitionwithbackend | /src/components/Signin/Signin.js | UTF-8 | 4,460 | 2.59375 | 3 | [] | no_license | import React, { Component } from 'react';
class Signin extends Component {
constructor(props) {
super(props);
this.state = {
signInEmail: '',
signInPassword: ''
}
}
onEmailChange = (event) => {
this.setState({ signInEmail: event.target.value });
... | true |
35f17f257d30ec054c3eb4d26701476b091f9cd7 | JavaScript | BNV99/HW1 | /SRC/ifElse/task3.js | UTF-8 | 195 | 3.046875 | 3 | [] | no_license | "use strict"
var a=3;
var b=45;
var c=6;
var res=0;
if (a>0) {
res=Number(a);
}
if(b>0) {
res=res+Number(b);
}
if(c>0) {
res=res+Number(c);
}
console.log (res);
| true |
530210ac929989b346edd46378717bd3d6d25271 | JavaScript | callistachang/ValueBasedPricingProgram | /frontend/src/components/SentimentTable.js | UTF-8 | 2,107 | 2.546875 | 3 | [] | no_license | import { Table, Thead, Tbody, Tr, Th, Td } from "@chakra-ui/react";
import { useEffect, useState } from "react";
import { readRemoteFile } from "react-papaparse";
export function SentimentTable(props) {
const [isLoading, setIsLoading] = useState(true);
const [arr, setArr] = useState([]);
const [competitorRankArr... | true |
2a365e8d0895784e130505d454b83bd58158feb9 | JavaScript | AndrewLeontev/http_request | /src/register_user.js | UTF-8 | 1,394 | 2.546875 | 3 | [] | no_license | import url from 'url';
import http from 'http';
import querystring from 'querystring';
const getToken = body => body.match(/value="(\w+)"/)[1];
export default (registrationFormUrl, submitFormUrl, nickname, callback) => {
// BEGIN (write your solution here)
http.get(registrationFormUrl, gres => {
if (... | true |
3bb975c7699ddfa315f8cb9a670e56f4c4e204ad | JavaScript | juanidiaz/RPS-Multiplayer | /assets/javascript/code.js | UTF-8 | 16,226 | 3.390625 | 3 | [] | no_license | // VARIABLES --------------------------------------------
// CONSTANTS
// ARRAYS
// STRINGS/CHAR
var userId = ''; // User UD when connecting to database
var mode = ''; // Keeps the mode the user is on ('player1', 'player2' or 'viewer')
// NUMBER/INTEGER
var wins = 0; // Keeps track of won ma... | true |
fe42d31781d502f42860cf1a6390f91d379e8581 | JavaScript | kennyooi/ep-react-ui | /src/components/Modal/Modal.js | UTF-8 | 3,803 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* Modal component
*/
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { createPortal } from 'react-dom';
import { addClass, removeClass } from '../../helpers/styler';
import './Modal.less';
export default class Modal extends PureCompo... | true |
14bdcae55a839cd5446b8390c57741cd538a262f | JavaScript | cdowlatram/Stereoscopic-Image-Analysis | /app/client/src/components/MeasurePoints.js | UTF-8 | 5,784 | 2.765625 | 3 | [] | no_license | import React from 'react';
import LoadingScreen from './LoadingScreen';
class MeasurePoints extends React.Component {
constructor(props) {
super(props);
this.state = {
distance: '',
isGroundDistance: true,
isLoading: false,
loadingMessage: 'Measuring distance between selected points.... | true |
63afcc9540813dd9700344fb46805d2155ed6f2d | JavaScript | lcorb/Tempus-Twitch-Bot | /twitch/advertise.js | UTF-8 | 2,385 | 2.859375 | 3 | [] | no_license | const api = require(`../tempus/api`);
/**
* AdvertiseManager class
*/
class AdvertiseManager {
/**
* Spawn timer for advertising servers
*/
constructor() {
this.servers = {};
this.regions = [];
setInterval(this.refresh.bind(this), 60000);
this.refresh(true);
}
/**
* GET server API.
... | true |
f9168951c0fa66826d8c829e7ea911fee8126774 | JavaScript | jasonluocesc/WebSoftwareDevelopment2017 | /exercises/04_javascript/decorate_objects.js | UTF-8 | 1,066 | 3.328125 | 3 | [] | no_license | function addPersonMethods(def){
var obj = {
name:def['name'],
age:def['age'],
greet : function(greeting){
console.log(greeting+", my name is " + this.name);
},
compareAge :function (otherpeople) {
if (this.age == otherpeople.age){
console.log... | true |
a5a6c0b78bfb269051f8cab00d5a01c65ef778b7 | JavaScript | shorya009/javascript | /checkboxexercise/checkbox_manager.js | UTF-8 | 2,751 | 3.46875 | 3 | [] | no_license | const MaxCheckCount = 3;
class CheckboxManager {
constructor(checkboxGroup, noneCheckbox, maxCheckCount) {
this.checkboxGroup = checkboxGroup;
this.noneCheckbox = noneCheckbox;
this.selectedCheckboxes = []; //array to store checked boxes value
this.maxCheckCount = maxCheckCount; //m... | true |
71270f37937d0e99ec516d792b0c84213b33e5ec | JavaScript | achadha0111/hacksocbot | /intents/greetings.js | UTF-8 | 2,470 | 2.71875 | 3 | [] | no_license | const random = array => { return array[Math.floor(Math.random() * array.length)] }
const getGreetings = (user, res, person, tableLocation) => {
console.log(user)
if(user.new === false){
var quickReplies = {"facebook":{
"text":`Hi ${user.name}, Since it is your first time here, you can a... | true |
2c021682c00053dd75faa9fec23a3c4357b442bd | JavaScript | b7Rexx/b7Rexx.github.io | /JsClassAssignments/js/task2/education-iteration.js | UTF-8 | 518 | 2.75 | 3 | [] | no_license | console.log('Task2: education iteration');
var myself = {
'name': 'Bijen Maharjan',
'address': 'Dhalko',
'emails': 'bij.maharjan@gmail.com',
'interests': 'chill',
'education': [
{'name': 'SVI', 'enrolledDate': 2005},
{'name': 'Nist', 'enrolledDate': 2012}
]
};
for (var kkey in ... | true |
81337aca718d16b5c744082b6ff161420700b3d6 | JavaScript | apiedrasanta/guatechapin1 | /public/js/cart.js | UTF-8 | 3,876 | 2.578125 | 3 | [] | no_license |
function init() {
if(localStorage["cart"]) {
var storage = JSON.parse(localStorage["cart"]);
var html = [];
var categories = {
0: "tejidos",
1: "cueros",
2: "mostacilla",
3: "bolsos",
4: "carteras",
5: "ropas"
};
var subtotal = 0;
storage.forEach(function each(store) {
subtotal +=... | true |
c32c58f3d65942aad30c787d89934e7b0b8187e0 | JavaScript | dineshkummarc/tiddlywiki-svn-mirror | /contributors/FND/verticals/DevPad/plugins/RemoteBackgroundPlugin.js | UTF-8 | 2,283 | 2.65625 | 3 | [] | no_license | /***
RemoteBackgroundPlugin v1.0 (2007-02-19)
by FND
Retrieves a random image from XKCD and uses it as background image.
''N.B.:'' Do not abuse this; retrieving the images from XKCD could be regarded as hotlinking!
!!Changelog
!!!v0.9 (2007-02-18)
* initial release
!!!v1.0 (2007-02-19)
* added ability to position ba... | true |
3dadbc5692ff7bf0e96fd964abb114fd032f77e6 | JavaScript | NeuroWhAI/shorelark | /www/index.js | UTF-8 | 1,966 | 3.328125 | 3 | [
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import * as sim from "lib-simulation-wasm";
CanvasRenderingContext2D.prototype.drawTriangle = function (x, y, size, rotation) {
this.beginPath();
this.moveTo(
x + Math.cos(rotation) * size * 1.5,
y + Math.sin(rotation) * size * 1.5
);
this.lineTo(
x + Math.cos(rotation + 2.0 / ... | true |
60744d587b8e5e1f7de67c9bc8fe85234d11874e | JavaScript | keishalois/SkyGIT-MVC-Final-Project | /views/javascript/chatbox.js | UTF-8 | 1,659 | 2.734375 | 3 | [] | no_license | $(document).ready(function(){
$("#exit").click(function(){
var exit = confirm("Sure you want to leave this session?");
if(exit===true){
$.get("?controller=chat&action=exitChat");
window.location.href = 'index.php?controller=blog&action=readAll';}
}); });
$(document).r... | true |
a8b9ea291c416df0baa3906f3ab95d615113d5e8 | JavaScript | YoelRibero/javaScriptUdemy | /teoria/1-objetos_constructores_this/2-otros_objetos_y_constructores/app.js | UTF-8 | 890 | 4.78125 | 5 | [] | no_license | // Strings utilizando constructores
const nombre1 = 'Pedro';
const nombre2 = new String('Pedro');
console.log(typeof nombre1); // String
console.log(typeof nombre2); // Object
// Número utilizando constructores
const number1 = 20;
const number2 = new Number(20);
console.log(typeof number1); // Number
console.log(typ... | true |
6087ab065d104505fc0d3a3c5b06b5a3d8d9858b | JavaScript | gaving/hta.js | /hta.js | UTF-8 | 3,169 | 2.671875 | 3 | [] | no_license | /**
* Hta.js - Security measures for an HTA environment
*
*/
(function(h) {
/**
* Check if we are actually a HTA
*/
h.isHTA = function() {
return (document.all && top.document && (top.document.getElementsByTagName('application')[0]));
};
/**
* Check if this is a text input
*... | true |
d4947bdc448214ef3e6900e17b0b848b4e7452e1 | JavaScript | manansaxena/Web-Development-Bootcamp | /section-28-ajax/app.js | UTF-8 | 4,153 | 2.78125 | 3 | [] | no_license | // JSON
// const data = `{
// "glossary": {
// "title": "example glossary",
// "GlossDiv": {
// "title": "S",
// "GlossList": {
// "GlossEntry": {
// "ID": "SGML",
// "SortAs": "SGML",
// "GlossTerm": "Standard Generalized Markup Language",
// ... | true |
c7d44993d995be18c85464ddaea75462924d793e | JavaScript | priyangaprakash/coursera-test | /Lecture 2/app.js | UTF-8 | 1,335 | 2.90625 | 3 | [] | no_license | (function(){
'use strict';
angular.module('filterApp',[])
.controller('filterController',myFunction)
.filter('custom',myFilter)
.filter('param',argFilter);
myFunction.$inject = ['$scope','$filter','customFilter'];
function myFunction($scope,$filter,customFilter)
{
$scope.msg = "h... | true |
e737cbd4c22cfbc58c414246cc561ead5916f1ed | JavaScript | study2018-9-5/summary | /learnJS/ES6/4.ES7的async.js | UTF-8 | 1,349 | 3.953125 | 4 | [] | no_license | // async是ES7才有的与异步操作有关的关键字,和Promise,Generator有很大关联的。
async function helloAsync(){
return "HelloAsync";
}
// Promise{'helloAsync'},async函数返回一个Promise对象,可以使用then方法添加回调函数。
console.log("helloAsync -> HelloAsync", helloAsync())
helloAsync().then(function (res) {
// console.log("res", res) // HelloAsync
})
/*
asyn... | true |
6d3132fa6e268e960e1eeb83a297b398555cda95 | JavaScript | Sanjit-Shelke/Advanced_Web_Programming | /Day_9/exam1.js | UTF-8 | 1,388 | 3.125 | 3 | [] | no_license | let l=0
function like() {
let l1 = document.querySelector('#like');
l ++;
let l2 = "Like" + " "+l;
document.querySelector('#like').innerHTML = l2;
}
let d = 0;
function dislike() {
let d1 = document.querySelector('#dislike');
d++;
let d2 = "Dislike" + " " + d;
document.querySelector... | true |
ea71d8c60f83fe24e80e0fef166abc50ee893d84 | JavaScript | ConnorBryan/Merkelle | /src/Game/classes/Worldmap/Tile/Dungeon/index.js | UTF-8 | 972 | 2.59375 | 3 | [] | no_license | /* @flow */
import Chance from 'chance';
import type { AdventurerData } from '../../../Adventurer/types';
import Monster from '../../../Monster';
import Tile from '../index';
import Trap from './Trap';
import Encounter from './Encounter';
const CHANCE = new Chance();
export default class Dungeon extends Tile {
name... | true |
42ae8e63ce4fe0e11da6dd51f2461585c5a39066 | JavaScript | cfa-jonathan/f21-prototypes | /prototypes.js | UTF-8 | 462 | 3.875 | 4 | [] | no_license | function Animal(numberOfLegs, numberOfEyes)
{
this.legs = numberOfLegs;
this.eyes = numberOfEyes;
}
// (1) Create a new object constructor for a Dog that
// meets the following criteria
// - Barks in the console
// - Breed can be set upon creation
// - Inherits from the Animal object
// (2) Create a... | true |
d30f0e528835788e24e4dfa991dc78e06263e152 | JavaScript | Gwanwoo/frontend-class | /frontend-class/-study02/sum.js | UTF-8 | 265 | 3.4375 | 3 | [] | no_license | /**
*
*/
function sumTest(){
var arr=[];
for(var i=0;i<1000;i++){
arr[i]=prompt("정수를 입력하세요");
if(arr[i]==null){
break;
}
}
var sum=0;
for(var k=0;k<arr.length;k++){
sum=sum+arr[k]*1;
}
alert("합은"+sum);
}
sumTest(); | true |
3064431894c794280ae1bb92e678626c6d0b942d | JavaScript | Luli158/idenmatica | /validarPremium.js | UTF-8 | 1,427 | 3.28125 | 3 | [] | no_license | var numeros="0123456789";
function tiene_numeros(texto){
for(i=0; i<texto.length; i++){
if (numeros.indexOf(texto.charAt(i),0)!=-1){
return true;
}
}
return false;
}
function validarPremium(){
if (document.premium.nombre.value == null || document.premium.nombre.value.length == 0 || /^\s... | true |
e28f5cf939118601270113d04e945cc0bd01a724 | JavaScript | kenrick90/SysMon | /systemInfos/static/systemInfos/tableSearch.js | UTF-8 | 1,848 | 3.1875 | 3 | [] | no_license | function searchProcessTable() {
// Declare variables
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("processInput");
filter = input.value
table = document.getElementById("processTable");
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide thos... | true |
23d618a95e3f2c2716345d0ea50519326fe8e262 | JavaScript | dewadisrivastava/balloon | /sketch.js | UTF-8 | 868 | 2.8125 | 3 | [] | no_license | var air,database,airImage,airImage2,airImage3
var position,city
function preload(){
city=loadImage("cityImage.png")
airImage=loadImage("hotairballoon1.png")
airImage2=loadImage("hotairballoon2.png")
airImage3=loadImage("hotairballoon3.png")
}
function setup(){
createCanvas(700,700)
air=createSprite(... | true |
46f1bc569baac91b1b816cb5db9c541a5d32caaf | JavaScript | EvgheniiC/JsLernen | /js/script.js | UTF-8 | 6,589 | 3.296875 | 3 | [] | no_license | /* Задания на урок:
1) Удалить все рекламные блоки со страницы (правая часть сайта)
Remove all ad units from the page (right side of the site)
2) Изменить жанр фильма, поменять "комедия" на "драма"
Change the genre of the film, change "comedy" to "drama"
3) Изменить задний фон постера с фильмом на изображение "bg.jp... | true |
da7f5fd263e38ad1e2658abc9db92bf3ff6f5897 | JavaScript | rayzlui/l33t_code | /searchRange.js | UTF-8 | 1,523 | 3.828125 | 4 | [] | no_license | //From 34 in LeetCode
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
function searchRange(nums, target) {
let left = 0;
let right = nums.length - 1;
let mid = Math.floor((right + left) / 2);
if (nums.length === 0) {
return [-1, -1];
}
if (nums.length === 1) {
if (... | true |
68f9d30bd6da70ced8b45d57e575184fb48073a5 | JavaScript | plasticine/react-canvas-experiments | /examples/05-images/app.js | UTF-8 | 903 | 2.640625 | 3 | [] | no_license | 'use strict';
import React from 'react';
import canvas from 'react-canvas';
class App extends React.Component {
render() {
let size = this.getViewportSize();
return (
<canvas.Surface top={0} left={0} width={size.width} height={size.height}>
<canvas.Image src="./caffeine.gif" fadeIn={true} sty... | true |
87198a185f819fd7083fae6b53a84f721c7d0000 | JavaScript | phongnhat19/kintone-ui-component | /esm/js/RadioButton/__test__/addItem.test.js | UTF-8 | 2,340 | 2.765625 | 3 | [
"MIT",
"OFL-1.1"
] | permissive | import RadioButton from '../index';
describe('Unit test RadioButton addItem', function () {
var expectedLabels = ['Orange', 'Banana', 'Lemon'];
var expectedValues = ['orange', 'banana', 'lemon'];
test('Function AddItem run successfully without optional props', function () {
var radioButton = new Rad... | true |
b4574cb3e0d5532a915c713cde78bb425105ebeb | JavaScript | kigenofkenya/unistack-core-express_multiapp | /apps/example/public/javascripts/modules/purejs.ajax.js | UTF-8 | 598 | 2.734375 | 3 | [] | no_license | var AjaxHandler={
callAjax:function(type,url, callback,dataparams,reqheader){
var r = new XMLHttpRequest();
r.open(type, url, true);
if(reqheader){
r.setRequestHeader( "Content-type", reqheader );
}
r.onreadystatechange = function(){
if (r.readyState == 4 && r.status == 200){
... | true |
5c3be034ef890a239cefb36122d10f3353744712 | JavaScript | pixeltight/js-problems-and-algos | /num-arrays.js | UTF-8 | 558 | 3.703125 | 4 | [] | no_license | // const numOfSubbarrays = (arr) => {
// for (let subArr of arr) {
// return !Array.isArray(subArr) ? 0 : arr.length
// }
// }
const numOfSubbarrays = (arr) => arr.filter(a => a instanceof Array).length
console.log(numOfSubbarrays([[1, 2, 3]]))
console.log(numOfSubbarrays([[1, 2, 3], [1, 2, 3], [1, 2, 3]]))
c... | true |
a612b173b9790a53fb1d45626d27df67017c8c56 | JavaScript | Jagermeister/cells_merge | /entity/entitygroup.js | UTF-8 | 3,129 | 2.96875 | 3 | [] | no_license | "use strict";
class EntityGroup {
constructor(context, entityClassName, count_initial, count_max, spawn_size, spawn_ms_cooldown, treeDisallowed) {
this.context = context;
// Canvas link
this.entityClassName = entityClassName;
// Entity we are holding
this._map = new M... | true |
698e3a04c0911a7c60b82e422d368061424fa221 | JavaScript | Pa7ry/html5-ejercicios | /ejerciciosJS/ejercicioJS.js | UTF-8 | 2,978 | 3.5 | 4 | [] | no_license | var meses = ["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"];
for(var i = 0; i < 12; i++) {
console.log(meses[i]);
}
for( i in meses) {
console.log(meses[i]);
}
var valores = [true, 5, false, "hola", ... | true |
9e2b22973dc976205754ae5b163948f100bea055 | JavaScript | c4collins/freethrow-probability-chart | /src/App.js | UTF-8 | 4,121 | 2.921875 | 3 | [] | no_license | import React, { Component } from 'react';
import { BarChart } from 'react-d3-basic';
import './App.css';
const NUM_OF_ATTEMPTS = 6;
const FREETHROW_PERCENTAGE = 70; // %
export default class App extends Component {
change_ft_percent = (event) => {
const input_pct = event.target.value;
if (input_pct >= 0 &&... | true |
474f966059e5b210ae2d89060cfd681af8e2b5c2 | JavaScript | Umiidd/FullStackTesting | /Tests/spec5.js | UTF-8 | 3,553 | 2.609375 | 3 | [] | no_license | //Pages
var SignIn = require("../Pages/SignIn.js");
//var testData = require("../TestData/data.json");
//DB Connection
var pgp = require('pg-promise')(/*options*/);
var queries = require("../TestData/queries.js");
var connectionString= require("../TestData/dbConnection.js")
describe('Login wi... | true |
54d10ac0acf82a6a67831270e0b77ea3c7860789 | JavaScript | laith-2020/data-structures-and-algorithms-2 | /challenges/Data-Structures/repetedWord/repeat.js | UTF-8 | 615 | 3.296875 | 3 | [] | no_license | 'use strict';
const HashTable = require('../hashTable/hash');
function repeatedWord(word) {
let words = word.replace(/,/g,'').split(' ');
console.log('words',words);
let hashtable = new HashTable(words.length);
for (let i = 0; i < words.length; i++) {
let key=words[i].toLowerCase();
console.log('key... | true |
b34441d3cda27601969515ecca5c560e10d40381 | JavaScript | lukiee555/ComicReader- | /ComicBackend/index.js | UTF-8 | 2,207 | 2.515625 | 3 | [] | no_license | var express = require("express");
var mysql = require("mysql");
var bodyParser = require("body-parser");
//Connect to MySQL
var connect = mysql.createConnection({
host: "localhost",
user: "root",
password: "",
database: "testmanga"
});
//Create RestFul
var app = express();
var publicDir = __dirname + "/public... | true |
22240465a48eb72d33fbc196f5b1d8a1dc04b8d7 | JavaScript | roenfa/championshipsApp | /server/server/core/database/adapter-factory.js | UTF-8 | 1,435 | 2.59375 | 3 | [
"MIT"
] | permissive | import fs from 'fs';
import path from 'path';
const GENERIC = 'generic';
const ADAPTER_FOLDER = 'adapter';
let pathAdapters = path.join(__dirname, ADAPTER_FOLDER);
/**
* Module for load all adapters.
*/
export default class AdapterFactory {
constructor() {
this.adapters = [];
}
/**
* Load... | true |
39ed11b6a60a65af2ac0ea036fa35a6ef034411f | JavaScript | anju851/YouTube-Video-Browsing | /src/components/VideoItem.js | UTF-8 | 910 | 2.84375 | 3 | [] | no_license | import './VideoItem.css';
import React from 'react';
//the below code would give an error saying Each child in a list should have a unique "key" prop.
/*const VideoItem = props => {
return <div>VideoItem</div>;
}; */
// to resolve the error we have refactored as below
const VideoItem = ({ video, onVideoSelect }... | true |
49229dcb84959b9ba8366265a6c677a544204750 | JavaScript | rtfeldman/node-test-runner | /lib/Project.js | UTF-8 | 2,818 | 2.515625 | 3 | [] | permissive | // @flow
const fs = require('fs');
const path = require('path');
const ElmJson = require('./ElmJson');
// Poor man’s type alias. We can’t use /*:: type Project = ... */ because of:
// https://github.com/prettier/prettier/issues/2597
const Project /*: {
rootDir: string,
testsDir: string,
generatedCodeDir: string... | true |
51cedb8ed5357ef366b7b06e88826f9bc6cd088f | JavaScript | d-dimitrov92/JavaScript_SoftUni | /SoftUni JSFund-sept2020/Exams/FinalExam-13Dec2020/01.solve.js | UTF-8 | 1,893 | 3.609375 | 4 | [] | no_license | function solve(array) {
let string = array.shift();
let line;
while ((line = array.shift()) != 'End') {
let tokens = line.split(' ');
let command = tokens[0];
if (command == 'Translate') {
let char = tokens[1];
let replacement = tokens[2];
let inde... | true |
cb52f9bb6a8c6cc1a2dfe7fc339ffc5627325829 | JavaScript | berendakova/news_portal | /assets/js/topMenuSlider.js | UTF-8 | 594 | 2.640625 | 3 | [] | no_license | let topSliderIndex = 0;
let topSlider = document.querySelectorAll('.opened-top-menu-item');
function topMenuSlider(elem) {
if(elem == 'arrow-right') {
topSlider[topSliderIndex].classList.toggle('active');
topSliderIndex++;
if(topSliderIndex == topSlider.length){
topSliderIndex = 0
}
topSlider[topSliderI... | true |
ecda6a23f823d73ca82d01e728715b0274b20671 | JavaScript | lorenzoferrone/CreativeCoding | /metro/app/grid.js | UTF-8 | 1,109 | 3.046875 | 3 | [] | no_license | // Generated by CoffeeScript 1.10.0
this.Dot = (function() {
function Dot(x1, y1) {
this.x = x1;
this.y = y1;
}
Dot.prototype.draw = function(r, g, b) {
stroke(r, g, b, 10);
fill(r, g, b, 10);
return ellipse(this.x, this.y, 10, 10);
};
Dot.prototype.highlight = function(r, g, b) {
st... | true |
bed9e4dbe43424b4c9ae1b78721f42b419575842 | JavaScript | albertobastos/advent-of-code-2017-nodejs | /src/d09.js | UTF-8 | 1,550 | 3.25 | 3 | [] | no_license | console.time("d09");
const rl = require("./utils").getInputRL("d09");
function programReadLine(rl) {
let inputs = [];
rl.on("line", line => {
inputs.push(line);
});
rl.on("close", () => {
inputs.forEach((input, index) => {
console.log(`Input #${index + 1}:`);
let result = run(input);
... | true |
b4e0321be0f47054b1046ed98edf3985f9310e6b | JavaScript | ly2xing/Advent-of-Code-2019 | /functions.js | UTF-8 | 6,212 | 2.796875 | 3 | [] | no_license | const computer = require('./computer');
module.exports = {
day6_2: (json) => {
const orbitMap = {};
for (let orbit of json) {
const [parent, child] = orbit.split(')');
orbitMap[child] = parent;
}
const findTree = (target) => {
const tree = [];
let parent = orbitMap[target];
... | true |
f2dfd1dbbe785ba0b38705cba1c614267f91c3d2 | JavaScript | mcallisterd/S19DataVis265 | /moving.js | UTF-8 | 563 | 2.96875 | 3 | [] | no_license |
d3.json("students.json").then(function(d){
var d_prime = process(d);
startPlot(d_prime);
},
function(err){
console.log(err);
});
function process(data){
var students = [
{
Name:"Kelly",
Grades:[]
},
{
Name:"Sally",
Grades:[]
},
{
Name:"Nick",
Grad... | true |
e4c9d58b969bc4fd3d66713404182311bf793e03 | JavaScript | aerycat/readhub-cli | /counter.js | UTF-8 | 3,454 | 2.65625 | 3 | [] | no_license | "use strict";
const React = require("react");
const { render, Text } = require("ink");
const axios = require("axios");
const dayjs = require("dayjs");
const argv = require("minimist")(process.argv.slice(2));
const pkg = require('./package.json')
const msUnit = 1000;
function argvFormat(key = [], verifier = null) {
... | true |
b10562d3161e0b782aec800e45d893fcc630e5ae | JavaScript | Nata25/typescript_course | /Lesson 4 - Union Types/dist/index.js | UTF-8 | 885 | 2.78125 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const courses_1 = require("./courses");
const studyGroups_1 = require("./studyGroups");
function searchEvents(options) {
let events;
if (options.eventType === 'courses') {
events = courses_1.default;
}
else
even... | true |
57f7ac779f792c9fb1e6ae996886cff28bcd1c79 | JavaScript | Ggodlyy/JavaScript-Homework | /JavaScript-Applications/Client-Side-Rendering-Exercise/06.Book-Library/templates/bookTemplates.js | UTF-8 | 1,257 | 2.515625 | 3 | [] | no_license | import { html } from '../../node_modules/lit-html/lit-html.js';
import { ifDefined } from '../../node_modules/lit-html/directives/if-defined.js';
import { tableTemplate } from './tableTemplate.js';
export let formTemplate = (form) => html`
<form class=${ifDefined(form.class)} id="${form.id}">
${form.type === 'edit... | true |
5af80039f152b2c59aec03fae18eb7ddeb11a22b | JavaScript | JacobTheEvans/cracking-password-lesson | /server/index.js | UTF-8 | 756 | 2.59375 | 3 | [] | no_license | let express = require("express");
let bodyParser = require("body-parser");
let cors = require("cors");
let app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));
app.use(cors());
app.post("/", (req, res) => {
console.log("Here")
if (req.body.username !== "mike") {
con... | true |
dfe10ac7bd1f6c6074a87738d12730efafc24fa5 | JavaScript | RachelParris/javascript_assistance | /session_1/control_flow.js | UTF-8 | 556 | 4.1875 | 4 | [] | no_license |
function A() {
return 1;
}
function B() {
return A() + 5;
}
function C() {
return B() + 13;
}
console.log("What is C? ", C());
function animalValue(animal) {
var value = 2;
switch (animal) {
case 'dog':
value = value + 10;
case 'cat':
value += 15;
break;
case 'horse':
value += 4;
break;... | true |
914a3b2776255d981234866439899374f26ffae4 | JavaScript | Kireck211/Api-mascotas- | /routes/animalRoute.js | UTF-8 | 1,428 | 2.609375 | 3 | [] | no_license | const express = require('express');
const Joi = require('joi');
const router = express.Router();
const data = require('../controllers/animals');
const schema = Joi.object({
animalname:Joi.string().min(3).required(),
breedname:Joi.string().min(1).required(),
basecolour: Joi.string().min(3).required(),
speciesn... | true |
869d9de24deaccce685bbec61f082b43909f8bd6 | JavaScript | Togeri/lab-javascript-vikings | /src/viking.js | UTF-8 | 4,922 | 3.78125 | 4 | [] | no_license | // Soldier
class Soldier {
constructor(health, strength) {
this.health = health
this.strength = strength
}
attack() {
return this.strength
}
receiveDamage(damage) {
this.health -= damage
}
}
// Viking
class Viking extends Soldier {
constructor(name, he... | true |
0ed785535b02428498e14418b0f37de1a7b89135 | JavaScript | weryew/lab-jquery-pizza-builder | /starter-code/pizza.js | UTF-8 | 1,904 | 3.359375 | 3 | [] | no_license | // Write your Pizza Builder JavaScript in this file.
$(document).ready(function(){
var pep = 0;
var greenPepper = 0;
var mushroom = 0;
var whiteSauce = 0;
var crustGluten = 0;
var s=0;
$('.price > ul > li:nth-child(4)').css('display','none');
$('.price > ul > li:nth-child(5)').css('display','none')
// ... | true |
4343a0637ffe8df5105a5ba47d796d2ce92d4b8f | JavaScript | thneves/To-Do-App | /src/testing/UI.test.js | UTF-8 | 1,313 | 2.859375 | 3 | [] | no_license | import UI from '../doom';
let arr; let obj1; let obj2; let obj3; let
getElementByIdMock;
beforeEach(() => {
obj1 = {
title: 'todo1', description: 'desc1', dueDate: '2021-04-29', priority: 'low',
};
obj2 = {
title: 'todo2', description: 'desc1', dueDate: '2021-04-29', priority: 'medium',
};
obj3 = ... | true |
bdebf0d0b1d8a4e7b2ae6b20ae5d0d3f2e69a416 | JavaScript | Razonar/lojs | /lojs/static/simulator.js | UTF-8 | 2,761 | 2.921875 | 3 | [
"MIT"
] | permissive | /*
pete.shadbolt@gmail.com
Communicates with the server-side simulator and renders the output.
*/
function Simulator(myCircuit) {
var self = this;
self.circuit = myCircuit;
self.highlightedPattern = [];
self.outputField = document.getElementById('simulator_output');
self.spinner = document.g... | true |
15711aacd7b6517ec39c979f4e4dc25e2334d863 | JavaScript | 5878794/npm | /files/src/es6/customElement/elements/ui/b_table_list.es6 | UTF-8 | 10,006 | 2.53125 | 3 | [] | no_license |
//==========================================================
//表格类型 列表显示
//==========================================================
// html:
// b-table-list
//js:
//获取元素对象
// let table = $('b-table-list').get(0);
//设置表单样式等整体设置
// table.setting = {
// titleRowHeight:30, //标题行 高度 默认:30
// tit... | true |
fc68f49beab57476164c88aa6b04100c6b290d13 | JavaScript | RodrigoCastiel/WebPhysics | /Support/selection_tool/edit_mode_tool.js | UTF-8 | 1,106 | 2.546875 | 3 | [] | no_license | function EditModeTool(parent) {
this.parent = parent;
this.active = false;
this.busy = false;
this.obj = null; // Selected object.
this.ToggleActive = function () {
this.active = !this.active;
if (this.active) {
this.parent.SetMessage("Hold mouse left button to move a" +
"sphere!");
}
}
... | true |
f3c7f33d7d64aa791e0b5ff11b6f542801835a84 | JavaScript | namitcy/static_angular_app | /js/controllers/product-controller.js | UTF-8 | 542 | 2.515625 | 3 | [] | no_license | (function() {
'use strict';
angular
.module('app')
.controller('ProductController',["apiService", ProductController]);
function ProductController(apiService) {
var vm = this;
vm.init = init();
vm.sendJson = sendJson;
function init(){
apiService.product.getData().then(function (data) {
... | true |
d28678af74047085f9bb8a6c254615722ce6c71c | JavaScript | GroupI/Group-I-project | /mvc/views/ToDo_List/js/todo_list.js | UTF-8 | 6,829 | 3 | 3 | [] | no_license | class ToDo {
constructor() {
this.text = null;
this.deadline = null;
}
showList() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.... | true |
e3f9f3cee6e6455fbb46edc110aeab68978c93c7 | JavaScript | bhanuarora05/Rainbow-App | /rainbow-app/src/server.js | UTF-8 | 2,386 | 3.015625 | 3 | [] | no_license | const express = require('express');
const app = express();
const cors = require('cors')
app.use(express.json());
app.use(cors());
let max=1;
class Node{
constructor(value)
{
this.value = value;
this.next = null;
this.id = max;
max++;
}
}
class LinkedList {
constructo... | true |
c85499d0f70de50234dba544e88c45212b94ad04 | JavaScript | whitj00/p5face | /processing.js | UTF-8 | 2,518 | 2.875 | 3 | [] | no_license | var setupbool = false;
var loadingscreen = true;
var currentface;
var face = {
xval: 0,
yval: 0,
xwidth: 0,
xheight: 0
};
function setup(){
setFrameRate(2);
camera = createDiv('<video id="video" width="640" height="420" preload autoplay loop muted></video>');
camera.position(0,0);
canvas = createCanvas(... | true |
405b02d347444673ab535138e65b631bc94047a3 | JavaScript | alejandrofdiaz/municipios | /parser.js | UTF-8 | 1,898 | 2.734375 | 3 | [] | no_license | const path = require('path');
const fs = require('fs');
const xmlToJS = require('xml-js').xml2js;
const xmlFolder = path.resolve(__dirname, 'xml');
const jsonFolder = path.resolve(__dirname, 'json');
fs.readdir(xmlFolder, (err, files) => {
files.forEach(item => {
fs.readFile(`${xmlFolder}/${item}`, 'utf8', (err, b... | true |
c125fa357a0322a1f0647713b99c1fd134319f60 | JavaScript | aaronchu415/LeetCode | /completed/leetcode-LongestPalindromicSubstring.js | UTF-8 | 1,004 | 4.25 | 4 | [] | no_license | // _NAME: Longest Palindromic Substring
// _LINK: https://leetcode.com/problems/longest-palindromic-substring/
// _CATEGORY: String
/**
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
/**
* @param {string} s
* @return {string}
*/
var longestPalind... | true |
9d108f13c30ace39687430b6a5cb20f31f4790c0 | JavaScript | DukeBas/DiceProbabilityTool | /probabilityCalc.js | UTF-8 | 16,036 | 3.890625 | 4 | [
"MIT"
] | permissive | /**
* Turns a given occurrences array into a probability array
* @param occ
*/
function occurrencesToProbabilities(occ) {
// we calculate the probabilities by dividing the amount per index by the total amount
let total = 0;
for (let i = 0; i < occ.length; i++) {
total += occ[i];
}
// cal... | true |
04cfd824232f7274b0c8a7b9d4911dce94a3d716 | JavaScript | rubelahme/react-second | /src/compronets/Cart/Cart.js | UTF-8 | 957 | 2.5625 | 3 | [] | no_license | import React from 'react';
import './cart.css'
const Cart = (props) => {
const Cart =props.name;
// const total =Cart.reduce((total,prd)=>total+prd.price,0);
let total =0;
for (let i = 0; i < Cart.length; i++) {
const price = Cart[i];
total=total+price.price;
};
let shopping=0;
... | true |