Skip to content

Instantly share code, notes, and snippets.

View cherta's full-sized avatar

Gabriel Chertok cherta

View GitHub Profile
@cherta
cherta / gulpfile.js
Last active March 11, 2019 06:05 — forked from chriskjaer/gulpfile.js
Gulp recipe: Jade, Stylus, CoffeeScript (and JavaScript), Livereload and static serve
var gulp = require('gulp'),
gutil = require('gulp-util'),
styl = require('gulp-styl'),
inline = require('rework-inline'),
csso = require('gulp-csso'),
uglify = require('gulp-uglify'),
jade = require('gulp-jade'),
coffee = require('gulp-coffee'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'), // Livereload plugin needed: https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
@cherta
cherta / index.md
Last active November 8, 2015 16:30
De partidos y oráculos

Van 15' del segundo tiempo en el estadio Centenario, hace media hora Darío Rodríguez conectaba en el medio del área un corner que bajó justo y entre gallos y medias luces en un partido feo Peñarol se puso 1 a 0.

Es 26 de Mayo del 2011 y yo estoy agarrándole la mano a mi padre cual gurí de 8 años cuando lo miro con cara seria, y le hago prometer, le hago jurar que estos tipos vestidos de blanco y azul no nos iban a clavar, que íbamos a ir al estadio José Amalfitani con este unito a cero.

Mi padre, -que supongo- hasta ese día jamás me había mentido me dice: "quedate tranquilo que termina así" y yo, lejos de tranquilizarme, ahora me preocupo el doble, ya no sólo por el resultado, si no, fundamentalmente por que que mi viejo no se equivoque en su profecía.

El fútbol es de las pocas cosas que te comprometen con la batalla al mismo nivel que con el oráculo que la vaticina, por eso es importante elegir bien a que oráculo preguntarle.

@cherta
cherta / action-and-test.js
Last active December 27, 2015 23:35
Testing async actions on redux without following the manual - gist 1
// src/actions.js
export function addTodo (todo) {
return { type: 'ADD_TODO', todo: todo }
}
// test/actions.js
import test from 'tape'
import * as actions from '../src/actions'
test('addTodo action creator', function () {
@cherta
cherta / async-action.js
Last active December 27, 2015 23:34
Testing async actions on redux without following the manual - gist 2 Raw
export function getPost(postId) {
return function (dispatch, getState) {
$
.getJSON('/posts/' + posotId)
.done(function (postData) {
dispatch( { type: 'SHOW_POST', post: postData } )
})
.fail(function (postData) {
dispatch( { type: 'SHOW_ERROR' } )
})
@cherta
cherta / async-action-with-test.js
Created December 28, 2015 00:00
Testing async actions on redux without following the manual - gist 3
// src/actions.js
export function getPost(postId) {
return function (dispatch, getState) {
$
.getJSON('/posts/' + posotId)
.done(function (postData) {
dispatch( { type: 'SHOW_POST', post: postData } )
})
.fail(function (postData) {
dispatch( { type: 'SHOW_ERROR' } )
@cherta
cherta / actionCreators.js
Created January 19, 2016 17:19
redux-simple-router and sagas
export function retrieve(nodeId) {
return { type: 'RETRIEVE_NODE', payload: { nodeId: nodeId } }
}
export function show(nodes) {
return { type: 'SHOW_NODE', payload: { nodes: nodes } }
}
@cherta
cherta / sagas.js
Last active January 29, 2016 14:35
Sagas
import { routeActions, UPDATE_LOCATION } from 'redux-simple-router'
import { take, put, fork, call } from 'redux-saga'
import { show, retrieve } from './actionCreators'
/*
* Small tree structure in a plain hash that works as my backend server.
*/
const fakeDB = {
'/': [
{ id: '/1',
@cherta
cherta / index.md
Created May 9, 2016 03:02
OC README feedback

Hi Matteo!

I've been playing with OC and I wanted to share with you how the doc could be improved to help people better grasp the concepts.

I will personally delay explaining how to set up a registry as far as I can in the learning process. To me the dev registry works great for testing the technology and avoids people going to S3, setting up infrastructure, etc.

Another thing I came across while testing is that I understand how to create components but combine them together is not so well explained, I can imagine it is acheived by creating a 'bigger' component, but who knows, maybe I'm missing something.

In conclussion, I will approach the doc the following way:

@cherta
cherta / index.md
Last active June 16, 2016 14:40
Mañana en el abasto

Volvía yo una madrugada, más melancólico que borracho remotando esas callecitas de San Telmo cuando me encuentro con un pibe, otro yo. Borrachos y melancólicos caminamos juntos como viejos amigos que vienen de darle pelea a la noche, de darle pelea y perder por goleada.

La noche se hacía día y él o yo, vaya a saber quien, arrancó con "mañana de sol..." y fue cantar hasta Estados Unidos o Independencia donde cada uno siguió cantando por su lado.

Mañana en el Abasto, una canción que se instala en la cabeza y se repite, en loop vinílico con su ritmo cancino y su batería repiqueteando el tono monocorde de Luca, mientras él escucha el tren y baja al subsuelo para (re)descubrir nuestra historia; nuestra única identificación de lugar y momento, esa nación redentora de embajadas en cada esquina, el barrio.

@cherta
cherta / reducer.js
Last active June 18, 2016 15:52
Sample reducer
const initialState = {
token:: null,
tokenIsExpired: false,
errors: [],
profile:null,
loading: false
}
export default function auth(state = initialState, action) {
switch(action.type) {