Skip to content

Instantly share code, notes, and snippets.

View AlexEscalante's full-sized avatar
🏠
Working in React, Node, PostgreSQL

Alex Escalante AlexEscalante

🏠
Working in React, Node, PostgreSQL
View GitHub Profile
@AlexEscalante
AlexEscalante / ReactSelectWithAllOption.js
Last active May 7, 2021 13:26
Gives users of the fine component react-select the ability to select all options with a single click.
/**
* react-select + allOption
*
* author: alex.escalante@gmail.com, @alex_escalante
*
* Gives users of the fine component react-select the ability to select
* all options with a single click.
*
* We're basically wrapping react-select but using a special option,
* the "allOption". This option is exclusive of any other option
@AlexEscalante
AlexEscalante / appconfig.js
Last active May 4, 2016 14:39
Ionic build with Browserify, development & production builds with sass, es6 transpiling, minification and more. Standard JS, no semicolons.
module.exports = {
default: {
// versionify will replace the following string with the actual version number
BUILD_VERSION: '__VERSION__'
},
development: {
API_URL: 'http://localhost:3000'
},
production: {
API_URL: 'http://acme.com'
@AlexEscalante
AlexEscalante / life_spec.rb
Last active August 29, 2015 14:14
Conway's Game Of Life
require_relative '../life_window.rb'
RSpec.describe LifeWindow do
describe "#count_around" do
it "counts elements around, not ibcluding, the specified coordinate" do
m1 = Matrix[[false, true, false], [true, true, true], [false, true, false]]
m2 = Matrix[[false, false, false], [true, true, true], [false, true, false]]
m3 = Matrix[[false, false, false], [true, true, true], [false, false, false]]
expect(LifeWindow.count_around(m1, 1, 1)).to eq(4)
puts (1..100).map &-> e { e % 15 == 0 ? :fizzbuzz : e % 3 == 0 ? :fizz : e % 5 == 0 ? :buzz : e }