Skip to content

Instantly share code, notes, and snippets.

View phone_number_formatter.js
import React from 'react';
import logo from './logo.svg';
import './App.css';
class App extends React.Component {
state = {
input: ''
}
handleChangeInput = (e) => {
View a.js
// Feel free to configure any libraries you want to use by clicking the gear icon to the left of "JS", and then clicking on the "Add External Scripts/Pens" dropdown
// Look up any documentation you need
// It's OK to use native Javascript APIs, too!
const cities = [
{
name: 'Boston',
description: 'A city in eastern Massachusetts, the capital of the state, on Massachusetts Bay; pop. 609,023 (est. 2008). It was founded c.1630 by the Massachusetts Bay Company under its governor, John Winthrop(1588–1649). Boston was the scene of many disturbances that led to the American Revolution at the end of the 18th century.'
},
{
View optionRenderer.js
import styles from './PanelDropdown.css';
import React from 'react';
import classnames from 'classnames';
import Dropdown from 'views/shared/Components/DropDown/DropDown';
import { getIconByType } from 'views/shared/Components/SingleEvent/SingleEvent';
const PanelDropdown = (props) =>
<div>
<Dropdown
{...props}
View minimun-distance.js
//var arr = [ 7, 1, 3, 4, 1, 7 ];
//var arr = [1, 2, 3, 4, 10];
//var arr = [20,760,143,550,365,559,539,299,160,955,706,462,329,786,989,867,47,648,171,369,625,975,538,532,973,25,515,395,724,487,618,745,247,113,647,612,24,186,263,537,493,321,999,174,108,988,394,507,988,917,228,613,892,118,497,218,144,13,613,220,500,583,965,748,49,613,712,73,151,976,610,997,297,961,171,757,949,565,616,937,483,844,903,727,963,400,945,459,765,910,31,266,494,997,366,895,962,78,968,465,406,931,814,56,892,338,813,194,255,782,483,90,626,386,818,941,139,115,752,904,26,784,522,872,133,888,767,447,967,87,264,725,370,79,781,263,417,947,809,672,729,292,763,355,31,933,649,522,48,401,426,426,537,301,650,670,189,769,469,508,857,734,234,227,813,15,842,582,314,651,606,43,296,721,751,679,654,400,201,55,153,979,481,691,280,484,713,470,253,183,978,462,269,564,690,434,580,884,16,894,536,622,290,184,696,41,863,350,441,64,757,946,395,239,989,676,75,703,498,328,238,828,791,507,393,833,941,325,717,309,571,605,283,861,141,979,902,4,682,695,420,439,642,
View gateway.js
const crypto = require("crypto");
const NodeTester = require("../index");
// Constants
const TIME_INTERVAL = 15000;
const GATEWAYS = 25;
const MAX_FCOUNT = 10000;
const PACKAGES = 40;
let fcounter = 0;
View InfiniteScroll.js
// PROBLEMA: hacer un infinite scroll y obtener mas datos e agregarlos a la lista
// Initial
$(window).on('scroll', scrollHandler);
function scrollHandler () {
}
// html
View palindrome.js
// PROBLEMA: Checar si una palabra es palindroma o no
// racecar
// car
// dog
function isPalindrome(word) {
return word === word.split('').reverse().join();
}
//que pasa cuando tienes ' racecar'
function isPalindrome(word) {
View objectsTest.js
// Problem
var Foo = function (a) {
function baz () {
return a;
}
this.bar = function () {
return a;
}
};
View taxCalculator.js
const tax = [[0, 0.1],
[1000, 0.2],
[4000, 0.3],
[6000, 0.4],
[6700, 0.6]];
const calcTax = (taxesTable, income) => {
let total = 0;
let index = taxesTable.findIndex((item) => {
View dropdown.js
import React, { Component } from 'react';
import { DateRange } from 'react-date-range';
class Dropdown extends Component {
handleSelect() {
console.log('selected');
// Dispatch and action for change the this.state.
// and know what is the current date range selected
}
render() {