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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fdcf183d9cdbfa24dfe511bc36abc52f1a7efc0e | JavaScript | paolaTorrealba/PPS-Teoria2019 | /alarma/src/login.js | UTF-8 | 386 | 2.875 | 3 | [] | no_license |
$('.button').click( () => {
if(btnON){
$('.button').removeClass('active');
$('.button .off').removeClass('nonactive');
$('.button .on').addClass('nonactive');
btnON = false;
}else{
$('.button').addClass('active');
$('.button .on').removeClass('nonactive');
$('.button .... | true |
ee930917a3bed914f54bdce60af4f8196b8b6b98 | JavaScript | akoz002/web-projects | /d3-projects/heatmap/src/index.js | UTF-8 | 763 | 3.078125 | 3 | [] | no_license | /*
* freeCodeCamp Data Visualization Certification
* Project 3: Heat Map
* Alex Kozlov, 2020
*
* Plots a heat map visualising global land surface temperature
* over months and years. Each cell shows the temperature for a
* given month of a given year. The temperature value is color
* coded using the color scale... | true |
67d816ddc739c1578bdb00523e3a707dba088d24 | JavaScript | cstolli/tictactoe | /index.js | UTF-8 | 6,035 | 3.65625 | 4 | [] | no_license | 'use strict';
// init some game tracking variables
var curPlayer = 0; /* keep track of current player */
var marks = ['X', 'O'] /* Available player marks */
let cells, playerCards /* references to DOM collections */
var playerMarks = [ /* the curent game state */
[], ... | true |
c3cdd2f14ddcfdbb8d2c8a5c4d918e5ef8669723 | JavaScript | takumigawa/test | /sib/src/main/webapp/view/topics/topicsChk.js | UTF-8 | 4,029 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | //----------------------------------------------------------------------------------------------------
//-- トピックス
//-- 入力チェックJS
//-- --------------------------------------------------------------------------------------------
//-- 修正履歴
//-- 2010/02/24 新規作成 SIB J.Hira
//---------------------------------------------... | true |
84880b4d6a0ef7e372ac6942c4bf6d85e5544f12 | JavaScript | langwan1314/map_php | /static/js/util/storageUtil.js | UTF-8 | 651 | 3.015625 | 3 | [] | no_license | /**
* 用于离线存储的工具类
*/
var StorageUtil = {};
/**
* 增加键值对
* @param key {Object}
* @param value {Object}
*/
StorageUtil.addItem = function(key, value){
window.localStorage.setItem(key, value)
};
/**
* 通过键获取对应的值
* @param key {Object}
*/
StorageUtil.getItem = function(key){
return window.localS... | true |
aa121da78690546bff82309016e10a6b170fcbb4 | JavaScript | Itsikben/apsos | /img/week1-6/ExerciseRunner/ex/16.js | UTF-8 | 323 | 3.921875 | 4 | [] | no_license | 'use strict';
console.log('Ex 16');
// 16.Write a function isEven that gets a number, and returns true if the number is
// even otherwise false.
function isEven(num) {
if (num % 2 === 0 ) {
return true;
} else {
return false;
}
}
var elNum = +prompt('number?');
console.log(isEven(elNum... | true |
6bade2396caca0780bde4c399e8bb5ae72efd4df | JavaScript | sahilbahl94/week3 | /javascript work/practise.js | UTF-8 | 960 | 3.515625 | 4 | [] | no_license |
// var sum = function (array) {
// return array.reduce(function(prev,current) {
// return current + prev;
// })
// }
// function output (result) {
// console.log(result);
// }
// function sum2(array, callback) {
// var summed = sum(array);
// callback(summed);
// }
// var a = sum2([1,2,3], output);
... | true |
d99d9be4f4a2d638001398f98d50fa4fe00d9a2e | JavaScript | sandeepkat/WebDevelopment | /FibonacciCalculator/WebContent/myScripts.js | UTF-8 | 4,770 | 3.40625 | 3 | [] | no_license | var fibOutputStr;
var fibSequence = new Array();
var tableNums;
var timeInterval = null;
var q = 0;
var playing = false;
var btn = document.getElementById("control-btn");
// submit button was clicked
document.getElementById("submitQuery").addEventListener("click", function() {
// get value of input text box
var num... | true |
7de81b6b76339c1cf3302cb740da9e10626c7f27 | JavaScript | DavidWiafe/Color-Design | /ColorDesigne/js/main.js | UTF-8 | 444 | 3.484375 | 3 | [] | no_license | // Your code here!
/*for (var element of window.document.getElementsByTagName("*")) {
element.style.backgroundColor = getRandomColor();
}
function getRandomColor() {
var letters = '0123456789ABCDEF';
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)... | true |
9bef92a5dac3e8422501cc7e3bab93262f6334d0 | JavaScript | luanpotter/labs | /labs-core/src/simplifier.js | UTF-8 | 7,129 | 2.953125 | 3 | [] | no_license | const Exp = require('./exp-base');
const Decimal = require('decimal.js');
let literal = Exp.literal,
identifier = Exp.identifier,
call = Exp.call;
const isMultipleOfIdentifier = function(arg) {
if (arg.isIdentifier()) {
return true;
}
if (arg.isCall() && arg.fn === '*' && arg.args.length =... | true |
2847b12229f8454ae6117aa2bcfeca50d4670daa | JavaScript | gmcshine/Learning-Nodejs | /Nodejs Code/14-模块系统/b.js | UTF-8 | 370 | 2.78125 | 3 | [
"ISC"
] | permissive | function add(x, y){
return x + y;
}
module.exports = add;
// exports.add = add;
// exports是一个对象
// 我们可以通过多次为这个对象添加成员实现对外导出多个内部成员
// 如果希望我们在外部直接拿到的不是一个对象,可以是
// 方法
// 字符串
// 数字
// 数组
// 这时候使用以下方法实现 | true |
ac0f29aff009a4e07eaf37f1ef974f2d4010d94a | JavaScript | grey-media/alcoExpert | /src/redusers/profile.js | UTF-8 | 348 | 2.5625 | 3 | [] | no_license | const initialState = {};
export default function profileData(state = initialState, action) {
switch (action.type) {
case 'PROFILE_UPDATE':
return {
...state,
userName: action.payload.userName,
gender: action.payload.gender,
weight: action.payload.weight,
};
default... | true |
531b9b717b42bd678a44f628c35b10b54ae20fa8 | JavaScript | bwkarr77/Personal_Portfolio | /src/components/ApiContent.js | UTF-8 | 1,167 | 2.59375 | 3 | [] | no_license | import React, { useState } from "react";
import axios from "axios";
export const useGetInfo = async (baseUrl, subText) => {
const result = await axios
.get(`${baseUrl}${subText}`)
.then(({ data }) => data);
return result;
};
//====custom hook below. Works with DonationsList:
//....const [token, setToken]... | true |
020556e151fb61c08c66ed4745d55741d62839f4 | JavaScript | Waseem-javed/weather-app | /app.js | UTF-8 | 1,108 | 3.4375 | 3 | [] | no_license | // Init Ui Object
const ui = new UI;
// init storage object
const storage = new Storage();
const weatherLocation = storage.getLocation();
// Init weather Object
const weather = new Weather(weatherLocation.city);
// get weather on dom loader
document.addEventListener("DOMContentLoaded", getWeather);
// weather.changeL... | true |
6028bcca3befd3c17dfe7c2b205f7932508ff1e2 | JavaScript | KeciLust/client-state | /popup/task.js | UTF-8 | 658 | 2.90625 | 3 | [] | no_license | const modal = document.querySelector(`#subscribe-modal`);
const closeModal = document.querySelector(`.modal__close`);
function getCookie(name) {
const cookie = document.cookie.split(`; `);
for (const c of cookie) {
const [key, value] = c.split(`=`);
if (key === name) {
return value;... | true |
ed6712524f4e9aa51e0d79ed61f0f910c73eaf95 | JavaScript | jraval92/JS-project | /js/match.js | UTF-8 | 1,311 | 3.25 | 3 | [] | no_license | let cards = document.querySelectorAll('.cards');
let flippedCard = false;
let card1, card2;
let lockGame = false;
function flipCard()
{
//this.classList.toggle('flip');
if (lockGame)
{
return;
}
if(this == card1)
{
return;
}
this.classList.add('... | true |
7f80ea25e563b64b30747d42e5eba3b34752466f | JavaScript | gagiopapinni/curves | /src/Curve.js | UTF-8 | 1,935 | 3.125 | 3 | [] | no_license | const {pow, sin, cos, asin, sqrt, sign, tan} = Math;
class Curve {
constructor(func, domain) {
this.func = func;
this.domain = domain;
this.init();
}
init() {
let func = {
x: math.parse(this.func.x),
y: math.parse(this.func.y),
};
le... | true |
d1981b75de4cce722427807f28231f63271f5118 | JavaScript | quyenvo2511/Vo-Trinh-Boi-Quyen_Eblouse_FE | /src/redux/reducers/clinics.reducers.js | UTF-8 | 1,267 | 2.59375 | 3 | [] | no_license | import * as types from "../constants/clinics.constants";
const initialState = {
isLoading: false,
clinic: null,
reviews: [],
listClinic: [],
};
const clinicsReducer = (state = initialState, action) => {
const { type, payload } = action;
switch (type) {
case types.GET_CLINIC_REQUEST:
return { ...... | true |
c18341eb5a32d7fb0105ef94b8cf0408af451137 | JavaScript | petridw/WDIRockPaperScissors | /js/scripts.js | UTF-8 | 3,737 | 3.734375 | 4 | [] | no_license | var userChoice;
var score = [0, 0, 0];
window.onload = function() {
var startButton = document.getElementById("startButton");
var resetButton = document.getElementById("resetButton");
var userScoreCell = document.getElementById("userScoreCell");
var tieScoreCell = document.getElementById("tieScoreCell");
va... | true |
75858772a4058f640b1ae846e668b567b0523869 | JavaScript | yaqootturman/snowball | /client/src/redux/actions.js | UTF-8 | 1,224 | 2.53125 | 3 | [
"MIT"
] | permissive |
import axios from 'axios'
// redux is sync so i need async to deal with api
export const getUserPledges = () => async (dispatch) => {
let userId = 1;
const response = await axios.get(`/api/home/${userId}`)
const userPledges = response.data
dispatch({
type: 'GET_USER_PLEDGES',
userPledges
})
}
ex... | true |
bfc1daf1938ba5aa2938a247b57502d1d97a112b | JavaScript | danialmalik/ydkjs-training | /book5-async-and-performance/chapter4-generators/promiseAwareGenerator.js | UTF-8 | 1,521 | 3.734375 | 4 | [] | no_license | // thanks to Benjamin Gruenbaum (@benjamingr on GitHub) for
// big improvements here!
function run(gen) {
var args = [].slice.call( arguments, 1), it;
// initialize the generator in the current context
it = gen.apply( this, args );
// return a promise for the generator completing
return Promise.resolve()
.then... | true |
61fc4828a5afd0b51cb8e1f6da004207bee24646 | JavaScript | jdpond/LightningFlowComponents | /flow_screen_components/mc_lookup/force-app/main/default/lwc/mc_comboboxUtility/mc_comboboxUtility.js | UTF-8 | 918 | 2.953125 | 3 | [] | permissive | const KEYS = {
ESCAPE: 'Escape',
UP: 'ArrowUp',
DOWN: 'ArrowDown',
ENTER: 'Enter'
}
const setValuesFromMultipleInput = (values) => {
if (!values) {
return [];
} else {
return Array.isArray(values) ? [...values] : [values];
}
}
const setValuesFromSingularInput = (value, deli... | true |
3bd0e8317ad7e7d984616647fe3cda254d09d51a | JavaScript | Html5wanghang/js-leetcode | /leetcode/editor/cn/[1417]重新格式化字符串.js | UTF-8 | 2,215 | 3.859375 | 4 | [] | no_license | //给你一个混合了数字和字母的字符串 s,其中的字母均为小写英文字母。
//
// 请你将该字符串重新格式化,使得任意两个相邻字符的类型都不同。也就是说,字母后面应该跟着数字,而数字后面应该跟着字母。
//
// 请你返回 重新格式化后 的字符串;如果无法按要求重新格式化,则返回一个 空字符串 。
//
//
//
// 示例 1:
//
// 输入:s = "a0b1c2"
//输出:"0a1b2c"
//解释:"0a1b2c" 中任意两个相邻字符的类型都不同。 "a0b1c2", "0a1b2c", "0c2a1b" 也是满足题目要求的答案。
//
//
// 示例 2:
//
// 输入:s = "leetcode"
//输出... | true |
f13476522135c1f78c3a6c4cdc29834f3c922f91 | JavaScript | rsmahabir/domestic-energy-performance | /src/script.js | UTF-8 | 2,812 | 2.828125 | 3 | [] | no_license | let map;
let data = '';
const baseUrl = 'http://127.0.0.1:5000'
const energyRatingColours = {
'A+++': '#00a652',
'A++': '#50b849',
'A+': '#c0d731',
'A': '#fef200',
'B': '#fcb913',
'C': '#f37020',
'D': '#ed1b24',
}
let markerGroup; // For adding and removing markers to the map
function initialiseMap() {
... | true |
316a0a25eff0d8247f5f73362a8c7f818120616c | JavaScript | AndieDrew/Mod4TakeHome | /src/Components/App/App.js | UTF-8 | 1,734 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from "react"
import { Switch, Route, Redirect } from "react-router-dom"
import './App.css'
import { getArticles } from "../../Util/api-calls"
import Search from '../Search/Search'
import List from '../List/List'
import Details from '../Details/Details'
export default function App(... | true |
c8b00070a10b46ba18dde2657f7f1ea8ea9dcd5b | JavaScript | ColeWalker/workout-tracker-app | /redux/actions.js | UTF-8 | 2,733 | 2.515625 | 3 | [] | no_license | export const ADD_EXERCISE = "ADD_EXERCISE";
export const DELETE_EXERCISE = "DELETE_EXERCISE";
export const EDIT_EXERCISE = "EDIT_EXERCISE";
export const COMPLETE_EXERCISE = "COMPLETE_EXERCISE";
export const CREATE_ROUTINE ="CREATE_ROUTINE";
export const ADD_ROUTINE_EXERCISE = "ADD_ROUTINE_EXERCISE";
export const DELETE... | true |
8e0ea42394e9a88367e6ace5eb238e84340773d5 | JavaScript | abhirup-mondal/leaphack | /save_data_in_extension.js | UTF-8 | 649 | 2.59375 | 3 | [] | no_license | function saveChanges( words_tags , result_link_to_search) {
if (!result_link_to_search)
{
message('Error: No result link specified');
return;
}
else if(!words_tags)
{
message('Error: No tags specified');
return;
}
else{
// Save it using the Chrome extension st... | true |
23ee45bc4b6f2afd40b3466b3b4df799af3df907 | JavaScript | sathishstar/react_router_tutorial | /src/pass_props_link.js | UTF-8 | 962 | 2.53125 | 3 | [] | no_license | class Profile extends React.Component {
state = {
user: null
}
componentDidMount () {
const { handle } = this.props.match.params
fetch(`https://api.twitter.com/user/${handle}`)
.then((user) => {
this.setState(() => ({ user }))
})
}
render() {
//..... | true |
1a568852e1ae9258220ae7316f797e616405a17d | JavaScript | kasabian/test_tic_tak_toe_5_5 | /game/models/BoardModel.js | UTF-8 | 861 | 2.921875 | 3 | [] | no_license | var GameModule = window.GameModule || {};
(function(module) {
module.BoardModel = function(x, y) {
var board = [],
boardX = x,
helper = new GameModule.Helper(),
boardY = y;
var createBoard = function() {
for(var i = 0; i < boardY; i++) {
var line = [];
for(var j = 0; j < boardX; j++) {
... | true |
ff8a3657d0eb771305ca5868acad1013f837f2f5 | JavaScript | CoreenCooper/Tie-In | /front-end/src/Components/Card.js | UTF-8 | 2,753 | 2.765625 | 3 | [] | no_license | import React from 'react';
import { render } from 'react-dom';
import '../index.css'
import Form from 'react-bootstrap/Form'
class Card extends React.Component{
constructor(props){
super(props);
this.state = {
name: 'Name:',
phoneNumber: 'Phone Number:',
email: 'E-mail:',
linkedin: 'Li... | true |
3c34120cb27704d1ddd5cb00c9aacfc2052b7cc0 | JavaScript | FuriousBranko/CG-Project-Linz | /code/src/custom_nodes/material.js | UTF-8 | 1,232 | 2.640625 | 3 | [] | no_license | /**
* a material node contains the material properties for the underlying models
*/
class MaterialNode extends SGNode {
constructor(children) {
super(children);
this.ambient = [0.2, 0.2, 0.2, 1.0];
this.diffuse = [0.8, 0.8, 0.8, 1.0];
this.specular = [0, 0, 0, 1];
this.emission = [0,... | true |
ce842a3a67fa0c1a476902465c5863b0407fa9bb | JavaScript | ryannguyen/wedding-site | /public/js/invitations/models.js | UTF-8 | 2,466 | 2.546875 | 3 | [] | no_license | /**
* MODELS
*/
var Wedding = (window.Wedding = window.Wedding || {});
(function(App) {
App.Invitation = Backbone.Model.extend({
defaults: {
address: '',
side: ''
},
initialize: function(attr, options) {
_.bindAll(this, 'updateID');
attr = a... | true |
7e0f862e6cc3bb38b9b4865f52bd1c210fe3f20f | JavaScript | CWolfAnderson/zene | /client/src/containers/Home/func/getCountryOptions.js | UTF-8 | 269 | 2.59375 | 3 | [] | no_license | const getCountryOptions = (dataSet) => {
return dataSet.reduce((acc, row) => {
if (!acc.includes(row.Country)) acc.push(row.Country);
return acc;
}, [])
.sort()
.map(country => ({ label: country, value: country }));
}
export default getCountryOptions;
| true |
c5f2dbf399588573243d88babe23e479a59e2c96 | JavaScript | RupySB/m2-4-js--events | /workshop/exercise-1.1/app.js | UTF-8 | 527 | 4 | 4 | [] | no_license | // Exercise 1.1
// ------------
let body = document.querySelector("body");
let result = document.getElementById("result");
let clickedFast = false;
// The 'click' function
function clickEvent() {
clickedFast = true;
result.innerText = "You Win!";
body.removeEventListener("click", clickEvent);
}
setTimeout(funct... | true |
6ce788b1a5dc1a3167a05be74ba21daa54af45c3 | JavaScript | qiubohong/qiubohong.github.io | /code/sandbox/vm-sandbox.js | UTF-8 | 177 | 2.671875 | 3 | [] | no_license | const vm = require('vm');
const sandbox = {
a: 1
};
vm.createContext(sandbox)
const whatIsThis = vm.runInContext(`
a = 2 ;
`, sandbox);
console.log(sandbox) // 输出2 | true |
13a6d27fd735f2d7d8182e4b07de63cb836e089e | JavaScript | EricEisaman/EricEisaman.github.io | /code/for_loop.js | UTF-8 | 104 | 2.859375 | 3 | [] | no_license | for( let i = 0 ; i < 100 ; i++){
console.log("HELLO FROM ANGEL!!")
console.log(Math.random())
}
| true |
0c083cb8aa2b5053d83311c1db1803dfb6aa0217 | JavaScript | Vergil0327/learning-basic-algorithm-by-js | /caesarCipher.js | UTF-8 | 2,169 | 3.546875 | 4 | [] | no_license | function caesarCipher (str, num) {
const charCodeOfa = 'a'.charCodeAt(0);
const charCodeOfz = 'z'.charCodeAt(0);
const charCodeOfA = 'A'.charCodeAt(0);
const charCodeOfZ = 'Z'.charCodeAt(0);
const a2zRegex = /[a-z]/;
const A2ZRegex = /[A-Z]/;
const ALPHABET_NUM = 26;
return str
.split('')
.map(... | true |
685892ae220f5017818c0594e8824a7751a6082a | JavaScript | twally3/ParticleEmitter | /public/js/Emitter.js | UTF-8 | 2,804 | 2.84375 | 3 | [] | no_license | let { random, times, assign } = _;
const WIDTH = window.innerWidth;
const HEIGHT = window.innerHeight;
const defaults = {
maxAge: 70,
exposure: 0.1,
damping: 0.8,
noise: 1.0,
fuzz: 1.0,
intensity: 1.0,
vx: 10,
vy: 10,
spawn: 5,
octaves: 8,
color: {
r: 25,
g: 100,
b: 75
},
width: ... | true |
8346b33d694c61cb166eb7dca67835ff9f38ee13 | JavaScript | practicas-ingenieria-de-software-2/Practicas | /Triqui/App.js | UTF-8 | 6,897 | 2.921875 | 3 | [] | no_license | import React from 'react';
import { StyleSheet, Text, View, TouchableHighlight } from 'react-native';
function calcularGanador(tablero) {
const matrizVictoria = [
[0, 1, 2],
[3, 4, 5],
[6, 7, 8],
[0, 3, 6],
[1, 4, 7],
[2, 5, 8],
[0, 4, 8],
[2, 4, 6]
];
for (let i = 0; i < matrizV... | true |
10048d9711eee93897ef7799f6c0b9f9e7dd924d | JavaScript | Crittenbach1/introduction-to-array-for-each-bootcamp-prep-000 | /index.js | UTF-8 | 403 | 4.28125 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | var evens = [0, 2, 4, 6, 8, 10];
evens.forEach(even => {
console.log(`${even} is not odd!`)
})
evens.forEach((even, index, array) => {
debugger
console.log(`${even} is not odd!`)
})
function square(n) {
console.log(n * n)
}
evens.forEach(square)
function doToEvens(callback) {
evens.forEach(callback)
... | true |
cc3723d6e41b2bb08a312f0a36083ed0453f29fd | JavaScript | backpackerhh/tmdb-react-ddd | /src/Domain/TMDb/ValueObjects/PageValueObject.js | UTF-8 | 476 | 2.546875 | 3 | [] | no_license | export class PageValueObject {
static create({ movies, paginationData }) {
return new PageValueObject({ movies, paginationData });
}
constructor({ movies, paginationData }) {
this._movies = movies;
this._paginationData = paginationData;
}
movies() {
return this._movies;
}
paginationData... | true |
46640746aa1ccdaa27f914fe289cbeec28bd8d0c | JavaScript | pouyansh/schedule-app | /modules/habits-module/habit/index.js | UTF-8 | 6,245 | 2.578125 | 3 | [] | no_license | const Repository = require('../../../database/repository.js')
const create_table = require('../../tools/table/index')
class Habit {
constructor() {
this.repo = new Repository('habits')
this.repo.createTable()
}
get = (item) => {item.show = true; return this.repo.get(item)}
getAll =... | true |
ee045c3138b35962fd576aabbf1a2960bf19c654 | JavaScript | rockyStallone/chat-application---Node-MongoDb | /controllers/userController.js | UTF-8 | 691 | 2.515625 | 3 | [] | no_license | const User = require('../models/userModel');
exports.createUser = async (req,res) => {
const newUser = await User.create(req.body);
res.status(201).json({
status: 'success',
data: {
newUser
}
})
}
exports.updateUser = async (req,res) => {
const user = await User.fin... | true |
fd320f52dbccbbce9cb179809b1e3552c276c355 | JavaScript | mwallacemn/firestore-mock | /mock_constructors/TimestampMock.js | UTF-8 | 236 | 2.609375 | 3 | [] | no_license | function TimestampMock(date) {
this.date = date;
}
TimestampMock.prototype.toMillis = function() {
return this.date.getTime();
};
TimestampMock.prototype.toDate = function() {
return this.date;
};
module.exports = TimestampMock;
| true |
0737971d5c8e35d2c050c9d5fc302d9b83b463b7 | JavaScript | maximjs/project-lvl2-s161 | /src/renders/plain.js | UTF-8 | 1,106 | 2.859375 | 3 | [] | no_license | import { isObject } from 'lodash';
const getMainStr = (property, propertyType) => `Property '${property}' was ${propertyType}`;
const getFromStr = (from, to) => `. From ${from} to ${to}`;
const getWithStr = valueStr => ` with ${valueStr}`;
const renderInsertedProp = (node, property) => {
const valueStr = (isObject(... | true |
db7c414bebde6b04ed80879ddbdd31905ed24695 | JavaScript | shafali03/JavaScript_Guide | /function/script.js | UTF-8 | 5,816 | 4.0625 | 4 | [] | no_license |
function trueOrFalse(isItTrue) {
if (isItTrue) {
return "Yes it's true"
}
return "no it's false"
}
function trueOrFalse(wasThatTrue) {
if (wasThatTrue) {
return "Yes that was true"
}
return "False"
}
console.log(trueOrFalse(true));
// Comparison with the Equality Operator
function testStri... | true |
f2c903bd7b7ca1a1250b7d69264f792cdd2aa34a | JavaScript | mc-unicamp/oficinas | /zumbi/caseset05/dccs/components/dcc-input.js | UTF-8 | 4,084 | 2.65625 | 3 | [] | no_license | /**
* Input DCC
***********/
class DCCInput extends DCCBlock {
constructor() {
super();
this.inputTyped = this.inputTyped.bind(this);
this.inputChanged = this.inputChanged.bind(this);
}
connectedCallback() {
this._statement = (this.hasAttribute("statement"))
... | true |
5f81dc8c118711f6b1a97fc9a4b4f0e3f85cb2c0 | JavaScript | bojandamchevski/SEDC-Homework-JavaScript | /Homework #6 BONUS Бојан Дамчевски/Scripts/bonus_homework6.js | UTF-8 | 1,389 | 3.28125 | 3 | [] | no_license | let htmlBody = document.getElementsByTagName("body")[0];
let mainDiv = document.createElement("div");
mainDiv.setAttribute("id","mainDiv");
htmlBody.appendChild(mainDiv);
let titleDiv = document.createElement("div");
let contentDiv = document.createElement("div");
mainDiv.appendChild(titleDiv);
mainDiv.appendChild(cont... | true |
a2b23f9813081ebe539992daed28a5e78a20366f | JavaScript | Bodegas/javascript | /helpers/Flatten/index.js | UTF-8 | 279 | 2.796875 | 3 | [] | no_license | const reducer = (accumulator, currentValue) => {
if (Array.isArray(currentValue)) {
return [...accumulator, ...currentValue.reduce(reducer, [])];
}
return [...accumulator, currentValue]
};
export const flattenArray = array => {
return array.reduce(reducer, []);
};
| true |
498b56c8427f5123bb92e87297741b04f6481fb7 | JavaScript | christo-pr/michefood | /utils.js | UTF-8 | 1,511 | 2.59375 | 3 | [] | no_license | /**
* Utils
*/
const BOT_OPTIONS = [
'add'
]
function validateFbURL (url) {
const pattern = new RegExp('^(https?://www.facebook.com/.{3,})', 'gi')
return pattern.test(url)
}
function createPlacesMessage (places) {
const blocks = [
{
type: 'section',
text: {
type: 'mrkdwn',
t... | true |
02f5d8c8b4b2c70d836e8ba8a3e47b1869adcff0 | JavaScript | sagar03d/node-mongo-sample | /controllers/userController.js | UTF-8 | 738 | 2.6875 | 3 | [] | no_license | const User = require('../models/user.js');
exports.create = function(req, res){
// Create a User
const user = new User({
name: req.body.email || "Untitled Note",
position: "CEO"
});
// Save Note in the database
user.save()
.then(data => {
res.send(data);
}).catch(er... | true |
5f351703fc565c27c0f0c6b778575285653e0252 | JavaScript | TheDeterminator/Morning-App | /morning-app/src/weather/index.js | UTF-8 | 7,262 | 2.6875 | 3 | [] | no_license | import React from 'react'
import './weather.css'
import icons from './weather-icons'
const week = {
0: "Sun",
1: "Mon",
2: "Tue",
3: "Wed",
4: "Thurs",
5: "Fri",
6: "Sat"
}
let Kelvin, Celsius, Fahr = null;
function changeUnit(event) {
// console.log(event.target.textContent)
let ... | true |
a4c7d2321dede1d21b71c7b1b0fa9c14a8c09a50 | JavaScript | ronsbons/project-2-wayfarer-frontend | /src/container/PostContainer.js | UTF-8 | 1,629 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react';
import PostsModel from '../models/PostsModel';
import PostList from '../components/PostList';
class PostContainer extends Component {
state = {
posts: [],
post: null,
userId: this.props.user._id
};
componentDidMount() {
this.fetchData();
};
fetchDa... | true |
d506d6b9da10f2fbb9fa074d6e61a8e47fbc840a | JavaScript | dongxli/sorting_algorithm_visualizer | /src/components/algorithms/selectionSort.js | UTF-8 | 704 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | export default function getSelectionSortAnimations(array) {
const animations = [];
selectionSort(array, animations);
return animations;
}
const selectionSort = (array, animations) => {
let array_len = array.length;
for (let i = 0; i < array_len - 1; i++) {
let min_index = i;
for (let j = i + 1; j < ... | true |
d02df38db60ee04b35404bfd195813cf1f80f523 | JavaScript | vitorueno/cod3r_js | /fundamentos/unarios.js | UTF-8 | 448 | 3.9375 | 4 | [] | no_license | let num1 = 1
let num2 = 2
num1++
console.log(num1);
--num1
console.log(num1);
// prefix tem maior precedencia que posfix:
// ++ será executado antes do --, logo fica
// 2 === 2 -> true
console.log(++num1 === num2--); // true
// o resultado é como se espera os dois diferentes um do outro
// 2 === 1 -> false
consol... | true |
3af18b5137588842dd871a3f8f5223cbf5d04778 | JavaScript | jhonGC96/redsocial | /public/js/crearusuario.js | UTF-8 | 5,248 | 2.515625 | 3 | [] | no_license | let formRegistrar = document.getElementById('formRegistrar')
let nombre = document.getElementById('nombre')
let apellido = document.getElementById('apellido')
let correo = document.getElementById('correo')
let edad = document.getElementById('edad')
let password = document.getElementById('password')
let repeat_password ... | true |
b76ea430fa5c72389d77e5c7eb7061fe4b20e743 | JavaScript | JonasBezerra/Introducao_a_Programacao_Web | /aulas/index.js | UTF-8 | 595 | 3.9375 | 4 | [
"MIT"
] | permissive | // criar programa que calcula a média
// das notas entre os alunos e envia
// mensagem do calculo da média
const aluno01 = "Jonas"
const notaAluno01 = 9.8
const aluno02 = 'Diego'
const notaAluno02 = 10
const aluno03 = 'Fulano'
const notaAluno03 = 2
const media = (notaAluno01 + notaAluno02 + notaAluno03)/3
// se a... | true |
68213291a9691c0b4b29dc9578ebb24fe8ea7d4b | JavaScript | ishumski/world | /JS/3.canvas/1.basic_canvas(lesson_53)/2.task/js/script.js | UTF-8 | 258 | 2.71875 | 3 | [] | no_license | /*2. Нарисуйте на канвасе фигуру (вертикальная линия) */
const canvas = document.querySelector("#canvas");
const ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.moveTo(50, 50);
ctx.lineTo(50, 250);
ctx.stroke(); | true |
29aeb0b70f9e34db8c39164966beb5a482d2d342 | JavaScript | Korilakkuma/XSound.js | /src/NoiseGate/NoiseGate.js | UTF-8 | 2,519 | 3.203125 | 3 | [
"MIT"
] | permissive | (function(global) {
'use strict';
/**
* This private class defines properties for Noise Gate.
* @constructor
*/
function NoiseGate() {
this.level = 0;
}
/**
* This method is getter or setter for parameters.
* @param {string|object} key This argument is property nam... | true |
152878f24b217ae44f3a6c95fb7cba1c355b7b6d | JavaScript | JorgeSerrano26/auto-click-twitch | /script.js | UTF-8 | 202 | 2.796875 | 3 | [] | no_license | setInterval(() => {
let el = document.getElementsByClassName('tw-button tw-button--success tw-interactive')[0];
if (el) {
el.click();
console.log("Collected");
}
}, 120000);
| true |
707afa6f91a0b5cb98b3e62c2d3f8aadd2d16ec0 | JavaScript | awesome-academy/r-p1-foody-fake | /app/assets/javascripts/search.js | UTF-8 | 1,223 | 2.640625 | 3 | [] | no_license | const DOMAIN_API = 'http://localhost:3000/'
$(document).ready(function () {
$('#search_restaurant_btn').on('click', search_restaurant)
$('#near_restaurant_btn').on('click', search_near_restaurant)
})
async function search_restaurant() {
let province_name = $('#province_select option:selected').html()
let dist... | true |
27362a5ed2b767f9d2a4dfc76e6954122a598f58 | JavaScript | TaylorWu21/verdatum | /app/components/comments/CommentForm.js | UTF-8 | 868 | 2.5625 | 3 | [] | no_license | import React from 'react';
import $ from 'jquery';
class CommentForm extends React.Component{
constructor(props) {
super(props);
this.addComment = this.addComment.bind(this)
}
addComment(e) {
e.preventDefault();
let admirer = this.refs.admirer;
let content = this.refs.content;
$.ajax({
url: '/commen... | true |
d0d94619e408ba8ac4b6364fe38656ae6481e483 | JavaScript | priyankasathiyaseelan/guvi | /javascript/mathematics/10_composite.js | UTF-8 | 411 | 2.984375 | 3 | [] | no_license | const readline=require('readline');
const inp=readline.createInterface({input:process.stdin});
inp.on("line",(data)=>{
var n=[]
n=data.split();
var a=n[0];
var b=0;
for(i=1;i<parseInt(a);i++)
{
if((parseInt(a)%parseInt(i))==0)
{
b=i;
}
}
if(parseInt(b)... | true |
2c8ac5f450a6e58006a83bdbb5327dcc7c9552b3 | JavaScript | Yanioconjota/angular-properati | /app/services/InmuebleService.js | UTF-8 | 867 | 2.515625 | 3 | [] | no_license | (function(){
function InmuebleService(httpHelper)
{
var inmuebleService = this;
inmuebleService.buscar = function()
{
var promise = httpHelper.get('/app/server/properati.txt', {});
return promise;
//promise.then(callbackBuscar);
}
var callbackBu... | true |
327dedbab6d53c6940b60781475dd1a813cfec17 | JavaScript | fobbytommy/Algorithm | /01_The_Dojo_Collection/01_Fundamentals/page_61.js | UTF-8 | 1,933 | 4.03125 | 4 | [] | no_license | "use strict";
function ListNode(value) {
if (this instanceof ListNode) {
this.val = value;
this.next = null;
} else {
return new ListNode(value);
}
}
function SList(value) {
if (this instanceof SList) {
this.head = ListNode(value);
this.length = 1;
} else {
return new SList(value);
}
}
SList.protot... | true |
b3a26f352271500910f51eada26c1790c1275eb0 | JavaScript | y0c/mvc-tag-editor | /app.js | UTF-8 | 2,791 | 3.421875 | 3 | [] | no_license |
class Observer {
notify() {
}
}
class Subject {
constructor() {
this.observers = [];
}
registerObserver(fn) {
this.observers.push(fn);
}
notifyAll(data) {
this.observers.forEach(obj => obj.notify(data));
}
}
class TagService extends Subject {
construct... | true |
d442c24e84180b427e43bade43d14ddec5d2c8c5 | JavaScript | e-spitz/OverlookHotel | /test/booking-test.js | UTF-8 | 1,404 | 2.53125 | 3 | [] | no_license | import chai from 'chai';
import Customer from '../src/customer'
import Booking from '../src/booking'
import Room from '../src/room'
import { testCustomers, testRooms, testBookings } from './test-data'
const expect = chai.expect;
describe('Booking', () => {
let booking1, booking2, booking3;
beforeEach(() => {
... | true |
032eca2914616924ceb9d3261a067df46f1c456e | JavaScript | qmonmert/es6-examples | /src/promise.js | UTF-8 | 579 | 3.453125 | 3 | [] | no_license | var myPromise1 = new Promise((resolve, reject) => {
setTimeout(() => {
resolve("Promise 1 resolved");
}, 2000);
});
var myPromise2 = new Promise((resolve, reject) => {
setTimeout(() => {
reject('Promise 2 rejected');
}, 2000);
});
myPromise1
.then((data) => console.log('success 1 :... | true |
ccba1f9a47db839e3fc77ed25f2e41053056b26e | JavaScript | joaopaul167/node-location | /index.js | UTF-8 | 2,953 | 3 | 3 | [] | no_license | let filiais = {
filiais: [
{
"name":"FILIAL ELDORADO DO SUL",
"Lat":"-29.9984899",
"Lon":"-51.306162",
},
{
"name":"FILIAL FARROUPILHA",
"Lat":"-29.2264495",
"Lon":"-51.3469796",
},
{
... | true |
a33ddba46e590a1ba45e751815a1f41ede8cda83 | JavaScript | LaimaNam/lets-code_js | /05-14-switch-ternary/app.js | UTF-8 | 4,407 | 3.734375 | 4 | [] | no_license | let country = {
countryName: "Lithuania",
continent: "Europe",
population: 3,
age: 100,
isIsland: false,
language: "lithuania",
};
let isIsland = country.isIsland;
function checkCountry(isIsland) {
return isIsland
? `${country.countryName} is island`
: `${country.countryName} is not an island`;
... | true |
3326d689a0f80242ee3a5f4efdf90dc6972fe746 | JavaScript | yonatankarimish/CommandIDE | /command-ide/corpus-worker.js | UTF-8 | 2,837 | 3.3125 | 3 | [] | no_license | onmessage = function(event) {
const corpus = event.data;
const rankedNgrams = getNgrams(corpus);
postMessage(rankedNgrams);
}
//Construct an occurrence map by checking for nGram occurrence in the provided corpus, on a line-by-line basis
//Because this is a costly operation, invoked from the front-end frame... | true |
999eaca0f58be6416b975ab57ee59a93e5a631c6 | JavaScript | ZavadskiyAS/goit-js-hw-07 | /js/task-3.js | UTF-8 | 1,177 | 2.9375 | 3 | [
"Unlicense"
] | permissive | 'use strict';
const images = [
{
url:
'https://images.pexels.com/photos/140134/pexels-photo-140134.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260',
alt: 'White and Black Long Fur Cat',
},
{
url:
'https://images.pexels.com/photos/213399/pexels-photo-213399.jpeg?auto=compress&cs=tinysrgb... | true |
f282f05b2baf5d5266b62198bf43696b064d068a | JavaScript | dremnik/network | /network/static/network/src/index.js | UTF-8 | 9,464 | 2.75 | 3 | [] | no_license | 'use strict';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
error: null,
isAuthenticated: false,
user: "",
page: 1,
posts: [],
}
this.loadPosts = this.loadPosts.bind(this);
this.handleMakePost = this.handleMakePost... | true |
188327fc21798ccbfe01029b9ec280787d286b6c | JavaScript | julGi/test | /react/pendu/src/App.js | UTF-8 | 2,536 | 2.765625 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Score from './Score.js';
import MaskedWord from './MaskedWord.js';
import Button from './Button.js';
import * as WordGenerator from './WordGenerator.js';
const DEFAULT_STATE = {
maskedWord : WordGenerator.generate... | true |
6d67652943ea01810cc89b06178d8df8b3af2d9c | JavaScript | rslfilho/trybe-exercises | /exercises/bloco_7/dia_2/exercicio_2.js | UTF-8 | 1,948 | 3.859375 | 4 | [] | no_license | const lesson1 = {
materia: 'Matemática',
numeroEstudantes: 20,
professor: 'Maria Clara',
turno: 'manhã',
};
const lesson2 = {
materia: 'História',
numeroEstudantes: 20,
professor: 'Carlos',
};
const lesson3 = {
materia: 'Matemática',
numeroEstudantes: 10,
professor: 'Maria Clara',
turno: 'noite'... | true |
29e420173a258606e90d3eb9edac01cc86f182a7 | JavaScript | aishwaryasurwase/Codevolution | /src/components/Message/Message.js | UTF-8 | 476 | 2.515625 | 3 | [] | no_license | import { Component } from "react";
class Message extends Component {
state = {
text: 'Welcome Visitors'
}
render() {
const subscribeHandler = () => {
this.setState({ text: 'Thank you for subscribing' });
}
return (
<div>
<p>{this.stat... | true |
4826a02ae5a0ff138a36321978d4012c554bad21 | JavaScript | dansegliode/igme230 | /fall2018sample/fall2018sample.js | UTF-8 | 811 | 2.984375 | 3 | [] | no_license | /* Don't use <script> tags in a linked js file! */
let open1 = false;
let open2 = false;
$(".menubox").first().click(function() {
if(!open1){
$("ul").first().css("display", "block");
open1 = true;
}else{
$("ul").first().css("display", "none");
open1 = false;
}
});
$(".menub... | true |
da3a8ec5bfa306787c284b3e34703b1ddd4bb59f | JavaScript | calband/calchart-viewer | /js/pdf/SurroundingDotsWidget.js | UTF-8 | 3,314 | 2.90625 | 3 | [] | no_license | /**
* @fileOverview Defines the widget for generating the surrounding dots widget
*/
var JSUtils = require("../viewer/utils/JSUtils");
var PDFUtils = require("./PDFUtils");
var PDFWidget = require("./PDFWidget");
// font size is smaller for dot labels
FONT_SIZE = 7;
DOT_RADIUS = 1;
/**
* Represents the widget for... | true |
f65221d0e1a64ef5a37ae28b4eb32a4151aca57e | JavaScript | jleonardo007/react-calculator | /src/Calculator/CalculatorComponent.jsx | UTF-8 | 1,331 | 2.546875 | 3 | [] | no_license | import React from "react";
import buttons from "./calculator_buttons";
const Button = ({ button, click }) => {
return (
<div
id={button.id}
className="button"
data-value={button.keyValue}
onClick={click}
>
{button.keyValue}
</div>
);
};
class Calculator extends React.Comp... | true |
b04d2f71644ec7d6a18e313f8fa93a068bac47be | JavaScript | dannyboy15/power-analysis-tool | /grid.js | UTF-8 | 1,662 | 2.953125 | 3 | [] | no_license | var _shape = 'Square';
var canvas = new fabric.Canvas('content', { selection: false });
var grid = 50;
// create grid
for (var i = 0; i < (600 / grid); i++) {
canvas.add(new fabric.Line([ i * grid, 0, i * grid, 600], { stroke: '#ccc', selectable: false }));
canvas.add(new fabric.Line([ 0, i * grid, 600, i * grid], ... | true |
f7cf1d179e96ce937e5d80953f7589f2f56fb9ab | JavaScript | manchuck/advent-of-code-2020 | /day-1/index.js | UTF-8 | 655 | 2.90625 | 3 | [] | no_license | const {readFile} = require('fs').promises;
const search = (list, entry) => list.some((element) => element === entry);
const loadExpenses = async (path) => {
const entries = await readFile(path, {encoding: 'ascii'});
return entries.split('\n').map((entry) => parseInt(entry))
};
(async (path) => {
const e... | true |
420c4bfac76416d147b785601bdfd985def71e1f | JavaScript | ivonnecv/LIM011-data-lovers | /src/data.js | UTF-8 | 2,428 | 3.140625 | 3 | [] | no_license | /* Manejo de data */
export const traerDataPokemon = (array) => {
const newArray = [];
for (let i = 0; i < array.length; i += 1) {
newArray.push({
id: array[i].id,
name: array[i].name,
img: array[i].img,
type: array[i].type,
avg_spawns: array[i].avg_spawns,
candy_count: arra... | true |
0e400dc40644cdf4e91716028f24fb7296133093 | JavaScript | vpyatin/tshirt-constructor | /js/app/common.js | UTF-8 | 17,874 | 2.734375 | 3 | [] | no_license | /**
* author: Vitaliy Pyatin
*/
(function ($, window, document) {
/**
* @param {Object} param
* @param {string} param.type - type of t-shirt ( man/women etc. )
* @param {string|int} param.id - t-shir id
* @param {Object|string} param.imageContainer
* @param {Object|string} param.imageCon... | true |
647eab7f360953627fd2f42243e80b929d052514 | JavaScript | johnsaugy/SurchPort | /assets/js/ui.js | UTF-8 | 2,094 | 2.625 | 3 | [] | no_license | // John owns the repository. This is an exercise in pull requests.
$(document).ready(function(){
//================================ Star Ratings ================================
var starsRating = 9.2/10;
var starsWidthNum = 100;
var newWidth = starsRating * starsWidthNum;
var starsWidth = $(".card--Rating_... | true |
b7ec61be3f1426b9b9b26c1936f4c9e36cd4eac9 | JavaScript | jfarmer/react-racer | /frontend/src/App.js | UTF-8 | 1,877 | 2.59375 | 3 | [
"MIT"
] | permissive | import io from 'socket.io-client';
import React, { useState, useEffect } from 'react';
import RacerStates from './RacerStates';
import TypeRacer from './TypeRacer';
import 'normalize.css';
import './App.css';
const socket = io('http://localhost:4001');
const App = () => {
const [racerState, setRacerState] = useSt... | true |
6d78df3b539366a18db597121fdfd84c552e64ec | JavaScript | Shubhamjain2908/DS-ALgo_JS | /extras/server.js | UTF-8 | 236 | 2.578125 | 3 | [] | no_license | const http = require('http');
const callBack = (req, res) => {
res.write('Hello Shubham!!!');
res.end();
}
const server = http.createServer(callBack);
server.listen(8001, () => console.log('App listening on port 8001!!!!'));
| true |
05b150f41c4c249a0445b32776eddd89125208c6 | JavaScript | etu-cad-2015/big-integer-math | /gcf_nn_n.js | UTF-8 | 1,784 | 3.34375 | 3 | [] | no_license | // Лобарев Андрей Александрович 5302
// Модуль N-13 (gcf_nn_n) Нахождение НОД натуральных чисел
MathLib.gcf_nn_n = function(a ,b) {
var tmp; // Переменная для обмена местами a и b в случае, если a < b
switch (MathLib.com_nn_d(a, b)) { // проверяем, какое из чисел
... | true |
04d48c287fb935ce65952b73c3d2a6429801e83b | JavaScript | Fziliotti/ExpressNodeJS | /server.js | UTF-8 | 652 | 2.640625 | 3 | [] | no_license | let express = require('express')
let app = express()
let port = 3000
app.get('/', (req, res) => {
res.sendFile('pages/index.html', {root: __dirname })
})
app.get('/contato', (req, res) => {
// res.sendFile(path.join('/contato.html'));
res.sendFile('pages/contato.html', {root: __dirname })
})
app.post('/c... | true |
af8eae3936c359c516a41a472ceb205bb1d77b7c | JavaScript | srartese/MonsterMash | /hosted/loginBundle.js | UTF-8 | 6,308 | 2.640625 | 3 | [] | no_license | let NavClass;
let navRender;
let aboutRender;
const handleLogin = e => {
e.preventDefault();
$("#domoMessage").animate({ width: 'hide' }, 350);
if ($("#user").val() == '' || $("#pass").val() == '') {
handleError("RAWR! Username or password is empty");
return false;
}
console.log($("input[name=_csrf... | true |
de44a46238427cc64ca4d60e4185ecfeb935a08a | JavaScript | vovachebr/external-courses | /src/ex15_js-oop/task-01_prototype.js | UTF-8 | 826 | 3.703125 | 4 | [
"MIT"
] | permissive | "use strict";
function Sweet(name, weight) {
this.weight = weight;
this.name = name;
}
function Gift(sweets) {
this.sweets = sweets;
}
Gift.prototype.getWeight = function() {
let totalWeight = 0;
for (const sweet of this.sweets) {
totalWeight += sweet.weight;
}
return totalWeight;... | true |
1372e3d1003f490b459a4d2323271598f3c6bc1a | JavaScript | giildas/1001-js | /Piece.js | UTF-8 | 4,021 | 3.40625 | 3 | [] | no_license | /*
TODO :
prendre en compte les rotations !!
*/
class Piece {
constructor(canvas, index, game_size, grid_size, sqSize, gap, nb_pieces, onPieceDropFunc){
let pieces = [ // number = color
"0",
"11",
"222",
"3333",
"44444",
"55o5",
"66o66",
"777o777o777",
"888o8o8",
].map(... | true |
37e3ab50773163917a93a3d133214e14e064d64b | JavaScript | mahongquan/pythonanywhere_mysite | /static/index.js | UTF-8 | 3,196 | 3.046875 | 3 | [] | no_license | let host = '';
var stringifyPrimitive = function(v) {
switch (typeof v) {
case 'string':
return v;
case 'boolean':
return v ? 'true' : 'false';
case 'number':
return isFinite(v) ? v : '';
default:
return '';
}
};
function queryString_stringify(obj, sep, eq, name) {
sep ... | true |
d2abe3020a881e731f6ec01e636a362054dcde8e | JavaScript | adamsjr8576/flashcards-starter | /src/data.js | UTF-8 | 11,225 | 3.515625 | 4 | [] | no_license | const prototypeData = [{
"id": 1,
"question": "What allows you to define a set of related information using key-value pairs?",
"answers": ["object", "array", "function"],
"correctAnswer": "object"
}, {
"id": 2,
"question": "What is a comma-separated list of related values?",
"answers": ["array", "object",... | true |
93ad201241b1b5fbee181aaa93e2816d57de3377 | JavaScript | Shember/Js | /ejemplo.js | UTF-8 | 607 | 3.671875 | 4 | [] | no_license | /*let faker = require('faker');
let arrayNombres = [];
let nombres = {}
for(let i=0; i<100; i++){
const nombre = faker.name.firstName();
arrayNombres.push(nombre);
nombres[nombre.charAt(0)] = [];
}
for (let i = arrayNombres.length - 1; i >= 0; i--) {
nombres[arrayNombres[i].charAt(0)].push(arrayNombres[i]);
}
co... | true |
1ecebf2b4757749360709e43c422370747ccb679 | JavaScript | MichaelStroet/Programmeerproject2019 | /code/javascript/starsDatasetButtons.js | UTF-8 | 804 | 2.90625 | 3 | [
"MIT"
] | permissive | // Name: Michael Stroet
// Student number: 11293284
function datasetButtons() {
/*
* Creates two buttons for switching datasets
*/
// Create a button for selecting the 'proper name' dataset
d3.select("#properDatasetButton").append("button")
.attr("type", "button")
.attr("class", "... | true |
fbdd0fa65de63cb9dccf4ea74c81b03b0ffbb7be | JavaScript | G3-Code/Hackerrank | /Arrays/Pairs.js | UTF-8 | 1,078 | 3.46875 | 3 | [
"MIT"
] | permissive | //Complete the pairs function below.
// function pairs(k, arr) {
// arr.sort();
// console.log(`sorted array is ${arr}`);
// let diffArr = [];
// let count = 0;
// for (let i = 0, l = arr.length - 1; i < l; i++) {
// diffArr.push(arr[i + 1] - arr[i]);
// // console.log(diffArr);
// var tempCount =... | true |
fcfae35fbdff24061a050650035151e7041ef506 | JavaScript | futurechallenger/react-router-v4-demo | /src/Button.js | UTF-8 | 1,188 | 2.59375 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
class Button extends React.Component {
constructor(props) {
super(props);
this.state = {
clicked: false,
};
}
componentDidMount() {
console.log('Button - componentDidMount');
}
shouldComponentUpdate(nextProps, nextState) {... | true |
dda06efcbd7f733fa7a5be99fd296db4b9e6eaae | JavaScript | Xelaflash/react-sandbox | /src/App.js | UTF-8 | 2,995 | 2.578125 | 3 | [] | no_license | import React from "react";
import { FilterableProductTable } from "./components/FilterableProductTable";
import Greeting from "./components/Greeting";
import Modal from "./components/Modal";
import Hooks from "./components/Hooks";
import ProgressBar from "./components/ProgressBar";
import FetchData from "./components/F... | true |
d7e22feaa216f858762bd42266ad2c84be953f70 | JavaScript | Oksydan/webpack-font-preload-plugin | /src/index.js | UTF-8 | 5,435 | 2.828125 | 3 | [
"MIT"
] | permissive | const RawSource = require("webpack-sources/lib/RawSource");
const JsDom = require("jsdom");
class WebpackFontPreloadPlugin {
constructor(options) {
const defaults = {
// Name of the index file which needs modification
index: "index.html",
// Default font extensions which should be used
e... | true |
c03ad13df6c2a9910b35edb3a27361d7add911d4 | JavaScript | Exairus/FOOD_DIST | /js/tries/incaps.js | UTF-8 | 551 | 3.9375 | 4 | [] | no_license | "use strict";
class User {
constructor(name, age) {
this.name = name;
this._age = age;
}
#surname = 'Petrychenko';
say = () => {
console.log(`Имя пользователя ${this.name}${this.#surname}, возраст ${this._age}`);
}
get userSurname() {
return this.#surname;
... | true |