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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a81c8d9d5d09c188b39d3868668210849b2a6d61 | JavaScript | eunjoolee787/Todo-jQuery | /public/js/todo.js | UTF-8 | 6,989 | 3.671875 | 4 | [] | no_license | //INSTRUCTIONS-LEVEL 1
// In todo.js add an eventlistener on the text input field that listens for the [enter] key to be pressed. (okay)
// when this event triggers, (okay)
// adds the value of the text input, (okay)
// as a new list item, (okay)
// only when the text input field is in focus. (???)
// once the new list... | true |
10cd837845a185bef20d1e3e90e38d8fe0e97db8 | JavaScript | rifal89/saffron | /old/packages/common/components/inputs/select/index.jsx | UTF-8 | 3,106 | 2.53125 | 3 | [
"MIT"
] | permissive | import './index.scss';
import React from 'react';
import cx from 'classnames';
class SelectComponent extends React.Component {
constructor() {
super();
this.state = {
position: -1
};
}
move(position) {
var options = this.getFilteredOptions();
var newPosition = Math.max(-1, Math.min(... | true |
c6d65d10fb4a4010b8b4d029a5b0948416b85c40 | JavaScript | mountsisw/adventofcode2020 | /Day9/part2.js | UTF-8 | 2,007 | 3.375 | 3 | [] | no_license | // @ts-check
import { doPart, PuzzlePart } from "../aocFW.js";
window.onload = function () { doPart(new PuzzleSolution()); };
class PuzzleSolution extends PuzzlePart {
// called after a file is selected, prior to processing
init(inputElement, outputElement, answerElement) {
super.init(inputElement, outp... | true |
6111ab913a9481c7f2da11de4667e7a360b5adc1 | JavaScript | augustoerico/zombie-market-web-platform | /app/components/ProductFormState.jsx | UTF-8 | 838 | 2.53125 | 3 | [] | no_license | var React = require('react');
var ProductForm = require('ProductForm');
var productsApi = require('productsApi');
var ProductFormState = React.createClass({
onSubmitHandler: function (name, price) {
var product = {name: name, price: price};
productsApi.createProduct(product).then(
func... | true |
885bdc4929c5f3eb9737e9896d2328fc5ac9fb3d | JavaScript | taliahm/typescript-fantasy | /api/routes/episode.js | UTF-8 | 2,396 | 2.625 | 3 | [] | no_license | const Episode = require('../models/Episode');
const express = require('express');
// const { isLoggedIn, requireRole } = require("../middleware");
const router = express.Router();
// To do: isLoggedIn, add super admin required role
router.post('/:seasonId', async (req, res) => {
const { seasonId } = req.params;
if... | true |
38828720c13cb2f13ae46fdaaa1a7690054aec78 | JavaScript | fanzhengF/product_two | /Public/Js/Home/mobile/common.js | UTF-8 | 1,520 | 2.5625 | 3 | [
"MIT"
] | permissive | $(function(){
//顶部搜索框弹出
$('#index_search').click(function(){
$('.search_tan').show();
})
$('.tan_backs').click(function(){
$(this).parents('.search_tan').css({ 'display':'none'});
})
//会议状态选择
$('.meets_chose').click(function(){
... | true |
d532b19df9f644f66b707609c7b2dcf5ca817667 | JavaScript | sunyuhang404/notes | /JS/test.js | UTF-8 | 871 | 3.84375 | 4 | [] | no_license |
const func = arr => {
const res = [];
const sub = [];
const obj = {};
function dfs(j) {
if (j === arr.length) {
res.push(sub.slice());
}
for (let i = 0; i < arr.length; i++) {
if (!obj[arr[i]]) {
obj[arr[i]] = 1;
sub.push(arr[i]);
dfs(j + 1);
sub.pop();
... | true |
7c9ebc818a8b549ab50918a7a4c7773aae031a1d | JavaScript | ram99125/burger-builder | /src/redux/reducers/burgerbuilder.jsx | UTF-8 | 1,340 | 2.71875 | 3 | [] | no_license | import * as actiontype from "../actions/actionType";
const initialState = {
ingredients: null,
totalprice: 25,
error : false,
building : false,
};
const price = {
salad: 6,
meat: 15,
bacon: 12,
cheese: 10,
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case action... | true |
2287e46f62cb1de64b1b90fb0fbdb7b934c0a38a | JavaScript | Animus-Necandi/bd-place | /js/payment.js | UTF-8 | 8,319 | 2.515625 | 3 | [] | no_license |
let b = document.body;
let userAddres = document.getElementById('user_addres');
let userCity = document.getElementById('user_city');
let userAddresDelivery = document.getElementById('user_addresd');
let userCityDelivery = document.getElementById('user_cityd');
let noDeliveryAddres = document.getElementById('... | true |
ed3095a05df73d7101a0112e8e23d31d3a5a05a9 | JavaScript | dhan-esh/opentable | /src/home/Saga.js | UTF-8 | 2,277 | 2.625 | 3 | [] | no_license | import { call, put, takeLatest, select } from "redux-saga/effects";
import constants from "./Types";
import actions from "./Actions";
import axios from "axios";
import * as selectors from "./Selectors";
function* updateCitySaga(action) {
try {
const fetchApi = async (searchValue) => axios.get(`http://open... | true |
216d7e63e6aa614ec0dbcc1b901efc53fa96da0e | JavaScript | JangamRahul/springapp | /SpringBootAngularApplication/src/main/resources/static/home.js | UTF-8 | 21,932 | 2.671875 | 3 | [] | no_license | /*var app = angular.module("EmployeeManagement", []);*/
var app = angular.module("EmployeeManagement", ['ui.bootstrap']);
// Controller Part
app.controller("EmployeeController", function($scope, $http) {
/*$scope.filteredTodos = [];*/
$scope.filteredEmps = [];
$scope.itemsPerPage = 4;
$scope.cu... | true |
2ff83a75f84b6e837d1098cd63f547b9752be835 | JavaScript | sallyseal/misplaced_drugs | /misplaced_drugs/drugs/repos/static/ngl-master/src/representation/line-representation.js | UTF-8 | 8,314 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* @file Line Representation
* @author Alexander Rose <alexander.rose@weirdbyte.de>
* @private
*/
import { defaults } from '../utils.js'
import { RepresentationRegistry } from '../globals.js'
import StructureRepresentation from './structure-representation.js'
import WideLineBuffer from '../buffer/wideline-buffe... | true |
8a36d16110315b476da3c597a29479a016de30b7 | JavaScript | xiaolinenet/openmediavault-zh | /deb/openmediavault/var/www/openmediavault/js/js-overrides.js | UTF-8 | 6,761 | 2.75 | 3 | [] | no_license | /**
* This file is part of OpenMediaVault.
*
* @license http://www.gnu.org/licenses/gpl.html GPL Version 3
* @author Volker Theile <volker.theile@openmediavault.org>
* @copyright Copyright (c) 2009-2019 Volker Theile
*
* OpenMediaVault is free software: you can redistribute it and/or modify
* it under the ... | true |
2661652338ff1fd786a0261640355f87c7ad6179 | JavaScript | sguillema/SES1B-M1 | /packages/stub/middleware/doctors.js | UTF-8 | 2,693 | 2.65625 | 3 | [] | no_license | const express = require('express')
const doctors = express()
const Ajv = require('ajv')
const ajv = new Ajv()
const moment = require('moment')
const helpers = require('../helpers/helpers')
let data = require('../mocks/doctors')
const doctorsSchema = require('../mocks/doctors-schema')
// GET -- Return doctors based... | true |
43eb3ad7516fccc882c26d05bffa5ea4ac33d3e8 | JavaScript | into-the-parker/js-object-oriented-classes-travel-lab-london-web-100818 | /index.js | UTF-8 | 1,585 | 3.296875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | class Driver {
constructor(name, startDate){
this.name = name;
this.startDate = new Date(startDate);
}
yearsExperienceFromBeginningOf(endDate){
let date = this.startDate.toDateString().split('01')[1]
return endDate - date
}
}
class Route {
constructor(start, finish){
this.start =... | true |
0e2bfff17be4666868276c0ccdd75407389c947a | JavaScript | yxsci66/EncryptedCommunicationLab | /src/aes.js | UTF-8 | 1,294 | 3.1875 | 3 | [] | no_license | // 注意这里的密钥必须是8/16/32位,如果加密算法是128,则对应的密钥是16位,如果加密算法是256,则对应的密钥是32位。
// 0123456789abcdef
const crypto = require('crypto');
const iv = 'fedcba9876543210'
function cipher(str, key, iv = 'fedcba9876543210') {
try {
const cipher = crypto.createCipheriv('aes-128-cbc', key, iv);
return cipher.update(str, 'u... | true |
763a6fdf4d9d5dba605cd1bd5ae56482cbece8ce | JavaScript | KageHitokiri/sandboxJS | /javaScript/JS básico/13-ejercicio2.js | UTF-8 | 630 | 3.890625 | 4 | [] | no_license | "use strict"
/**
* Utilizando un bucle.
* Mostrar la suma, media y resultados
* Hasta introducir un numero negativo.
* Mostrar la media al finalizar.
*/
var suma = 0;
var counter = 0;
var average;
var number;
do {
do {
number = parseInt(prompt("Por favor, introduce un número"));
} while (isNaN(n... | true |
0fb052c368d1ace1df476f4204d43cb11a24eb7a | JavaScript | skyxie/node-word-counter | /test/word-machine-test.js | UTF-8 | 3,734 | 2.578125 | 3 | [] | no_license |
'use strict';
var winston = require("winston");
var sinon = require('sinon');
var chai = require('chai');
var should = chai.should();
var path = require('path');
var WordMachine = require(path.resolve(__dirname, "..", "word-machine"));
describe("WordMachine", function() {
var wm;
describe("instance", function(... | true |
affb109d392657c6f01176ee5e39ca6402df3767 | JavaScript | KKUSIAKU/numericalcalculator | /src/CalculatorEngine/evaluate/index.js | UTF-8 | 1,958 | 3.375 | 3 | [] | no_license | /** @function evaluate
*
* Calculate an the result of a postfix expression input.
* @param {array|string} expression - A postifix expression.
* @param {string} [separator=$] A string symbol to used to distinguish the postifix expression items
* @returns {number} A result of expression evaluation.
*
*/
var ge... | true |
d1697a6420e4c7358ae49fc344edfdb91a74ee19 | JavaScript | peytondoyle/jsdom-toy-tale-dc-web-080519 | /src/index.js | UTF-8 | 2,433 | 3.734375 | 4 | [] | no_license | const addBtn = document.querySelector('#new-toy-btn')
const toyForm = document.querySelector('.container')
let addToy = false
// loading these functions as the page loads
document.addEventListener("DOMContentLoaded", () => {
fetchToys();
initializeForm();
})
// makes the button work
addBtn.addEventListener('clic... | true |
64509c3fbeee729cc7579b44f16dec76fa987f58 | JavaScript | franco-canedo/Speed | /src/Components/Timer.js | UTF-8 | 1,036 | 2.671875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
const Timer = (props) => {
const [timeLeft, setTimeLeft] = useState(6);
const [h1ClassName, setClassName] = useState('h1timer');
const answerObject = useSelector((state) => state.rightAnswer);
... | true |
316aa7b9d622b412ba3b3228e8a24b5da7ad2de5 | JavaScript | Battlerax/MTGRP | /client_packages/UI/job_manager/fisher/Fisher.js | UTF-8 | 2,963 | 2.65625 | 3 | [
"MIT"
] | permissive | "use strict";
var isFishing = false;
var res = null;
var perfectCatchStrength = 0;
var currentCatchStrength = 50;
var nextStrengthTick = 0;
var nextCatchTick = 0;
var catchTime = 0;
Event.OnResourceStart.connect(function () {
res = API.getScreenResolutionMaintainRatio();
});
Event.OnServerEventTrigger.connect(funct... | true |
ed1690a8427089ca153ed9b6b012a0026a8dc4e5 | JavaScript | ishandutta2007/fingerprint.ninja | /lib/probes/canvas/quadraticCurve.js | UTF-8 | 691 | 2.96875 | 3 | [
"LicenseRef-scancode-public-domain",
"MIT"
] | permissive | const quadraticCurve = () => {
const canvasDOM = document.createElement('canvas');
canvasDOM.style.display = 'none';
document.body.appendChild(canvasDOM);
const context = canvasDOM.getContext('2d');
context.beginPath();
context.moveTo(75, 25);
context.quadraticCurveTo(25, 25, 25, 62.5);
context.quadrat... | true |
1fd106176d7f601f652081471b0feda4652fe5e9 | JavaScript | zilveer/vanilla-mvc-demo | /scripts/templates/photosTemplate.js | UTF-8 | 502 | 2.96875 | 3 | [] | no_license | var DEMO = window.DEMO || {};
DEMO.photosTemplate = (function() {
// Some people like to call templates "views", but that just muddies the
// water even more. Just call them templates.
// {{#each photo}}
// <img src="{{url}}" />
// {{/each}}
function photosTemplate(photos) {
var h... | true |
1a54cbc64b6454d9791c5c07c24ccc1ab8abf2d5 | JavaScript | ManigunaV/marks-management | /ManiGunaV92/src/InputMarks.jsx | UTF-8 | 2,154 | 2.78125 | 3 | [] | no_license | import React, {Component} from 'react'
import {Link} from 'react-router-dom'
class InputMarks extends Component {
submitDetails = (event) => {
event.preventDefault();
const stdClass = event.target.elements.standard.value;
const name = event.target.elements.stdName.value
const roll = event.target.elements.roll... | true |
0a1ac55d2dd4402f9ef77e4594a10f693d50021d | JavaScript | paulfcdd/mbp | /mnt/app/public/assets/theme_5/static/js/burger-menu.js | UTF-8 | 380 | 2.53125 | 3 | [] | no_license | function openMenu() {
var elem = document.getElementById("header-my-links");
if (elem.style.display === "flex") {
elem.style.display = "none";
} else {
elem.style.display = "flex";
}
}
window.onresize = function () {
if ( window.innerWidth > 991 ) {
document.getElem... | true |
54c59cd6ae6264f958b5d3444a79abc54ab21454 | JavaScript | mileszim-interviews/captain401 | /lib/utils.js | UTF-8 | 2,600 | 3.515625 | 4 | [] | no_license | /**
* Utils/decorators
*/
// Output shares
export function printShares(name, shares, price, total) {
return `${name}: ${shares} at $${price.toFixed(2)} ea. -- $${total.toFixed(2)}`;
}
// Output total
export function printTotal(total) {
return `Total: $${total.toFixed(2)}`;
}
// Output shares + total
export f... | true |
50543c7c409018d9fe1e9861d6e8e3c858a363f8 | JavaScript | SAMTHP/elove_base | /eloce/list_elociens.js | UTF-8 | 398 | 2.84375 | 3 | [] | no_license | $(document).ready(function() {
// Array which save the formations
var formation = ["CDA","Mécanicens","SSI","Assistant comptable","Commercial","Maçon","Développeur web","Designer web"];
formation.forEach(function(formation){
var cursus = "<option>"+formation+"</option>";
$("#formati... | true |
6ec836fcab00f7aa1c8c7a5b15b8a32b038a8bda | JavaScript | winstonjs/abstract-winston-transport | /index.js | UTF-8 | 1,202 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* Winston TransportStream Abstract Test Suite
*
* @param {Object} opts Options for your test suite execution
* @param {String} opts.name Transport name.
* @param {TransportStream} opts.Transport Class to instantiate (new Transport).
* @param {Boolean} opts.query If true, will a... | true |
6501ad3d1f243dc2ac0f790d1e100d58f6def580 | JavaScript | tabdenver/javascriptproject | /casshtest.js | UTF-8 | 368 | 3.1875 | 3 | [] | no_license | if (1234!= "1234") {
console.log(true);
}
else {
console.log(true);
}
let cashWithdrawal = (amount, accnum) => {
console.log(`withdrawal ${amount} from ${accnum}`)
if
("balance is equal to, or more than, the amount you’re trying to withdraw") {
console.log(true);
}else {
con... | true |
4136f5e4f66704e04ad89eb6805dd020a0822c42 | JavaScript | StephanGerbeth/agency-pkg-polyfills | /src/js/picture.js | UTF-8 | 8,354 | 2.65625 | 3 | [
"MIT"
] | permissive | "use strict";
/* globals $: true */
if (!global.HTMLPictureElement) {
document.createElement('picture');
document.createElement('source');
if (global.addEventListener) {
global.addEventListener('resize', function () {
render(document.getElementsByTagName('picture'));
}, false);... | true |
9e5c2b799564e07a79fd7f19d305a9059e48a628 | JavaScript | cherish-wwl/front-web | /app/yundun/index_ori.js | UTF-8 | 4,872 | 2.875 | 3 | [] | no_license | (function (){
/**
* 支持两种路径
* 1. ?type=news&id=1
* 2. ?type=good&id=10&part=0
* */
document.getElementById("header").addEventListener("click", function (e) {
if (e.target.classList.contains("tab")) {
e.target.parentElement
.querySelectorAll(".active")
.forEach(function (dom)... | true |
82b122763f3e3eb98ab19fd0c083b789d2dbfa8a | JavaScript | kitoshi/freecodecamp-javascript-projects | /Palindrome Checker.js | UTF-8 | 1,415 | 3.984375 | 4 | [
"MIT"
] | permissive | function palindrome(str) {
const lowerstr = str.toLowerCase()
const regexp = /[a-z0-9]/gi
const found = lowerstr.match(regexp)
console.log(found)
const newArr = found
const oldArr = []
for (let i = newArr.length - 1; i >= 0; i--) {
oldArr.push(newArr[i]);
};
console.log(newArr)... | true |
6a87128d4720b62c4ccde70d9aecdc6dda117375 | JavaScript | abhishekbhalani/Chessy | /script/chess/board/Field.js | WINDOWS-1250 | 2,115 | 2.75 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2012 Andr jr Steenveld all rights reserved
* Licensed under the MIT public license for the full license see the LICENSE file
*
*/
define([ ".", "lib" ], function( board, lib ){
board.Field = lib.declare( [ ], {
piece: null,
board: null,
x: null,
y: null,
name: n... | true |
201afa4b0350b5860d571832cb909d035479ee74 | JavaScript | jsmatthews/Algorithms | /src/Array/CombSort.js | UTF-8 | 456 | 3.40625 | 3 | [] | no_license | const CombSort = function() {
const SHRINK_FACTOR = 1.3
let gap = this.data.length
// Decrease the gap until it reaches 1
while(gap !== 1){
gap = (gap > 1) ? Math.floor(gap / SHRINK_FACTOR) : 1
// Compare the element with the element at gap length away from it
let i = 0
while(gap + i < this.data.length){... | true |
efcf86985d50128af8ce2b4d031fa092a86e4613 | JavaScript | xielehe/NFTCastle | /script/publish.js | UTF-8 | 1,820 | 2.53125 | 3 | [] | no_license | const R = require('ramda')
const { BosClient } = require('@baiducloud/sdk')
const path = require('path')
const recursive = require("recursive-readdir");
const config = require('./config')
const bucket = 'nftcastle'
const client = new BosClient(config)
const getLocalBundles = async () =>{
const files = await recurs... | true |
98ad216bf778a5ff8c893e762be5da1e48d2d1c0 | JavaScript | chanderbhanu096/Landing_Page-FEND- | /js/app.js | UTF-8 | 3,404 | 3.28125 | 3 | [] | no_license | // --------- Adds <li> items to the DOM ----------
let containerCount = document.getElementsByClassName("landing__container")
.length;
const myList = document.getElementById('myList');
// new list item
let newListItem = document.createElement('li');
newListItem.innerHTML = `<a href="#section1">Section 1</a>
<a hr... | true |
95eb9b1bfb71941f1c88ce11fdc50f8322d524be | JavaScript | SilCorp/Eloquent-JavaScript | /Task2/task2.js | UTF-8 | 129 | 3 | 3 | [] | no_license | //Function return
//smallest argument
function min(first, second) {
if (first < second){ return first;}
return second;
}
| true |
020368963fc6ee742b36598e173011515f910233 | JavaScript | querocelebrar/celebrar | /assets/js/chat.js | UTF-8 | 16,504 | 2.71875 | 3 | [] | no_license | var counter = 0;
var userName = "";
var typingSpeed = -25;
// All the HTML elements loaded?
document.addEventListener('DOMContentLoaded', function() {
// Initialize Firebase
var config = {
apiKey: "AIzaSyDtaj6AuQj4DIXeegcIMkUkDH2llTiPE78",
authDomain: "querocelebrar-9e5e9.firebaseapp.com",
datab... | true |
051f376ba25ba612c88f8252808506145f7c09a6 | JavaScript | georgemg1187/Slider | /carousel2.js | UTF-8 | 3,286 | 3.109375 | 3 | [] | no_license | /*****************************************
* ==> SlideShow
****************************************/
function SlideShow(root) {
this.root = root;
this.index = 0;
animationEnd = getAnimationEvent();
this.init = function() {
this.slides = Array.prototype.slice.call(root.children);
this... | true |
482c2ee4782b1c95fb0844790ce55a53eb04612b | JavaScript | Wayne-Bai/AST-normalize | /data/jussi-kalliokoski/sink.js/src/extra/write-buffers.js | UTF-8 | 3,678 | 2.75 | 3 | [] | no_license | void function (Sink, proto) {
proto = Sink.prototype;
Sink.on('init', function (sink) {
sink.asyncBuffers = [];
sink.syncBuffers = [];
sink.on('preprocess', sink.writeBuffersSync);
sink.on('postprocess', sink.writeBuffersAsync);
});
proto.writeMode = 'async';
proto.asyncBuffers = proto.syncBuffers = null;
/**
... | true |
1252132674bce8bfe97d1de5b0581b80e12ddf7f | JavaScript | namitamanohar/flowers | /scripts/flowerList.js | UTF-8 | 604 | 2.75 | 3 | [] | no_license |
import flowerComponent from "./flower.js";
import { useFlowers } from "./flowerDataProvider.js";
import { useColors } from "./colorsDataProvider.js";
const contentTarget=document.querySelector(".flowerGarden")
const FlowerComponent = () =>{
const allFlowers=useFlowers()
const allColors=useColors()
const render =... | true |
dcea2b2f56749a418ba9d632d667c084d86aed84 | JavaScript | batmacumba/fechadura | /subscriber/server.js | UTF-8 | 5,840 | 2.765625 | 3 | [] | no_license | /*******************************************************************************
O subscriber deve assinar os tópicos 'entrada', 'saida' e 'ocupacao' do servidor
MQTT, salvando os eventos no banco de dados MongoDB.
******************************************************************************/
// Configuração do Mo... | true |
8ea1d20ae71b8be843b73b11e88f2f17686dfd01 | JavaScript | gormonn/neurocity_test | /2_canvas/script.js | UTF-8 | 1,221 | 3.421875 | 3 | [] | no_license | // Таблица совместимости let:
// https://caniuse.com/#search=let
document.addEventListener("DOMContentLoaded", init);
function init(){
// window.requestAnimationFrame(draw);
draw();
}
function draw(){
let WIDTH = 800, HEIGHT = 600;
let canvas = document.getElementById('canv');
canvas.width = WIDTH;... | true |
7ec11a1b74df2de28aac5ae3bb0bf5c57d872970 | JavaScript | gustavofabro/gustavofabro.github.io | /script/main.js | UTF-8 | 2,338 | 2.859375 | 3 | [] | no_license | $(document).ready(onPageReady)
function onPageReady() {
function init() {
configureSection()
// configureText()
configureProjectItems()
configureMenu()
//configureTerminal()
}
function setSection(target) {
const targetDataFor = $(target).attr("data-for")
$('[id^="content"]').hide(... | true |
60137e45ad1030f0f623a02bfa85831513f34b24 | JavaScript | AlcinaW/react-tea-time | /javascript_projects/1-js_sandbox/mediator_pattern.js | UTF-8 | 1,236 | 3.53125 | 4 | [] | no_license | const User = function (name) {
this.name = name;
this.chatroom = null;
}
User.prototype = {
send: function (message, to) {
this.chatroom.send(message, this, to);
},
recieve: function (message, from) {
console.log(`${from.name} to ${this.name}: ${message}`);
}
}
const Chatroom =... | true |
0fba91b14a1620e63cd783c87ae983bf00314218 | JavaScript | freaktechnik/featured-video | /shared.js | UTF-8 | 2,214 | 2.78125 | 3 | [
"MIT"
] | permissive | function showPlayerInEmbed(embed, src, poster) {
var video = embed.querySelector("video");
video.src = src;
video.poster = poster || '';
video.className = '';
embed.querySelector("a").className = 'hidden';
}
function showPreviewInEmbed(embed, src, link) {
var image = embed.querySelector("a");
... | true |
00e8b1fb0b7906a9487f09f69bf4ba96455b121c | JavaScript | moguchev/Computer-Graphics | /Lab09/bresenham.js | UTF-8 | 856 | 3.21875 | 3 | [
"MIT"
] | permissive | function Line(ctx, x0, y0, x1, y1) {
var dy = Math.abs(y1-y0);
var dx = Math.abs(x1-x0);
var dmax = Math.max(dx, dy);
var dmin = Math.min(dx, dy);
var xdir = 1;
if (x1<x0) xdir = -1;
var ydir = 1;
if (y1<y0) ydir = -1;
var eps = 0;
var s = 1;
var k=2*dmin;
if (dy<=dx) {
... | true |
c1445f9272eaec59a19c141b78b43b317b252c28 | JavaScript | eescueta/eescueta.github.io | /MoonRunner/global.js | UTF-8 | 3,921 | 2.5625 | 3 | [
"MIT"
] | permissive | // GLOBAL VARIABLES:
var canvas;
var gl;
var program;
var length = 0.5;
var time = 0.0;
var timer = new Timer();
// GAME SETTINGS:
var SMART_MOVEMENT = false;
var DEBUGGING_MODE = false;
var RESET_READY = false;
// constant game data (i.e. number of each object to render, total health capacity, etc.
var N... | true |
a57113928f4a6f077d084d83d55105f60fa9beee | JavaScript | Liu-Jing-Jing/liu-jing-jing.github.io | /Atom.app/Contents/Resources/vendor/pilot/types/basic.js | UTF-8 | 9,157 | 2.625 | 3 | [] | no_license | /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
... | true |
3e59f76403043cbf762f703ed0ef266b3081d596 | JavaScript | robenk10/TypeScript | /ArrayOfObject.js | UTF-8 | 494 | 2.640625 | 3 | [] | no_license | "use strict";
var arr = new Array({
id: 101,
name: 'robin',
depart: {
dname: 'computer',
company: 'abc'
}
}, {
id: 101,
name: 'rohan',
depart: {
dname: 'marketing',
company: 'xyz'
}
}, {
id: 101,
name: 'vishal',
depart: {
dname: 'medici... | true |
628d36fc2ff565ee9b06a23bf95d4f2f0eed7aea | JavaScript | dylanmestyanek/javascript-challenges | /3-29-2020/repeated-string.js | UTF-8 | 391 | 3.53125 | 4 | [] | no_license | function repeatedString(s, n) {
const splitStr = s.split('');
let counter = 0;
while (s.length < n) {
s = s + splitStr[counter];
if (counter === splitStr.length - 1) {
counter = 0;
}
else {
counter++;
}
}
return s.split('').filter(lette... | true |
de515d9e7c2482bef7efe8cef6248254649e1861 | JavaScript | MorganeLM/MorganeLeMarquer_6_29042021 | /js/script.js | UTF-8 | 24,654 | 3.1875 | 3 | [] | no_license | /*jslint es6 */
'use strict';
let jsonData;
let photographers;
let tagNav = document.querySelector('#tagNav');
let homeMain = document.querySelector('#homepageMain');
let tagFilter = null;
let tagList = [];
// Touche entrée = clic sur liens au rôle bouton
function enterEqualCLick(){
document.querySelectorAll('[r... | true |
ea3361d6406e3412630f3f806faeae64a5c69cc4 | JavaScript | kimnamsun/miniproject | /javascript/2048Game/2048.js | UTF-8 | 6,961 | 3.328125 | 3 | [] | no_license | var table = document.querySelector('#table');
var score = document.querySelector('#score');
var data = [];
//초기화
function init() {
var fragment = document.createDocumentFragment();
[1, 2, 3, 4].forEach(function () {
var columnData = [];
data.push(columnData);
var tr = document.createEl... | true |
a260083be349d2b1decfc1f0339a021bbad79a37 | JavaScript | Madfun2910/JavaScript-2.0 | /coffe_mashine/main.js | UTF-8 | 2,178 | 3.90625 | 4 | [] | no_license | function text(){
var water = document.querySelector("div > p.water2");
var coffee = document.querySelector("div > p.coffee2");
water.innerHTML = textWater;
coffee.innerHTML = textCoffee;
}
var textWater = 500;
var textCoffee= 100;
//АМЕРИКАНО
var AmericanoWater = 250;
var Ameri... | true |
c0bac9baca1991fd30b5b3a2203e84481ef8326c | JavaScript | nholdsworth/Burger | /models/burger.js | UTF-8 | 1,554 | 2.9375 | 3 | [] | no_license |
const orm = require(`../config/orm.js`)
// Why does adding a string to the console log change the data that I get back?
// console.log(orm);
//create the code that will call the ORM functions using burger specific input for the ORM. I beleive this is where I have to use my client created variables...
const burger = ... | true |
0ac8da4a375055a84b8b3cff7391baf1d3a40d8d | JavaScript | sharathkrml/tip-calculator | /src/App.js | UTF-8 | 2,482 | 2.609375 | 3 | [] | no_license | import logo from "./assets/images/logo.svg";
import "./App.css";
import Result from "./components/Result";
import BillComponent from "./components/BillComponent";
import CountComponent from "./components/CountComponent";
import dollarSign from "./assets/images/icon-dollar.svg";
import personSign from "./assets/images/i... | true |
11bf8a7e84d1e60e9980aa893ee813b7da5ec137 | JavaScript | yo-ch/Inazuma | /src/lib/anime/AiringAnime.js | UTF-8 | 1,404 | 2.78125 | 3 | [] | no_license | const util = require('../../util/util.js');
/**
* A currently airing anime.
*/
class AiringAnime {
constructor({ id, name, synonyms, airingInfo }) {
this.id = id;
this.name = name;
this.synonyms = synonyms;
this.nextEpisode = airingInfo[0].episode;
this.airingInfo = airing... | true |
e8b0f81471c851dcd38b0eb5271f51da6ca5cbc4 | JavaScript | AAI-USZ/FixJS | /input/100+/after/af5fb66bcf53cdeb75726286f36b96ecedebb1f9_0_2.js | UTF-8 | 435 | 2.59375 | 3 | [
"MIT"
] | permissive | function showCheckedState(element) {
element.parent().prev().css("color",settings.on_label_color).addClass('on');
element.parent().next().css("color",settings.off_label_color).removeClass('on');
element.parent().css("background-color", settings.on_bg_color).addClass('on');
element.parent().paren... | true |
75201fa6e576632953432e3c15d34003236f4f47 | JavaScript | realflash08/Blog-Management-System | /blog_controller.js | UTF-8 | 2,958 | 2.546875 | 3 | [] | no_license | var mongoose = require('mongoose');
var blogModel = mongoose.model('Blog');
// module.exports is used to export some function out of a file
module.exports.controller = function(app){
// routes to get data
app.get('/blogs/all', function(req, res){
blogModel.find({},function(err,result){
if(e... | true |
7e33c468dad2c1666063778f4f9890ad201d7d7e | JavaScript | KitchenBomber/Sick-and-Safe-Tracking-Tool | /src/components/InfoPage/InfoPage.js | UTF-8 | 1,551 | 2.578125 | 3 | [] | no_license | import React from 'react';
// This is one of our simplest components
// It doesn't have local state, so it can be a function component.
// It doesn't dispatch any redux actions or display any part of redux state
// or even care what the redux state is, so it doesn't need 'connect()'
const InfoPage = () => (
<div>
... | true |
d0f3fca08a5c885f9fdf58cb6fc5092dd97abc45 | JavaScript | urnotzane/Hulk | /codes-box/Redux/all.js | UTF-8 | 4,980 | 3.09375 | 3 | [
"MIT"
] | permissive | /** 创建状态管理器 */
const createStore = (reducer, initState, rewriteCreateStoreFunc) => {
/** 有时候我们创建 store 的时候不传 initState */
if(typeof initState === 'function') {
rewriteCreateStoreFunc = initState
initState = undefined
}
/** 如果有重写createStore的函数 */
if(rewriteCreateStoreFunc) {
const newCreateStore =... | true |
6c43b09040b19330b3d012d43f9119a95027cabc | JavaScript | DaveSeidman/screen-party | /html/js/utils.js | UTF-8 | 1,265 | 2.9375 | 3 | [] | no_license | function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
timeout = setTimeout(function() {
timeout = null;
if (!immediate) func.apply(context, args);
}, wait);
if (imme... | true |
519aad6ccaaf72ba6dc3ac7f10bdb55ddbc7a773 | JavaScript | Przemek-Szadkowski/map_of_buczek_new | /.history/app_20211104203934.js | UTF-8 | 5,481 | 3.25 | 3 | [] | no_license | import * as elements from './src/elements.js';
import { removeAllSelectedBuildings, toggleDescriptionsAndDirectionsOpacity } from './src/helpers.js';
import { removeCenterClassFromNorthMap, addCenterClassToNorthMap, removeActiveButtonClass, addVisibleClassToBuilding, removeVisibleClassFromBuilding, removeVisibleClassFr... | true |
6dd99a116f2ef1c8395b36e25b334b51f058610f | JavaScript | jjesperlund/catapult-simulation | /initLights.js | UTF-8 | 575 | 2.890625 | 3 | [] | no_license | /**
* Initializing lights in scene
*/
function initLights(){
// Sunlight 1
var spotLight = new THREE.PointLight(0xffffff, 1.2, 200);
spotLight.castShadow = true;
spotLight.shadowMapWidth = 700;
spotLight.shadowMapHeight =700;
spotLight.position.set(100,150,40);
scene.add(spotLight);
... | true |
c5c56aa1b8179ec4682587e705ec74ba0c5799bc | JavaScript | zhubo1/-1 | /手机网页/homepage/js/comment.js | GB18030 | 689 | 2.53125 | 3 | [] | no_license | /**
* Created by csz on 2016/12/7.
*/
/*jsļ*/
/*һ Ƿװ¼*/
window.itcsz = {};/*һitcastĶ*/
//װһtransitionEnd Ƚ¼
itcsz.transitionEnd = function(dom,callback){
/* Ҫ¼dom ֮ ¼ʱ ִ callback */
if(dom && typeof dom == 'object'){
dom.addEventListener('webkitTransitionEnd',function(){
/*if(callbac... | true |
8825250148fec1e0c7dc486ce5de13570938d4dd | JavaScript | fayewong6198/visitek_test | /controllers/banner.js | UTF-8 | 3,706 | 2.5625 | 3 | [] | no_license | const asyncHandler = require("../middlewares/async");
const ErrorResponse = require("../utils/errorResponse");
const Banner = require("../models/Banner");
const BannerImage = require("../models/BannerImage");
const path = require("path");
const fs = require("fs");
// @des Get current banner
// @route Get /api/banner/... | true |
90e32344c8ede73e0463bfa05690c4ae2ef83d0e | JavaScript | maxwell-martin/txst-cis3360-spring2019 | /in-class-practice/web/js/web-scraping-notes.js | UTF-8 | 2,192 | 2.84375 | 3 | [
"MIT"
] | permissive | // 04/18/2019
// Web Scraping Notes:
// https://www.imdb.com/chart/top?ref_=nv_mv_250
// gets all links for the top 250 movies
// Script
var numOfUrls = $("td.titleColumn").length;
var myLinks = [];
var myData;
var lineResult = [];
var arrayResult = [];
for(i=0; i<numOfUrls; i++) {
//console.log($("td.titleCol... | true |
f3e939e988fbc166745b24130cdfffb92fe7d21e | JavaScript | robinperani/jeopardy3 | /public/create-category-screen.js | UTF-8 | 2,691 | 3.75 | 4 | [] | no_license | // This is the screen that allows the user to create a specific category
// each category includes question, answers, values that if chosen will be pulled into the game
class CreateCategoryScreen {
constructor(containerElement, onCreateCatCallback) {
this.containerElement = containerElement;
this.onCreateCat... | true |
c8f36d28a12e5268819a15130503fdc860325e7d | JavaScript | susanzhang66/webpack_test | /webpack-06/webpack-04/src/expo.js | UTF-8 | 154 | 2.984375 | 3 | [] | no_license | export const add = (a, b) => {
console.log("aaaaaaa");
return a + b;
};
export const minus = (a, b) => {
console.log("bbbbbb");
return a - b;
};
| true |
372a3c86d3631169aa56bb901342292957cf543d | JavaScript | emonty/patternfly-react-side-effects | /dist/esm/components/Sort/SortDirectionSelector.js | UTF-8 | 2,279 | 2.53125 | 3 | [
"MIT"
] | permissive | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
f... | true |
a08cbcaf7a5fb8ace14f3cc1c1a0def62bb3651a | JavaScript | BCX18ConnectedLife/big-iot | /nodejs-provider.js | UTF-8 | 1,851 | 2.5625 | 3 | [] | permissive | const bigiot = require('bigiot-js');
const provider = new bigiot.provider("... Your Provider ID ...", "... Your Provider Secret ...");
function createOffering() {
// Instantiate an offering of the desired type
const offering = new bigiot.offering("TestOffering", "urn:proposed:Miscellaneous");
... | true |
78e134f3d4c59586b78d016cfcb61a7a6b5136fa | JavaScript | zzy2005137/50-projects-50-days-study | /p07-extra/script.js | UTF-8 | 1,143 | 3.1875 | 3 | [] | no_license | const cards = document.querySelectorAll(".card");
const parts = document.querySelectorAll(".part");
cards.forEach((card) => {
card.addEventListener("dragstart", dragStart);
card.addEventListener("dragend", dragEnd);
});
parts.forEach((part) => {
part.addEventListener("dragenter", dragEnter);
part.addEventList... | true |
6bcbd5a1733299f456486abed53a2377ce508e46 | JavaScript | koolkishan/curriculum-authoring-tool | /src/utils/functions.js | UTF-8 | 962 | 2.734375 | 3 | [] | no_license |
export const handleDelete = (id,level) => {
let item =this.state.item;
let a;
if(level==1) { item = item.filter((i) => i.id !== id);}
else if(level==2) {
for(let i=0; i<this.state.item.length; i++) {
for(let j=0; j<this.state.item[i].children.length; j++) {
if(this.state.... | true |
dbe71007ffdf9f666e4238cca77972604f63fbe6 | JavaScript | AJVicens/rape-statues-table | /js/script.js | UTF-8 | 4,502 | 2.5625 | 3 | [] | no_license | var public_spreadsheet_url = "https://docs.google.com/spreadsheet/pub?key=0ArjPQkXVuVJudEx3UE4tREVtMmE1T1FQSUVjazBfY3c&single=true&gid=0&output=html";
var set_class = function(state, map, css_class) {
var svg = jQuery('#' + map + ' .' + state);
svg.attr('class').baseVal = state + ' ' + css_class;
}
var set_ma... | true |
8785f9ad1c259a526f73728ea308bd4ac3dcf689 | JavaScript | eshu-kumar/task-manager | /src/index.js | UTF-8 | 2,923 | 2.8125 | 3 | [] | no_license | const express = require("express");
const userRouter=require("./routers/user");
const taskRouter=require("./routers/task");
//we just want to run this file to connect to database
require('./db/mongoose');
const app = express();///setting up middleware
//always remember that we need to call next once our do something f... | true |
b0750805d10fe65500e1a86bb7d5cd4e08aeb039 | JavaScript | Lucho2027/structure-algorithms | /LinkList.js | UTF-8 | 5,738 | 4.53125 | 5 | [] | no_license | // //Given a sorted linked list, write an algorithm to delete all duplicate numbers from the sorted linked list.
// let head = {
// value: 1,
// next: {
// value: 2,
// next: {
// value: 3,
// next: {
// value: 3,
// next: {
// value: 4,
// next: null
// ... | true |
f1bbe561b77a857758dedc49681b52e1ae49813e | JavaScript | Johnzord/alurakut-1 | /pages/login/index.js | UTF-8 | 5,285 | 2.53125 | 3 | [] | no_license | import React, { useState } from 'react';
import { useRouter } from 'next/router';
import nookies from 'nookies';
export default function Login() {
const router = useRouter();
const [githubUser, setGithubUser] = useState('');
const [userExist, setUserExist] = useState(true);
async function handleSignIn(e) {
... | true |
8314052bae848eccc5a1c0efa22c3077d1486d09 | JavaScript | jully-popat/Zscaler-Dev | /force-app/main/default/aura/multiSelect/multiSelectHelper.js | UTF-8 | 6,499 | 3.03125 | 3 | [] | no_license | ({
/**
* This function will close all multi-select drop down on the page
* @author - Manish Choudhari
* */
closeAllDropDown: function() {
//Close drop down by removing slds class
Array.from(document.querySelectorAll('#ms-picklist-dropdown')).forEach(function(node){
nod... | true |
edf8d41c5e37cc3d3d56568dbf9d73d0ca23b67b | JavaScript | shocoman/SuperTestSystem | /src/Tasks/information_measurement.js | UTF-8 | 5,423 | 3.015625 | 3 | [] | no_license | import { powerOfTwo, randDouble, randInt } from './utilities';
import {ProtoTask} from "./_ProtoTask";
export class SizeOfAlphabet extends ProtoTask {
static taskName = "Размер алфавита"
static paramsLength = 1;
static uses_calculator = true;
static solve([bitsInOneLetter]) {
return Math.pow(... | true |
331daf5071c66d507f4005a008bf8e165d43c383 | JavaScript | nevadskiy/super-mario-js-clone | /src/Game/Entities/Koopa/States/WalkingState.js | UTF-8 | 1,117 | 2.90625 | 3 | [] | no_license | /* eslint-disable import/no-cycle */
import State from './State.js';
import HidingState from './HidingState.js';
export default class WalkingState extends State {
/**
* WalkingState constructor
*
* @param {Koopa} entity
* @param {Number} speed
*/
constructor(entity, speed = 20) {
super(entity);... | true |
517d6648b2512a69bd0ccd4f0b3bb6588fdd394e | JavaScript | kvartsianyi/react-movies | /src/components/Pagination/Pagination.js | UTF-8 | 1,839 | 2.515625 | 3 | [] | no_license | import React from 'react';
import {Link} from "react-router-dom";
import './Pagination.scss';
const CN = 'pagination';
export const Pagination = (props) => {
const {page: currPage, totalPages, changePage} = props;
let pagesRange = 4;
console.log(window.innerWidth);
if(window.innerWidth <= 768){
... | true |
bc449c2ac55f2080b649b4cf635f6e32dc81d980 | JavaScript | andrewcham/node-googleplaces | /test/googlePlacesTest.js | UTF-8 | 17,489 | 2.671875 | 3 | [
"MIT"
] | permissive | import {expect} from 'chai';
import GooglePlaces from '../src/index';
describe('Google Places Node Wrapper', () => {
before(() => {
if (!process.env.GOOGLE_API_KEY)
throw new Error('The GOOGLE_API_KEY env variable is not set!');
});
const places = new GooglePlaces(process.env.GOOGLE_API_KEY);
desc... | true |
8108f4f90d0c841a8c7cc1d1b13e58abd007bd8d | JavaScript | EvoluWil/Pokedex_JQuery | /scripts/list-service.js | UTF-8 | 372 | 2.6875 | 3 | [] | no_license | var listService = {
createList: (pokemonList)=>{
return pokemonList.map((pokemon)=>{
return `<li class="poke-list-item" >
<img src="//serebii.net/pokedex-xy/icon/${pokemon.number}.png"/>
<span> ${pokemon.number} - ${pokemon.name}</span>
... | true |
03cad93798f8f2b581c6201fa7304eda79d45067 | JavaScript | luopeng95/goweb | /小东西/jq网页/js/banner.js | UTF-8 | 9,248 | 2.84375 | 3 | [] | no_license | /**
* 传入轮播图的父级和图片的个数就好,往插件方面优化
* imgParent[DOM]:img图片li的ul的id名字
* cicreParent[DOM]:小圆点li的ul
* cicreClassName[str]:小圆点设置背景的className
* 图片的li需要设置data-id,顺序为2-0-1这样的,最后一张放在开头
* 小圆点的li需要设置data-class,顺序0-1-2这样正常排序即可
*/
class SideBanner {
constructor(imgParent, imgCount, imgArray) {
this.parent = imgParen... | true |
90476a83bd96fb1da12519535043e50d3f0e0765 | JavaScript | frazaslam99/food-delivery-app | /client/src/components/Account/Admin-Panel/PromoCode/index.js | UTF-8 | 2,036 | 2.578125 | 3 | [] | no_license | import React, { useState } from "react";
import { Url } from "../../../../Endpoint/index";
function PromoCode(props) {
const [promoCode, setPromoCodeValue] = useState("");
const [discountedPercentage, setDiscountedPercentage] = useState("");
const handleChange = (e) => {
setPromoCodeValue(e.target.value);
... | true |
215b9970ecc5916bf012f7e57b67ca2302f43b4f | JavaScript | joscha/indexifier | /dirTreeFilters.js | UTF-8 | 2,020 | 3.0625 | 3 | [
"MIT"
] | permissive | /**
* Remove all tree nodes below a given depth.
* Note: This feature can be inefficient due to this filtering taking place on a complete directory tree,
* compared to filtering while building the dirTree in the first place.
* To fix we would need to add this feature to directory-tree instead.
* @param {dirTree} t... | true |
1fe45ca74d16d2c1842f8760f58b6a4d569b6a81 | JavaScript | WannapornJ/JSHomework | /part2_1.js/13.sum_input_digit.js | UTF-8 | 362 | 3.46875 | 3 | [] | no_license | let input = prompt('enter number'),
store = [],
total = 0;
while (input !== "stop") {
if (input === "stop") {
break;
} else {
store.push(input)
}
input = prompt('enter next number')
}
for (let i = 0; i < store.length; i++) {
total += store[i].split("").reduce((a, b) => Numbe... | true |
4f83741146f56dbce0cee075edb2548215f3a9f0 | JavaScript | redeyed-archive/ttrpgkit | /plotdevice/plot.js | UTF-8 | 3,156 | 3.03125 | 3 | [] | no_license | var plotTables = {
"Plurals": ["Stones", "Keys", "Masks", "Swords", "Blades", "Gems", "Jewels", "Staves", "Rings", "Crowns", "Orbs"],
"Capacity": ["Omens", "the Sun", "Power", "the Stars", "Shadows", "Light", "Flame", "the Heavens", "the Moon",
"Storms"],
"Count": ["Two", "Three", "Four", "Five", "S... | true |
d9c619dcae9f9738182f22d37558a4a48facc0e3 | JavaScript | Serranosoft/Memorify | /src/components/Cardboard.js | UTF-8 | 3,639 | 2.53125 | 3 | [] | no_license | import React, { useState } from "react"
import Card from "./Card";
import styled from '@emotion/styled'
import test from "../images/test.gif"
import test2 from "../images/test2.gif"
import cardsArray from "../resources/cardsArray"
import { TwitterShareButton, TwitterIcon } from "react-share";
const Cardboard = (props)... | true |
1149d9b8414529ee4113afb14b9ca0fbbf0c8c2a | JavaScript | afandrey/Klientbaserad-programmering | /Exam Assignment 2/examination/client/source/js/Timer.js | UTF-8 | 1,482 | 3.46875 | 3 | [] | no_license | "use strict";
/**
* Timer constructor
* @param owner {Object} - owner object that created timer
* @param element {Object} - element to print timer
* @param time {Number} - time to count down
* @constructor
*/
function Timer(owner, element, time) {
this.owner = owner;
this.time = time;
this.element =... | true |
273b4ed2a5f656c61316f15dd863debafc984d70 | JavaScript | odelijairo/gerador-boletos | /tests/validacoes-test.js | UTF-8 | 11,940 | 2.671875 | 3 | [
"MIT"
] | permissive | const validacoes = require("../index").validacoes;
module.exports = {
eTituloDeEleitor: {
'É capaz de validar titulos de eleitor': function(test) {
test.ok(validacoes.eTituloDeEleitor('106644440302'));
test.ok(validacoes.eTituloDeEleitor('0196 3894 2097'));
test.ok(validacoes.eTituloDeEleitor(... | true |
c26dc41b71fe49f1eaa095af23d482388ac609ba | JavaScript | JRHyc/WebFundamentals | /Javascript/FoundationConcepts/forAFewBillion.js | UTF-8 | 365 | 3.890625 | 4 | [] | no_license | var pen = .005;
var sum = 0;
day = 0;
function count(){
for(i = 1; i < 31; i++){
pen = pen * 2;
sum = sum + pen;
day = day + 1;
console.log("Earned Day " + day + ": " + pen);
console.log("After " + day + " days total is: " + sum);
if(sum > 10000){
console.log(sum + " only took " + ... | true |
39f3d696dff42836c2eb4db0bb4f2acd26c28a1a | JavaScript | rodrigodata/express-rest-api | /app/middlewares/SchemaValidation.js | UTF-8 | 3,825 | 2.640625 | 3 | [] | no_license | /* Importação de dependencias */
const _ = require('lodash');
const Joi = require('joi');
/* Importação de Schemas */
const Schemas = require('../routes/v1/validations');
/* TODO: Melhorar validação de Schemas. Permitir mensagens customizadas. Tentar simplificar e organizar melhor validações Joi. */
module.exports = ... | true |
9a4e9f6cfce63a0b60c9d9a30fdce7573ee7b66b | JavaScript | RakeshSR10/JavaScript_PracticeProgram | /SequencePracticeProblem/UnitConversion.js | UTF-8 | 528 | 3.765625 | 4 | [] | no_license | //UC1 - Unit conversion
//feet to inches, 1ft = 12 inch and find 42in = ?
let oneFeet = 12;
let result = 42/oneFeet;
console.log("42 inches in feet = " + result + " ft.");
//Rectangular plot of 60ft x 40ft in meters
let oneMeter = 3.28;
let inMeters = (60 * 40) / oneMeter;
console.log("(60ft x 40ft) In meters = "+ i... | true |
6c770d9e061fbdf58809fa9217ecc9c096d8c580 | JavaScript | JhoanLT/server-node-arkix | /src/controllers/news.js | UTF-8 | 2,122 | 2.515625 | 3 | [] | no_license | const News = require('../models/news');
/**
* Registrar una nueva noticia
* @author Jhoan López <jhoanlt19@gmail.com>
*/
exports.register = (req, res) => {
const body = req.body;
let news = new News({
title : body.title,
content : body.content,
publication_date :... | true |
5b2d3b08c21787fd891c562df853273bc5f867f9 | JavaScript | Tatiana-pct/NavBarResonsive | /NavBar Responsive/script.js | UTF-8 | 343 | 2.9375 | 3 | [] | no_license | const liste = document.querySelector('.liste');
const bntResponsive = document.querySelector('.btn-responsive');
bntResponsive.addEventListener('click', () => {
liste.classList.toggle('show');
})
window.addEventListener('resize', () =>{
if(window.innerWidth > 650){
liste.classList.remove(... | true |
70dd47be181040aa74e619052385bc14e483dfca | JavaScript | focussed-techie/password-store | /src/main/resources/static/app/signup/signup-controller.js | UTF-8 | 1,291 | 2.53125 | 3 | [] | no_license | (function (){
var singupModule = angular.module("signUpModule");
singupModule.controller("signUpController",signUpController);
function signUpController($scope,$http,$location,alertService){
var ctrl = this;
ctrl.username = '';
ctrl.password = '';
ctrl.confirmPassword = '';
... | true |
8af9af4b9bc3b1d4207b914a9ac503051bbacd75 | JavaScript | ReeceLangerock/libru | /controllers/controller.index.js | UTF-8 | 3,075 | 2.59375 | 3 | [] | no_license | //SETUP ROUTER
var express = require("express");
var router = express.Router();
var mongoose = require("mongoose");
var resource = require("../models/resourceModel");
var user = require("../models/userModel");
var bodyParser = require("body-parser");
var categoryList = require("../models/categoryList.json");
var numRes... | true |
579bf20ac437ec182580b832c694a42f1c1a1535 | JavaScript | melange-app/melange | /client/app/reducers/loader.js | UTF-8 | 2,045 | 2.546875 | 3 | [
"MIT"
] | permissive | var Loader = function(prefix, initial, loaders) {
var actions = {
loading: "__" + prefix + "_LOADING",
loaded: "__" + prefix + "_LOADED",
}
var methods = {
loading: function(S, f) {
S.dispatch(actions.loading);
var loaded = function(data) {
S... | true |