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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
395bacdfb3cf8fb2d748c1cd2624688f6e49d3da | JavaScript | MarkProvanP/candy-register | /script.js | UTF-8 | 1,470 | 3.296875 | 3 | [] | no_license | function regButtonClick() {
var reg = this.register;
reg.processInput(this);
}
function Register() {
// Add the buttons
this.buttons = {};
var btns = document.getElementsByClassName("keypad-button");
for (i = 0; i < btns.length; i++) {
var btn = btns[i];
this.buttons[btn.id] = btn;
btn.register... | true |
80aec07752788c5889fdbb5c317c0257ac460a6a | JavaScript | Ahmad-Sawalqeh/hackerRank | /10_days_of_JS/day_6_bitwise_operators.js | UTF-8 | 196 | 2.78125 | 3 | [
"MIT"
] | permissive | `use strict`
function getMaxLessThanK(n, k){
console.log(n)
console.log(k)
}
console.log(getMaxLessThanK(5,2))
// console.log(getMaxLessThanK(8,5))
// console.log(getMaxLessThanK(2,2))
| true |
8f279683a74b644bd30ebaebb6104e0110555a41 | JavaScript | az674lqs/GitNovel | /lab/service/AttributeLoad.js | UTF-8 | 552 | 2.734375 | 3 | [] | no_license | var fs = require("fs");
/**
* load attributes from file
**/
function laodAttributes(filename, encode) {
/** set the <k,v> map **/
map = {};
/** read file in sync way **/
var data = fs.readFileSync(filename, encode);
/** parse the data **/
var lines = data.toString().split("\n");
for (inde... | true |
023226423e5c02a78d8bd0b6f7a5e143374d44a4 | JavaScript | gbtapps/BLECon | /Mindfulness_Data/StreamingAssets/www/dist/misc/MES001.js | UTF-8 | 3,087 | 2.609375 | 3 | [] | no_license | import { HourGlass } from "../components/hourglass.js";
import * as theme from "../../config/theme.json";
import {HitWallSound} from '../components/sounds/hitwallsound.js';
import {Alert} from '../components/sounds/alert.js';
const time_limit = 60000; //{number} - トレーニングの制限時間
/**
* 計測タイマー
* Libries: p5
... | true |
d0bff5c1146c0f29198586dc0cf52fafe7411e76 | JavaScript | amorfati0310/javascript-food | /js/components/Shared/SearchForm/Model/SearchModel.js | UTF-8 | 1,189 | 2.703125 | 3 | [] | no_license | import Model from "../../../../Model/Model.js";
import NUMBER from "../../../../constants/NUMBER.js";
const KEYWORDS_KEY = "KEYWORDS_RECENT";
export default class SearchModel extends Model {
constructor(dataHelper) {
super(dataHelper);
}
saveKeyWords(keyword) {
let { keywordList } = this.getLocalItem(KE... | true |
eb3854d19a658aea73bf7453dc6e652a353f9f7a | JavaScript | shiyunkai/mp-shop | /utils/base.js | UTF-8 | 1,492 | 2.640625 | 3 | [] | no_license |
import { Config } from '../utils/config.js';
import { Token } from '../utils/token.js';
class Base{
constructor(){
this.baseRequestUrl = Config.restUrl;
}
/**
* 发送请求
* params 请求参数
* noRefetch true——不做未授权重试机制
*/
request(params, noRefetch){
var that = this;
var url = this.baseRequest... | true |
109889c9de52dd3f2870b3b917779381b887f061 | JavaScript | AndVikVin/additional_5 | /src/index.js | UTF-8 | 1,050 | 2.9375 | 3 | [
"MIT"
] | permissive | module.exports = function check(str, bracketsConfig) {
// your solution
let arr = str.split('');
let arr2 = [];
let arr3 = [];
for(let i = 0; i<arr.length; i++){
bracketsConfig.forEach(element => {
if(arr[i] === element[0]){
if (arr[i] === element[1]){
arr3 = arr2.slice(-1);
... | true |
ce0bb77cde3c8e5d3fed5c70cea8ef53b478f709 | JavaScript | byhj/The-Programmings-Idea | /Text/Reverse a String/ReverseString.js | UTF-8 | 205 | 3.46875 | 3 | [] | no_license | /**
* @param {string} s
* @return {string}
*/
var reverseString = function(s) {
var len = s.length;
var ans = "";
for (var i=len-1; i>=0; --i) {
ans += s[i];
}
return ans;
}; | true |
fa3c9a6538945cde8156cbae5513f56a050405f2 | JavaScript | jw120/fcc-markdown-previewer | /src/App.js | UTF-8 | 1,555 | 3.015625 | 3 | [] | no_license | /** @flow
*
* Container that holds our state and includes the source and render components
*
*/
import React from 'react';
import './App.css'
import Render from './Render.js';
import Source from './Source.js';
/** We start with some dummmy markdown */
const initialMarkdown: string = `
## Heading
Text attributes ... | true |
527f897c47f32b67ce1db333954cd8934a40c7a3 | JavaScript | xtashao/gulp-webapp | /src/js/index.js | UTF-8 | 297 | 2.765625 | 3 | [] | no_license |
const _ = require('lodash')
const hello = () => {
var users = [
{
'user': 'aaron',
'show': true
},
{
'user': 'tom',
'age': 40,
'show': false
}
]
var user = _.filter(users, function (o) {
return o.show
})
console.log(user)
}
hello()
| true |
ea0ebdb3238c78f208e9ae409b1e2ddd33897983 | JavaScript | kazuyukitanimura/scw | /scw.js | UTF-8 | 8,678 | 2.875 | 3 | [] | no_license | // https://github.com/kazuyukitanimura/scw
var fs = require('fs');
var ByLineStream = require('./byLineStream');
var MAX_FLOAT = Number.MAX_VALUE;
var NON_CATEGORY = typeof undefined;
var NON_CATEGORY_SCORE = - MAX_FLOAT;
var innerProduct = function(featureVector, weightVector) {
var score = 0.0;
for (var pos in ... | true |
92d91fb31007ab2f2003f1c3aea39bc5f99fa24e | JavaScript | acchoblues/engine | /src/resources/resources_texturecache.js | UTF-8 | 1,542 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | pc.extend(pc.resources, function () {
/**
* @name pc.resources.TextureCache
* @class Cache textures to prevent multiple instances being created between models
* Uses file hashes to determine if a texture is already loaded
* @param {pc.resources.ResourceLoader} loader The loader used to get Assets fo... | true |
f8b6b47048dd4c9093333084b471e51f993cc6c1 | JavaScript | rewarren/tic_tac_toe | /script.js | UTF-8 | 1,489 | 3.84375 | 4 | [] | no_license | // var gameBoard = ["topleft", "topmid", "topright", "midleft", "midmid", "midright", "botleft", "botmid", "botright"];
// gameBoard.addEventListener("click", xOrO, false);
//
// function xOrO () {
// for(i = 0; i < gameBoard.length; i++) {
// if (i === (i % 2 === 1)) {
// return ("X");
// }
//... | true |
e26fb74eb07c993b2b938a1d39a1cb1d0c4a20da | JavaScript | manuelalosada/GrisantiLosadaProyectoIntegrador | /js/home.js | UTF-8 | 2,333 | 3.21875 | 3 | [] | no_license |
// FOOTER
// redes sociales
window.onload = function () {
var topAlbum = " ";
var topArtista = " ";
var topTrack = " ";
// var carrousel = " ";
fetch('https://cors-anywhere.herokuapp.com/https://api.deezer.com/chart')
.then(function(response){
return response.json();
})
.then(functio... | true |
b30e5b7e415e5fdae7f39a5642506b91ab54f46a | JavaScript | 1rosehip/webgl-slideshow | /src/1.0.0/slideshow.js | UTF-8 | 553 | 3.015625 | 3 | [
"MIT"
] | permissive | /**
* the main WebGL SlideShow class
*/
export default class WebglSlideShow{
/**
* @constructor
* @param {Object} options
* @param {HTMLElement} placeholder
*/
constructor(options, placeholder){
if(!options || !placeholder) return;
for(let slide of options.slides){
... | true |
fe41e92a8d1f0bb819c759b2fec52ec1a611fd56 | JavaScript | Smolli/fractal-jigsaw-puzzle | /worker.js | UTF-8 | 1,647 | 2.71875 | 3 | [] | no_license |
onmessage = function(event) {
var data = event.data.data;
var re = event.data.re;
var im = event.data.im;
var dre = event.data.dre;
var dim = event.data.dim;
var w = event.data.w;
var h = event.data.h;
set(re, im, dre, dim, data, w, h);
postMessage({path: event.data.path, data: data});
};
var limit = 1023;
... | true |
0a94fc39bc071f11921eaf68707a1eed34204809 | JavaScript | brownzach125/brownzach125.github.io_old | /csce444/game/scripts/TextBlock.js | UTF-8 | 1,937 | 3.515625 | 4 | [] | no_license | function ToggleWordBlock(words , hide) {
var textBlock = document.getElementById("theTextBlock");
var span = document.getElementById("words");
span.textContent = words;
function toggleHidden() {
var index = textBlock.className.indexOf("hidden");
if ( index >= 0 && !hide) {
t... | true |
6ebb1da5c9a0c43d0f8296cd9b45e77e059bce4b | JavaScript | TLDxilon/navigation | /js/global.functions.js | UTF-8 | 5,269 | 3.390625 | 3 | [] | no_license | /*
colorValues
@color puede ser HEX, RGB, HSL
return array of [r,g,b,a] from any valid color. if failed returns undefine
*/
function colorValues(color) {
if (color === '')
return;
if (color.toLowerCase() === 'transparent')
return [0, 0, 0, 0];
if (color[0] === '#')
{
... | true |
af787353cc0535bf79e1bc1c1e67d35bdf986cd3 | JavaScript | eshiett1995/Helper | /server/public/back-office/js/model/orphanage-home/create-orphanage-home-model.js | UTF-8 | 3,758 | 2.640625 | 3 | [] | no_license |
function createOrphanagePageModel(data) {
var model = {};
model.callingServer = { savingOrphanageHome :ko.observable(false)};
model.orphanageHome = {
name: ko.observable(''),
address : ko.observable(''),
image : ko.observable(''),
mobile : ko.observable(''),
... | true |
b8478f872bb9c4cf7ac487b61c2765def1de0437 | JavaScript | kaidong-chr/HW9_README_Generator | /index.js | UTF-8 | 2,781 | 3.046875 | 3 | [
"MIT"
] | permissive | // Variables and dependencies
const inquirer = require('inquirer');
const fs = require('fs');
const util = require("util");
const writeFileAsync = util.promisify(fs.writeFile);
// Prompt user questions for our README
function promptUser(){
return inquirer.prompt([
{
type: "input",
name: "projectT... | true |
72ad4f4413025428fdb25c8c25d7efa98a771089 | JavaScript | EWarringer/Javascript-and-AJAX-exercises | /nebula/app/strings.js | UTF-8 | 929 | 2.859375 | 3 | [] | no_license | exports = (typeof window === 'undefined') ? global : window;
exports.stringsAnswers = {
reduceString: function(str, amount) {
return str.replace(/(\w)\1+/g,function(x){
if(x.length>amount) {
return x.slice(-amount);
} else {
return x;
}
});
},
wordWrap: function(str, cols) {
va... | true |
cfe28489853c0c33101be03e79c45ecb0385fe14 | JavaScript | melnichenkod/Using-React-Routing | /src/components/Lists.js | UTF-8 | 526 | 2.671875 | 3 | [] | no_license | import React from 'react';
import { useEffect, useState } from 'react';
export default function Lists({endpoint, keyToShow}) {
let [list, setList] = useState([])
const api = `https://swapi.dev/api/${endpoint}/`;
const getData = async () => {
const res = await fetch(api);
const data = await res.json();... | true |
5e939dab0a6727060186b36d0a60fc6e3182dad6 | JavaScript | Madhuresan/perf | /src/libs/native.js | UTF-8 | 1,564 | 3.046875 | 3 | [] | no_license | 'use strict';
// Adding in array includes
// Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
// if (!Array.prototype.includes) {
// Object.defineProperty(Array.prototype, 'includes', {
// value: function(searchElement, fromIndex) {
// if (this == null... | true |
b127430553ff4ec4484bd8d445dfda4bc96a06e8 | JavaScript | jstiling/front-end-app-dev | /mod8-solution/assignment3-starter-code/app.js | UTF-8 | 1,566 | 2.703125 | 3 | [] | no_license | (function () {
'use strict';
angular.module('NarrowItDownApp', [])
.controller('NarrowItDownController', NarrowItDownController)
.service('MenuSearchService', MenuSearchService)
.directive('foundItems', FoundItemsDirective)
function FoundItemsDirective() {
var ddo = {
templateUrl: "foundItems.html",
scope: ... | true |
1b4723aaf9500ebdc2b1a175001f13601f008a12 | JavaScript | witherStormXD/bot | /commands/misc/8ball.js | UTF-8 | 1,569 | 2.640625 | 3 | [] | no_license | const { Command } = require('discord.js-commando');
const { MessageEmbed } = require('discord.js');
const config = require('../../data/config');
module.exports = class ballCommand extends Command {
constructor(client) {
super(client, {
name:"8ball",
group: 'misc',
member... | true |
d10e7dc36b7f3c1715c986d52b8298e1ce6915f8 | JavaScript | ISA-tools/isa-explorer | /app/js/reducers/study-reducer.js | UTF-8 | 1,090 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | /**
* @author Massimiliano Izzo
*/
import * as types from '../actions/action-types';
const initialState = {
isFetching: false,
investigation: {},
jsonld: {},
error: null
};
const studyReducer = function(state = initialState, action) {
switch (action.type) {
case types.SEND_REMOTE_REQU... | true |
6c3b1f6c3cc709bed44751b9d13195119878ccdf | JavaScript | recursion/calculator | /src/__tests__/actions.test.js | UTF-8 | 3,666 | 2.890625 | 3 | [
"MIT"
] | permissive | import inputAction from '../inputAction';
describe('Actions: ', () => {
describe('(CE) Clear Entry', () => {
test('It clears only the last entry', () => {
const startingModel = {
buffer: '55',
registerA: 5,
registerB: 0,
operation: '+',
actions: ['5', '+'],
};
... | true |
ca3747e1254d2d727f38048f9795f793f6fe6552 | JavaScript | justwes2/ga-project-1 | /main.js | UTF-8 | 1,684 | 3.421875 | 3 | [] | no_license | //create the discs
function createDiscs () {
$("#firstTower").append (
'<div class="disc selected" id="disc1"></div>',
'<div class="disc" id="disc2"></div>',
'<div class="disc" id="disc3"></div>',
'<div class="disc" id="disc4"></div>',
'<div class="disc" id="disc5"></div>',
'<div class="disc" ... | true |
71b5662a4165b7545cafec9e8036c05d2c6fd0c5 | JavaScript | Curtisdhi/HeartWorks | /firework.js | UTF-8 | 1,273 | 3.140625 | 3 | [
"MIT"
] | permissive | function Firework(color, size, x, y, velocity, speed, fuseTimer, pCount) {
Particle.call(this, color, size, x, y, velocity, speed, fuseTimer);
this.pCount = pCount;
this.particles = [];
}
Firework.prototype = Object.create(Particle.prototype);
Firework.prototype.update = function(delta) {
Particle.prototype.u... | true |
b1277be3d6f3cb8c4415f5d4e5fa268aa7ca1bf2 | JavaScript | CindyChenx/fewpjs-iterators-fndcl-fnexpr-reduce-lab-nyc-web-060319 | /index.js | UTF-8 | 190 | 2.953125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const batteryBatches = [4, 5, 3, 4, 4, 6, 5];
// Code your solution here
let totalBatteries = batteryBatches.reduce(
function(total, battery){
return total + battery
}, 0); | true |
6f29ffebdb0692cb66c77b3d25db51ede02232f7 | JavaScript | lositskyi/Apiko-Full-Stack-Intensive | /Lesson 4/first-app/src/Components/PostList.js | UTF-8 | 1,726 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import PostListItem from './PostListItem.js';
import MoreButton from './MoreButton.js';
import styled from 'styled-components';
import data from '../data.js';
const Wraper = styled.section `
max-width: 80%;
margin: 0 auto;
background-color: #f3f3f3;
`;
const List = styled... | true |
1c51215d3ae12551beaf6b07ee30f88a4a332c26 | JavaScript | policygenius/contentful-ghost-importer | /src/data-mapper.js | UTF-8 | 1,662 | 2.546875 | 3 | [
"MIT"
] | permissive | 'use strict';
import * as _ from 'lodash';
export function mapData (ghostData) {
return {
authors: mapAuthors(ghostData.users),
posts: mapPosts(ghostData),
tags: mapTags(ghostData.tags)
};
}
export function mapAuthors (authors) {
return authors.map((author) => {
return _.pick(author, ['name', '... | true |
fab1529ff0e55f5053349fcd5df85595fa903b94 | JavaScript | henryhomes/stremio-twistmoe | /lib/search.js | UTF-8 | 621 | 2.671875 | 3 | [] | no_license |
const searchers = {
movie: {},
series: {}
}
function simplify(str) {
return str.toLowerCase().replace(/[^a-z0-9 ]/gi,'')
}
module.exports = {
set: (meta, obj) => {
searchers[meta.type][meta.id] = {
name: simplify(obj.title),
altName: obj.alt_title ? simplify(obj.alt_title) : null
}
},
get: args => {
... | true |
fedefbf4932c09c1bb360380a57cf716ae9445db | JavaScript | milosv/RangeSlider | /js/rangeSlider.js | UTF-8 | 33,794 | 2.6875 | 3 | [] | no_license | /**
@author Milos Veljkovic
@description jQuery plugin that creates a range slider that can easily be used with event based framework, backbone.js or such
@version 1.0
@requires jQuery, modernizr
@example $(elem).rangeSlider({
'maxVal': 100,
'minVal': 0,
'maxLimit': 100,
... | true |
e21f3ea2431b7bbc5a8ee7fa7135d0bde2e3d603 | JavaScript | charles-ekube/JS_Validation | /js_form_validation/js/main.js | UTF-8 | 1,955 | 2.890625 | 3 | [] | no_license | document.querySelector('#signup').onclick = function () {
var name = document.querySelector('#name').value;
var email = document.querySelector('#email').value;
var pass = document.querySelector('#pass').value;
var confirm_pass = document.querySelector... | true |
fbda3fb965d794fcf19c8bfc6704e15aab077bcd | JavaScript | saahilh/tetris | /src/components/GameInfo.jsx | UTF-8 | 860 | 2.640625 | 3 | [] | no_license | import React from 'react';
const getStyle = () => ({
display: 'flex',
fontSize: '1.2em',
padding: '10px',
width: '100%',
border: 'solid black 1px',
fontFamily: 'Graduate',
backgroundColor: 'black',
color: 'white',
border: 'solid 1px white',
});
const GameInfo = ({heading, info}) => {
... | true |
6c6728e8aa72fa9642fdcde6f98ac6717f10fa0a | JavaScript | RandyField/asp.net-mvc-framework | /Doc/JS模块化-前端/h-require.js | UTF-8 | 1,441 | 3.171875 | 3 | [] | no_license | <script src="1.js"></script>
<script src="2.js"></script>
<script src="3.js"></script>
<script src="4.js"></script>
<script src="5.js"></script>
<script src="6.js"></script>
<script src="js/require.js"></script>
<script src="js/require.js" defer async="true" ></script>
//async属性表明这个文件需要异步加载,避免网页失去响应。
//IE不支持这个属性,只支持def... | true |
bf7bcc3fc08f7f224efd3f83883f8c8d8e41b659 | JavaScript | getoia/Gipa | /p5js/scripts/work2.js | UTF-8 | 961 | 3.34375 | 3 | [] | no_license | function setup() {
createCanvas(512, 512);
noLoop();
}
function draw() {
background("black");
drawLogic(0, 512, 0, 512, 0);
}
function drawLogic(x1, x2, y1, y2, depthIndex) {
if (depthIndex < 6) {
for (let i = x1; i < x2; i += 1 * Math.pow(2, 7 - depthIndex)) {
for (let j = y1; j < y2; j += 1 * Ma... | true |
883e506b8226e1168b80ab6420b4fd22c5d2faa1 | JavaScript | madoos/adt-workshop | /src/adt.laws.js | UTF-8 | 3,347 | 3 | 3 | [] | no_license | const {
identity,
pipe,
inc,
multiply,
o,
forEachObjIndexed,
applyTo,
pick
} = require('ramda')
const monoid = ({
type: Monoid,
isEquivalent,
value
}) => {
describe('Monoid laws', () => {
test('Left identity "M(x).concat(M.empty()) === M(x)"', () => {
const x = Monoid(value).concat(Monoid.empty())
... | true |
c7e1795e439235fa06e42bca4aed59b3e3fc98a5 | JavaScript | TibereDbzt/football-results | /scripts/club-details.js | UTF-8 | 4,322 | 2.984375 | 3 | [] | no_license | // ================================================================
// CALLER : / || CALLING : /
// Ferme la section club quand la croix est cliquée
// RETURN : none
// ================================================================
function hideClubDetails() {
$('body').on('click', 'img.close', function() {
... | true |
6591090a47b0c6b72ad56375a71fbc39be2a9479 | JavaScript | DemienFeenstra/reparatieweken-software-development | /blok 2 week 6, 7 & 8/B2W6L4 - speelbord/opdracht C/script.js | UTF-8 | 886 | 3.3125 | 3 | [] | no_license | function check() {
var word = document.getElementById("woord").value
var inputWord = document.getElementById("letter").value
word = word.split("")
inputWord = inputWord.split("")
for (i = 0; i < word.length; i++) {
document.getElementById(i).innerHTML = inputWord[i];
document.... | true |
0cea7afcfbeb68964c2c491be63b44fcacfb0a44 | JavaScript | zakerl/AlgoVisualiser | /src/SortingVisualiser/SortingVisualiser.js | UTF-8 | 812 | 2.90625 | 3 | [] | no_license | import React,{useState, useEffect} from "react";
import "./SortingVisualiser.css"
import Navbar from "./Navbar/Navbar.js"
import Bar from "./Bar"
function SortingVisualiser(){
const [array, setArray] = useState([]);
useEffect(()=>resetArray(),[])
const resetArray = (NUMBER_OF_ARRAY_BARS = 30) => {
let new_ar... | true |
80256b2c51ecd9e664de03c214b1bad1d85e7190 | JavaScript | Agamennon/react-playground | /app/src/notes/text-area.jsx | UTF-8 | 1,681 | 2.6875 | 3 | [] | no_license |
var textArea = React.createClass({
onChange:function(e){
this.props.onNoteEdit({text:e.target.value});
},
componentDidMount:function(){
this.props.onTextReady(this.refs.text);
},
render: function(){
return (
<div className="fill-all">
<text... | true |
f6eff7a05028c790efd3db0f43bab527b4c1ceb0 | JavaScript | metamorph-inc/metamorphosys-web | /src/app/mmsApp/services/connectorService/connectorService.js | UTF-8 | 8,700 | 2.546875 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | /*globals angular */
'use strict';
angular.module('mms.connectorService', [
])
.service('connectorService',
function($log, $compile, nodeService ) {
var cloneConnector,
isNodeConnected,
updatePortDecorator;
/**
* Modifies targetCo... | true |
d19f37f95540482e47ee3eca327a5ba784911343 | JavaScript | hisekaldma/Polyhymnia | /test/music/degrees.spec.js | UTF-8 | 397 | 2.640625 | 3 | [
"MIT"
] | permissive | describe('Degrees', function() {
'use strict';
it('can be found by name, tonic and scale', function() {
var degree = Polyhymnia.Degrees.fromName('vii°', 'C', 'major');
expect(degree).toEqual([71, 74, 77]);
});
it('can be found by midi numbers', function() {
var degree = Polyhymnia.Degrees.toName(... | true |
44571d921f8da721b357f2e4ed7556db6c1c9885 | JavaScript | Michael250-1/Superhero | /main.js | UTF-8 | 850 | 2.875 | 3 | [] | no_license | var Canvas=new fabric.Canvas("myCanvas");
playerx=10;
playery=10;
blockwidth=30;
blockheight=30;
var player_object="";
var block_object="";
function player_update(){
fabric.Image.fromURL("player.png", function(Img){
player_object=Img;
player_object.scaleToWidth(150);
player_obje... | true |
89e8a51992954b7cdf748fc3adade868638b131e | JavaScript | wernad/advent_of_code_2015 | /task17.js | UTF-8 | 836 | 2.921875 | 3 | [] | no_license | const path = require('path');
const fs = require('fs');
const itertools = require('iterator-tools')
const puzzle_input = fs.readFileSync(path.join(__dirname, '/puzzle_input/input17.txt'), 'utf8').toString().split(/\r|\n|\r\n/).filter(item => item).map(item => +item);
function store_eggnog(total_liters, buckets) {
... | true |
4e207f4d2ac27b1d03356a085a9d25c6392ecbb8 | JavaScript | dblodorn/felictas-test | /src/chat/index.js | UTF-8 | 470 | 2.671875 | 3 | [] | no_license | import state from '../state'
export default function (container) {
function chatDom () {
const chatInner = `<div id="chat-inner">CLICKS: ${state.clicks}<br/>SLIDE: ${state.currentSlide}</div>`;
container.innerHTML = chatInner;
}
function repeatChecking(oldValue) {
setInterval(() => {
if(oldVal... | true |
d5639d21381b7004f6ed23e92518d20ddcd22e66 | JavaScript | Mohit-Sharma02/Resident | /src/utils/shortenString.js | UTF-8 | 163 | 2.671875 | 3 | [
"MIT"
] | permissive | export const shortenString = (string, maxLength) => {
return string && string.length <= maxLength
? string
: string.substring(0, maxLength - 2) + '..'
}
| true |
d4b198f9913461cf7e919c60cde482a7214118c8 | JavaScript | takumi0910/calendar | /src/store/index.js | UTF-8 | 749 | 2.609375 | 3 | [] | no_license | import { createStore } from "redux";
const initialState = {
lists: [
{
name: "友人と遊びに行く",
delite: false,
},
{
name: "9:00~ ZOOMミーティング",
delite: false,
},
],
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case "ADD_LIST":
... | true |
f5f98c125ddc85df6a73b99c0a78dbcc65ec7173 | JavaScript | Paganini1987/NewYear | /app/js/grid.js | UTF-8 | 1,539 | 2.703125 | 3 | [] | no_license | export default class Grid {
constructor (svg, selector) {
this.selector = selector
this.wrap = svg.closest(this.selector);
this.svg = svg;
this.path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
this.init();
}
init () {
let d = this.draw();
this.path.setAttribute('d', d)
this.s... | true |
537a2cbea3e7a1e218e518308811b6d481a4ae3d | JavaScript | KasperPtak/Projekt04-Team02-App | /content/js/settings.js | UTF-8 | 794 | 2.59375 | 3 | [] | no_license |
var insKnap = document.getElementById('indstillinger')
function openSettings() {
insKnap.style.display = "block"
}
function closeSettings() {
insKnap.style.display = "none"
}
// document.addEventListener(
// "click",
// function (event) {
... | true |
ac909f8cb364c369a5e0d61052f16700408b06c7 | JavaScript | myYearOfCode/LaunchAcademy_Ignition | /launch-academy-faq-part-1/src/components/Question.js | UTF-8 | 1,306 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react'
class Question extends Component {
constructor(props){
super(props);
this.state = {
question: this.props.data.question,
answer: this.props.data.answer,
id: this.props.data.id,
setSelected: this.props.setSelected
}
}
showAnswer() {
... | true |
8ed3f996598ccd9123983abb83ca5676c737c17b | JavaScript | NoobProgrammerRoy/zappy-boilerplate-code-generator | /generateCode.js | UTF-8 | 2,503 | 3.03125 | 3 | [] | no_license | const fs = require('fs');
const path = require('path');
const process = require('process');
const readline = require('readline-sync');
// Function to generate boilerplate code using JSON templates
const generateCode = () => {
// Read all templates as a string
const templateString = fs.readFileSync(path.join(__... | true |
7f5f3da7669ce4dd8b91e3c2c3112a82a2a7fbcb | JavaScript | chirag-doshi/ski | /js/collision.js | UTF-8 | 2,744 | 3 | 3 | [] | no_license | 'use strict';
import { ctx } from './variables.js';
import { skier } from './skier.js';
import { obstacles } from './variables.js';
import { vars } from './variables.js';
/**
* collision class
* has methods that deal with the collision of the skier and obstacles
* requires skier object and obstacle Object
*
*/
e... | true |
5af8cb0d8970dee5a7eb1d9ad6c623cc9c55469c | JavaScript | google/google-ctf | /2021/hackceler8/game 1/common/entities.js | UTF-8 | 53,109 | 2.71875 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | // Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | true |
50394341880ec05d0885327d79e76716bf64c3cc | JavaScript | UKGovLD/registry-core | /src/main/webapp/ui/js/ds-explore.js | UTF-8 | 9,207 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Data set explorer, based on jsPlumb
*/
var DATASET_EXPLORER = function() {
// var dynamicAnchors = [
// [0, 0.2, -1, 0], [0, 0.5, -1, 0], [0, 0.8, -1, 0], // left
// [0.2, 1, 0, 1], [0.5, 1, 0, 1], [0.8, 1, 0, 1], // top
// [1, 0.... | true |
99db64b5c818aea7aec3311718f995f263e62c38 | JavaScript | conorhogan2/CountPocketReadItLaterList | /CountPocketList.js | UTF-8 | 740 | 3.015625 | 3 | [] | no_license | function scrollListAndReturnPos() {
var x;
vert = document.height;
window.scroll(x, vert);
return vert;
}
function countList() {
var ul = document.getElementById("queue");
var liNodes = [];
for (var i = 0; i < ul.childNodes.length; i++) {
if (ul.childNodes[i].nodeName == "LI") {
l... | true |
558566f30db695993c20e4ba27f437aa9af155bb | JavaScript | relynch91/classwork | /Week10/jsAlgorithims/javascriptCompletions/practises/practice3Completed/src/js_assessment.js | UTF-8 | 5,746 | 4.1875 | 4 | [] | no_license | // Write a recursive function, `factorialsRec(num)`, that returns the first
// `num` factorial numbers. Note that the 1st factorial number is 0!, which
// equals 1. The 2nd factorial is 1!, the 3rd factorial is 2!, etc.
function factorialsRec(num) {
if (num <= 1) {
return [1];
}
let facts = factor... | true |
4305dc24c87a336dc49f2c3d0d09e689f8c219a2 | JavaScript | 256Taras/ubnt-unms-nodejs | /lib/fixtures/util.js | UTF-8 | 986 | 3.109375 | 3 | [] | no_license | 'use strict';
const EARTH_RADIUS = 6371000; // meter
const DEG_TO_RAD = Math.PI / 180.0;
const THREE_PI = Math.PI * 3;
const TWO_PI = Math.PI * 2;
const generateRandomLocationWithin = (distance, point) => {
const randomDistance = Math.sqrt(Math.random()) * distance;
let x = point[0] * DEG_TO_RAD;
let y = poi... | true |
629f67f6e4ba277bfe87345b04d97e7a0ebc3f61 | JavaScript | rych182/pagina-personal | /js/efectos.js | UTF-8 | 1,873 | 3.140625 | 3 | [] | no_license | /*Esta linea indica que nuestro código jquery se ejecutara hasta que todo nuestro documento este listo*/
$(document).ready(function() {
//Efeceto menu
$('.menu a').each(function(index, elemento) {
$(this).css({
'top': '-200px' /*Estan 200px arriba del header y por eso no se ven*/
});
$(this).animat... | true |
f0b3ec1cd4014a848fa5bf28c11294987c3c689b | JavaScript | Matthensley777/random-challenges | /main.js | UTF-8 | 1,994 | 4.375 | 4 | [] | no_license | // Create a function that takes two numbers as arguments and return their sum.
function addingTwoNumbers () {
var a = 5;
var b = 3;
var sum = a + b;
console.log("sum", sum);
};
function subtractingNumbers () {
var a = 7;
var b = 3;
var answer = a - b;
console.log("answer", answer)
}
// Create an array th... | true |
90f9e044daaa738e4084d442ca18e5eafb582904 | JavaScript | adrianwegrzyn/Kolokwium_1_TAI_L1 | /script.js | UTF-8 | 173 | 2.8125 | 3 | [] | no_license | let divColor = document.querySelector(".box");
let button = document.querySelector(".button");
button.addEventListener('click', ()=>{
divColor.className = 'boxRed';
}); | true |
fa21cb75fb0b3c3f7068461aa9b5b91a137230f3 | JavaScript | userfog/cs171-pr-city-scape | /js/OvertimeVis.js | UTF-8 | 3,490 | 2.75 | 3 | [] | no_license | // Based on http://bl.ocks.org/mbostock/3883245
OvertimeVis = function(_parentElement, _eventHandler, _data, _socrataModel){
this.parentElement = _parentElement;
this.initialized = false;
this.prev_brush = [];
// defines tants
this.margin = {top: 50, right: 0, bottom: 2, left: 50},
this.width = getInnerWid... | true |
ce43a32a39884229fbd451b5cabbc5acf7b200fa | JavaScript | Saideepak01/IP_address_lookup | /script.js | UTF-8 | 9,119 | 2.765625 | 3 | [] | no_license | const pagedisplay = document.querySelector(".main");
pagedisplay.innerHTML = `
<div class="row">
<div class="col d-flex flex-column align-items-center">
<h1 class="gradient">IP Address lookup <i class="fas fa-location-arrow symbol"></i></h1>
<form class="row g-2">
... | true |
a621d51198b1d4d2833eadf7e12247050e3d75cd | JavaScript | RayHuangm4a1/mj-local | /app/ljit-react-components/src/__tests__/decimal-number.test.js | UTF-8 | 11,686 | 2.546875 | 3 | [] | no_license | import React from 'react';
import { shallow, mount, } from 'enzyme';
import DecimalNumber, { PREFIX_CLASS, } from '../components/decimal-number';
describe('DecimalNumber', () => {
it('should PREFIX_CLASS to equal ljit-decimal-number', () => {
expect(PREFIX_CLASS).toEqual('ljit-decimal-number');
});
it('should ha... | true |
256e1ec185d689a5c567e3bb1c5c4237cf7239ef | JavaScript | owenmcateer/Motus-Art | /src/week_20/main.js | UTF-8 | 1,870 | 3.265625 | 3 | [
"MIT"
] | permissive | /**
* Motus: Biennial/Perennial 🌼
* https://owenmcateer.github.io/Motus-Art
*/
const canvas = 1080;
const colours = [];
const cx = canvas / 2;
const outerDots = 9;
let offset = 0;
let canvasBg;
// Setup
function setup() {
createCanvas(canvas, canvas);
pixelDensity(1);
colorMode(RGB, 255, 255, 255, 1);
// ... | true |
4eb63f36a626b15a9c35583329b46e32ce9a8f5b | JavaScript | leohlgctzby/KennethHuang.github.io | /ITJiangren/JSPractice/assignment1.js | UTF-8 | 215 | 3.1875 | 3 | [] | no_license | var numArray = [3,4,-10, 100 ,200, 5];
var numArray2= numArray[0];
for(i=0;i<numArray.length;i++){
if (numArray2< numArray[i+1]){
numArray2 = numArray[i+1];
}
}
console.log(numArray2);
| true |
10b231bb971f7793f9219993cb3762f18f745d75 | JavaScript | david-1975/IFCD0110-DAVID- | /MF0951_2_JS/examen-MF0951_2/js/funciones.js | UTF-8 | 8,802 | 3.09375 | 3 | [] | no_license | // JavaScript Document
//EJERCICIO 1
function ejercicio1(){
//Nombre navegador
var navegador;
var agenteUsuario1 = navigator.userAgent;
if (agenteUsuario1.indexOf("Firefox") > -1){
navegador = "Firefox";
}
else if ((agenteUsuario1.indexOf("Opera") > -1) || (agenteUsuario1.indexOf("OPR") > -1)){
navegador... | true |
359ff584d2ba177731aae2d63bc5c891c894f0ca | JavaScript | Chandrima-Barua/fieldnation | /problem2/problem.js | UTF-8 | 884 | 3.15625 | 3 | [] | no_license | let wrapper = document.getElementById("wrapper").offsetHeight;
let box = document.getElementById("box");
let animateDirection = 0;
StartAnimation = function() {
let PositionLeft = box.offsetLeft;
let PositionTop = box.offsetTop;
if ((PositionLeft + 100) >= screen.width || (PositionTop + 100) >= wrapp... | true |
7d382d9b252bf8012cf7152528d0fe974ec08381 | JavaScript | AutumnRogue/workstuff | /forofinloops.js | UTF-8 | 379 | 4.15625 | 4 | [] | no_license | let array = ["alpha","bravo","charlie"];
let object = {
a: "1",
b: "2",
c: "3"
}
// for(let item of array) {
// console.log(item) // values of the array 'alpha,bravo,charlie'
// }
// for(let item in object) {
// console.log(item) // keys of the object 'abc'
// }
// for(let item in object) {
// ... | true |
40a2b1d6aa74fc770a15d188497122a2b513f73b | JavaScript | zbignevus/Einam | /app_api/controllers/locations.js | UTF-8 | 6,691 | 2.515625 | 3 | [
"MIT"
] | permissive | var mongoose = require('mongoose');
var Loc = mongoose.model('Location');
var sendJsonResponse = function(res, status, content){
res.status(status);
res.json(content);
};
module.exports.locationsListByDistance = function(req, res){
var lng = parseFloat(req.query.lng);
var lat = parseFloat(req.query.lat);
va... | true |
004e95fc4f9d2e85cc145cb6b63cb71fc2cf079b | JavaScript | JoseOgam/Test | /src/components/createUser/CreateUserPage.js | UTF-8 | 5,928 | 2.625 | 3 | [] | no_license | import React from "react";
import { useFormik } from "formik";
import * as yup from "yup";
import axios from "axios";
import FormField from "./FormField";
import "./CreateUser.css";
//setting the initial values
const initialValues = {
firstName: "",
lastName: "",
phone: "",
email: "",
password: "",
confirm... | true |
02248490993b19a5ee3dac04381dea6c469f75c7 | JavaScript | lfvilella/turing-machine | /frontend/app/src/cards/cards.jsx | UTF-8 | 2,142 | 2.71875 | 3 | [
"MIT"
] | permissive | import React, { useState } from 'react';
import './cards_style.css';
const axios = require('axios');
axios.defaults.baseURL = 'http://localhost:8000/api/v.1';
axios.defaults.headers.post['Content-Type'] = 'application/json';
const Card = props => {
const [tapeData, setTapeData] = useState('');
const [machineResu... | true |
fcdc38a7cf0cc31c5a515f52ece1e34773e46ba1 | JavaScript | AliakseiBabko/Exadel-Test-Automation-Training | /1_3_Replacement.js | UTF-8 | 1,670 | 3.515625 | 4 | [] | no_license | function Replacement (text, positionToReplace, insert) {
const regex = /[ `!@#$%^&*()_+\-=\[\]{};'’:"\\|,.<>\/?~]/; //list of special characters
let newText = text; //create a copy of the text to work with
let positionInWord = 0; //a counter for the current position in a word
let positionInText = 0; //a... | true |
80ee8812ff5055e7f95487464fda35df680aa86f | JavaScript | Kirby2021/Cyrus | /commands/info/sysinfo.js | UTF-8 | 1,011 | 2.546875 | 3 | [
"MIT"
] | permissive | const Discord = require('discord.js');
const { mem, cpu, os } = require('node-os-utils');
const { stripIndent } = require('common-tags');
const { re } = require('mathjs');
const { Color, Prefix } = require("../../config.js");
module.exports = {
name: "systeminfo",
aliases: ["sysinfo", "gpu"],
category: "In... | true |
09b166afe2eb115171c917339b24d55ca6db0f8a | JavaScript | what-to-do/team-project | /js/search_history.js | UTF-8 | 2,279 | 2.90625 | 3 | [] | no_license | function search_history() {
// var search_history_record = new Array();
if (search_history_record != null) {
$("#past-ul").empty();
// past searches are saved in search_history_record in local storage
// open search_history_record, iterate through items
// create buttons for each record in search_history_r... | true |
f0ba9e5b1ddc085c960d3c12dd48b7dc71dd653e | JavaScript | Aswin-A-Arun/Survey- | /voting.js | UTF-8 | 1,657 | 2.96875 | 3 | [] | no_license | // JavaScript source code
class Form {
constructor() {
this.input = createInput("Name");
this.button = createButton('Submit');
this.greeting = createElement('h2');
this.text = createElement('h1', "Lets Do A Survey in Our School");
this.question1 = createElement('h3',... | true |
63bc6e98af46c0477d28bfbfaa2223c0e2fa608b | JavaScript | bimanathanael/sudoku-public | /store/actions/sudokuActions.js | UTF-8 | 1,856 | 2.984375 | 3 | [] | no_license | const encodeBoard = (board) => board.reduce((result, row, i) => result + `%5B${encodeURIComponent(row)}%5D${i === board.length -1 ? '' : '%2C'}`, '')
const encodeParams = (params) =>
Object.keys(params)
.map(key => key + '=' + `%5B${encodeBoard(params[key])}%5D`)
.join('&');
export const getSudokuBoard = (diff... | true |
a1a3f53429a66867e86f385bf156a469da27f41e | JavaScript | dany338/news-feed | /src/pages/Category.js | UTF-8 | 2,335 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import Card from '../components/Card'
const categoriesId = {
politica: 1,
internacionales: 2,
tecnologia: 3,
espectaculos: 4,
deportes: 5
}
const Category = ({ match }) => {
const category = match.params.category
// const categoryFilter = categoriesId.f... | true |
2565d692d7e92c5b46727bb2f910b33603831a1b | JavaScript | StefanJovic123/service-provider-app | /src/domain/usecases/Skills/GetAll.js | UTF-8 | 451 | 2.625 | 3 | [] | no_license | class GetAll {
constructor(SkillsService) {
this.skillsService = SkillsService;
}
/**
* Get All Skills
* @param {Object} query
* @param {Object} options
* @param {number} [options.limit] - how many skills to get
* @param {number} [options.offset] - how many skills to skip
* @return {Promise... | true |
d019180c1a2b707f00a530134a4faabcf701a1be | JavaScript | nikolaiev/study | /info protection/module 2/lab7/node/index.js | UTF-8 | 3,386 | 2.859375 | 3 | [] | no_license | const PORT=3010;
var express=require("express");
var app=express();
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
var fs=require('fs')
/*var enc=new Encoder("english",10);
var result=enc.encode("i remember that september");
enc=new Encoder("english",10/*key* /);
var result2=en... | true |
0901d713bfb8414d6a4f27483d771704b024c246 | JavaScript | Johny73/Formation2020 | /JavaScript/Version_LOIC/JAVASCRIPT POEC/07-DOM/js/script.js | UTF-8 | 828 | 3.0625 | 3 | [] | no_license | 'use strict'
document.addEventListener('DOMContentLoaded',()=>{
let title = document.querySelector('h1');
console.log(title);
let monParagraphe =document.querySelector('p');
console.log(monParagraphe);
let mesParagrpahes = document.querySelectorAll("p");
console.log(mesParagrpahes);
let ... | true |
1cfc9aea6462439ab78542c4b16c9b6245e6d409 | JavaScript | oleglegun/node-file-server | /src/handlers.js | UTF-8 | 4,285 | 2.828125 | 3 | [] | no_license | const fs = require('fs')
const log = require('./logger')
// sendFile opens the file on `path` and pipes it to the response `res`.
function sendFile(path, res, mimeType) {
const fileStream = fs.createReadStream(path)
fileStream
.on('open', () => log.info('File opened: %s', path))
.on('error', e... | true |
81ef2fac2cc1e2edc511fd517b2f439f68d0965e | JavaScript | jlkardas/CSB-Capstone-Website | /public/more-info.js | UTF-8 | 7,015 | 2.65625 | 3 | [
"MIT"
] | permissive | $(document).ready(function () {
// Update text label to file name when new file is uplaoded'
$("#submit").prop("disabled", true);
$("#fileInput").on("change", function () {
var fileName = $(this).val().replace("C:\\fakepath\\", "");
$(this).next(".custom-file-label").html(fileName);
});
// Bootstrap ... | true |
3e9900e471b02110204794da12eb601f2a3f9ec6 | JavaScript | Mathiasduc/practice | /exercices/2016_09_26/pair_impair/index.js | UTF-8 | 196 | 3.109375 | 3 | [] | no_license |
function odd_even(start, skip){
for (; start <= 100; start = start + skip)
{
if (start % 2 == 0)
console.log("pair", start);
else
console.log("impair", start);
}
}
odd_even(20, 5); | true |
0d8cc752c247d7e60d411250705fdf6011e531b7 | JavaScript | pragyes31/ticTacToe_FCC | /src/index.js | UTF-8 | 3,478 | 3.125 | 3 | [] | no_license | import "./styles.css";
function createTicTacToeGame() {
const gridBoxes = document.querySelectorAll(".box");
const weaponButtons = document.querySelectorAll(".weapon");
const opponents = document.querySelectorAll(".opponent");
const restartButton = document.querySelector(".restart-game");
const gridBoxesArra... | true |
938ec798c2ef3b037304e56a1eec83c837ea841f | JavaScript | adbak97/adbak97.github.io | /zadania-domowe/zadanie-16/js.js | UTF-8 | 253 | 3.140625 | 3 | [] | no_license | function liczLiterki(slowo, litera) {
var countString = 0;
slowo.split("").forEach(function (element, index) {
if (element === litera) {
countString++;
}
});
console.log(countString);
}
liczLiterki("Szkoła Programowania Akademia 108", "a");
| true |
22bdb2e17c07e00d1849a18c0d53f450d39e45f9 | JavaScript | pachoulie/projects | /tests/routes/TodoList/modules/todolist.spec.js | UTF-8 | 6,572 | 2.65625 | 3 | [
"MIT"
] | permissive | import { fromJS } from 'immutable';
import {
index, actionTypes, actions, VisibilityFilters,
default as todoListReducer
} from 'routes/TodoList/modules/todolist';
describe('(Redux Module) Todo List', () => {
const initialState = fromJS({
filter: VisibilityFilters.SHOW_ALL,
todos: []
});
beforeEa... | true |
fb53de6f78be6b25c56364e17a31ce89eb4a4965 | JavaScript | rulywe/octane-dod | /FeatureDoD.js | UTF-8 | 8,982 | 2.671875 | 3 | [] | no_license | module.exports = {
featureDoD: function (requestor, callback, logic) {
return new FeatureDoD(requestor, callback, logic);
}
};
const FEATURE_DONE_PHASE = 3030;
const FEATURE_INPROGRESS_PHASE = 3028;
const FEATURE_NEW_PHASE = 3027;
var FeatureDoD = function (requestor, callback, logic) {
this.ca... | true |
3f994d8cd56cbb3b6964952223eeace88a40c9c6 | JavaScript | raghavdeivachilai/data-app | /server/server.js | UTF-8 | 1,245 | 2.5625 | 3 | [] | no_license | const express = require('express')
const app = express()
const cors = require('cors')
const fetch = require('node-fetch');
//Route to get the data from extrenal API
app.get('/getdata', cors(), function (req, res) {
let page_num = req.query.page
let per_page = req.query.per_page
let q = req.query.q
let c... | true |
28001db56788694a0924063c05e8252b87ac2c92 | JavaScript | chiaradiaz1991/Deno | /arguments/index.js | UTF-8 | 305 | 2.578125 | 3 | [] | no_license | // to run this file -> deno run arguments/index.js
console.log(Deno.args)
// parse arguments:
import { parse } from 'https://deno.land/std@v0.61.0/flags/mod.ts';
const parsed = parse(Deno.args); // Obj
console.log('Parsed', parsed);
console.log('a: ', parsed.a);
// deno run arguments/index.js -a 1 | true |
001b1b492996e665963f450c61cd0f5dde7d9566 | JavaScript | briangallagher/Canvas-Signature | /cloud/main.js | UTF-8 | 853 | 2.53125 | 3 | [] | no_license | var util = require('util');
/* main.js
* All calls here are publicly exposed as REST API endpoints.
* - all parameters must be passed in a single JSON paramater.
* - the return 'callback' method signature is 'callback (error, data)', where 'data' is a JSON object.
*/
exports.fhdbSaveSig = function(params, callback)... | true |
47a1afdf82d1a392ab0c191977b93479856c56d0 | JavaScript | KristinaTodd/moody-kittens | /app.js | UTF-8 | 4,526 | 3.296875 | 3 | [] | no_license |
let kittens = [];
function addKitten(event) {
event.preventDefault()
let form = event.target
let kittenName = form.name.value
let kittenId = generateId()
let kitten = kittens.find(kitten => kitten.name == kittenName)
if (kitten) {
alert("This kitten is already in existence!")
}
else {
kitten... | true |
d15b0b4ac3fe7e63d0ead56af08b1cc030dd0f77 | JavaScript | Gab-Metzger/PayDocAPI | /api/models/Appointment.js | UTF-8 | 1,550 | 2.65625 | 3 | [] | no_license | /**
* Appointment.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/#!documentation/models
*/
module.exports = {
schema: true,
attributes: {
start: {
type:'datetime',
required: true
},
end... | true |
853b42fe9cdd5964f9bcca3d5e8e2e908c2f1eb4 | JavaScript | juanmanuelromeraferrio/calc-impuesto-ganancias | /lib/calc_ganancias.js | UTF-8 | 4,278 | 2.765625 | 3 | [
"MIT"
] | permissive | "use strict";
var utils = require("./utils");
var defaults = require("lodash.defaults");
var flowRight = require("lodash.flowright");
var forEach = require("lodash.foreach");
var defaultValues = require("../data/values-2021.json");
var defaultOptions = {
sueldoBruto: {
default: 0,
min: 0,
max: null
}... | true |
3daaa93a47d1b7e30b7938b13efcfef1d9906a06 | JavaScript | rebeccaestes/fewer-white-men | /books.js | UTF-8 | 5,863 | 3.453125 | 3 | [] | no_license | $(document).ready(function(){
class Author {
constructor(name, data) {
this.name = name;
this.gender = data.gender;
this.race = data.race;
}
}
// TODO: what if a book has multiple authors??
class Book {
constructor (title, author, data) {
this.title = title;
this.auth... | true |
9a752a722904a9cf6d5fef925b2c205cf5508f74 | JavaScript | hamishtodd1/hamishtodd1.github.io | /RILectureVR/RILectureObjects/neoShapes.js | UTF-8 | 19,611 | 2.765625 | 3 | [] | no_license | function initToys(presentation)
{
var edgeCylinderSides = 5;
var edgeLength = 0.1;
var edgeRadius = edgeLength / 40; //edge length is 1, but then they do get scaled down
var sphereTemplateGeometry = new THREE.SphereGeometry(edgeRadius * 2);
var sphereMaterial = new THREE.MeshPhongMaterial({
color: 0xD4AF37,//g... | true |
b96ccfc99b61d90d4f445e77719f081b2f774c59 | JavaScript | chimeziesolomon/mywork | /app.js | UTF-8 | 437 | 3.03125 | 3 | [] | no_license | const TOTALE = document.getElementById("totale-number");
const BUTTONS = document.querySelectorAll("button");
BUTTONS.forEach((BTN) => {
const LETTER = BTN.innerHTML;
BTN.addEventListener("click", (e) => {
if (e.target.className === "num") {
TOTALE.innerHTML = LETTER;
}
});
});
c... | true |
be4acfced13ac6868b9eb4ddcdf2b49b4e6bd907 | JavaScript | GeorgeCybersport/shop | /front/src/redux/cartReducer.js | UTF-8 | 1,356 | 2.78125 | 3 | [] | no_license | import { ADD_PRODUCT, REMOVE_PRODUCT, GET_CART, CLEAR_CART } from "./keys";
const initialstate = {
items: [],
totalPrice: 0,
};
export default function cartReducer(state = initialstate, action) {
switch (action.type) {
case GET_CART:
return {
...state,
totalPrice: action.totalPrice,
... | true |