Skip to content

Instantly share code, notes, and snippets.

View benoror's full-sized avatar
🌀
In a quantum state between coding and procrastinating

Ben Orozco benoror

🌀
In a quantum state between coding and procrastinating
View GitHub Profile
@benoror
benoror / README.md
Created May 13, 2022 17:06 — forked from tannerlinsley/README.md
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

@benoror
benoror / export_base_meta_from_airtable.js
Created December 10, 2020 05:37 — forked from wassim/export_base_meta_from_airtable.js
Export base meta data from Airtable
const fda = ( fields ) => {
let data = []
for(const f of fields ){
data.push(fd(f))
}
return data
}
const fd = ( field ) => {
let data = {
@benoror
benoror / README.md
Created September 23, 2020 15:53 — forked from ggondim/README.md
Airtable schema API request

Airtable Schema API

Replace the variables below in the script

  • YOURBASEID: your Airtable base ID starting with 'app...'
  • YOURCOOKIESFORAIRTABLEDOMAIN your browser cookie for airtable.com domain
@benoror
benoror / latency.markdown
Created September 1, 2019 04:48 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@benoror
benoror / 00_Heroku-Release-Phase-Review-Apps-Rails_README.md
Created July 9, 2019 21:01 — forked from stevenharman/00_Heroku-Release-Phase-Review-Apps-Rails_README.md
Heroku Release Phase script for managing Rails DB migrations, and playing nice with Review Apps and postdeploy scripts

Heroku Release Phase + Review Apps + Rails

This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps. Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:

  1. Fail, loudly, if the DB does not yet exist.
  2. Load the DB schema if the current schema version (as determined by bin/rails db:version) is 0.
  3. Run DB migrations otherwise.

For a "normal" app that usually means it will run the DB migrations.

@benoror
benoror / array.js
Last active October 3, 2016 07:13 — forked from NuckChorris/array.js
In Ember-CLI, transforms are located in app/transforms/name.js
// app/transforms/array.js
import Ember from 'ember';
import DS from 'ember-data';
export default DS.Transform.extend({
deserialize: function(value) {
if (Ember.isArray(value)) {
return Ember.A(value);
} else {
return Ember.A();
@benoror
benoror / Rails Console Actionmailer test.rb
Last active November 20, 2016 00:57 — forked from tansengming/Rails Console Actionmailer test.rb
Rails Console Actionmailer test
# Copy and paste this to the rails console to test your email settings
class MyMailer < ActionMailer::Base
def test_email
set_tracking_headers 'test_campaign'
@recipients = "benoror@gmail.com"
@from = "Equipo Nimbo X <hola@" + Rails.application.secrets.sparkpost_domain + ">"
@subject = "sparkpost email test with open & click tracking"
@body = "This is a test email. With a <a href=\"http://blog.nimbo-x.com/nimbo-x-gold/\">test link</a>."
@benoror
benoror / adapters.application.js
Created April 12, 2016 23:16 — forked from Serabe/adapters.application.js
Country/States Cascaded
import DS from 'ember-data';
const ActiveModelAdapter = DS.ActiveModelAdapter;
const ApplicationAdapter = ActiveModelAdapter.extend({
shouldReloadAll: function(store, snapshotRecordArray) {
return true;
},
shouldBackgroundReloadRecord: function(store, snapshot) {
return false;
@benoror
benoror / adapters.application.js
Last active April 12, 2016 22:19 — forked from Gaurav0/application.route.js
Country/States Cascaded
import DS from 'ember-data';
const ActiveModelAdapter = DS.ActiveModelAdapter;
const ApplicationAdapter = ActiveModelAdapter.extend({
shouldReloadAll: function(store, snapshotRecordArray) {
return true;
},
shouldBackgroundReloadRecord: function(store, snapshot) {
return false;
@benoror
benoror / README.md
Created December 16, 2015 00:42 — forked from kentcdodds/README.md
upload-file

upload-file angular-formly type

This is my upload-file type for what I use at work. We use angular-upload for the upload service to do the actual file uploading. We also have several abstractions and use ES6 that may confuse you a little bit (sorry about that). Hopefully this gets you started though.