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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
d08da83263857a09289edd1c39de5d564582ed57 | JavaScript | ge6285790/formatting | /src/object/index.js | UTF-8 | 1,414 | 3.296875 | 3 | [] | no_license | import equal from 'deep-equal';
export default function object(that) {
// 深層合併
that.deepMerge = (obj1, obj2, mergeObj = {}) => {
// mergeObj = {};
const obj1Key = Object.keys(obj1);
const obj2Key = Object.keys(obj2);
const newKey = that.arrayMerge(obj1Key, obj2Key); // 合併兩個 array,重複的值只留下一個
con... | true |
354ab3d39475dbdb07dcce792a901c606f5f0082 | JavaScript | drewculhane/Tunr_front_end- | /tunr-app/src/DeleteSong.js | UTF-8 | 671 | 2.546875 | 3 | [] | no_license | import React, { useState } from "react";
import axios from "axios";
const DeleteSong = (props) => {
const [isDeleted, setIsDeleted] = useState(false)
const destroy = async (link) => {
await axios({
url: `${link}`,
method: "DELETE",
});
setIsDeleted(true);
c... | true |
3715ba272fe50a66ab315179419e9ddd85ef10f3 | JavaScript | MSumaiya/Assignment | /salt-calculator/calctest.spec.js | UTF-8 | 1,363 | 3.46875 | 3 | [] | no_license | // // should calculate add expression
// // should calculate subtract expression
// // should calculate multiply expression
// // should calculate division expression
// // should throw exception when operation is
// undefined (like division by zero)
// // should throw exception when expression is not
// ... | true |
456804a7db42c18f0d8f3512734856c4d97fdcce | JavaScript | ShekharPaatni007/node_learn | /intro javascript & node/numbers.js | UTF-8 | 252 | 3.375 | 3 | [] | no_license | var age = 26;
var results = 97.5;
console.log("age+results " + age+results);
console.log("age*results " + age*results);
console.log("age/results " + age/results);
console.log("results - age "+ parseFloat(results-age));
console.log(age + " "+ results) | true |
13e3c92ae880e640545f5c449cb5909d2da1f12f | JavaScript | jhimanshu623/recipe | /src/js/index.js | UTF-8 | 5,452 | 2.65625 | 3 | [] | no_license | import Search from "./models/Search";
import * as searchView from './views/searchView';
import {elements,loader,clearLoader} from './views/base';
import Recipe from './models/recipe';
import * as recipeView from './views/recipeView';
import List from "./models/shoppingList";
import * as listView from "./views/sho... | true |
d499bc7424759f027f58cb73bb70da5e52f22e44 | JavaScript | Wokinv/frog | /index.js | UTF-8 | 747 | 2.59375 | 3 | [
"MIT"
] | permissive | require('dotenv').config();
var fs = require('fs');
var Discord = require('discord.js');
var client = new Discord.Client();
var IMGDIR = './ImgSetOpt'
client.on('ready', () => {
client.user.setActivity('.frog | frog.wtf', { type: 'PLAYING' });
console.log(`- Logged in as ${client.user.tag}!`);
});
client.on('mess... | true |
58b49c3b953bfb32b8ae4db390eee40354ce746b | JavaScript | AlexanderWaychoff/dice_game | /dice_game.js | UTF-8 | 42,419 | 3.171875 | 3 | [] | no_license | describeGame ();
function describeGame(){
let refresh = prompt ("If this is the first time loading this page, type 'exit' to stop the game. Hit 'F12' to reveal the console log after typing 'exit' then refresh the page. If you completed this step hit 'Cancel'.");
if (refresh === "exit"){
return;
}
c... | true |
c4cc4b51b4c0610fbf6c23cebb855841a0e76a7f | JavaScript | Aszkali/RoseBot- | /komendy/kostka.js | UTF-8 | 844 | 3.03125 | 3 | [] | no_license | module.exports = {
name: 'kostka',
description: 'losowy numer od 1 do 6',
execute(message, args, Discord) {
var kostka = new Discord.MessageEmbed()
.setTitle("KOSTKA WYLOSOWAŁA:")
.setColor("#ff364e")
.setTimestamp()
var random2 = Math.floor(Math.random() * 6)... | true |
0ba4fc0e60660c6b43f5dba6076a529b1ea8da8a | JavaScript | mendezjose/maxit-frontend | /src/components/pagination.jsx | UTF-8 | 2,613 | 2.671875 | 3 | [] | no_license | import React, { useRef, useCallback } from "react";
import PropTypes from "prop-types";
import _ from "lodash";
const Pagination = ({ itemsCount, pageSize, currentPage, onPageChange }) => {
const pagesCount = Math.ceil(itemsCount / pageSize) || 1;
const left = getLeft(currentPage, pagesCount);
const right = get... | true |
674b9ab00999741155cd2c8299d853a2f44e7c05 | JavaScript | wael9823/ExploringES6 | /Chapter11/destructuringArr.test.js | UTF-8 | 593 | 2.765625 | 3 | [] | no_license | const { getVillians, getIndianHero, getSuperHeroes } = require("./destructuringArr");
describe('Destructuring can be used to get properties of objects', () => {
it('Getting the values I need and skipping others', () => {
expect(getVillians()).toEqual([ 'Joker', 'Crusher', 'Thanos' ]);
});
it('Getti... | true |
8aa454bbbbcb5f022a2648786e2a1539215fab91 | JavaScript | yt2628/Final-Project---Interactive-Experience | /js/main.js | UTF-8 | 6,026 | 3.0625 | 3 | [] | no_license | var data = [
{
id: 1497141891479,
title: "Sweet potatoes",
ingredients: "Potatoes, Butter, Water",
details: "1. Put sweet potatoes on the baking pan 2. Add water as you like 3. Set the oven to 275F and insert food for 30 minutes 4. Cut sweet potatoes in halves and spread butter 5. Enjoy... | true |
5853cf440f8f25057473daafc9ab7c934b6cb84c | JavaScript | bspille/jika-cattery | /src/reducers/side-nav-reducer.js | UTF-8 | 438 | 2.796875 | 3 | [] | no_license | import { TOGGLE_SIDE_NAV } from "../actions/types";
export default function(state = false, { type, payload }) {
// console.log(JSON.stringify(action, null, 1));
switch(type){
// if the action type is set id token return the payload from the action to state
case TOGGLE_SIDE_NAV:
re... | true |
9a39520071f394b165012ce194738155f848d4a0 | JavaScript | mariamtanahi/cetris | /js/scripts.js | UTF-8 | 4,714 | 2.859375 | 3 | [
"MIT"
] | permissive | /* Description: Custom JS file */
/**
* Easy selector helper function
*/
const select = (el, all = false) => {
el = el.trim()
if (all) {
return [...document.querySelectorAll(el)]
} else {
return document.querySelector(el)
}
}
/**
* Easy event listener function
*/
cons... | true |
1fb531a3b81f11057ecf05a8d68edb1a77b67cbf | JavaScript | pathuribhavani/quiz | /grocery.js | UTF-8 | 280 | 2.90625 | 3 | [] | no_license | function multiplyBy()
{
num1 = document.getElementById("length").value;
num2 = document.getElementById("base").value;
num3 = document.getElementById("height").value;
res1=num1*num2*num3;
document.getElementById("result").innerHTML = res1;
} | true |
232f4bca9d2707e65d963879eb3bc371e0a4c71e | JavaScript | jasethomson/practice-problems-jt | /leet12/main.js | UTF-8 | 167 | 3.375 | 3 | [] | no_license | const numberOfSteps = num => {
let count = 0;
while(num !== 0){
(num % 2 === 0) ? num /= 2 : num -= 1;
count++;
}
return count;
}
numberOfSteps(123);
| true |
af583dcc6084df59edb9eb88a2b0b71197acd442 | JavaScript | yuliiasenyk/patterns | /creational/factory.js | UTF-8 | 1,074 | 3.234375 | 3 | [] | no_license | // delegates instantiation to subclasses
//https://alligator.io/js/factory-pattern/
class TailFactory {
constructor(props) {
this.tailLength = props.tailLength;
}
};
class TorsoFactory {
constructor(props) {
this.color = props.color;
}
};
class HeadFactory {
constructor(props) {
... | true |
25141c3ff42455426317cbad6c6b7c343b83d6b8 | JavaScript | balthazarely/Hiker | /src/reducers/trailReducer.js | UTF-8 | 775 | 2.828125 | 3 | [] | no_license | const initialState = {
trails: null,
city: "",
coordinates: null,
error: true
};
const trailReducer = (state = initialState, action) => {
switch (action.type) {
case "FETCH_TRAILS":
return {
...state,
trails: action.payload.trails,
city: action.payload.city,
coordina... | true |
2365b22a83204b75bb3735155db21e1f0143a9ce | JavaScript | anselm/arpersist | /public/js/XRSupport.js | UTF-8 | 5,911 | 2.625 | 3 | [] | no_license | ///
/// XR Support
///
/// The WebXR exposes an API for talking to various XR devices in a standards based way.
/// This code is a wrapper to isolate some of the setup into one place.
///
///
export default class XRSupport {
constructor(args) {
// caller must provide some parameters
this.camera = args.camera
... | true |
95e457f4965def4866a3632ed5e62a198d5650d8 | JavaScript | WPAS/jQuery_training | /trainig/Ajax/11. Ajax_wykorzystywanie_danych/js/app.js | UTF-8 | 2,216 | 3.03125 | 3 | [
"MIT"
] | permissive | $(function() {
console.log("działa");
// variables for DOM
var $select = $("select");
var $h1 = $("h1");
//variables for url
var holidayUrl = 'https://holidayapi.com/v1/holidays?key=7d9260a5-067d-4059-ac66-ef56d29a6355&country=PL&year=2015';
function insertContent(holidays) {
$.each(h... | true |
2dd5f86e7b3410f5f681a33b8cb614d9d7a7be16 | JavaScript | estimar2/javaScript | /ex11.js | UTF-8 | 321 | 3.890625 | 4 | [] | no_license | function abc() {
//매개변수 X, 반환값 X
console.log("여기는 기본함수에오");
return false;
}
var def = function() {
console.log("여기는 기본함수2에오");
};
function ghi(a) {
// 매개변수 O, 반환값 X
console.log(a + "가 입력되었습니다.");
}
abc();
def();
ghi(20200202);
| true |
5e64c2a80f030db5a8dbc838bf9e55e3c1421456 | JavaScript | phil-dobson/slack-lambda-gateway | /src/lambdaFunctionFactory.spec.js | UTF-8 | 2,950 | 2.734375 | 3 | [] | no_license | // MIT License
//
// Copyright (c) 2017 Philip Dobson
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modif... | true |
30ea317ca2a9882b12ad1968fdd1d3a0c8c6d61f | JavaScript | LeniaMarga/JS_hero | /Food.js | UTF-8 | 201 | 3.265625 | 3 | [] | no_license | function Food(name, value) {
this.name = name;
this.value = value;
}
Food.prototype.prettyPrint = function() {
return "Name: " + this.name + ", Value: " + this.value
}
module.exports = Food;
| true |
b1df3917af3d847db56c5ec8d2a085f3d70c3f86 | JavaScript | tonydjones/Portfolio | /Personal Projects/Django (Python and JavaScript)/medication_management/med_management/static/med_management/javascript.js | UTF-8 | 11,513 | 2.640625 | 3 | [] | no_license | var csrfToken = null;
document.addEventListener('DOMContentLoaded', function() {
if (document.querySelector("[name='csrfmiddlewaretoken']")) {
csrfToken = document.querySelector("[name='csrfmiddlewaretoken']").value;
}
});
function update_settings() {
var data = {}
data.name = document.querySelector('i... | true |
f14ddd68f40730b82d5cb7e05dc2e4511614e49e | JavaScript | willfong/node-web-cam | /index.js | UTF-8 | 1,866 | 2.515625 | 3 | [
"MIT"
] | permissive | const crypto = require("crypto");
const express = require("express");
const fileUpload = require('express-fileupload');
const morgan = require("morgan");
const app = express();
const PORT = process.env.PORT || 3000;
const PHOTOPATH = __dirname + '/image.jpg';
const TITLE = process.env.TITLE || 'NODE-WEB-CAM';
const U... | true |
26ad1717f73d378efa8ce3c5594afe0fe8ac3f01 | JavaScript | leomaia97/ProgWeb | /Aula6.js | UTF-8 | 1,548 | 3.859375 | 4 | [] | no_license |
// Operadores Logicos "and &&", "or ||" e "not !""
// Operador Logico "and &&"
var x=6;
alert("(x>=1) && (x<=10)");
alert((x>=1) && (x<=10));
var y=prompt("Entre com um numero:");
alert("(y>=1) && (y<=10)");
alert((y>=1) && (y<=10));
// Operador Logica "or ||"
var x=6;
alert("(x>=1) || (x<=5)");
alert((x... | true |
5aab7e676a03f326c56fc49c0bb4040cee687edb | JavaScript | SpencerWhitehead7/xoxo | /game/index.js | UTF-8 | 2,164 | 3.09375 | 3 | [] | no_license | import {Map} from 'immutable'
const MOVE = `move`
export const move = (player, position) => {
return {
type : MOVE,
player,
position,
}
}
const turnReducer = (turn = `X`, action) => {
if(action.type === MOVE){
return turn === `X` ? `O` : `X`
}else{
return turn
}
}
const boardReducer = (board = Map(), ... | true |
b6378cba0245d6ee4adbb61d3d9f5dd2ba278f07 | JavaScript | zwy942652315/plugin-cli | /lib/list.js | UTF-8 | 1,595 | 2.640625 | 3 | [] | no_license | // 请求 fs-extra 库,用于文件操作
const fse = require('fs-extra')
// 请求 chalk 库
const chalk = require('chalk')
// 请求 ora 库,用于实现等待动画
const ora = require('ora')
// 请求 log-symbols 库
const symbols = require('log-symbols')
const path = require('path')
projectPrompt = [
{
type: 'list',
message: '请选择框架类型:',
name: 'frameType',... | true |
025cc2d4485b9cf475b1071ecf6e1e38119c9d73 | JavaScript | laurenchong1/Computing-2-Applications | /Week 5 – Client Side DOM/web-app/static/robots.js | UTF-8 | 460 | 2.640625 | 3 | [
"MIT"
] | permissive | const Robots = Object.create(null);
const agreeOptions = [
"Yes!",
"My Man!",
"Looking Good!"
];
Robots.agreeBot = {
"name": "Agree Bot",
"response": function () {
return agreeOptions[Math.floor(Math.random() * agreeOptions.length)];
}
};
Robots.reverseBot = {
"name": "Reverse Bot"... | true |
ca2c97fd2c672ff8c4d3bf7816084cd873d56395 | JavaScript | shenjiayao-sjy/js-exercise | /impatient-js/numbers-math/parse_number.mjs | UTF-8 | 72 | 2.6875 | 3 | [] | no_license | export function parseNumber(x){
const n = Number(x);
return n;
} | true |
6c9ee7f338c8b93b7f85e58807fdc4e4abfaed22 | JavaScript | renzoamodiajr/suds-duds | /admin.js | UTF-8 | 9,360 | 2.609375 | 3 | [] | no_license |
// =============================== MANAGE USERS ===============================
// DEACTIVATE
$(document).on('click', '.deactBtn', function(){
let id = $(this).data('id');
let btn = $(this);
$.ajax({
url: 'server.php',
method: 'POST',
data:{
'id':id,
'deactTr... | true |
b6343aa6e0d2820610766c5b0b70241d2a5b4f85 | JavaScript | nheyland/MFTPro | /src/content/process/geoJson.js | UTF-8 | 2,502 | 2.6875 | 3 | [] | no_license | const geoJson = (logbook) => {
let flights = [];
let json = {
type: "FeatureCollection",
features: flights,
};
// POINT
logbook.forEach((flight) => {
if (typeof flight.Geo.dep.Data[0] !== "undefined") {
let point = {
type: "Feature",
properties: {
date: flight.Date,... | true |
39a555d42687ff57ea31bd939c3255c7d36af347 | JavaScript | pootrank/rankomatic | /rankomatic/static/javascript/app/models/dataset.factory.spec.js | UTF-8 | 4,238 | 2.578125 | 3 | [] | no_license | (function() {
'use strict';
describe('module: models', function() {
beforeEach(module('app.models'));
beforeEach(function() {
module(function($provide) {
$provide.value('InputGroup', function(init) {
return {input: '', init: init};
});
});
});
describe('facto... | true |
49fe0718f68193b8f1ca9704290a0fad46c68396 | JavaScript | sanchay0/Delone | /testSuite/chatTest.js | UTF-8 | 1,361 | 2.5625 | 3 | [
"MIT"
] | permissive | var assert = require('chai').assert,
mocha = require('mocha'),
mongoose = require('mongoose');
//connect to mongoose
mongoose.connect("mongodb://localhost/delone");
//setup database schema
var chatSchema = new mongoose.Schema({
event_name: String,
place: String,
date: String,
time: String,
count: String,
... | true |
096b1d1b81ff007428089649e1360ed8ed5cfaaa | JavaScript | MetronSolucoes/MetronBackOffice | /src/controllers/company.js | UTF-8 | 580 | 2.546875 | 3 | [] | no_license | import axios from 'axios';
export function getCompany() {
return axios.get('/companies')
.then(function (response) {
// handle success
return response;
})
.catch(function (error) {
// handle error
})
.finally(function () {
// always executed
});
}
export function updateCompany(data) {
return ... | true |
bc44c93962970461995946c953ebe43bb241749d | JavaScript | vigneshmohandas/user-app | /app/helpers/cacheHelper.js | UTF-8 | 1,062 | 2.546875 | 3 | [] | no_license | const redis = require('redis');
const { promisify } = require('util');
const setUserCache = async(data) => {
const client = redis.createClient(process.env.REDIS_PORT, process.env.REDIS_HOST);
const getAsync = promisify(client.get).bind(client);
const setAsync = promisify(client.set).bind(client);
const quitAsy... | true |
3f92e46a1941cd26cd8e329e55dc3e71b107b813 | JavaScript | kavizzz/GridManager | /src/js/Order.js | UTF-8 | 1,473 | 2.578125 | 3 | [
"MIT"
] | permissive | /*
* Order: 序号
* */
import { jTool } from './Base';
import I18n from './I18n';
class Order {
constructor() {
// 序号的唯一标识
this.key = 'gm_order';
}
/**
* 获取 th 的字符串节点
* @param settings
* @returns {string}
*/
getThString(settings, thVisible) {
return `<th th-name="${this.key}" th-visible="${thVisible}"... | true |
369567528e4ba73b2322401be67bfe62cae58641 | JavaScript | alivepages/lab--react-todo-list2 | /src/components/todo.js | UTF-8 | 1,047 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
import Buttons from './buttons';
import Rows from './rows';
export default class Todo extends Component {
constructor(props) {
super(props)
this.state = {
value: '',
listValues: []
}
}
saveText = (value) => {
this.setState({ valu... | true |
be33212784a7437e539c49360cda5eed5c220293 | JavaScript | milanstojanov/backbone_spa | /public/scripts/views/comments.js | UTF-8 | 1,032 | 2.625 | 3 | [
"MIT"
] | permissive | define([
'backbone',
'../collections/comments',
'views/form',
'views/comment'], function(Backbone, CommentsCollection, CommentFormView, CommentView) {
var CommentsView = Backbone.View.extend({
id: 'comments',
commentsCollection: null,
initialize: function() {
var self = this,
ideaId = this.mo... | true |
8038758a98db8e671f28d0c6a542b94749f6ca48 | JavaScript | beefan/palette | /db/User.js | UTF-8 | 1,799 | 2.546875 | 3 | [] | no_license | const db = require('./database');
const bcrypt = require('bcrypt');
async function loginUser(req, username, password, done) {
try {
const sql = 'SELECT id, username, email, password FROM users WHERE username=$1';
const {rows} = await db.query(sql, [username]);
if (rows[0] == null) {
... | true |
cc1afe6310d17ab5aeeb7ae0bb6dd4a38fb56185 | JavaScript | mrbowerbird/pigdice | /js/scripts.js | UTF-8 | 2,797 | 3.671875 | 4 | [
"MIT"
] | permissive | //Business Logic
function PlayerRoll() {
this.roll = 0;
this.turnTotal = 0;
this.finalScore = 0;
};
PlayerRoll.prototype.rollDie = function() {
this.roll = Math.floor(Math.random() * 6) + 1;
if (this.roll === 1) {
this.turnTotal = 0;
alert("You're done");
$("#Roll1").hide();
$("#Hold1").hide(... | true |
4c96ec2206bdcfab1e6ca98d1c6c58c70a538c84 | JavaScript | sebastian8080/ipca | /public/js/ejemplo.js | UTF-8 | 6,335 | 2.921875 | 3 | [] | no_license | let rigthAnswer = null;
let currentQuestionIndex = 0;
//CONTADORES DE LAS RESPUESTAS CORRECTAS E INCORRECTAS
let rigthAnswers = 0;
let wrongAnswers = 0;
//VARIABLE GLOBAL PARA REPRODUCIR Y PARAR EL AUDIO
let audio;
let audio_section;
//Variables para obtener la respuesta del button y la imagen
let respuesta, objeto;... | true |
08d7c7a353f3d2112166dc37586fea909272ef77 | JavaScript | goldenbelle/nomfilx | /REACTPRACTICE/p2_useInput.js | UTF-8 | 803 | 3.078125 | 3 | [] | no_license | import React, { useState } from "react";
import ReactDOM from "react-dom";
import "./styles.css";
const useInput = (initialValue, validator) => {
const [item, setValue] = useState(initialValue);
const onChange = (event) => {
const {
target: { value }
} = event;
let willUpdate = true;
if (t... | true |
990e1e2fdb9f4471b7095e95be870fe82e68d83f | JavaScript | emilka1337/DestroyUSA | /scripts/rockets/rocketClass/rocket.js | UTF-8 | 4,272 | 2.8125 | 3 | [] | no_license | 'use strict'
import { game, kim, kimInventory, trump } from "../..";
import Interface from "../../interface";
import Methods from "../../methods";
import TrumpReactions from "../../trumpReactions/trumpReactions";
export default class Rocket { // Базовый класс для всех типов бомб и ракет
con... | true |
15a152b2745b8e2d1cdcc81f1e7ec30ca1fd8527 | JavaScript | thisistaimur/Course | /02-Programming-Basics/2020-10-26-Objects-Revises-and-Destructuring/demo/10-array-destructuring/14-array-destructuring-defaults.js | UTF-8 | 291 | 3.3125 | 3 | [] | no_license |
console.log("using default name:")
[greeting = "hi", name = "Sarah"] = ["hello"];
console.log(greeting);//"Hello"
console.log(name);//"Sarah"
console.log("\nusing no defaults:")
let [greeting = "hi", name = "Sarah"] = ["hello", "Tom"];
console.log(greeting);//"Hello"
console.log(name);
| true |
7c5349a09a8573c34cf96d11318d5987a4d9a4bf | JavaScript | theothergeorge/hackler | /public/scripts/schedule.js | UTF-8 | 778 | 2.890625 | 3 | [] | no_license | var START = 3 * 60 + 15;
function getTimeString(time) {
var actualTime = START + time;
var minutes = Math.floor(actualTime / 60);
var seconds = actualTime % 60;
seconds = seconds < 10 ? "0" + seconds : seconds;
return minutes + " : " + seconds;
}
$(document).ready(function() {
var presentations = ... | true |
77abc8e16c853c9ac56df54985572788af85171a | JavaScript | Ar11rA/es6 | /tagged-template.js | UTF-8 | 681 | 3.59375 | 4 | [] | no_license | console.log(html`<b>${process.argv[2]} says</b>: "${process.argv[3]}"`);
function cleanString(stringToClean) {
var safeString;
safeString = stringToClean.replace(/&/g, '&');
safeString = safeString.replace(/>/g, '>');
safeString = safeString.replace(/</g, '<');
safeString = safeString.replace(/"/g, ... | true |
aa2d13ea58a0093b953ad10747d36335e035b4af | JavaScript | beebeebeeebeee/fyp | /draft-ui/script.js | UTF-8 | 8,780 | 3 | 3 | [] | no_license | let addressProfiles = [];
let currentAddressProfile;
//--FOR ADDRESS PROFILE LIST PAGE START--
//to show the form for add a new address profile and hide the add btn
document
.querySelector("#new-address-profile-btn")
.addEventListener("click", (event) => {
document.querySelector("#new-address-profile-btn").cla... | true |
69d4ae8904f1c14e2ae404321e2ee640b992ec92 | JavaScript | AdobeDocs/analytics-2.0-apis | /.github/scripts/get-path-prefix.js | UTF-8 | 1,806 | 2.859375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // This script retrieves the pathPrefix from the gatsby-config.js file.
// It serves as an example for how to set up external javascript functions
// outside workflow .yml files when they get too big or complex to keep them inline.
// Documentation for the actions/github-script:
// https://github.com/actions/github-sc... | true |
cf643d2ac2ebb618c1b437d82bdde50fd2903329 | JavaScript | larsthorup/nit | /lib/index/entry.js | UTF-8 | 4,351 | 2.640625 | 3 | [
"MIT"
] | permissive | // Note: Entry contains detailed information about a file: name, oid and stats
const assert = require('assert').strict;
const fs = require('fs');
const { Name } = require('../name');
const { Oid } = require('../oid');
const DIRECTORY_MODE = 0o40000;
const ENTRY_BLOCK_SIZE = 8;
const EXECUTABLE_MODE = 0o100755;
const... | true |
633e4e7b76c8ef9bb7324f0514e25c811bc4a564 | JavaScript | enochtsang/potential-fortnight | /assets/filters/sceneFilter.js | UTF-8 | 1,754 | 2.53125 | 3 | [] | no_license | Phaser.Filter.sceneFilter = function (game) {
Phaser.Filter.call(this, game);
//this.uniform.development = 0;
//warnings are shown, something like, no texture or something
//what is happening is the shader is being initilizaed with the default variables with
// a value of null, but there is no er... | true |
d1bc33d7673c6b4f92de83f7791d21afdd8f0484 | JavaScript | Lanre039/FOHCAF_App | /Client/src/components/shared/Pagination.jsx | UTF-8 | 2,178 | 2.609375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | import React from "react";
// reactstrap components
import { Pagination, PaginationItem, PaginationLink } from "reactstrap";
// core components
class PaginationComponent extends React.Component {
state = {
currentPage: 1,
pages: []
};
changePage = page => {
this.setState({ current... | true |
819fdb36cc9304db890420e7b4d079a5f1ad401b | JavaScript | marianoheller/tic-tac-toe-minimax | /src/ComputerMove.js | UTF-8 | 2,456 | 3.265625 | 3 | [] | no_license | import AIHelpers from './AIHelpers'
const MAX_VALUE = 99999999;
export default function ComputerMove ( board , symbols, difficulty) {
const { huPlayer, aiPlayer } = symbols;
function evaluate() {
if ( AIHelpers.playerWon(board, huPlayer) ){
return -10;
}
else if ( AIHelpers.playerWon(board, aiPlayer ... | true |
b4cd82204e9682780b458d1f4eaec87ff4fca89a | JavaScript | Jongtelles/jongtelles.github.io | /src/components/About.js | UTF-8 | 1,965 | 2.53125 | 3 | [
"MIT"
] | permissive | function About() {
return (
<div className='about'>
<h2>About Me</h2>
<div className='flex-container flex-evenly'>
<div
className='about--img'
alt="headshot of a very cool and handsome smiling man (it's me)"
></div>
<div className='about--list-container'>
... | true |
b20d92f0ef2f1b62ccab88318595531a1d5c94e3 | JavaScript | samoyi/note | /Theories/Web/Architecture/UnderstandVuejs/原理/Observer/源码注释/observer/scheduler.js | UTF-8 | 8,480 | 2.5625 | 3 | [] | no_license | /* @flow */
// 2.5.21
import type Watcher from "./watcher";
import config from "../config";
import { callHook, activateChildComponent } from "../instance/lifecycle";
import { warn, nextTick, devtools } from "../util/index";
// 如果一个 watcher 在一个 tick 里连续更新超过了 MAX_UPDATE_COUNT,就认为是陷入了循环更新
export const MAX_UPDATE_COUNT... | true |
12bbba58e641f655e2b99ca9c1fe84148abe8158 | JavaScript | hejans/GestioneDipendenti | /Server/server.js | UTF-8 | 9,665 | 2.828125 | 3 | [] | no_license | //lib express
var express = require ('express');
//general lib
var app = express();
//inspect
var util = require('util');
//Cross-Origin Resource Sharing (CORS), used for enabling pre-flight option
cors = require('cors');
//student manager
var employeeManager = require('./EmployeeManager.js');
//POST
var bodyParser =... | true |
659cf8272cdb9b970bf2f34cc6ad383b99afd690 | JavaScript | CleverCloud/clever-components | /src/stories/fixtures/fake-map-data.js | UTF-8 | 685 | 2.5625 | 3 | [
"Apache-2.0",
"BSD-2-Clause"
] | permissive | import fakePointsDataBig from './country-city-points-big-orga.js';
import fakePointsDataMedium from './country-city-points-medium-orga.js';
import fakePointsDataNormal from './country-city-points-normal-orga.js';
const FAKE_POINTS_DATA = [
fakePointsDataNormal,
fakePointsDataMedium,
fakePointsDataBig,
];
let la... | true |
d803c2d342bdecb7cc957f9cd91a916d05daee3b | JavaScript | benjamminj/backend_node_capstone_curriculum_and_student_manager | /student_models/seedDB.js | UTF-8 | 1,604 | 2.71875 | 3 | [] | no_license | // function fake
const mongoose = require('mongoose');
const {Curriculum} = require('./../student_models/models');
const faker = require('faker');
function generateFakeCurriculumData (numberOfStudentRecords) {
console.log('Generating fake data');
console.log(numberOfStudentRecords);
for (let i=0; i < numberOfS... | true |
020f9b40baaf76b0a9e96eac4f4a642dbb9bf118 | JavaScript | javascriptst18/felix-mongodb-aggregation-solutions | /solutions.js | UTF-8 | 3,121 | 2.84375 | 3 | [] | no_license | /**
* MongoDB Aggregation Operations
* Förslag på lösningar.
* Felix H W
*/
// Uppgift 3.1
// Hur många djur finns det av varje färg?
db.safari.aggregate({$group: {_id: {color: "$color"}, total: {$sum: 1}}}, {$sort: {total: 1}}).pretty();
// Uppgift 3.2
// Sortera på färg
db.safari.aggregate({$project: {_id: 0,... | true |
bf19d78a17d07828a6d7fe78da158bd5e2dd2e94 | JavaScript | adrianchagas/workspace | /js/cart.js | UTF-8 | 11,274 | 2.640625 | 3 | [] | no_license | var cart = {};
var mensaje = {};
let costoEnv = 0;
function showProductCart(array){
let htmlContentToAppend = "";
for(let i = 0; i < array.length; i++){
let product = array[i];
htmlContentToAppend += `
<div class="row">
<div class="col order-1">
... | true |
c01d75962e2062471675d8597ce154cd02d0edaf | JavaScript | oconnorir/polyfill-library | /polyfills/TypedArray/prototype/entries/polyfill.js | UTF-8 | 1,571 | 2.71875 | 3 | [
"MIT"
] | permissive | /* global CreateMethodProperty, ArrayIterator */
// 23.2.3.7 %TypedArray%.prototype.entries ( )
(function () {
function entries() {
// 1. Let O be the this value.
var O = this;
// 2. Perform ? ValidateTypedArray(O).
// TODO: Add ValidateTypedArray
// 3. Return CreateArrayIterator(O, key).
// TODO: Add Crea... | true |
c092c9b859e37fb7cd87ff7dd6469133920fae1e | JavaScript | ChristofferSaaby/avanceret-webintegration | /film.js | UTF-8 | 1,227 | 3.546875 | 4 | [] | no_license | class film {
constructor(title, længde) {
this.title = title;
this.længde = længde;
this.vurdering = false;
}
givVurdering(){
this.vurdering = !this.vurdering;
}
givLængde(tid) {
this.længde += tid;
};
profil() {
return `Filmen ${this.title} har længden ... | true |
ed228705ade62c5d16005851a1c25414cb19aba1 | JavaScript | KevSan/FrontEndProject | /server/index.js | UTF-8 | 3,473 | 2.703125 | 3 | [] | no_license | var express = require('express');
var cors = require('cors');
var pg = require("pg");
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json({type: 'application/json'}));
app.use(cors());
var connectionString = "postgres://kevin:123@localhost:5432/kevin";
app.get('/', function (req, ... | true |
34cde39e953df37b45ea7249b76cc8b549ce6d71 | JavaScript | FrankThomasTveter/varseltavle | /src/globe/utils.js | UTF-8 | 1,227 | 2.9375 | 3 | [] | no_license | import * as TWEEN from 'es6-tween';
export function coordinatesToPosition(coordinates, radius) {
const [lat, long] = coordinates;
const phi = (lat * Math.PI) / 180;
const theta = ((long - 180) * Math.PI) / 180;
const x = -radius * Math.cos(phi) * Math.cos(theta);
const y = radius * Math.sin(phi);
... | true |
7e8000312bcdecd86d948348a38b3cade3fa3404 | JavaScript | kvp06933/TacoCat | /js/site.js | UTF-8 | 1,218 | 4.15625 | 4 | [] | no_license | //get values -- controller function
function getValue(){
document.getElementById("isPalindromeDisplay").classList.add("invisible");
let str = document.getElementById("userInput").value;
let strRegex = str.replace(/[^a-zA-Z]/g, "");
let strLowerCase = strRegex.toLowerCase();
if(strLowerCase.valu... | true |
60fb8685c780f4ae48c1c5ad249f30fd9d7344af | JavaScript | gvkhacha/homebar | /client/src/components/DrinksPage/index.js | UTF-8 | 2,442 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { useEffect, useState } from 'react';
import axios from 'axios';
import Drink from '../../util/Drink';
import DrinkCard from './DrinkCard';
import DrinkFilter from './DrinkFilter';
import Layout from '../Layout';
import Grid from '@material-ui/core/Grid';
function filterDrinks(dr... | true |
dbcd48731bb67ba989d4a093ccafa3d18b69544b | JavaScript | Catanna82/Fundamentals-JS | /regularExpressionsExercises/softUniBar.js | UTF-8 | 1,159 | 2.71875 | 3 | [] | no_license | function softUniBar(params) {
let total = 0;
let command = params.shift();
while (command !== 'end of shift') {
let regName = /%(?<name>[A-Z][a-z]+)%/g.exec(command);
let regProduct = /<(?<product>\w+)>/g.exec(command);
let regCount = /\|(?<count>[0-9]+)\|/g.exec(command);
... | true |
d6d9705293076224fc885771424d144d5d1fe728 | JavaScript | Taskan-IV/Reveneau_Cano_Meteo | /js.js | UTF-8 | 5,862 | 2.9375 | 3 | [] | no_license | // Au départ on créé la carte de la france sans les données //
// Création de l'instance d'une carte
var chart = am4core.create("chartCarte", am4maps.MapChart);
// On set le fait que c'est une carte de france
chart.geodata = am4geodata_franceHigh;
chart.projection = new am4maps.projections.Miller();
// Create map pol... | true |
e56a189639b70f889f07d1b925d5775d621d32b5 | JavaScript | thinkful-ei22/Donny-noteful-v3 | /test/notes.test.js | UTF-8 | 6,616 | 2.609375 | 3 | [] | no_license | 'use strict';
const chai = require('chai');
const chaiHttp = require('chai-http');
const mongoose = require('mongoose');
const app = require('../server');
const { TEST_MONGODB_URI } = require('../config');
const Note = require('../models/note');
const Folder = require('../models/folder');
const seedNotes = require(... | true |
f1a2e9ea5a5376eba3f44ad08cf61fb87df9a191 | JavaScript | swsnu/swpp2019-team15 | /oga/frontend/src/containers/Map/GoogleMap.js | UTF-8 | 8,391 | 2.625 | 3 | [] | no_license | /**
* Summary.
* Wrapper for GoogleMapReact.
*
*
* Description.
* Map with a search box
* Referred from google-map-react examples
* Searches will be bound to nearby areas, and
* upon search, the map will be zoomed in, with a clickable red marker
* @author taehioum
* @since 2019-10-18
*/
import React, { Com... | true |
b638ca85a3ecb237e1b3c56d4d8edd53abe243d2 | JavaScript | elzbyfar/top-five-DOA | /src/App/Helpers/formatFollowers.js | UTF-8 | 338 | 3.0625 | 3 | [] | no_license | // Add comma every third digit from the right
const formatFollowers = (followerCount) => {
let string = followerCount.toString();
return string
.split('')
.reverse()
.map((digit, i) => {
return (i + 1) % 3 === 0 && i < string.length - 1 ? `,${digit}` : digit;
})
.reverse()
.join('');
};
export default... | true |
07cab94fee33f2216dea7d37f72b75c9c1ce4a1d | JavaScript | CoachLab2013/MMS | /Integrated Project/Gauteng MMS/web/js/CallDetailsScript.js | UTF-8 | 5,284 | 2.65625 | 3 | [] | no_license | /*
* This is all the validation rules for call details
*/
/**
* Need to begin with $(document).ready(function)
* This ensures that the document if fully loaded before the script is executed
*/
$(document).ready(function(){
/**
* validation for the login form
*/
$("#callform").validate({
... | true |
7963c74ffd5797efddae7cd0459ce2dad17532f9 | JavaScript | zyselvis/ImageServer | /js/render.js | UTF-8 | 2,054 | 2.703125 | 3 | [] | no_license | class ImageUpload extends React.Component {
constructor(props) {
super(props);
this.state = { file: '', imagePreviewUrl: '' };
}
handleSubmit(e) {
e.preventDefault();
// upload the image to server directory ./image/IP_date_hour based on user IP&time
// call python prcessing script to process im... | true |
cdf223feff51b83ba7b163c7c7b924a2b51f6a58 | JavaScript | vollmerr/app-hub | /app/containers/App/LoadCommandBar.js | UTF-8 | 1,277 | 2.515625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import PropTypes from 'prop-types';
/**
* This component is used set and remove the
* CommandBar in an app. It is a seperate component
* to allow the componentDidMount lifecycle to trigger
* when the component gets rendered (after the app
* is done loading)
*/
class LoadCommandBar ext... | true |
e8914d7346d3027edea9f670f06d97f6ebf5d0d6 | JavaScript | badbutcher/SoftUni-Web-Individual-Project | /StarCraft/StarCraft.Web/wwwroot/js/site.js | UTF-8 | 497 | 3.265625 | 3 | [] | no_license | // This sets the image for the race you pick
function setImage(select) {
var image = document.getElementsByName("image-swap")[0];
image.src = select.options[select.selectedIndex].title;
}
// Sums the unit price
function MineralsSum(value) {
var minerals = 0;
minerals += new Number(value);
document... | true |
4cb90a7f61cd0f29c2f7d1bb31b70693084200fc | JavaScript | Lennerblom/cookie-stand | /app.js | UTF-8 | 7,980 | 3.046875 | 3 | [
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | 'use strict';
var hours = ['6am', '7am', '8am', '9am','10am', '11am', '12am', '1pm', '2pm', '3pm', '4pm','5pm','6pm','7pm',];
var storeLocations = [];
var totalCookiesByHour = [];
var totalTotal = 0;
function CookieStore(name, minCust, maxCust, avgCookiePerCust) {
this.name = name;
this.minCust = minCust;
this... | true |
0f2f37c1965730c93dc6040ff9a1b3f9135f62bb | JavaScript | mbrecunier/epicodus-places | /js/scripts.js | UTF-8 | 1,199 | 2.96875 | 3 | [
"MIT"
] | permissive | function Place(region, landmarks, timeOfYear, notes) {
this.region = region;
this.landmarks = landmarks;
this.timeOfYear = timeOfYear;
this.notes = notes;
}
$(document).ready(function() {
$("form#new-place").submit(function(event) {
event.preventDefault();
var inputtedRegion = $("input#new-region").v... | true |
7906427b15cc69af9ad67fd0daf71037db259e96 | JavaScript | qwop/userscript | /monolith/6/66074.user.js | UTF-8 | 2,351 | 2.546875 | 3 | [] | no_license | // ==UserScript==
// @name eRepublik gasterbajter - croatia
// @namespace http://www.tralala.com/
// @description replaces urls for news and country stats to croatia ones - useful if you are working out side of your country - hardcoded for croatia
// @version 1.1
// @include http://www.erep... | true |
7d68df5af643aa3a51ed67c22f5882b5eabf6b14 | JavaScript | zhishouH/HTML5 | /学生项目/黄智守/项目/test1/js/resize.js | UTF-8 | 291 | 2.90625 | 3 | [] | no_license | (function(){
let calc = function() {
const docElement = document.documentElement
let clientWidthValue = docElement.clientWidth > 750 ? 750 : docElement.clientWidth
docElement.style.fontSize = 16 * (clientWidthValue / 375) + 'px'
}
calc()
window.addEventListener('resize',calc)
})() | true |
e74a10ab94811cbc9024f3ba021b55892c5c1fb2 | JavaScript | skyfoxs/AngularGameOfLife | /test/controller/game_controller_spec.js | UTF-8 | 3,685 | 2.609375 | 3 | [] | no_license | describe("GameController", function() {
var controller, Universe, $interval,
cell = {
LIVE: true,
DEAD: false
};
beforeEach(function() {
module("GameOfLife");
inject(createController);
});
function createController($controller, _Universe_) {
... | true |
1ba2d53a42462e8de192f919b932310cf4f6a6a3 | JavaScript | HabibehKhavari/Calorie-Tracker-App | /src/components/EditDishItem/AddDish.js | UTF-8 | 1,157 | 2.53125 | 3 | [] | no_license | import './AddDish.css';
import DishForm from './DishForm';
import ErrorModal from '../UI/ErrorModal'
import { useState } from 'react';
const AddMetric = (props) => {
const [error, setError] = useState()
const addedDishHandler = (dish) => {
console.log('someone gave me a new dish to add', dish);
if (dish.na... | true |
ceb4a8d43c3e68d2906534ed4eaf5199aecff7a5 | JavaScript | bel-caylor/FamilyDashboard | /public/index.js | UTF-8 | 16,122 | 2.703125 | 3 | [] | no_license | //Toggle visible sections on familySetup.
function clickExpandBtn(section) {
document.getElementById("content" + section).classList.toggle("hidden");
}
//Toggle visible sections on dashboard.
function clickDashboardSection(section) {
//Hide all sections.
document.getElementById("completeTasks").classList.add("hi... | true |
c3c12b713317fc5b383c8a4cead22d504e12f8bc | JavaScript | jinwoocho/self_practice | /js_practice/practiceR04.js | UTF-8 | 1,166 | 4.09375 | 4 | [] | no_license | //<Goals and rules>
// Return the length of the longest word in the provided sentence.
// Your response should be a number.
//
// <Given code>
// function findLongestWord(str) {
// return str.length;
// }
// findLongestWord(“The quick brown fox jumped over the lazy dog”);
//
// <... | true |
b2cde7081cd10d02970cc3400355dfda1b9f9b57 | JavaScript | PAEz/JS-Bin-Plus | /beautify/unpackers/urlencode_unpacker.js | UTF-8 | 1,409 | 2.859375 | 3 | [] | no_license | /*global unescape */
/*jshint curly: false, scripturl: true */
//
// trivial bookmarklet/escaped script detector for the javascript beautifier
// written by Einar Lielmanis <einar@jsbeautifier.org>
//
// usage:
//
// if (Urlencoded.detect(some_string)) {
// var unpacked = Urlencoded.unpack(some_string);
// }
//
//
... | true |
d785fa38bf6533c04e8ba0063fc14e3a38ff354c | JavaScript | fengzhenfz/Record | /canvas/pie/index.js | UTF-8 | 2,701 | 3.4375 | 3 | [] | no_license | /*
option={
id:id,
radius:100,
textPosition:20,
data:[
{
ratio:2,
color:'red',
title:'中国'
},
{
ratio:3,
color:'green',
title:'日本'
},
{
ratio:2,
color:'gray',
title:'韩国'
},
{
ratio:3,
color:'orange',
title:'朝鲜'
}
]
}
*/
var Pie = function(o... | true |
f9850e982e114d8c0b4a5225971e3f0c80636a31 | JavaScript | AlexandraHoude/AEC_Front_End | /Programmation1/chapitre3-4/Q3.js | UTF-8 | 126 | 3.140625 | 3 | [] | no_license | /* Affichez tous les nombres pairs jusqu'à 10 000. */
for(var i = 0; i <= 10000; i += 2) {
document.write(i + "<br>");
} | true |
2a06e6ddbdf0b3d7d84f00082aec10036ef14239 | JavaScript | dannysbentley/jsCoding | /dataStruc_BTS.js | UTF-8 | 1,020 | 3.765625 | 4 | [] | no_license | class Node {
constructor(data) {
this.data = data;
this.left = null;
this.right = null;
}
}
class Tree {
constructor() {
this.root = null;
}
}
Tree.prototype.insert = function(data) {
let node = new Node(data);
if (this.root == null) {
this.root = node;
} else {
this.root.insertN... | true |
41817be213767728538c47a678b5ad7824626809 | JavaScript | derek-diaz/the-meme-express-backend | /src/models/users.js | UTF-8 | 763 | 2.515625 | 3 | [] | no_license | /**
* Users - Model
*
* @file users.js
* @author Derek Diaz Correa
* @since 7.17.2019
*/
import mongoose from 'mongoose';
import bcrypt from 'bcrypt';
import {SALT_ROUNDS} from '../constants';
//Defining Giphy Schema
let userSchema = new mongoose.Schema({
email: {
type: String,
unique: tru... | true |
b24be78e66d7942e1ee71b33952ecd6c19269dc7 | JavaScript | qrk18/personal-learnings | /jquery dynamic/dynamicmodalJquery.js | UTF-8 | 1,241 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive |
var strSubmitFunc = "applyButtonFunc()";
var btnText = "Just do it!";
function doModal(heading, formContent) {
html = '<div id="dynamicModal" class="modal fade" tabindex="-1" role="dialog" >';
//aria-labelledby="confirm-modal" aria-hidden="true"
html += '<div class="modal-dialog">';
html += '<div cla... | true |
97a423246ac68d72e79157e8514a8414d602200a | JavaScript | Aney/StaffBook | /public/assets/js/validation.js | UTF-8 | 1,931 | 3.46875 | 3 | [] | no_license | // Front-end Validation
const form = document.getElementById('staffType')
const fname = document.getElementById('staff_firstname')
const lname = document.getElementById('staff_lastname')
const dob = document.getElementById('staff_dob')
const email = document.getElementById('staff_email')
const jsError = document.getE... | true |
b6cc35b86af4c4958840d437954a495cbb463e79 | JavaScript | Crtrl/laravel | /public/js/login.js | UTF-8 | 7,889 | 3.203125 | 3 | [
"MIT"
] | permissive | window.onload = function (){
//验证用户名
var uname = document.getElementById('uname');
var nd = document.getElementById('name');
// console.log(uname);
var aaa;
//单击时
nd.onclick = function(){
... | true |
5e5e9c8dcac352959954073849bbaa275fd7d051 | JavaScript | EnricoM/dieet-app-nl | /nodecellar/server/sessionDAO.js | UTF-8 | 3,234 | 2.609375 | 3 | [] | no_license | var bcrypt = require('bcrypt-nodejs');
var crypto = require('crypto');
function createUser(registration, db, queryResult) {
var users = db.collection("users");
var salt = bcrypt.genSaltSync();
var password_hash = bcrypt.hashSync(registration.pwd, salt);
//var query = {'_id': registration.email, 'password': passwor... | true |
1a67d5b02dd70afb4c2c38fcdcc4578a498cb586 | JavaScript | vibhorsingh11/30DaysLeetCoding | /Challenges/Week2/14-PerformStringShifts.js | UTF-8 | 1,613 | 4.375 | 4 | [] | no_license | /**
* You are given a string s containing lowercase English letters, and a matrix shift,
where shift[i] = [direction, amount]:
-> direction can be 0 (for left shift) or 1 (for right shift).
-> amount is the amount by which string s is to be shifted.
-> A left shift by 1 means remove the first charact... | true |
794b598c4ab8eab026a2167b5597ba825a412a17 | JavaScript | hectorlopezv/javascript-from-zero-to-hero | /react_Es6_js/arrow_function.js | UTF-8 | 936 | 4.5 | 4 | [] | no_license | //arrow functions - el this se refierre a el codigo que rodea al arrow function
//context --> objects that calls the function / how its called
//lexical scope --> all variables visible to a function where it its defined // cares about how its defined
//example Context scope
const obj = {
var_: 5,
fun_ : functi... | true |
5121afb20ef3d4a80d36c2e5fb5bf0515077a810 | JavaScript | AmritK2/MindYourself | /apicall.js | UTF-8 | 1,930 | 3.109375 | 3 | [] | no_license | // var curl = ("./node_modules/curlrequest.index ");
//
// function getUserInfo() {
//
// var uri = "https://www.codewars.com/api/v1/users/vietanh16";
//
// var options = {
// url: uri,
// headers: { Authorization: "RNwKdUApVYGbbaAjUEa8" }
// };
//
// curl.request(options, function(err... | true |
6f53439e10a175ae7ed090b32ccfc9ac5032fa77 | JavaScript | higordiego/foil-apm | /src/config/index.js | UTF-8 | 2,012 | 2.53125 | 3 | [] | no_license | const REQUEST_CONFIG = 'https://foil.higordiego.com.br/apm/handler-config'
const METHOD_CONFIG = 'POST'
const { requestApi } = require('../helpers/request')
const { isJsonBoolean } = require('../helpers/parse')
/**
* @function
* @param time
* @returns {number}
*/
const setMinute = (time) => new Date().setMinutes(... | true |
55ca464a5024fb01b4ae96055cc3b0e14daaa44e | JavaScript | VALDEV05/js-hamburger | /assets/js/main.js | UTF-8 | 1,168 | 3.359375 | 3 | [] | no_license | /* foglio di javascript */
/*
Hamburger menu:
mostrare / nascondere il menù principale
(ricordate che per vedere l’hamburger in alto a destra dovete scendere a risoluzioni tipo tablet o mobile).
*/
/* STRUMENTI
- selettori
-hamburger document.querySelector("selezione")
- aggiunta di evento
... | true |
3e54859693566472cdbb0f727501168c3df64772 | JavaScript | felipemesina/CounterEXP | /server.js | UTF-8 | 1,620 | 2.625 | 3 | [] | no_license | const express = require ("express");
const session = require('express-session');
const bodyParser = require('body-parser');
const port = process.env.PORT || 8000;
const app = express();
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.use(session({secret: 'codingdojo'}));
app.use(express.... | true |
39d137f3790a8a1453d241a2fdf7c5415410b61e | JavaScript | oscarfrancomovilla/once | /mod3-js1/dia-5/www/js/ejercicio-4.js | UTF-8 | 277 | 3.9375 | 4 | [] | no_license | /* #################
* ## Ejercicio 4 ##
* #################
*
* Filtra los números superiores a 10.
*
*/
'use strict;'
const numbers = [1, 5, 23, 4, 12, 45, 78, 8, 9, 10, 11];
const higherThan10 = numbers.filter((value) => value > 10);
console.log(higherThan10);
| true |
680744755b4c4a421cb6964f6c461fe6919b4a60 | JavaScript | jetcitysoftware/eliza | /src/api/v1.events.js | UTF-8 | 614 | 2.640625 | 3 | [] | no_license | 'use strict';
const Eliza = require('../eliza/eliza.js');
const eliza = new Eliza();
eliza.memSize = 100;
const events = io => {
io.on('connection', socket => {
console.log(`Socket connected with id ${socket.id}...`);
console.log('Your app is connected');
socket.emit('output', {display:eliza.getInit... | true |
3a8b0d3ab60eb806aa4d675ee1aec36c49615a65 | JavaScript | a-axton/colors-from-string | /src/index.js | UTF-8 | 1,649 | 2.734375 | 3 | [
"MIT"
] | permissive | /* eslint-disable */
const csscolors = require('json!css-color-names');
/* eslint-enable */
const types = {
hsl: new RegExp(/(hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\))/gi),
hsla: new RegExp(/(hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d]+)\))/gi),
rgba: new RegExp(/(rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*([... | true |