Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel H Pugliese gabrielhpugliese

View GitHub Profile
View entry.js
{
heating: [
{
cost: 4.11,
date: 'Di.'
},
{
cost: 4.11,
date: 'Mi.'
},
View genesis_public_key
04ea31fa598b02dcad3fff9b55f7bbae770728a192332fddb5e22e77bfac37cf73c767a571926b42588715d45c13dde1e27b79c5e0dca9c802d1709f718bcdd430;rabc
View remove.js
import {
compose,
findIndex,
pullAt,
curry,
} from 'lodash/fp';
const MY_LIST = [/* items here */];
const removeFromList = curry((itemToRemove, list) => compose(
View find2.js
import {
compose,
findIndex,
cond,
} from 'lodash/fp';
const MY_LIST = [/* items here */];
const findMyItemIndex = findIndex(item => item === 'MY_ITEM');
const changeItemToSomething = () => // returns NEW object (immutable)
View find.js
import {
compose,
findIndex,
cond,
} from 'lodash/fp';
const MY_LIST = [/* items here */];
const findMyItemIndex = findIndex(item => item === 'MY_ITEM');
const changeItemToSomething = () => // returns NEW object (immutable)
View methods.js
class A {
constructor(){
this.method3 = this.method3.bind(this);
}
method1() {
}
method2 = () => {
}
View gist:51e2aee90acb457ea0adc548c3df8dae
------------------
System Information
------------------
Serial Number: 9S7179111077ZF5000145
Product Name: GE72 2QF
OS: Microsoft Windows 10 Home 64-bit
Windows Product Key: 8HVX7
HDI Build: non-OEM
BIOS Version: E1791IMS.113
BIOS Release Date: 2016/04/19
View gist:d9d5fa251d397f5d9e5ee3513e9947fa
> require.extensions['.svg'] = () => 1;
[Function]
> var bla = require('../icons/icon-close.svg')
undefined
> bla
{}
@gabrielhpugliese
gabrielhpugliese / bench.txt
Last active Dec 13, 2018
Python 3.4 asyncio + aiohttp parallel vs sequential requests
View bench.txt
$python parallel.py
[13:48:59:130701] Doing GET request to http://google.com
[13:48:59:134958] Doing GET request to http://facebook.com
[13:48:59:135498] Doing GET request to http://twitter.com
[13:48:59:136174] Doing GET request to http://slack.com
****** STATUSES: [{'status': 200, 'url': 'http://google.com'}, {'status': 200, 'url': 'http://twitter.com'}, {'status': 200, 'url': 'http://slack.com'}, {'status': 200, 'url': 'http://facebook.com'}]
$python sequential.py
[13:49:04:078752] Doing GET request to http://google.com
[13:49:04:232725] Doing GET request to http://facebook.com
View form.jsx
<form
onSubmit={handleSubmit(values => (
new Promise((resolve, reject) => {
// errorsForm returns an Object where keys are fields with errors and values are messages to show in form.
const errors = this.errorsForm(values);
if (! isEmpty(errors)) {
return reject(errors);
}
You can’t perform that action at this time.