Skip to content

Instantly share code, notes, and snippets.

View juliobetta's full-sized avatar
🎧

Julio Betta juliobetta

🎧
View GitHub Profile
// serverEvents.js
export function FOO_CREATED (event) {
return {
type: 'RECEIVE_FOO',
payload: {
foo: event.foo
}
}
}
@zabirauf
zabirauf / expng.ex
Created July 23, 2015 08:32
PNG format Parser in Elixir
defmodule Expng do
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks]
def png_parse(<<
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
_length :: size(32),
"IHDR",
width :: size(32),
height :: size(32),
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active May 17, 2026 22:03
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
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, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@Dr-Nikson
Dr-Nikson / README.md
Last active April 23, 2026 07:17
Auth example (react + redux + react-router)
@maxivak
maxivak / 00_readme.md
Last active September 16, 2020 15:52
God + Resque or Sidekiq for multiple applications in Rails
@chantastic
chantastic / on-jsx.markdown
Last active May 22, 2026 08:30
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't

@holgergp
holgergp / flatMapTest.sc
Last active December 15, 2020 13:45
Some fiddling with map, flatMap and foldLeft on Collections, Strings and Option. Trying to understand the generic monadic approach
object flatMapTest {
import scala.util.{ Try, Success, Failure }
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
val intList = 1 :: 2 :: 5 :: Nil //> intList : List[Int] = List(1, 2, 5)
intList.map(x => x * 2) //> res0: List[Int] = List(2, 4, 10)
//intList.flatMap(x=>x*2) //type mismatch; found : Int required: scala.collection.GenTraversableOnce[?]
intList.foldLeft(0)((x, y) => x + y) //> res1: Int = 8
val stringList = "eins" :: "zwei" :: "drei" :: Nil
@Fishrock123
Fishrock123 / gulp.js
Last active August 13, 2025 15:59
gulp & browserify (+watchify +babelify)
var gulp = require('gulp')
var browserify = require('browserify')
var watchify = require('watchify')
var babelify = require('babelify')
var source = require('vinyl-source-stream')
var buffer = require('vinyl-buffer')
var merge = require('utils-merge')
@torgeir
torgeir / react-scaled-file-upload.js
Created March 25, 2015 12:16
React scaled file upload
function resize (file, maxWidth, maxHeight, fn) {
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function (event) {
var dataUrl = event.target.result;
var image = new Image();
image.src = dataUrl;
image.onload = function () {

2015-01-29 Unofficial Relay FAQ

Compilation of questions and answers about Relay from React.js Conf.

Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.

What is Relay?

Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).