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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
945e986fe2b6ab05c8cf6c9449dc08e3318753a9 | JavaScript | SoShibby/Conductor-Repository | /server/lib/validators/propertyValidator.js | UTF-8 | 2,629 | 3.28125 | 3 | [] | no_license | PropertyValidator = (function() {
function validate(propertyName, property) {
var validDataTypes = ['string', 'integer', 'double', 'float', 'boolean', 'enum'];
if (!DataTypeUtil.isString(propertyName) || propertyName.length === 0) {
throw new Meteor.Error(400, 'Invalid component name. T... | true |
7e3912c81f8fa7df6aa1482b697528148d8090bb | JavaScript | rach-vp/trybe-exercises | /01_Intro_Web_Development/10_Automated_Tests_with_Jest/10.2_Jest_Asynchronous_Tests/exercise4.spec.js | UTF-8 | 785 | 2.890625 | 3 | [] | no_license | const fetch = require('node-fetch');
const getRepos = (url) => {
return fetch(url)
.then(response => response.json())
.then((data) => {
return data.map((repo) => repo.name);
});
};
const url = 'https://api.github.com/orgs/tryber/repos';
const toDoList = 'sd-01-week4-5-project-todo-list';
const mem... | true |
51277fbfcb605a9cd06951ad94157e4b6625414e | JavaScript | veontomo/editor | /jasmine/spec/classes/HtmlElements/FactorySpec.js | UTF-8 | 7,841 | 2.90625 | 3 | [] | no_license | /*jslint plusplus: true, white: true */
/*global describe, it, it, expect, spyOn, beforeEach, Factory, Mapper*/
describe('Factory-related functionality', function(){
var f, mapping;
beforeEach(function(){
f = new Factory();
mapping = new Mapper();
});
describe('Factory construction', f... | true |
1aedf22a097e6d9e817b13a81d5dff4f933d78e2 | JavaScript | poshitharavi/Medical-Center-Management-System | /js/profile.js | UTF-8 | 1,262 | 3.140625 | 3 | [] | no_license | window.onload = function () {
$('#profile').submit(function () {
// stopping post form refresh
event.preventDefault();
//getting the textbox values to variables
let newPassWord = document.getElementById("newPassword").value;
let confirmPassword = document.getElementById("co... | true |
36d3c410ac5b039f5145e08db7f8eb101926d59c | JavaScript | inho2736/react_hook | /src/hooks/useEffect_base.js | UTF-8 | 947 | 3.203125 | 3 | [] | no_license | import React, { useState, useEffect }from 'react';
import './App.css';
//useEffects는 componentDidMount, componentDidUpdate, componentWillUnmount ...와 같은거
const App = () => {
const sayHello = () => {console.log("sayHello")};
const [number, setNumber] = useState(0);
const [anumber, setAnumber] = useState(0);
... | true |
4ce83548700ced9d0fa75423738aa60959720eac | JavaScript | cgabriel5/nodecliac | /src/parser/js2/utils/exit.js | UTF-8 | 379 | 3.125 | 3 | [
"MIT"
] | permissive | "use strict";
/**
* Logs messages and exits if needed.
*
* @param {array} list - List of messages to log.
* @param {boolean} stop - exit after printing?
* @return {undefined} - Nothing is returned.
*/
let exit = (list, stop) => {
for (let i = 0, l = list.length; i < l; i++) console.log(list[i]);
if (stop ===... | true |
01335954d8c5f2a697f1125bfe24ad9fd1a39d47 | JavaScript | DanMat/js-data-structures | /examples/stack.js | UTF-8 | 899 | 3.140625 | 3 | [
"MIT"
] | permissive | import { Stack } from '../src/data-structures';
const DIGITS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// node -e "import('./stack.js').then(module => { console.log( module.decimalToBaseConverter(123) ) })"
const decimalToBaseConverter = (decimal, base = 2) => {
if (!Number.isInteger(decimal)) {
throw new Error('P... | true |
234b4974978ec0ba43398ce4997a9324c40773f1 | JavaScript | SineadSwayne/unit_challenge12 | /tests.js | UTF-8 | 2,089 | 2.921875 | 3 | [] | no_license | QUnit.test("Test the validPhone.", function (assert) {
var num = "(415) 234-5678";
var result = validPhone(num);
assert.deepEqual(result, true, "Valid validPhone test passed.");
});
QUnit.test("Errors thrown for validPhone", function(assert) {
assert.throws(function () {
getvalidPhone("415)x44-... | true |
cc6e05fc559dec6eb6c341dfa77ef487bf5fe0ae | JavaScript | KentonCargile/Puffer-Phish-Game | /index.js | UTF-8 | 4,006 | 3.296875 | 3 | [] | no_license | var cvs = document.getElementById("canvas");
var ctx = cvs.getContext("2d"); // methods access
// load images
var fish = new Image();
var background = new Image();
var coral = new Image();
var topObstacle = new Image();
var bottomObstacle = new Image();
fish.src = "images/fish.png";
background.src = "images/ba... | true |
454de779f7520da499db370ef27a0e1a5f15df17 | JavaScript | philstenning/robot-dashboard | /src/controls/slider-control.jsx | UTF-8 | 3,950 | 2.59375 | 3 | [] | no_license | /** @jsx jsx */
import { jsx, css } from '@emotion/core';
import { Component } from 'react';
import { sendMovementControl, subscribeToMovementControl } from '../api';
const innerGrid = css`
text-align: center;
display: grid;
column-gap: 10px;
grid-template-columns: 1fr 3fr 3fr 1fr;
`;
cons... | true |
e6825c015498a39c0389a8ad392a4dc159310489 | JavaScript | SteveKoontz/roll20-character-sheets | /Ironsworn-Starforged/src/app/workers/scripts/stats.js | UTF-8 | 1,254 | 3.078125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | //Cannot increase Health while Wounded
//Health reaching 0 marks Wounded
on('change:health', function(eventinfo) {
getAttrs(["impactWounded"], function(values) {
if(values.impactWounded == "on") {
if (parseInt(eventinfo.newValue) > parseInt(eventinfo.previousValue)) {
setAttrs({h... | true |
c81a61b6808b874882c4e786140683347c49904e | JavaScript | wesamhamed/background-generator | /script.js | UTF-8 | 2,109 | 3.71875 | 4 | [] | no_license | var button = document.getElementById("enter");
var input = document.getElementById("userinput");
var ul = document.querySelector("ul");
function inputLength() {
return input.value.length;
}
function createListElement() {
var li = document.createElement("li");
li.appendChild(document.createTextNode(input.value));
... | true |
4d3436910e219ee27bb735c145aeaf85bef5a58e | JavaScript | WarathatPan/nodejs-nodemailer | /utils/inputValidator.js | UTF-8 | 1,025 | 3.140625 | 3 | [] | no_license | /**
*
* @param input Input
* @param requiredFields String array of required field
* @return Result { isValid: boolean, invalidFields: String[] }
* @usage inputValidator(input, ['name', 'otherRequiredField'])
*/
function inputValidator(input, requiredFields) {
if (!input || !requiredFields) {
throw n... | true |
ebfefc7825e4542bdbbbcfa77e53c825709ab3c3 | JavaScript | nikolasclay/Project | /Vending Machine/js/home.js | UTF-8 | 3,945 | 3 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
getItems();
purchase();
$('#vendItems').on('click', ".items", function () {
var id = $(this).data("id");
$('#item-Status1').val(id);
});
$('#addDollar').click(function(){
var currentVal = $('#total').val();
if (currentVal == "") {
$('#total').val((1.00... | true |
b9c13d20c11b37842e58acb9da4287c3fdcd0156 | JavaScript | itkot/itkot.github.io | /pro/space/js/model/Gravity.js | UTF-8 | 775 | 2.546875 | 3 | [] | no_license | Gravity = function () {
var bodies = [];
this.addBody = function(body){
bodies.push(body);
}
this.tik = function() {
for (var body in bodies) {
for (var another in bodies) {
a = bodies[body];
b = bodies[another];
if (a.name ... | true |
e3b1ff7f6767798800d0988aef265e48cb6208d2 | JavaScript | Ding2d/gisalgorithm | /public/javascripts/workflow.js | UTF-8 | 5,270 | 2.796875 | 3 | [] | no_license | //10-17两个待解决bug
//Line192
//Line201
var TIMES=4;
var timeSum=0;
var restValue,availValue;
var sequence=new Array();
var rssequence = new Array(); //先声明一维
var totalNum=0;
var y=0;
for(var k=0;k<1000;k++)
{ //一维长度为i,i为变量,可以根据实际情况改变
rssequence[k]=new Array(); //声明二维,每一个一维数组里面的一个元素都是一个数组;
for(var j=0;j<TIMES;j++)
... | true |
7beab2415bf9743d948a8b1820d2ca4625f79451 | JavaScript | titocepeda31/JavascriptModerno | /01 Fundamentos/assets/js/ciclos/for.js | UTF-8 | 373 | 3.65625 | 4 | [] | no_license |
const heroes = ['SuperMan','Mujer Maravilla','Acuaman'];
console.warn("FOR TRADICIONAL");
let i = 0;
for(i;i<heroes.length;i++){
console.log(heroes[i]);
}
// Sirve par obtener la posicion de cada elemento en un array
console.warn('FOR IN');
for(let i in heroes){
console.log(heroes[i]);
}
console.warn('... | true |
4b53b8dc3f193a6f426da9663e91dc7d473f004d | JavaScript | fugehappy/react-hn | /js/NewsItemTest.js | UTF-8 | 587 | 2.546875 | 3 | [
"MIT"
] | permissive | var $ = require('jquery');
var NewsItem = require('./NewsItem');
var React = require('react');
var ReactDOM = require('react-dom');
$.ajax({
url: '/json/items.json'
}).then(function (items) {
// Log the data so we can inspect it in the developer console.
console.log('items', items);
// Use a fake rank for now.... | true |
c41edf2ec6a28ae01219556a4997a020c20b4a0a | JavaScript | ahmadwaluyo/HACKTIV8-fase0 | /WEEK_2/DAY2/jumlah_kata.js | UTF-8 | 251 | 3.203125 | 3 | [] | no_license | let kalimat = 'My Life my advanture this is because of you';
let kata = '';
for (let i = 0; i < kalimat.length; i++) {
if (kalimat[i] === ' ') {
kata += 1;
}
}
// untuk kata terakhir agar menambah nilai 1
kata += 1;
console.log(kata.length);
| true |
42ff47e46aba3d1daf6b45362b86b9a763481f87 | JavaScript | sonamt731/avatarScene | /ARAnastasia/sketch.js | UTF-8 | 3,981 | 3.21875 | 3 | [] | no_license | // create a variable to hold our world object
var world;
var planet, planetContainer
var particleContainer
var particles = []
// create variables to hold our markers
var markerHiro, markerZb;
// logic for flipping the incoming video feed
var videoRepositioned = false
function setup() {
// create our world (this ... | true |
02905c858a4f385f6e74377d6b23b1e79b756ec2 | JavaScript | Otthello/Resources-and-Wiki | /usefulFunctions.js | UTF-8 | 98 | 2.9375 | 3 | [] | no_license | var roundToNearestCent = function(num){
return Math.round( num * 100 + Number.EPSILON ) / 100
}
| true |
dfb6a5a5304167c92574ccad2753380096aa7b02 | JavaScript | gihanprimesha/order-spark-gihan-primesha | /public/store/store.js | UTF-8 | 666 | 2.59375 | 3 | [
"MIT"
] | permissive | import { createStore } from 'vuex';
const state = {
cartList: [],
};
/**
* If project is big one getters should be in different files
*/
const getters = {
getCartTotalPrice: (state) => {
return state.cartList
.reduce((total, item) => {
return total + parseFloat(item.price);
}, 0)
.toFixed(2);
},
}... | true |
6c8042d637b7d33d79cef29d42ddd1a3236eba77 | JavaScript | lixianelite/Full-Stack-for-Subway-Card-Management | /public/javascripts/login.js | UTF-8 | 1,589 | 2.609375 | 3 | [] | no_license | $(document).ready(function() {
$('#signin-error-div').hide();
$('#passenger-div').hide();
$('#sign-in-form').find('#username').on('click keyup', function() {
$('sigin-error-div').hide();
});
$('#sign-in-form').find('#password').on('click keyup', function() {
$('sigin-error-div').h... | true |
fe31436b1015763b745b678f338a2adcce31ee83 | JavaScript | jburto94/fcc-basic-algs | /title-case.js | UTF-8 | 284 | 3.390625 | 3 | [] | no_license | function titleCase(str) {
let array = str.split(' ');
let newArray = [];
for (let i = 0; i < array.length; i++) {
let singleStr = array[i];
newArray.push(array[i].charAt(0).toUpperCase() + array[i].slice(1).toLowerCase());
}
str = newArray.join(' ');
return str;
} | true |
85a2eda78b558c69139aa60097b11124b9a0644f | JavaScript | songji1165/react_study | /src/App.js | UTF-8 | 1,534 | 3.375 | 3 | [] | no_license | import React from "react";
import PropTypes from "prop-types";
// class Component 는 state(동적 data)를 사용할 수 있다.
// class Component는 상위 component의 속성을 상속받을 수 있다.
// React는 모든 class Component의 render method를 알아서 redering 함.
class App extends React.Component {
//App component는 React component의 속성을 상속 받는다.
//state는 Obj... | true |
3d1c789836aa2cbc9aab9baeff1417bd89f3fc64 | JavaScript | ivansertic/webLv5 | /src/app.js | UTF-8 | 17,072 | 3.234375 | 3 | [] | no_license | class CatFC {
constructor(buttons, fighters) {
this.buttons = buttons;
this.fighters = fighters;
this.fight = false;
this.leftFighter;
this.rightFighter;
}
init() {
this._fighterHandler(this.fighters);
this._buttonHandler(this.buttons, this.fighters);... | true |
814794ed305c81201c14ee3001d49c311e7ed79f | JavaScript | JX-Zhuang/learn_node | /7.http/4.静态文件.js | UTF-8 | 1,120 | 2.625 | 3 | [] | no_license | /**
* Created by Jesse on 17/4/28.
*/
//导入核心模块http
var http = require('http');
var fs = require('fs');
/**
* 1.能在特定的IP 特定端口上监听客户端的请求
* 2.当请求到来的时候能执行监听函数,并返回响应
* 创建一个服务器
* 指定监听函数 每当客户端请求到来时执行的函数
*/
var server = http.createServer((req, res) => {
var url = req.url;
if(url==='/style.css'){
res.setHea... | true |
789264d00031c5ea4ddeb34e19483a181d64a4fa | JavaScript | nachosdt/SudokuKiller | /controller.js | UTF-8 | 16,163 | 3.203125 | 3 | [] | no_license | // CLASES
class Sudoku {
constructor() {
let sudoku = new Array(9);
let casillas = [...document.getElementsByClassName("casilla")];
for (let i = 0; i<9; i++) {
sudoku[i] = new Array(9);
for (let j = 0; j<9; j++) {
sudoku[i][j] = new Casilla(ca... | true |
4a8205b4bbf04e53e02b458e27d35cdf696f47fc | JavaScript | imjuangarcia/link-sharing-app | /public/js/loading.js | UTF-8 | 245 | 2.59375 | 3 | [] | no_license | const body = document.querySelector('body');
const overlay = document.querySelector('.overlay');
// eslint-disable-next-line no-undef
form.addEventListener('submit', () => {
body.classList.add('loading');
overlay.classList.add('show');
});
| true |
1d7d8009459eeeb2e8993d98f2c719849219df77 | JavaScript | jiacong-l/node_vue | /demo/testNet/client.js | UTF-8 | 588 | 2.53125 | 3 | [] | no_license | /**
* Description:客户端socket
* User: 赵一鸣
* Date: 2017/5/23
*/
var net = require('net');
var client = new net.Socket();
var readline = require('readline');
var rl = readline.createInterface({
input : process.stdin,
output : process.stdout
});
var content = '';
rl.setPrompt('>');
rl.on('line', function(dat... | true |
8dcd478663e0fcd80de0c1836d2d216697614961 | JavaScript | ridhoassuryadi/Learning-Mastering-Javascript | /es-6-wesbos/Destructing_Objects.js | UTF-8 | 732 | 3.46875 | 3 | [] | no_license | const person = {
first : 'Wes',
last : 'Bos',
country : 'Canada',
city : 'Hamilton',
twitter : '@wesbos'
}
//get object desctructuring from variable person
const { first, last, twitter } = person;
console.log(`First ${first}, Last ${last}, Twitter ${twitter}`);
const people = {
first : 'Wes',... | true |
4f36b71e0d9ef54a1afb917de4fdef24c973cb85 | JavaScript | Shameless521/PT | /js/atmosphere/star.js | UTF-8 | 3,330 | 2.71875 | 3 | [] | no_license | let Star=(()=>{
class Star1{
constructor(o3d,options){
let o=options?options:{};
this.o3d=o3d;
this.radius=o.radius?o.radius:15;
this.color=o.color?o.color:0xffffff;
this.randomColor=o.randomColor?o.randomColor:false;
this.maxPartic... | true |
63db164586d9927c54869f8c7887c83c10394fe4 | JavaScript | e-mergo/qs-emergo-triggers | /util/qs-emergo-events.js | UTF-8 | 35,262 | 2.546875 | 3 | [
"MIT"
] | permissive | /**
* E-mergo Events Utility Library
*
* @version 20230304
* @author Laurens Offereins <https://github.com/lmoffereins>
*
* @param {Object} qlik Qlik API
* @param {Object} qvangular Qlik's Angular implementation
* @param {Object} _ Underscore library
* @param {Object} $... | true |
e06a90e8fa73e5589b9f830d23f47f5ece248776 | JavaScript | senorrossie/php-sio2bsd-web | /js/dragndrop.js | UTF-8 | 613 | 2.578125 | 3 | [
"MIT"
] | permissive | /*** Drag n Drop ***/
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data).cloneNode(true... | true |
87b3af030f9536e1085e3d99c28103410a32095d | JavaScript | lobohatt/nodejs-weather-web | /src/exp1.js | UTF-8 | 870 | 3.015625 | 3 | [] | no_license | const express = require('express');
const app = express();
// This is app.com
app.get('', (req, res) => { // first agrument in app.get is partial url and other is function
res.send('Hello express!'); //function argument is request and response
});
// This is app.com/help
app.get('/help', (req, res) => {
... | true |
8556012cb8699bbd89a5a5722097620268c569b3 | JavaScript | vuduclong3010/WebFrontEnd | /Tokyo/js/main.js | UTF-8 | 1,064 | 3.0625 | 3 | [] | no_license | let $ = document.querySelector.bind(document);
let $$ = document.querySelectorAll.bind(document);
// Menu
let menus = $$('.react-tabs__tab');
let hienthis = $$(".react-tabs__tab-panel");
menus.forEach(function(menu, index) {
let hienthi = hienthis[index];
menu.onclick = function() {
$('.react-tabs__t... | true |
b0eca63709f3616657dd693572a413c3e9d2acc1 | JavaScript | Zac-L/todo | /app-react/src/data/todos/todos.reducers.js | UTF-8 | 438 | 2.578125 | 3 | [
"MIT"
] | permissive | import TODOS from 'data/todos/todos.constants';
const todos = (state = [], { type, payload }) => {
switch(type) {
case TODOS.CREATE_TODO:
return state.concat(payload);
case TODOS.UPDATE_TODO:
return state.map(todo => todo._id === payload._id ? payload : todo);
case TODOS.DELETE_TODO:
r... | true |
421f0664d333d4dd5c9d2bd91e469e9324ad9586 | JavaScript | SohailBepari/CC-Hosting | /canvas.js | UTF-8 | 1,899 | 3.21875 | 3 | [] | no_license |
let circle = new Circle(window.innerHeight/2, 10);
window.addEventListener('keypress', (event) => {
if(event.keyCode == 32)
circle.jump();
})
let pipeArray = [];
let continueAnimating = true;
let points = 0;
let interval = undefined;
function startRender(){
let val = setInterval(() => {
let w... | true |
6f7267821458c1d245a0cbd3a55a6e13be805878 | JavaScript | valeriavetyan/ACA_Homeworks | /hwk__2/task 8.js | UTF-8 | 381 | 3.625 | 4 | [] | no_license | let n = +prompt('Enter a Number')
function sequence(n){
let result = 0;
let plyusOrMinus = '+';
for( let i = 1; i <= n ;i = i + 2 ) {
if( plyusOrMinus === '+' ){
result += 1 / i ;
plyusOrMinus = '-';
}else if (plyusOrMinus === '-'){
result -= 1 / i ;
plyusOrMinus = '+';... | true |
b4fc53c1662356d5305537cd857e0913b511e26b | JavaScript | CurtisFenner/aask2014 | /frcevent.js | UTF-8 | 6,688 | 2.84375 | 3 | [] | no_license | /*
This file is part of the Adambots Automated Scouting Kit (AASK).
AASK is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
AASK is distribute... | true |
408476cdd7738a769f6a3f1d3f45a4697ad63ca0 | JavaScript | istiyakamin/learn_javascript | /js/array.js | UTF-8 | 950 | 3.296875 | 3 | [] | no_license | (function () {
"use strict";
var testArray = ['one', 'two', 'three', 'four'];
var testArray1 = ['one', 'two', 'three', 'four'];
var testArray2 = ['one', 'two', 'three', 'four'];
var testArray3 = [20, 100, 30, 185];
var testArray4 = ['one', 'two', 'three', 'four'];
var testArray5 = ['one', 'two', 'three', 'four'... | true |
8880dee248a330c6898efd3c19bf152086027023 | JavaScript | justJokee/algorithm | /Leetcode/JavaScript/0045-trapping-rain-water.js | UTF-8 | 1,532 | 4.03125 | 4 | [] | no_license | /**
* 可以采用动态规划的思想:分别计算出每个柱子左右两边的最高的柱子
* 时间复杂度O(n)
* 空间复杂度O(m)
* @param {number[]} height
* @return {number}
*/
var trap = function(height) {
const length = height.length
if (length === 0) return 0
// maxL[i]表示第i个元素左侧的最高的柱子
const maxL = [0]
// maxR[i]表示第i个元素右侧的最高的柱子
const maxR = new Array(length).fill(... | true |
53a11c7529eb035c39f79fbc60c98af583d1e0f9 | JavaScript | AustinCodingAcademy/campus-manager | /controllers/TrackController.js | UTF-8 | 3,421 | 2.578125 | 3 | [] | no_license | const TrackModel = require('../models/TrackModel.js');
/**
* TrackController.js
*
* @description :: Server-side logic for managing tracks.
*/
module.exports = {
/**
* TrackController.list()
*/
list: function (req, res) {
TrackModel.find({client: req.user.client})
.populate({
path: 'courses', pop... | true |
ceab441332ca6759545f2284a69914188b0885c6 | JavaScript | GabrieleCorti/reduxtodo | /plain/index.js | UTF-8 | 899 | 2.5625 | 3 | [] | no_license | /* import { createStore } from './node_modules/redux/dist/redux.js'; */
const initisalState = {
isVisible: false
}
//Named constant
const BUTTON_CLICKED = "BUTTON_CLICKED"
// Action creators
const ButtonClickedAction = () => {
return {type: BUTTON_CLICKED}
}
const rootReducer = (state = initisalState, ac... | true |
4792ca86da13500ca1abcbb595da7250f9f60525 | JavaScript | KonradBaranek/dszi2018 | /cnn/cnn.js | UTF-8 | 3,343 | 2.515625 | 3 | [] | no_license | const tf = require('@tensorflow/tfjs');
require('@tensorflow/tfjs-node');
const LoadData = require('./loadData');
class CNN {
constructor() {
this.createConvModel();
const options = {
shuffle: true,
trainSize: 4900,
testSize: 100,
batchSize: 100,
};
this.data = new LoadData... | true |
7da5fb853c48ba9c99f52dc188f805e64cf2cc96 | JavaScript | Cmfauvel/Rick-Morty | /David/script2.js | UTF-8 | 2,796 | 3.34375 | 3 | [] | no_license | const divListEpisode = document.querySelector('#list-episodes');
let tabFetch = ["https://rickandmortyapi.com/api/episode", "https://rickandmortyapi.com/api/episode?page=2", "https://rickandmortyapi.com/api/episode?page=3"]
/*
let select = document.getElementById("season");
select.addEventListener("change", (e) =>{
... | true |
a846c3d733de3c700fe26a06a257c39c92e72dff | JavaScript | edselpinpin/worker | /Client/src/reducers/workorder.js | UTF-8 | 1,632 | 2.515625 | 3 | [] | no_license | import * as ActionTypes from '../actions/ActionTypes';
const initialState = {
workorder: [],
worderdue: [],
wordertoday: [],
worderopen:[],
custworkorder: []
}
const WorkOrderReducer = (state = initialState, action) => {
switch (action.type) {
case ActionTypes.FETCH_WORKORDER:
... | true |
9ef0d148717a7a3297b787652368d7c77f891699 | JavaScript | RAzaALy/UI | /Glassmorphism/animatedHeartBg/index.js | UTF-8 | 628 | 3.140625 | 3 | [] | no_license | const container = document.querySelector(".container");
for (let i = 1; i <= 70; i++) {
const hearts = document.createElement("div");
hearts.classList.add("heart");
container.appendChild(hearts);
}
function animateHearts() {
anime({
targets: ".heart",
translateX: function () {
return anime.random(... | true |
7b72b1f045a958ec34d563f01b687dcb63f2c4fc | JavaScript | jmcoleman/news-commenter | /middleware/logger.js | UTF-8 | 1,360 | 3.0625 | 3 | [
"MIT"
] | permissive | const chalk = require('chalk')
// helper function to calc time it takes to complete the request
const getActualRequestDurationInMilliseconds = (start) => {
const NS_PER_SEC = 1e9 // convert to nanoseconds
const NS_TO_MS = 1e6 // convert to milliseconds
const diff = process.hrtime(start)
return (diff[0] * NS_PER_SE... | true |
ae05fb64618182910e5036253b8bc603e28dc912 | JavaScript | marsonparulian/name-analyzer | /src/services/nameService.js | UTF-8 | 2,729 | 3.265625 | 3 | [] | no_license | // Services to analyze name
import crossFetch from "cross-fetch";
/**
* Predict age based on a name.
* @param {string} name - Name to be analyzed
* @param {*} country - Optional. Country of origin to improve accuray. Uses ISO 3166-1 alpha-2.
*/
export const analyzeNameForAge = async (name, country = null) => {
... | true |
49329042167b1ed55b9f7359d64a978986440c13 | JavaScript | rtagashira/algorithms | /leetcode/searchA2DMatrix.js | UTF-8 | 1,656 | 4.46875 | 4 | [] | no_license | // Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:
// Integers in each row are sorted from left to right.
// The first integer of each row is greater than the last integer of the previous row.
const searchMatrix = (matrix, target) =>{
let i = 0
... | true |
bdaa04d3a8a5540013b30c7e6403972192ea2068 | JavaScript | gwpmad/advent-of-code-2019 | /6/1.js | UTF-8 | 915 | 3.296875 | 3 | [] | no_license | const fs = require('fs');
const input = fs.readFileSync(__dirname + '/input', 'utf8');
function countOrbits (orbits) {
const orbitsGraph = getOrbitsGraph(orbits.split('\n'));
let count = 0;
const queue = [{ entity: 'COM', depth: 1 }];
while (queue.length) {
const { entity, depth } = queue.shift();
... | true |
b07e904b52b8f4504c733e8474f36f4798435b62 | JavaScript | sunaoqi/zhouyi | /qc.js | UTF-8 | 184 | 3.75 | 4 | [] | no_license | var arr = [1, 2, 3, 1, 2, 3];
var newarr = [];
for (var i = 0; i < arr.length; i++) {
if (newarr.indexOf(arr[i]) === -1) {
newarr.push(arr[i]);
}
}
console.log(newarr); | true |
ca0fe62b8b4bf3d0112c2c4b6a5efba9c412777f | JavaScript | monarch0111/appsmith | /app/client/cypress/manual_TestSuite/Clipboard_Copy_Spec.js | UTF-8 | 1,378 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | const dsl = require("../../../fixtures/tableWidgetDsl.json");
describe("Test for Clipboard Copy", function() {
it(" Clipboard copy on selecting a row ", function() {
// Add a table widget
// Click on the Property Pane
// Naviagte to Action Items
// Click on "onRow Selection" Dropdown
// Select "C... | true |
765f0d9b5d6ef67fc42dc69dabb5acd3a5bcb1e6 | JavaScript | stefclaus/js-object-oriented-classes-travel-lab-v-000 | /index.js | UTF-8 | 2,400 | 3.46875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | let eastWest = [
'1st Avenue',
'2nd Avenue',
'3rd Avenue',
'Lexington Avenue',
'Park',
'Madison Avenue',
'5th Avenue'
];
class Driver {
constructor(name, startDate) {
this.name = name
this.startDate = new Date( startDate );
}
yearsExperienceFromBeginningOf( year ) {
let startYear = thi... | true |
b6f93eec1f1ccdb8424eb85e1cdca5dee63ccd5a | JavaScript | pengchengCN/myBlog_web | /src/common/util.js | UTF-8 | 1,364 | 3.0625 | 3 | [] | no_license | class Util {
// 处理文章的分类和标签
articleList (data, catData, labData) {
catData = JSON.parse(JSON.stringify(catData))
labData = JSON.parse(JSON.stringify(labData))
for (let x in data) {
let catAry = data[x].category_id
let labelAry = data[x].label_id
if(catAry.length !== 0) data[x].category_... | true |
d351e3a9e5232209f6de5d85bd19e3bba0bfff27 | JavaScript | nSiggy/bootcamp | /Day10/src/App.js | UTF-8 | 2,468 | 2.640625 | 3 | [] | no_license | // @flow
import React, {Component} from 'react';
import type {Contact, State} from './contact';
import ContactList from './ContactList';
import ContactDetail from './ContactDetail';
type Props = {};
const pad8 = {
padding: 8,
};
const boxStyle = {
display: 'flex',
padding: 3,
justifyContent: 'center',
};
cl... | true |
abcf27a5e86b28bc215615f66a7bf9c1afb60464 | JavaScript | appajugadar/corda-sample | /corda-core/src/main/resources/exampleWeb/jqueryAjaxGet.js | UTF-8 | 7,693 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | $(document).ready(function() {
getCashBalance();
getSecurityBalance();
getBuyRequests();
getSellRequests();
getMyInfo();
// DO GET
$("button[id='cashIssueButton']").click(function(data){
var amt = $('input[name="amount"]').val();
var currency = $('input[name="currency"]').val();
var restUrl ... | true |
cc8606092c5586b194b2b062ffe522f5d0b8d76d | JavaScript | GiantKs/MusicVisible | /心内饱满.js | UTF-8 | 3,313 | 3.46875 | 3 | [] | no_license | /*
var ary=[{a:1},2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]
var obj={a:1}
console.log(ary.slice(0,50 ));
.slice(0,50 )*/
/*var num = '0.07000000000000000001';
function retainTwo(num){
if(isNaN(num*100)){
... | true |
44dc775678bd9ced5a4147190513912459212ad8 | JavaScript | sriharilakshmanan/Burger-Builder | /src/components/Order/Order.js | UTF-8 | 1,087 | 2.609375 | 3 | [] | no_license | import React from "react";
import classes from "./Order.module.css";
const Order = (props) => {
const ingredientColors = {
bacon: "#ebc6c6",
cheese: "#ffe699",
meat: "#e6b3b3",
salad: "#c6ffb3"
};
const ingredients = [];
for (let ingredientKey in props.ingredients) {
ingredients.push({
... | true |
80710419e4f0428b4fbaba0ff11250118801f763 | JavaScript | JaeTutorials/SpringBoot2.2.11_ReactJS | /client/src/components/views/DetailProductPage/Sections/ProductImage.js | UTF-8 | 1,041 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import ImageGallery from 'react-image-gallery'; // 이미지 슬라이딩, 이미지 전체보기 기능
import { URL } from '../../../Config';
function ProductImage(props) {
const [Images, setImages] = useState([])
useEffect(() => {
if (props.detail.images && props.detail.images.... | true |
ee63e8e82c92571c7f46cd96a2b824cbe7edcfbd | JavaScript | mikolertesx/calendar-frontend | /src/constants/weekdays.js | UTF-8 | 415 | 3.125 | 3 | [] | no_license | export const weekdays = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
export const getWeekday = (day, month, year) => {
const date = new Date(year, month, day);
return date.getDay();
}
export const getWeekdayString = (day, month, year) => {
const currentWeekday... | true |
cea5be7237c0b7e419b7b99f52734df6497bf398 | JavaScript | tisidro/Javascript | /methods/reduceminmax.js | UTF-8 | 479 | 3.953125 | 4 | [] | no_license | //return max and min as an array -- min score and max score
const scores = [10, 30, 44, 98, 22, 16, 6];
//arrow function below follows scores.reduce. you have as inputs first the accumulator, then the element from the array (score)
//after fat arrow, set up array b/c you want to return an array
var minMax = scores.... | true |
547ac260f191bd09d0e487187277c023078e6611 | JavaScript | PoxeyCo/poxey | /src/utils/travalingSlider.js | UTF-8 | 1,797 | 2.828125 | 3 | [] | no_license | module.exports = function slider() {
const arrowLeft = document.querySelector(".arrow-left"),
arrowRight = document.querySelector(".arrow-right");
const sliderLenta = document.querySelector(".slider-lenta");
const sliderWrapper = document.querySelector(
".traveling-wrapper__slider-tape"
).offsetWidth;
... | true |
659ce2d90ac0dbc3c14e5500b00db6a2d78e4300 | JavaScript | Rayvid/men-microservice-skeleton | /src/exceptions/Exception.js | UTF-8 | 3,611 | 2.671875 | 3 | [] | no_license | import path from 'path';
import fs from 'fs';
const pkgJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'package.json')));
// It's recommended to extend this class to be able to pass trough it to callbacks, etc.
/**
* @export
* @class Exception
* @extends {Error}
*/
export default class Exception extend... | true |
82f557f18a6c6ef519842caeafb0d89cbb1240cb | JavaScript | SMIS20/fear-core-ui | /lib/mns-core-ui/base/analytics.events.js | UTF-8 | 1,072 | 2.796875 | 3 | [] | no_license | export default class Analytics {
/**
* Attach analytics events
*/
constructor() {
}
/**
* bind
* @param el {Object}
* @param actions {Object}
*/
static bind(el, actions) {
if (el.length) {
el = Array.from(el);
} else {
el = [e... | true |
bac6a696dd7d1af80227e36b12b7cb3a230756b9 | JavaScript | Reference-for-Ding/algorithm-practice | /questions/backTracking/beautifulArrange.js | UTF-8 | 830 | 2.875 | 3 | [] | no_license | var countArrangement = function(N) {
const allCandidates = []
for (let i = 1; i <= N; i++) {
allCandidates[i - 1] = i
}
let count = 0
countArrange(allCandidates, [], 0)
return count
function countArrange(allCan, acc, start) {
if (acc.length === allCan.length) {
count += 1
... | true |
6874d6963ab38f47087d04b68261b12af099adbd | JavaScript | crobicha/react_form_example | /src/reducers/ParticipantReducer.js | UTF-8 | 1,818 | 2.953125 | 3 | [] | no_license | /* Define your initial state here.
*
* If you change the type from object to something else, do not forget to update
* src/container/App.js accordingly.
*/
import {ADD_PARTICIPANT, EDIT_PARTICIPANT} from '../actions/const';
import {STATUS_NOT_REVIEWED} from '../actions/const';
const initialState = {
participan... | true |
5e3547094021ee2a3385b9fc5582dbebedd5c7b2 | JavaScript | mkyaw/learn-angularjs | /angularjs-4-controllers.js | UTF-8 | 228 | 2.625 | 3 | [] | no_license | var app = angular.module('myAngularApp', []);
app.controller('myAngularCtrl', function($scope){
$scope.fname = "John";
$scope.lname = "Smith";
$scope.fullName = function() {
return $scope.fname + " " + $scope.lname;
}
}); | true |
37daaa7103d08ea45ab9cd2c6c3630f7206ad8dc | JavaScript | nitowahyu01/BetaParkir | /java.js | UTF-8 | 540 | 2.78125 | 3 | [] | no_license | var luas;
var keliling;
var alas;
var tinggi;
var sisiMiring;
function hitung() {
alas = parseFloat(document.getElementById("ipt_alas").value);
tinggi = parseFloat(document.getElementById("ipt_tinggi").value);
luas = (alas * tinggi) / 2;
sisiMiring = Math.sqrt(Ma... | true |
e4e15f2348876e44760d81cc5f581d6369d4953d | JavaScript | igor007-cyber/Aulas_HtmlCss | /javascript/Aula2/index1.js | UTF-8 | 439 | 3.703125 | 4 | [] | no_license | // Laço de repetição
window.onload = function(){
var repeticao = 0
/*
// WHILE
while(repeticao < 10){
console.log(`ola mundo: ${repeticao}`)
repeticao++
}
*/
/*
//FOR
for(let numero = 0; numero < 10; numero++){
console.log(`ola mundo`)
}
*/
do{
... | true |
ca1595beadc72fa2dbf1e9e5d630fea35f678047 | JavaScript | andrewschmidt-a/validator | /validator.js | UTF-8 | 20,231 | 2.765625 | 3 | [] | no_license | /**
* validator.js
*
* javascript validator script that takes a form and validates it. The validator is designed to work along side the bootstrap library but
* it is compatable with pretty much any type of form. Bug fixes for rigorous testing have not been applied quite yet but are a process that
* will be implemented ... | true |
e2880a1736441a8a426caf249f16f429440df9e0 | JavaScript | gundam1993/wolf-judger | /app/reducers/player.js | UTF-8 | 841 | 2.734375 | 3 | [] | no_license | let init = {
username: '',
id: '',
role: '',
lastRole: '',
ready: false,
}
const player = (state = init, action) => {
let newState
switch (action.type) {
case 'UPDATE_USER_ID' :
newState = Object.assign({}, state, {id: action.id})
return newState
case 'UPDATE_USERNAME' :
newStat... | true |
a313b3084981b553464d480389a3bc537b82f73d | JavaScript | wendellbruno/CURSO-WEB-MODERNO | /PraticandoFundamentos/Array/forEach2.js | UTF-8 | 178 | 3.3125 | 3 | [] | no_license | console.log(forEach2 === forEach)
const aprovados = ['Agatha', "julia", 'Ana', 'Wendell']
aprovados.forEach2(function(nome,indice) {
console.log(`${indice +1}) ${nome}`)
})
| true |
4a688003ac46ab11df6cae7750938a2b3409b541 | JavaScript | ploxx95/SearchGifs | /src/App.js | UTF-8 | 808 | 2.515625 | 3 | [] | no_license | import React, { useState } from "react";
import { AddCategory } from "./components/AddCategory";
import { GridGift } from "./components/GridGift";
export const App = () => {
const [category, setCategory] = useState(["Anime"]);
// const handleButtonClick = () => {
// setCategory([...category, "Tralalala"]);
... | true |
e8056c2b5cb4e3a749e17f825b9386c13342e311 | JavaScript | bryan-menendez/juanitoscript | /lesson4/ninja.js | UTF-8 | 1,089 | 2.9375 | 3 | [] | no_license | var h1_titulo = document.getElementById("titulo");
console.log(h1_titulo.innerHTML);
h1_titulo.innerHTML = "NO PASA NA SOSIO";
h1_titulo.style.color = "purple";
h1_titulo.style.background = "gray";
var btnApretame = document.getElementById("btnApretame");
btnApretame.onclick = function(){
btnApretame.className =... | true |
1aa98bf4f2d6e8c69e30f8d82f2e11056ad47eb8 | JavaScript | arun-deva/rmp | /src/main/webapp/js/unused_knockoutjs/searchModel.js | UTF-8 | 781 | 2.671875 | 3 | [
"MIT"
] | permissive | function SearchModel() {
var self = this;
this.searchText = ko.observable("");
this.searchResults = ko.observableArray([]);
this.search = function() {
$.ajax({
type: "GET",
url: "rest/search",
data: {
"searchText": self.searchText
},
success... | true |
2a055d4c4a86dd4ed84c2170aa64f678f2ec5115 | JavaScript | catacs/udacity-javascript-design-patterns | /cat-clicker-premium/js/app.js | UTF-8 | 3,157 | 2.921875 | 3 | [] | no_license | var counter = {};
var currentCatIndex = -1;
$(function() {
var data = {
currentId: null,
cats: [{
id: 'cat1',
name: 'Cat1',
src: 'img/cat-1.jpg',
clicks: 0,
}, {
id: 'cat2',
name: 'Cat 2',
src: 'img/cat-2.jpg',
clicks: 0,
}, {
id: ... | true |
ca2158f39be841612298b809088b8ee36a2b7642 | JavaScript | Deputat-Maksym/calc | /sw.js | UTF-8 | 956 | 2.609375 | 3 | [] | no_license | self.addEventListener('install', function(event) {
console.log('[Servise Worker] Installing Service Worker', event);
event.waitUntil(
caches.open('static')
.then(function(cache) { // make cache
console.log('[Service Worker} Precaching');
cache.addAll([
'/',
'/index.html... | true |
4cbec17749049cf6208964712ec1a2b6d3278f35 | JavaScript | vibsbali/Playbook | /ngPlaybook/Apps/common/js/services/currentUser.js | UTF-8 | 1,179 | 2.75 | 3 | [] | no_license | "use strict";
(function () {
angular.module("common").factory("currentUser", ["localStorage", currentUser]);
function currentUser(localStorage) {
var USERKEY = "utoken";
//profile will be result of some function that gets called
var profile = initialize();
function initiali... | true |
515764d9a6d92ee3d625bec5c64ca142bfb2280c | JavaScript | gornyyvladimir/Weather | /src/adapters/__unit__/weatherAdapter.test.js | UTF-8 | 2,168 | 2.515625 | 3 | [] | no_license | import { DEFAULT_LATITUDE, DEFAULT_LONGITUDE } from '../../constants/constants';
describe('weatherAdapter', () => {
test('default', async () => {
// arrange
const expectedWeatherDescription = 'Sunny';
const expectedIcon = '01d';
const expectedTemperature = {
day: 29.94,
min: 20.22,
... | true |
819b754594b9e2c1dacbaa648bd0f356edf17580 | JavaScript | johnKHill/ES6_7_8 | /promises.js | UTF-8 | 1,240 | 3.734375 | 4 | [] | no_license | // Promises
// JavaScript is async.
console.log("1");
setTimeout(()=>{
console.log("2");
},0);
for(let i = 0; i < 10000000; i++){
// looping...
}
console.log("Loop done");
// Initial request to get list of movies
// With that list of movies, comes all their id's.
// Take the id's and get specific information.
//... | true |
afb841f5918ec97eaf4fe2060f0a11b936349086 | JavaScript | cliffzxc/CordovaShare | /platforms/ios/www/js/camera.js | UTF-8 | 2,661 | 2.953125 | 3 | [
"MIT"
] | permissive | /**
* Created by njupt on 7/13/15.
*/
var pictureSource; //图片来源
var destinationType; //设置返回值的格式
// 等待PhoneGap连接设备
document.addEventListener("deviceready",onDeviceReady,false);
// PhoneGap准备就绪,可以使用!
function onDeviceReady() {
pictureSource=navigator.camera.PictureSourceType;
destinationType=navig... | true |
11c03b3e8e330eab71dbd1a9449255cb585ed665 | JavaScript | victordanielgithub/faq-accordion-card-main | /js/main.js | UTF-8 | 434 | 2.890625 | 3 | [] | no_license | let item_title = document.querySelectorAll('.accordion-container .item-title');
for (let i = 0; i < item_title.length; i++) {
item_title[i].addEventListener('click', (e) => {
console.log(e.target);
let item = e.target;
if (item.className == 'item-title active') {
item.classList.remove('active');
} else {
... | true |
0476b6b7b9008f46f3d826858d7e80f073670f42 | JavaScript | konklone/ohnomymoney | /public/javascripts/ohnomychart.js | UTF-8 | 3,114 | 2.65625 | 3 | [
"MIT"
] | permissive | var chart;
// color of the graph's line
var color;
var colors = {positive: "#3fb021", negative: "#b61515"};
if (account.type == 'worth')
color = colors[account.direction];
else if (account.type == 'assets')
color = colors.positive;
else // if (account.type == 'debts')
color = colors.negative;
// y axis optio... | true |
4a4f60d7eca4f4ecf4e905501e919ed1c561e98b | JavaScript | andela/ah-frontend-thor | /src/actions/resetPasswordAction.jsx | UTF-8 | 1,961 | 2.5625 | 3 | [
"MIT"
] | permissive | import toastr from "toastr";
export const updateError = message => {
if (message == "Password updated") {
toastr.success(message);
setTimeout(() => window.location.replace("/signup"), 3000);
} else if (message == "Token Expired. Update failed") {
toastr.error(message);
setTimeout(() => window.locat... | true |
7fa5bcc79ac4148dcdd911278d110cc52e748004 | JavaScript | Zanhua1999/Steen-Papier-Schaar-370d838c | /script.js | UTF-8 | 2,250 | 3.59375 | 4 | [] | no_license | var player1 = document.getElementById("player1");
var player2 = document.getElementById("player2");
var speel = document.getElementById("speel");
var keuze1 = "";
var keuze2 = "";
player2.style.display = "none";
speel.style.display = "none";
function steen1() {
keuze1 = "steen";
player1.style.display... | true |
bf88bafd27f8b7ed7a59b869e3d5a8ea29a714cb | JavaScript | markosaur/react-1-afternoon | /src/components/Topics/FilterObject.js | UTF-8 | 1,808 | 3.078125 | 3 | [] | no_license | import React, { Component } from 'react';
export default class FilterObject extends Component {
constructor() {
super();
this.state = {
StarWars: [
{
name: 'Yoda',
lightSaber: 'Green',
age: 900,
... | true |
cfd587d098949fccc2db2bdcbc6b86cfbedcd432 | JavaScript | zhangjiang1203/HTMLTest | /10-nodejs/05-node第五天/curd-express/operationFile.js | UTF-8 | 2,818 | 3.234375 | 3 | [
"MIT"
] | permissive | /*
* operationFile.js
* 数据操作文件模块
* 只处理数据,不关心业务
*
* */
var fs = require('fs')
var filePath = './students.json'
/* 获取所有学生
* 第一个参数是err
* 第二个参数是学生信息
*
* */
exports.find = function (callback) {
fs.readFile(filePath,'utf8',function (err,data) {
if (err){
return callback && callback(err)
}
... | true |
d1d675733a5c491cf2c679ae4ffebb82ab3cf1fd | JavaScript | jesus07098/intro_javascript | /ejercicios_PROMPT/ejercicios_prompt_3.js | UTF-8 | 723 | 3.859375 | 4 | [] | no_license | //Pido datos al usuario como el nombre, edad y la cantidad en pesos a convertir
let nombre = prompt("Como te llamas");
let edad = parseInt(prompt("Que edad tienes"));
let monto = parseInt(prompt("Que cantidad tienes en pesos?"));
//monto = Number.parseInt(monto);
//console.log(typeof monto);
//edad = parseInt(edad);
... | true |
d047ebe311b52c71010bb86739313c2a518a1c28 | JavaScript | Henrik99-hu/webtechbeadando-nrthzz | /js/cars.js | UTF-8 | 5,069 | 3.203125 | 3 | [] | no_license | //Calling needed methods
$(document).ready(function(){
getAllCars();
getManufacturerList();
$("#addCar").click(function(){
addCar();
});
$("#modifyCar").click(function(){
updateCar();
});
$("#deleteCar").click(function(){
deleteCar();
});
});
//Method to get ... | true |
c943d4b9bdb8c55be0d08e057c6f5dd8cdbe8478 | JavaScript | saladisathish/coderbyte | /04LetterChanges.js | UTF-8 | 513 | 3.171875 | 3 | [] | no_license | function LetterChanges(str) {
var newStr=str.split("");
for(var i=0;i<newStr.length;i++)
{
if(newStr[i].search(/[a-z]/gi)!=-1)
{
if(newStr[i].search(/[z]/gi)!=-1){
newStr[i]=String.fromCharCode(newStr[i].charCodeAt()-26);
}
newStr[i]=String.fromCharCode(newStr[i].charCodeAt()+... | true |
21d67290683c059da32075363b4dbd942bfa2644 | JavaScript | CrimsonKurikara/Blue_EdTech | /CodeLab/Modulo 1/Aula 07 - CodeLab/ex1.js | UTF-8 | 357 | 3.953125 | 4 | [] | no_license | const prompt = require("prompt-sync")();
function somaDigito(numero)
{
var soma = 0
for (var digito of numero)
{
soma += Number(digito);
}
return soma
}
let numeroDigitado = prompt("Digite um número positivo e irei somar os digitos deste número para você: ");
var print = somaDigito(nu... | true |
dd42ccae25433ca1cb135bc32c2c83423fecec2b | JavaScript | isamu-isozaki/farmtopia-backend | /src/app/user/repository.js | UTF-8 | 1,708 | 3 | 3 | [] | no_license | /**
* Author: Isamu Isozaki
* Note: All functions here return promises not objects but for the sake of simplicity, they just say they return
* objects
*/
const { User } = require("./model");
/**
*
* @param {object} data user at ./model.js
* Creates user
*/
function createUser(data) {
return User.create(dat... | true |
fa084e20ecb8ad3af4607459170ca7bd97bdc085 | JavaScript | jeanufu21/SeedBox | /release/js/userValidations.js | UTF-8 | 193 | 2.671875 | 3 | [] | no_license | function validatePass(){
senha1 = document.formInsertUser.senha_usuario.value
senha2 = document.formInsertUser.cw.value
if (senha1 != senha2)
alert("Passwords doesn't match!");
} | true |
b9a072e048769afba09524a1e48a85e7beda6857 | JavaScript | maciejsto/JSProject | /src/backend/service/arduino.js | UTF-8 | 4,076 | 2.921875 | 3 | [] | no_license |
/*
*Arduino model wihich provides data flow betweend Arduino board and Node server
*/
/**
* Created by Maciej on 6/16/2014.
*/
//TODO require mandatory models/confuguration
//Arduino Service
function ArduinoModel() {
//private
this.buffer = {
serial: [],
temperature: []
};
//private fun... | true |
6fe65911288e537eccd5a0d6e40c058056286105 | JavaScript | m-sureshraj/openvpn3-linux-client-wrapper | /lib/color.js | UTF-8 | 251 | 2.53125 | 3 | [
"MIT"
] | permissive | function yellow(text) {
return `\u001b[33m${text}\u001b[0m`;
}
function cyan(text) {
return `\u001b[36m${text}\u001b[0m`;
}
function red(text) {
return `\u001b[31m${text}\u001b[0m`;
}
module.exports = {
yellow,
cyan,
red
};
| true |
0b27b273930968d3a2b838fec8d5eeab6127b328 | JavaScript | fintechstudios/angularjs-mdc | /src/util/mock-component.js | UTF-8 | 4,058 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive |
function UNINITIALIZED_VALUE() {}
const _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();
/**
* @ngdoc service
* @name $componentGenerator
* @description
* Creates a mock component generator that wraps extra functionality for unit-testing.
*
* @param {string} componentName the camelCase name of the component to... | true |
c8bbb1c74f0df80e8a3954ae8b080973fdf6311a | JavaScript | Cetasdi123/evaluacion_primaria | /js/ejem1.js | UTF-8 | 130 | 2.609375 | 3 | [] | no_license | let nombre = prompt("digite su nombre");
let edad = prompt("digite su edad");
console.log(`hola ${nombre}, su ${edad} años`);
| true |
546770c4f5942018947427413e7a9227bcc5277e | JavaScript | drregg6/project-euler-2020 | /026-050/euler-045.js | UTF-8 | 1,434 | 4.625 | 5 | [] | no_license | /*
Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ...
Pentagonal Pn=n(3n−1)/2 1, 5, 12, 22, 35, ...
Hexagonal Hn=n(2n−1) 1, 6, 15, 28, 45, ...
It can be verified that T285 = P165 = H143 = 40755.
Find the next triangle... | true |