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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e295000699f8a17d34bcb8cb519ca068f7025cf9 | JavaScript | juliomac/react-day-time-picker-ptBR | /src/time-slots/generate-time-slots.js | UTF-8 | 991 | 3.09375 | 3 | [
"MIT"
] | permissive | import dateFns from 'date-fns';
function generateTimeSlots(selectedDate, slotSizeMinutes) {
const isToday = dateFns.isToday(selectedDate);
let start = selectedDate;
if (isToday) {
const now = new Date();
const offsetHours = dateFns.getHours(now);
/*
* "Pad" the start time with the amount of hou... | true |
fc49698fdd0d4a7b95600666896515d1e2682a6f | JavaScript | alexxux/vue-music | /src/common/js/storage.js | UTF-8 | 1,121 | 2.625 | 3 | [] | no_license | import storage from 'good-storage'
const SEARCH = '__search__'
const MAX_SEARCH = 30
export const saveSearch = function(query) {
// 获取storage的search值,无则返回空数组
let searchH = storage.get(SEARCH, [])
if (!query) {
return searchH
}
// 查找搜索历史里是否有新插入的歌曲
let oindex = searchH.findIndex((item) => {
return... | true |
d7a2aae526164c6fdaf1e444d46f5ac008285845 | JavaScript | duplebado/CurrencyExchange | /app.js | UTF-8 | 2,603 | 2.65625 | 3 | [] | no_license | function converter(Aaron){
let output = [];
for(let i in Aaron){
let result1= {name: i + '', rate: Aaron[i] };
output.push(result1);
}
return output;
text
}
new Vue({
el: '#app',
template: `<div :style="container">
... | true |
3d9c620b08587d11d08435718bb4ef55cf009878 | JavaScript | Sandipta87/ToDo-List | /code.js | UTF-8 | 7,061 | 2.515625 | 3 | [] | no_license | var isNewItem = 0;
var addItemtolistTitle;
var listDetails = /** @class */ (function () {
function listDetails(listName, listItem) {
this.listItems = [];
this.listName = listName;
for (var iCounter = 0; iCounter < listItem.length; iCounter++) {
this.listItems.push(listItem[iCount... | true |
cfbeec92d3b452a7caafaaba3c59b927db61a58c | JavaScript | SemkaAlexey1988/react-wp | /src/utils/QueryTransformer.js | UTF-8 | 909 | 2.59375 | 3 | [] | no_license |
const QueryTransformer = (value, inPage, idPage) => {
let galleryArray = [];
let galleryList = value.split(',');
let count = 0
galleryList.forEach(function(item) {
count++
galleryArray.push(`&include[]=${item}`);
});
let pagesCount
let galleryString
let counter = [];
let subarray = [];... | true |
79542819622e426d1032c05b7cb8a51fb630ae42 | JavaScript | deniz6190/NewWords | /Client/index.js | UTF-8 | 1,846 | 3.09375 | 3 | [] | no_license | var myApp = angular.module('myApp', []) //links js and html together
myApp.service('GifService', function ($http) {
var baseUrl= "https://api.giphy.com/v1/gifs/"
var apiKey = "dc6zaTOxFJmzC"
this.getGifs=function(query) {
var url= baseUrl + "search?q=" + query + "&api_key=" + apiKey
return $http.get(url)
}
... | true |
c541fbccf24e1d9821ae1064a0ba6ee68b28f3e6 | JavaScript | weronikaolejniczak/travellan-rn | /src/actions/transportActions.js | UTF-8 | 5,660 | 2.53125 | 3 | [] | no_license | import axios from 'axios';
import { FIREBASE_URL } from 'react-native-dotenv';
import Transport from 'models/Transport';
export const SET_TRANSPORT = 'SET_TRANSPORT';
export const CREATE_TRANSPORT = 'CREATE_TRANSPORT';
export const DELETE_TRANSPORT = 'DELETE_TRANSPORT';
export const SET_QR = 'SET_QR';
export const SE... | true |
43e295555f311deb19533db7f9ac09324a76fc69 | JavaScript | Mayankgupta688/NodeRepository | /Node/server.js | UTF-8 | 420 | 2.546875 | 3 | [] | no_license | var http = require("http");
http.createServer(function(req, res) {
if(req.url == "/") {
res.write("Hello World...")
res.end();
}
if(req.url == "/about") {
res.writeHead(200, {"Content-Type": "text/html"})
res.write("<h1>Hello World...</h1>")
res.end();
}
if... | true |
e7d186cad4c423258374f53662d1db25159a5ecf | JavaScript | dp9u0/Notebook-Javascript | /2.4.promise/test/index.js | UTF-8 | 1,238 | 3.5 | 4 | [
"MIT"
] | permissive | const Promise = require("../src/promise");
function log(msg) {
console.log(msg)
}
function test(resolve, reject) {
var timeOut = Math.random() * 2;
log('set timeout to: ' + timeOut + ' seconds.');
setTimeout(function () {
if (timeOut < 1) {
log('call resolve()...');
resolve('200 OK');
} el... | true |
d0b75d4e77cfbc2c01ab1e7d4076869b8a3273c5 | JavaScript | mayank-suman/core-js-learning | /src/objectMethods.js | UTF-8 | 838 | 3.9375 | 4 | [] | no_license | // Initialize an object with properties and methods
const job = {
position: "cashier",
type: "hourly",
isAvailable: true,
showDetails() {
const accepting = this.isAvailable
? "is accepting applications"
: "is not currently accepting applications";
console.log(
`The ${this.position} po... | true |
c664740954e6c031e86f92e04ec96ed5e9156ad7 | JavaScript | SergSmith64/freecodecamp-counting-card | /t104-random-numbers-within-a-range.js | UTF-8 | 262 | 3.828125 | 4 | [] | no_license | // Random Whole Numbers within a Range
// Случайные целые числа в заданном диапазоне
console.log("Hello");
var min = 120;
var max = 123;
console.log(Math.floor(Math.random() * (max - min + 1)) + min);
console.log("End");
| true |
2a53da4f4bb1d681ad8bfacdd056aad18937c9e9 | JavaScript | ravindu14/plantNutritionApp | /app/helpers/helpers/objects.js | UTF-8 | 922 | 3 | 3 | [] | no_license | export const removeEmptyKeys = (obj) => {
Object.entries(obj).forEach(
([key, val]) =>
(val && typeof val === "object" && removeEmptyKeys(val)) ||
((val === null || val === "" || val === undefined) && delete obj[key])
);
return obj;
};
export const getCalories = (item) => {
switch (item) {
... | true |
0d06c95bd883f7514dbff9b9a9623467504e8eea | JavaScript | oliver-0/oliver-0.github.io | /radiobox.js | UTF-8 | 594 | 3.1875 | 3 | [] | no_license | //
var buttons = document.getElementsByClassName('radiobox-button');
for (var buttonsIndex = 0; buttonsIndex < buttons.length; buttonsIndex++) {
buttons[buttonsIndex].onclick = showBox;
}
function showBox() {
//hides all of the radioboxes (yearly, monthly, weekly)
var boxes = document.getElementsByClassName('ra... | true |
3ff7b1a0d7bea02f7e728b59d3c36e2c5a9f020f | JavaScript | rohanpai/graphJS | /graph.js | UTF-8 | 2,699 | 2.921875 | 3 | [] | no_license | var graph = function () {
//
// private
//
var _force = null;
var _links = null;
var _link = null;
var _nodes = null;
var _node = null;
var _svg = null;
var _fill = null;
var _tick = function(){
_link.attr("x1", function(d) { return d.source.x; })
.attr("y1", function(d) { return d.... | true |
2c6a90ac02f1a979055db87e7a3ac3769ca4c391 | JavaScript | SamyAbdelAal/GuessThatNumber | /src/store/reducers/RandNumReducer.js | UTF-8 | 861 | 2.640625 | 3 | [] | no_license | import * as actionTypes from "../actions/actionTypes";
const initialState = {
randNum: 0,
playerWon: false,
clickedHint: 0,
numOfTries: 5
};
const getRandNumReducer = (state = initialState, action) => {
switch (action.type) {
case actionTypes.GET_RAND_NUM:
return {
...state,
randNu... | true |
d3635adcf76d89e63497e6391162770870c6a7fb | JavaScript | ValVarius/https-projecteuler.net-archives | /10 Summation of primes.js | UTF-8 | 357 | 3.75 | 4 | [] | no_license | function isPrime(n) {
if (n === 1) {
return false;
} else if (n === 2) {
return true;
} else {
for (let x = 2; x < n; x++) {
if (n % x === 0) {
return false;
}
}
return true;
}
}
let sum = 0;
for (let i = 1; i < 2000000; i++) {
if (isPrime(i)) {
sum += i;
cons... | true |
9b0a7878249a803f62015b64adfacee6cfe84825 | JavaScript | taego0918/2048 | /socket.js | UTF-8 | 1,090 | 2.546875 | 3 | [] | no_license | const express = require('express');
const app = express();
const server = require('http').Server(app);
const io = require('socket.io')(server);
let connectionNum = 0;
let OPDate = [];
io.on('connection', (socket) => {
connectionNum++;
socket.on('connectNum',()=>{
io.emit('connectNum',connectionNum);
... | true |
f7f876541b46ee9f013619d70dc0e3b2f86bdb9b | JavaScript | LawrenceHaney/dcdr | /Test/Puppet.js | UTF-8 | 5,407 | 2.625 | 3 | [] | no_license | require("dotenv").config();
const puppeteer = require('puppeteer');
const url = 'http://localhost:8080/';
let testPollCode = null
//Logs in with fake account. Necessary for anything that requires the user to be logged in
async function Login(page) {
return new Promise(async (resolve, reject) => {
try {
... | true |
e2236b5120971563f962548ea60dbbddc729c8e4 | JavaScript | stavaser/tortiki | /frontend-buyer/src/components/Countdown.js | UTF-8 | 3,919 | 2.765625 | 3 | [] | no_license | import React from 'react';
import { CountdownCircleTimer } from 'react-countdown-circle-timer';
import { useSelector } from 'react-redux';
import './countdown_style.css';
const minuteSeconds = 60;
const hourSeconds = 3600;
const daySeconds = 86400;
const timerProps = {
isPlaying: true,
size: 80,
strokeWidth: 6,... | true |
b04f11d3d9c2c8b0d1790b1c0cbab0800cc5e4bf | JavaScript | shiva10162/ID101 | /JS-level-2/9-new-syntax-from-ES6.js | UTF-8 | 2,386 | 3.765625 | 4 | [] | no_license |
// 1. // string-interpolation ( from Es6 )
let comp = "sapient";
let tnr = {
name: 'Nag',
sub: '.js'
}
//let dynamicString="The trainer "+tnr.name +" killing "+tnr.sub +" in "+comp;
let dynamicString = `The trainer ${tnr.name} teaching ${tnr.sub} in ${comp}`;
// let htmlTeplate='<div>'+
// ... | true |
02c6562458396e6aa60dcabd696d8f3d7fd756e8 | JavaScript | niv199723/Deloittewebpage | /demojs.js | UTF-8 | 1,817 | 3.03125 | 3 | [] | no_license | function cardValidation()
{
var x=document.getElementById("cardnum").value;
var numPattern="^[0-9]{16}$";
if(x==0||x==null)
{
document.getElementById("errornum").innerHTML="Enter your number";
return false;
}
else if(!x.match(numPattern))
{
document.getElementById("errornum").innerHTML=... | true |
c484b8cc5b3fb4dce4d1247ee03c10b2a436ebda | JavaScript | Usuario0990/Botd-super | /comandos/utilidad/backup.js | UTF-8 | 2,573 | 2.609375 | 3 | [] | no_license | const Discord = require('discord.js');
const client = new Discord.Client();
const { Client, MessageEmbed } = require('discord.js');
const backup = require("discord-backup")
backup.setStorageFolder(__dirname+"/backups/")
module.exports = {
name: "backup",
alias: [],
execute (client, message, args){
var perms ... | true |
e348ca3a176b4c0762fe99200a0875d61d69ea44 | JavaScript | tylergeery/geerydev | /src/js/src/reducers/posts.js | UTF-8 | 697 | 2.546875 | 3 | [] | no_license | import actions from '../actions/constants';
let initialState = {
list: [],
searchResults: [],
sidePanelPosts: []
};
export default function posts(state, action) {
if (!state) {
state = initialState;
}
let newState = Object.assign({}, state);
switch (action.type) {
case ac... | true |
68832058ffbddc7640ff8d17f4f1e232c765e52a | JavaScript | macarenaquisbert/ingresoA | /ingresoA-master/uno.js | UTF-8 | 2,227 | 4.03125 | 4 | [] | no_license | /*
1)De 5 personas que ingresan al hospital se deben tomar y
validar los siguientes datos.
nombre , temperatura, sexo y edad.
a)informar la cantidad de personas de cada sexo.
b)la edad promedio en total
c)la mujer con más temperatura(si la hay)
pedir datos por prompt y mostrar por document.write o console.log
... | true |
5c7a23cb09614e55d4dfcf4af925378998fd8a38 | JavaScript | vtkrishn/Learning | /Problems/reverseLinkedList.js | UTF-8 | 578 | 3.640625 | 4 | [] | no_license | function ListNode(val){
this.val = val;
this.next = null;
}
var reverse = function(node){
if(node.next === null)
return node;
var nextNode = reverse(node.next);
node.next.next = node;
node.next = null;
return nextNode;
}
var l1 = new ListNode(1);
var l2 = new ListNode... | true |
a0fa4cdc9c010443b6ba8e7a07ca21e5c5a3264b | JavaScript | YoDarcoDev/Projet-Utilisateur-Github | /app.js | UTF-8 | 1,580 | 3.265625 | 3 | [] | no_license | // https://api.github.com/users/
const APICALL = " https://api.github.com/users/";
const affichage = document.querySelector('.affichage');
const form = document.querySelector('.form-github-recherche');
const inpRecherche = document.querySelector('.inp-recherche');
// FONCTION ASYNCHRONE QUI VA RECUPERER LES DONNEE... | true |
d505c5fd6bd5eb8a6c4671f7f9d30223c50b1bf0 | JavaScript | jwhendershott/employee-directory | /src/utils/searchEmployee.js | UTF-8 | 640 | 2.828125 | 3 | [
"MIT"
] | permissive | const searchEmployee = {
searchEmployee: (value, empArr) => {
let filteredEmps = empArr.filter((emp) => {
return emp.firstName.toLowerCase().includes(value.toLowerCase()) ||
emp.lastName.toLowerCase().includes(value.toLowerCase()) ||
emp.email.toLowerCase().i... | true |
cfdd33005277aae41456f851bf8d00af37690229 | JavaScript | abhijitkalta/Server-authentication-JWT | /models/user.js | UTF-8 | 1,164 | 2.859375 | 3 | [] | no_license | const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const bcrypt = require('bcrypt');
const userSchema = new Schema({
email: {
type: String,
lowercase: true,
unique: true
},
password: String
});
//on save hook, hash the password
userSchema.pre('save', function(next){
//get acces... | true |
87560e5b34b7ce55cf88ddbb91fdaf3add791fd8 | JavaScript | peter-kish/js_components | /vector2d.js | UTF-8 | 3,658 | 3.25 | 3 | [] | no_license | var V2D = (function() {
var module = {};
module.Vector2d = function(x, y) {
if (x) {
this.x = x;
} else {
this.x = 0;
}
if (y) {
this.y = y;
} else {
this.y = 0;
}
};
module.Vector2d.prototype.set = function (vector) {
this.x = vector.x;
... | true |
7d6c14b4a7768c4644693af3e368e9724111126f | JavaScript | Dragon159f/trivia | /src/components/App.jsx | UTF-8 | 2,131 | 2.609375 | 3 | [] | no_license | import React, { Component } from 'react';
import '../css/App.css';
import { EndGame } from './EndGame.jsx';
import { Question } from './Question.jsx';
import { getQuestions } from '../clients/firebase.js';
// import components
class App extends Component {
constructor(props){
super(props);
this.state = ... | true |
6a30442eb3ecce97eb13937b25a65a1e43cb1440 | JavaScript | LeagueLugas/LeagueLugas.github.io | /js/index.js | UTF-8 | 3,335 | 2.65625 | 3 | [] | no_license | let request;
window.onload = async () => {
let token;
await fetch("ghtoken.txt", {
method: 'GET',
redirect: 'follow'
}).then(response => response.text())
.then(data => token = data);
request = axios.create({
baseURL: 'https://api.github.com/repos/LeagueLugas/LeagueLugas.g... | true |
2dcc67b495ab1e25e921e68988c4808397ec3c8d | JavaScript | poongnewga/LunchtingWeb_Beta | /app/assets/javascripts/post_write.js | UTF-8 | 355 | 2.921875 | 3 | [] | no_license | function validatePostForm()
{
var a=document.forms["postForm"]["title"].value;
var b=document.forms["postForm"]["content"].value;
if (a==null || a=="")
{
alert("제목을 써주세요!");
return false;
} else if (b==null || b=="") {
alert("내용을 써주세요!");
return false;
}
return tru... | true |
9e7f5fa977367290532eedac75c93e0e3ebe1903 | JavaScript | prajwalsbeta/happiness | /progress.js | UTF-8 | 658 | 2.578125 | 3 | [] | no_license | var score1 =localStorage.getItem("score")/36
var color1 = '#ff0000';
if (score1 <= 0.25) {
var color1='00ff00'
}
var progressBarOptions = {
startAngle: -1.55,
size: 200,
value: score1,
fill: {
color: color1
}
}
$('.circle').circleProgress(progressBarOptions).on('circle-animation-progress', function(event... | true |
fce5c35740b88ecabcee7ab26c870d0c8005fd9a | JavaScript | srikanth9493/DSA-450 | /Solutions/Arrays/Find longest coinsecutive subsequence.js | UTF-8 | 606 | 3.09375 | 3 | [] | no_license | class Solution {
//Function to return length of longest subsequence of consecutive integers.
findLongestConseqSubseq(arr, N){
// code here
arr.sort((a,b)=>a-b)
let count=1
let max=1
arr=[...new Set(arr)]
let flag=false
let i;
for(i=1;i<N;i++){
/... | true |
3d9592b004b8a6f85757ec930c5fa8dea52fb342 | JavaScript | khushboo-rgb/web-dev-starter | /functions.js | UTF-8 | 1,917 | 4.21875 | 4 | [] | no_license | function sayHello()
{
console.log("Functions Demo");
}
//function calling
sayHello();
//pasing string as an argument
function sayHello(name)
{
console.log("Hello" +" " + name);
}
//function calling
sayHello("khushboo");
//pasing multiple argument
function sayHello(firstName, lastName)
{
console.log("... | true |
e529b6fda80d23b0ef01d72f6dfdc2c672a8688c | JavaScript | NolanKern/MongoScraper | /.history/controllers/controller_20180513223834.js | UTF-8 | 2,310 | 2.765625 | 3 | [] | no_license | // Controller for our scraper
// ============================
var db = require("../models");
var scrape = require("../scripts/scrape");
module.exports = {
scrapeHeadlines: function(req, res) {
// scrape the NYT
return scrape()
.then(function(articles) {
// then insert articles into the db
... | true |
cce196d8848f1fb7c07c46d30f7629fcc063e11d | JavaScript | NectonDev/BOOpenbank | /app/js/models/EstadosModel.js | UTF-8 | 2,023 | 2.515625 | 3 | [
"MIT"
] | permissive | angular.module('EstadosModel',[])
.service('EstadosModel', ['$localStorage', function ($localStorage) {
var service = this;
service.getEstadoById = function(estadoId){
var listaEstados = $localStorage.tiposEstados;
for (var estado in listaEstados){
if (listaE... | true |
77ef9a1d95baa9a68a802ea04c262d1f71c00cf8 | JavaScript | alemughal/ExpenseTrackerApp | /src/Context/transContext.js | UTF-8 | 1,190 | 2.515625 | 3 | [] | no_license | import React, { createContext, useReducer } from 'react';
import TransactionReducer from "./transReducer";
const initialTransactions = [
{ id: 1, desc: "Cash", amount: 1000 },
{ id: 2, desc: "Cold Drink", amount: -50 },
{ id: 3, desc: "Deposit", amount: 100 },
{ id: 4, desc: "Books", amount: -200 },
]
... | true |
db7d95e1c3b0d1de44da8dd0626b00baf892933b | JavaScript | writetome51/get-date-time-id | /dist/index.js | UTF-8 | 2,247 | 2.625 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var get_date_id_time_id_1 = require("@writetome51/get-date-id-time-id");
var year_separator_options_1 = require("@writetome51/year-separator-options");
var has_value_no_value_1 = require("@writetome51/has-value-no-value");
var modify_object_1 ... | true |
9bcb165ed6d66935f9f104f6499685b8a22202bb | JavaScript | thegeorgenikhil/birthday-pallindrome-m13 | /index.js | UTF-8 | 6,705 | 3.515625 | 4 | [] | no_license | var date = document.querySelector("#date");
var btnInput = document.querySelector("#btn");
var pallindromeDiv = document.querySelector("#pallindrome");
var notPallindromeDiv = document.querySelector("#not-pallindrome");
var loadingGIF = document.querySelector("#timer-img");
btnInput.addEventListener("click", loadingO... | true |
3ca83b1d29fa2c3e5341c49f8fc755944cd18d0e | JavaScript | samhuynhle/JavaScript_Algorithms | /Big_O/example_7.js | UTF-8 | 352 | 4.0625 | 4 | [] | no_license | // Find 1st, Find Nth...
const array = [{
tweet: 'hi',
date: 2012
}, {
tweet: 'my',
date: 2013
}, {
tweet: 'teddy',
date: 2014
}];
array[0];
array[array.length-1];
// both were O(1) operations
// What is the cost of comparing the dates? O(n)
// What is JavaScripts .length? O(1), Java... | true |
242b6914f6800daa83c95a0ee9e8bd69e491f7cb | JavaScript | JesusGarcia23/HackerRankChallenges | /gradingStudents.js | UTF-8 | 1,700 | 4.28125 | 4 | [] | no_license | // HackerLand University has the following grading policy:
// Every student receives a grade in the inclusive range from 0 to 100.
// Any grade less than 40 is a failing grade.
// Sam is a professor at the university and likes to round each student's grade according to these rules:
// If the difference between the a... | true |
530a85bf5bc72c1c4d19b5ade90c05a47a91bfb7 | JavaScript | lmtss/webgl-particle | /gl/item.js | UTF-8 | 3,499 | 2.640625 | 3 | [] | no_license | function initFramebufferObject(gl) {
var framebuffer, texture, depthBuffer;
// Define the error handling function
var error = function() {
if (framebuffer) gl.deleteFramebuffer(framebuffer);
if (texture) gl.deleteTexture(texture);
if (depthBuffer) gl.deleteRenderbuffer(depthBuffer);
... | true |
bfd3c403d98aea92ab14d5b98642711ac83353fb | JavaScript | ihgazni2/es2xml | /TEST/NODES/for_of_statement.js | UTF-8 | 759 | 2.8125 | 3 | [] | no_license | > d = ac.parse("for(let i of d){}")
Node {
type: 'Program',
start: 0,
end: 17,
body:
[ Node {
type: 'ForOfStatement',
start: 0,
end: 17,
await: false,
left: [Object],
right: [Object],
body: [Object] } ],
sourceType: 'script' }
> nd = d.body[0]
Node {
typ... | true |
72d6c656bf4c48bb2a5ef8aad224b766a94ef93b | JavaScript | nicomauvecin/libreria-ecommerce | /src/ui.js | UTF-8 | 8,002 | 2.515625 | 3 | [] | no_license | const app = document.querySelector('#app');
export const renderHTML = () => {
app.innerHTML = `
<header class="header">
<div class="notification">ENVIOS GRATIS A TODO EL PAIS DESDE $4000.</div>
<nav class="navbar">
<div class="toggle-container"><i class="fas fa-user"></i></div>
<div class="brand-contai... | true |
10fc374805d55cade7a9c6ecf7bbd9d5eae500cf | JavaScript | CBrooks12/weatherMap | /static/sidebar.js | UTF-8 | 1,637 | 3.140625 | 3 | [] | no_license | //adds new location button to sidebar
function setLoc(submittedLoc,placeID,temp) {
if(submittedLoc === undefined){
return;
}
var list = document.getElementById("locList");
var l2 = list.childNodes;
for(var i = 2; i<l2.length;i++){
try{
//if button exists, ignore
if(l2... | true |
2292616f1f3b9e2070a80a3d7e4c63e37151b08d | JavaScript | glushakova/registration | /src/pages/SignUp/index.js | UTF-8 | 2,076 | 2.546875 | 3 | [] | no_license | import React, { useState } from 'react';
import * as firebase from 'firebase';
import { Loader, TextInput } from '../../components';
import './style.css';
function SignUp() {
const [email, onChangeFromProps] = useState('');
const [pincode, onPincodeChange] = useState('');
const [loading, loadingChange] = useStat... | true |
4b9a009778d6543492abebb17510e2492230b3e0 | JavaScript | jakegray1717/bowling_scorecard | /src/components/PinButton.js | UTF-8 | 2,848 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { Button } from 'react-bootstrap';
const PinButton = ({ buttonValue, setCurrentRollIdx, currentRollIdx, setFrames, frames, setCurrentFrameIdx, currentFrameIdx }) => {
const enterPins = (e) => {
let pins = buttonValue
const rollOne = frames[currentFrameIdx].frame[0];
if ... | true |
2bbdee47ecd35a2823455ea1bed1d4f59522b021 | JavaScript | maksim-korzhov/pokedex | /src/sagas/index.js | UTF-8 | 1,872 | 2.734375 | 3 | [] | no_license | import { call, put, takeEvery } from "redux-saga/effects";
import axios from "axios";
import {
FETCH_POKEMONS,
FETCH_POKEMONS_SUCCEEDED,
FETCH_POKEMONS_FAILED,
FETCH_POKEMON,
FETCH_POKEMON_FAILED
} from "../actions/types";
const ROOT_URL = "https://pokeapi.co/api/v2";
/*
get pokemon by id
... | true |
3e8cfda867fa31850ccbe66b6a949eebd9367caf | JavaScript | Nan0416/UserManagementService | /db-operations/user/register_user.js | UTF-8 | 2,448 | 2.515625 | 3 | [] | no_license | // register a user
// third parties library
const bcrypt = require('bcrypt');
// self-defined
const userDB = require('../../db-models/user/user_db');
const userType = require('../../db-models/user/user_status_types');
const validateEmail = require('../user/helper_functions').validateEmail;
const validatePassword = r... | true |
d86b18cdaad6b0d511ce3069d3a910cc523e90e9 | JavaScript | prakharaditya/genuary2021 | /code/genuary-16/sketch.js | UTF-8 | 732 | 3.234375 | 3 | [
"MIT"
] | permissive | /**
* Circles only
*
* Matthias Jäger
* genuary2021 | Day 15
*/
let angle = 0;
let radius = 360;
let innerRadius = 100;
let epsilon = 0.01;
let rotation;
const frames = 600;
function setup() {
createCanvas(900, 900);
background(220);
noFill();
rotation = TAU * 18;
}
function draw() {
if (angle <=... | true |
fdd940a5bb141ecbba5ab00848f0d708ee4e44be | JavaScript | ahmetfirat23/mathematische-durchfuhrener | /script.js | UTF-8 | 3,977 | 3.578125 | 4 | [] | no_license | const numbers = document.querySelectorAll("[data-number]");
const dotBtn = document.querySelector("#dot");
const allClearBtn = document.querySelector("#ac");
const clearEntryBtn = document.querySelector("#ce");
const signChangeBtn = document.querySelector("#signchange");
const divisionBtn = document.querySelector("#div... | true |
2bded12946ad397f55d3c3270d07cdffdad39dcf | JavaScript | ricardolagg/Store15908 | /htm/cod.js | UTF-8 | 3,268 | 2.53125 | 3 | [] | no_license |
// EFEITOS
// blindX, blindY, blindZ, cover, curtainX, curtainY, fade, fadeZoom, growX, growY, scrollUp, scrollDown, scrollLeft, scrollRight, scrollHorz,
// scrollVert, shuffle, slideX, slideY, toss, turnUp, turnDown, turnLeft, turnRight, uncover, wipe e zoom
// CONFIGURAÇÕES
/*fx 'fade' one of: fade, shuff... | true |
5a2e2542fce3be3fbd2f3ebd7eab25998a541424 | JavaScript | pigstake/my-portfolio | /src/App.js | UTF-8 | 19,378 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
class App extends Component {
render() {
return (
<main>
<header className='hero'>
<p className='subtitle'>Hi, I’m <a href='#aboutMe'>Jamie.</a> I’ve been designing (mostly for screens) since 2010 — leading startups through re... | true |
2af12e916297a4eb36a0c8afa4c698c80484bed8 | JavaScript | IcaFulokoja/compromise | /test/unit/subset/sentence/question.test.js | UTF-8 | 1,904 | 2.90625 | 3 | [
"MIT"
] | permissive | var test = require('tape');
var nlp = require('../../lib/nlp');
test('question-test :', function (t) {
[
'which party was it again?',
'so then which day was it?',
'he\'s fun?',
'but who did you really go with??',
'go where?!',
'go with who!?',
'then you said ... ?',
//no question-mar... | true |
1cc96183f23187586a8f2c363e2949dad0af33ee | JavaScript | una-chou/pictureContrast | /src/Chobi.js | UTF-8 | 11,726 | 3.125 | 3 | [
"MIT"
] | permissive | 'use strict';
var Chobi = function (elem) {
if (elem instanceof (Image)) {
this.image = elem;
this.imageData = this.extractImageData();
try {
this.onload();
} catch (e) {
console.log('ready callback not found');
}
}
else if (typeof (elem) == 'string') {
var context = this;
var img = new Image();... | true |
d51feb26e53837e5f1847a1f531554d48e06f070 | JavaScript | wang790222/Leetcode_Practice | /solutions/1389_CreateTargetArrayintheGivenOrder.js | UTF-8 | 470 | 3.359375 | 3 | [] | no_license | /**
* @param {number[]} nums
* @param {number[]} index
* @return {number[]}
*/
var createTargetArray = function(nums, index) {
let ans = [];
for (let i = 0; i < nums.length; i++) {
if (ans[index[i]] === undefined) {
ans[index[i]] = nums[i];
} else {
let leftPart = ans.slice(0, index[i]);
... | true |
4fe14983e0945385b3d4454a1147e9d5fcd9efa6 | JavaScript | abhinandansharma/grid-gallery | /src/components/GridGallery.js | UTF-8 | 2,943 | 3.046875 | 3 | [] | no_license | // Container component that takes in a keyword and api key as props
// and fetches the photos and other required information from the API
import React, { Component } from 'react';
// a promised-based library that makes server requests in React
// It will ne used to fetch the data from Flickr
import axios from 'axios';... | true |
86a708ea9053b20873f462fe9e5d77fadba296b1 | JavaScript | oalbe/exercism | /javascript/gigasecond/gigasecond.js | UTF-8 | 440 | 2.828125 | 3 | [] | no_license | var Gigasecond = function(inputDate) {
this._date = inputDate;
};
Gigasecond.prototype.date = function() {
var gigadate = new Date(this._date);
gigadate.setTime(this._date.getTime() + 1000000000000);
// this is a very ugly workaround to get rid of
// that 46 minutes and 40 seconds that a... | true |
a3d299148804f57ca16d1719bf0623c337fd5276 | JavaScript | WilliamLongKing/HTN2019 | /client/src/Graph.js | UTF-8 | 1,521 | 2.59375 | 3 | [] | no_license | import React from "react";
import {
VictoryBar,
VictoryChart,
VictoryAxis,
VictoryLabel,
VictoryTheme
} from "victory";
import XYTheme from "./theme.js";
// TO DO: FIX THIS DATA AS WELL AS JSON KEY VALUE PAIR NAMES
const data = [
{ quarter: 1, earnings: 1 },
{ quarter: 2, earnings: 2 },
{ quarter: 3, e... | true |
0f822c6f588e08700e55ae6f7586862c4110f6e0 | JavaScript | Mahmoud-Elsamman/MyNotes-application | /src/views.js | UTF-8 | 2,586 | 3.125 | 3 | [] | no_license | import moment from 'moment'
import { getFilters } from './filters'
import { sortNotes, getNotes } from './notes'
// Generate the DOM structure for a note
const generateNoteDOM = function (note) {
const noteEl = document.createElement('a')
const textEl = document.createElement('p')
const statusEl ... | true |
32d42a50dd033a329bcc897ce3131ae202ec1daf | JavaScript | dcorderoch/peds-innards | /WebApp/newProject/newProject.controller.js | UTF-8 | 4,920 | 2.5625 | 3 | [] | no_license | (function () {
'use strict';
angular
.module('app')
.controller('NewProjectController', NewProjectController);
NewProjectController.$inject = ['$location', 'FlashService', 'RegService', 'JobService', 'UserService', '$localStorage', 'ProfileCourseService'];
function NewProjectControlle... | true |
2ed3bc1c33c76bbcdb941257bd656b528d7adf98 | JavaScript | anthonykao10/lotide | /test/countLettersTest.js | UTF-8 | 626 | 2.921875 | 3 | [] | no_license | const assert = require('chai').assert;
const countLetters = require('../countLetters');
describe('#countLetters', () => {
it('should return { h: 1, e: 1, l: 2, o: 1}, given input "h" for string "hello"', () => {
const result = countLetters('hello');
assert.deepEqual(result, { h: 1, e: 1, l: 2, o: 1});
});... | true |
cfb853c3d9df69f504afd8de000282e98d59b0c5 | JavaScript | vitaliiborodulin/HelloExpress | /js/script.js | UTF-8 | 5,321 | 3.109375 | 3 | [] | no_license | // window.addEventListener('load')//ждет пока загрузится всё (и картинки)
window.addEventListener('DOMContentLoaded', () => {//ждет только загрузку дерева
const loadContent = async (url, callback) => { //выполнить колбэк только после фетча
await fetch(url) //обещание
.then(response => response.json())
.then(... | true |
cab5f3ba1528d76428a0577f91f0a727511fad1a | JavaScript | Aduomas/altV-server | /resources/core/client/html/ban/js/app.js | UTF-8 | 1,090 | 2.84375 | 3 | [] | no_license | function kickPlayer(){
if('alt' in window){
alt.emit('kickPlayerWeb');
}
}
function loadDetails(username, reason, type, length){
let usernameText = document.getElementById('username');
usernameText.textContent = username;
let reasonText = document.getElementById('reason');
reasonText.te... | true |
83f4a52ac9d9181d14a2a9e0a2a76f15625c8900 | JavaScript | brl0/extractionator | /src/extractionator_util.js | UTF-8 | 2,318 | 2.640625 | 3 | [
"MIT"
] | permissive | import CONSTANTS from "./constants";
const getURLQuery = (qType, fields, url) => JSON.stringify(`${qType}(url:"${url}"){${fields}}`);
export function buildQueries(infoArrays) {
const subQueriesArray = infoArrays.map(buildQuery);
const subQueries = subQueriesArray.join();
const query = `{"query": "query {${subQu... | true |
a7f1980f0b1f1d139304fe6ef3025276f235ff6b | JavaScript | sergio4156/reactProjects | /src/Form.js | UTF-8 | 833 | 2.71875 | 3 | [] | no_license | import React from 'react';
import {Component} from 'react';
class Form extends Component {
state = {
name: '',
age: null
}
handleChange = (e) => {
this.setState({
[e.target.name] : e.target.value
})
}
handleSubmit = (e) => {
e.preventDefault();... | true |
88d9c19e4396d9d4e664071480d935f30b80f9fd | JavaScript | elisa-chen/js-exercises | /index130.js | UTF-8 | 260 | 3.25 | 3 | [] | no_license | let mutants = ['Professor X', 'Cyclops', 'Iceman', 'Angel', 'Beast', 'Phoenix'];
console.log(mutants);
let sorted = mutants.sort();
console.log(sorted);
let reversed = sorted.reverse();
console.log(reversed);
let joined = sorted.join(" * ")
console.log(joined);
| true |
afdfa87035933d06ead2ef6074cdd76dc152743d | JavaScript | endowl/estate-contracts | /test/endowl_estate.js | UTF-8 | 5,102 | 2.65625 | 3 | [] | no_license | const EndowlEstate = artifacts.require("EndowlEstate");
let catchRevert = require("./utils/exceptions").catchRevert;
contract("EndowlEstate", async accounts => {
let estate;
let owner = accounts[0];
let nonOwner = accounts[1];
// How much ETH to test sending to and from the estate
let sendAmount = ... | true |
2515abbe57ed92d957feb601e48f0766b3e779e0 | JavaScript | akarshjp/Weather | /script.js | UTF-8 | 1,808 | 3.46875 | 3 | [] | no_license | var button= document.querySelector(".button");
var inputValue = document.querySelector(".inputValue");
var name = document.querySelector(".name");
var desc = document.querySelector(".desc");
var temp = document.querySelector(".temp");
var tempFeelsLike = document.querySelector(".tempFeelsLike");
var tempMax = doc... | true |
0d3ded3417e34eae42c2414b9cfae347e9a6934e | JavaScript | kakeru14/VoiceDairy | /routes/users.js | UTF-8 | 2,359 | 2.5625 | 3 | [] | no_license | var express = require("express");
var router = express.Router();
const User = require("../models/User");
const mongoose = require("mongoose");
const cors = require("cors");
router.use(
cors({
origin: "*", //アクセス許可するオリジン
credentials: true, //レスポンスヘッダーにAccess-Control-Allow-Credentials追加
optionsSuccessStat... | true |
2dd86d0c0b960a4c03b4269d1386aec6b91038f5 | JavaScript | isdampe/Raspberry-PI-Node | /gpio/gpio.js | UTF-8 | 1,307 | 2.640625 | 3 | [] | no_license | var gpio = require("pi-gpio");
var http = require("http");
var flashes = 51;
var i = 0;
var state = 0;
var server = http.createServer(function(request, response) {
if ( request.url === "/" ) {
response.writeHead(200, {"Content-Type": "text/html"});
response.write('<!DOCTYPE html><html><head><script src="ht... | true |
6a9ac6f63fb451f6a5863417b6283db95a6c7c79 | JavaScript | greentec/greentec.github.io | /public/js/gridworld/Env.js | UTF-8 | 19,827 | 2.765625 | 3 | [
"MIT"
] | permissive | function Env(_w, _canvas) {
this.canvas = _canvas;
this.grid = null;
this.grid_W = _w;
this.grid_W_max = 8;
this.grid_width = 30;
this.width = null;
this.height = null;
this.globalReward = -0.1;
this.episodes = 0;
this.maxEpisodes = 100;
this.steps = 0;
this.maxSteps = 20... | true |
130a763a115fb8f1fed9a6a10d4d5c0d85a433a7 | JavaScript | Royserg/kea-mentorship-app | /server/src/models/user.js | UTF-8 | 1,477 | 2.71875 | 3 | [] | no_license | const { hash, compare } = require('bcryptjs')
const jwt = require('jsonwebtoken')
const { TOKEN_SECRET, TOKEN_EXPIRATION } = require('../../../config')
const mongoose = require('../../../db')
const Schema = mongoose.Schema
const userSchema = new Schema(
{
email: String,
password: String,
name: String,
... | true |
e0c456c375aecace5ad31b8d5b5576290b83d886 | JavaScript | MaayanLab/clustergrammer-web | /clustergrammer/static/js/ccle_treemap.js | UTF-8 | 2,866 | 2.6875 | 3 | [
"MIT"
] | permissive |
console.log('making treemap')
var tree = {
name: "tree",
"children": [
{
"size": 12,
"name": "THYROID"
},
{
"size": 2,
"name": "SALIVARY GLAND"
},
{
"size": 21,
"name": "SOFT TISSUE"
},
{
"size": 180,
"name": "HAEMATOPOIETIC AN... | true |
0fca24728e8c64902256615a204cc57a369642e1 | JavaScript | leomartinjimenez/js-coding | /varScope/varScope.js | UTF-8 | 418 | 4.21875 | 4 | [] | no_license | //alert('hello')
var name = "Leo"
function greet10() {
var name
if (true) {
name = "Yessica"
}
console.log(`Hello ${name} - greet10 fuction SCOPE`)
//console.log('Hola ' + name)
}
greet10("Leo")
console.log(`The variable name sets the value ${name} - Main SCOPE`)
function greetLeo10() {
const n... | true |
ea294045f94f84b367fa190da3f59e2a2c0030fc | JavaScript | bryantt23/stress-test | /app/assets/javascripts/application.js | UTF-8 | 1,527 | 2.65625 | 3 | [] | no_license | // This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative ... | true |
40799ede3a534aa3388d0d35b4173abf98d272c9 | JavaScript | SebastianFlo/sebastian-npm-test-module | /index.js | UTF-8 | 451 | 2.8125 | 3 | [] | no_license | var http = require('http');
http.createServer(function (req, res) {
// Send the Http Header
// Http Status : 200 : OK
// Content Type: text/plain
res.writeHead(200, { 'Content-Type' : 'text/plain' });
// Send the response body as "Hello World"
res.end('Hello World');
}).listen(8081);
// C... | true |
2bebb148592efebbb4ea290dc6a364be43d6f649 | JavaScript | NickJansenCode/DriveAddinTest | /index.js | UTF-8 | 1,326 | 2.515625 | 3 | [] | no_license | geotab.addin.DriveAddin = () => {
'use strict';
const elAddin = document.getElementById("driveAddin");
return {
/**
* initialize() is called only once when the Add-In is first loaded. Use this function to initialize the
* Add-In's state such as default values or make API requests... | true |
a631836352f733e46370f250b886495bb1b05e90 | JavaScript | jccedano05/Notes-React-Redux | /src/reducers/authReducer.js | UTF-8 | 615 | 3 | 3 | [] | no_license | /*
El state va a estar vacio cuando yo no este autenticado
ya autenticado {
uid: aslidjlasidj,
name:'carlos'
}
*/
import { types } from "../types/types";
export const authReducer = (state = {}, action) => { //state nunca debe regresar a undefined por eso le damos el valor de un {} inici... | true |
ef71dd6a89687c91c8239ed1164de997b8bca91a | JavaScript | sandeep-07/DevsNest | /FrontEnd/Day-13/script.js | UTF-8 | 611 | 3.3125 | 3 | [] | no_license | let main = document.querySelector('.memes')
let text = document.querySelector('.text')
function gettext(event) {
text=event.target.value
}
function getimage() {
main.innerHTML=""
fetch(`https://meme-api.herokuapp.com/gimme/wholesomememes/${text}`)
.then(res => res.json())
.then(data => {
... | true |
4d4db8c7ebeac12fce47f64ddf10339b085f7240 | JavaScript | AlvaroGomezIng/bootcamp-awakelab | /module2/tarea1/main.js | UTF-8 | 8,846 | 4 | 4 | [] | no_license | /* NOTE: You can comment and uncomment the activities in order to visualize them individually as you prefer */
/* ------------------------------------------------------------------------------------------ */
/* ACTIVITY 1: JavaScript Básico */
/* Variable declaration */
var nombre;
var admin;
... | true |
9b78a1380daab1e1cdc786491d03a345f792439c | JavaScript | karem-mohamed/weather-app | /public/js/app.js | UTF-8 | 1,255 | 3.046875 | 3 | [] | no_license |
document.querySelector("form").addEventListener("submit",(e)=>{
e.preventDefault()
var vall=document.getElementById("licationinput").value
if(vall){
console.log(vall)
getdata(vall)
}else{
console.log("please enter location")
}
})
// document.getElementById("l... | true |
eda4c34ef8ab41e7e08d86d4a32d2f96fddd9cda | JavaScript | 100DaysOfCloud/100DaysOfCloudFrontend | /pages/api/users/recent/[[...limit]].js | UTF-8 | 468 | 2.703125 | 3 | [] | no_license | import { users } from '../../../../data/users.json';
export default function returnUser(req, res) {
const { limit } = req.query;
const number = limit ? limit : users.length;
const sortedUsers = users.sort((a, b) => {
let date_a = new Date(a.dateJoined),
date_b = new Date(b.dateJoined);... | true |
ce3540f4adf6e31dfca3aeaa8cb0ba3335a8fb83 | JavaScript | liaoyoujia/gentle-windy | /miniprogram/util/index.js | UTF-8 | 1,130 | 3 | 3 | [] | no_license | const formatDate = (nDate, date) => {
if (isNaN(nDate.getTime())) {
// 不是时间格式
return '--'
}
let o = {
'M+': nDate.getMonth() + 1,
'd+': nDate.getDate(),
'h+': nDate.getHours(),
'm+': nDate.getMinutes(),
's+': nDate.getSeconds(),
// 季度
'q+': Math.floor((nDate.getMonth() + 3) / 3... | true |
bed102f110c2a4257952e1d7e55ea924713eb5bc | JavaScript | nguyenhoangadhp/the-band | /main.js | UTF-8 | 1,790 | 2.71875 | 3 | [] | no_license | const buyBtns = document.querySelectorAll('.js-buy-ticket')
const modal = document.querySelector('.js-modal')
const modalClose = document.querySelector('.js-modal-close')
const modalContainer = document.querySelector('.js-modal-container')
//Hàm hiển thị modal mua vé (thêm class open vào modal)
function showBuyticket... | true |
2a615c3b50574455a7b7196bb8b5f29e64ea252d | JavaScript | VTFL/CompteurWeb | /src/main/webapp/js/index.js | UTF-8 | 4,953 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* Created by Lucas-PC on 09/11/2016.
*/
var ws = null;
function connect() {
var target ='ws://' + window.location.host+"/CompteurWeb/websocket/CreateTimer";
if ('WebSocket' in window) {
ws = new WebSocket(target);
} else if ('MozWebSocket' in window) {
ws = new MozWebSocket(target);
... | true |
3518f6835a70fe7baf180b95db288e1fbccdad1e | JavaScript | nasirhussain17/Transcloud | /src/reducers/names.js | UTF-8 | 445 | 2.703125 | 3 | [] | no_license | import { GET_NAMES, POST_NAME } from "../actions/types";
const initialState = {
names: [],
};
export default function (state = initialState, action) {
const { type, payload } = action;
switch (type) {
case GET_NAMES:
return {
...state,
names: state.names,
};
case POST_NAME:
... | true |
e6b1090ccb37f8823fbb67f29e196eb1361d3e0d | JavaScript | pine-book/team7 | /src/schedule.js | UTF-8 | 460 | 3.328125 | 3 | [] | no_license | function show_day() {
var date = new Date()
var year = date.getFullYear()
var month = date.getMonth() + 1
document.getElementById("date").innerHTML = get_day();
create_cal(year, month)
read(year, month, date.getDate)
}
function get_day() {
let now = new Date()
let year = now.getFullYear... | true |
38738b8ecf4f0e92f6ec42b793c0534a5bae93c3 | JavaScript | lonelygoogle/zhufengSeniorLessonNote | /20200821(类型转换,parseInt,this)/20200821/1.js | UTF-8 | 2,347 | 3.984375 | 4 | [] | no_license | let result = 100 + true + 21.2 + null + undefined + "Tencent" + [] + null + 9 + false;
console.log(result); //“NaNTencentnull9false”
// let result = 100 + true + 21.2 + null
// console.log(result)
/*
* A+B
* 两边中的任何一边遇到字符串或者对象(对象转换为数字要先转换为字符串[排除有原始值的]),都是按照字符串拼接处理的
* {}+10 => 10 左边的大括号当作一个代码块,不参与运算
* ({... | true |
c660afdd6b8bee9388ebedfecac63ccbd109e136 | JavaScript | hytcshiyue/Mywebs | /webs/360-Luxury/flash.js | UTF-8 | 1,323 | 2.515625 | 3 | [] | no_license | $(function(){
$(".flashContral").click(function(){
currIndex=$(this).attr("picIndex");
showFlashImage();
});
$("#guanggaoPic").hover(function(){
clearInterval(timeHandle);
},function(){
timeHandle= setInterval("showFlashImage()",1000);
});
timeHandle= setInterval("showFlashImage()",1000);
... | true |
039de670c2ae44b183c2f3fcacbb0e2762d565b9 | JavaScript | rlau4/bamazon | /bamazonCustomer.js | UTF-8 | 3,647 | 3.03125 | 3 | [] | no_license | var mysql = require("mysql");
var inquirer = require("inquirer");
var connection = mysql.createConnection({
host: "Localhost",
port: 3306,
user: "root",
password: "",
database: "bamazon_db"
});
connection.connect(function (err) {
if (err) throw err;
start();
})
// List full inventory of a... | true |
34aac32c91d6d01fb4db681bfb5d9050df1687bd | JavaScript | ShreyasShray/batman-begins-project-42 | /sketch.js | UTF-8 | 2,119 | 3.03125 | 3 | [] | no_license | const Engine = Matter.Engine;
const World = Matter.World;
const Body = Matter.Body;
const Bodies = Matter.Bodies;
var engine, world;
var umbrella;
var thunder1, thunder2, thunder3, thunder4;
var man, manAnimation;
var drops = [];
function preload(){
thunder1 = loadImage("images/1.png");
th... | true |
239a8f0aa0035a8f3957d7a6341490c1280c74ed | JavaScript | projeto-de-algoritmos/grafos2MenorTrajeto | /public/Kruskal.js | UTF-8 | 1,636 | 3.265625 | 3 | [
"MIT"
] | permissive | class Kruskal {
constructor(gNodes, gEdges, gFrom, gTo, gWeight) {
this.gNodes = gNodes;
this.gEdges = gEdges;
this.gFrom = gFrom;
this.gTo = gTo;
this.gWeight = gWeight;
}
krk(gNodes, gEdges, gFrom, gTo, gWeight) {
let i = 0, j = 0, cost = 0;
let subsets = new Map(),
result = ... | true |
667cfcb3a6af9a8e18c378b9f95e4b6e6590e44c | JavaScript | Tejaswini-Ekkaldevi/JSExercises | /logic-1/specialEleven.js | UTF-8 | 364 | 4.21875 | 4 | [] | no_license | // 7> Logic-1 -- specialEleven
// We'll say a number is special if it is a multiple of 11 or if it is one more than a multiple of 11. Return true if the given non-negative number is special. Use the % "mod" operator.
function specialEleven(n){
if(n % 11 === 0 || n % 11 === 1)
return true;
else
retu... | true |
49557355f1644a25ae2a3414b495f4f1eaa7a7ac | JavaScript | tdkcumberland/fullstackopen | /Part2/src/courseApp/Content.js | UTF-8 | 673 | 2.71875 | 3 | [] | no_license | import React from 'react';
import Part from './Part';
const Content = ({contents,id}) => {
console.log("ContentsID", id)
const getSumofArray = (accumulator, currentValue) => accumulator + currentValue
const exeList = contents.map(content => content.exercises).reduce(getSumofArray)
const partList = () =... | true |
1b33afb9085dd9cee1b926b17348d4bcd6fdc9c5 | JavaScript | grese/picasso | /paintr/vendor/paintr/paintr.js | UTF-8 | 21,833 | 2.734375 | 3 | [] | no_license | (function(){
var DEFAULTS = {
width: 400,
height: 200,
strokeColor: '#42d9f7',
strokeWidth: 5,
bgColor: '#ffffff'
};
/**
* @param params
* - element (Node): containing DOM element
* - width: (Number) width
* - height: (Number) height
... | true |
d566f169d1021fc86a258d5f75603ebba5ca4b26 | JavaScript | productlabs/shorturl | /lib/valdate.js | UTF-8 | 483 | 2.578125 | 3 | [] | no_license | "use strict";
require('dotenv').config();
var _RegExp;
exports.isUrl = function isUrl(url) {
_RegExp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
if(_RegExp.test(url)){
return true;
}else{
return false;
}
};
exports.isMyShortUrl = function is... | true |
531559be5743c026995433801420b29004f04240 | JavaScript | glundgren93/am-i | /index.js | UTF-8 | 4,664 | 3.28125 | 3 | [
"MIT"
] | permissive | "use strict";
let amI = { not: {} };
const Types = {
String: "String",
Number: "Number",
Boolean: "Boolean",
Symbol: "Symbol",
Undefined: "Undefined",
Null: "Null",
Function: "Function",
AsyncFunction: "AsyncFunction",
Object: "Object",
Int8Array: "Int8Array",
Uint8Array: "Uint8Array",
Uint8Cl... | true |
3d746191d59c9ffb88bd991880364806cc8a51ef | JavaScript | Francisca105/backup-bot-loja-v10 | /commands/tempmute.js | UTF-8 | 1,752 | 2.984375 | 3 | [] | no_license | const Discord = require('discord.js');
const ms = require("ms");
module.exports.run = async (client, message, args) => {
var logChannel = message.guild.channels.find("name", "punições");
if (!logChannel) return message.channel.send("O canal não existe");
let tomute = message.guild.member(mes... | true |