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 / 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 / functional-spec.md
Last active June 29, 2019 02:35
Sundly Sharing (read-only)

User Story

  • Alice adds Bob as a contact
  • Alice shares his data with Alice
  • Bob now can see Alice Profile & Timeline (timestamped) in their contacts

Mockups

[ Bob.id ](link-to-user-profile/timeline) [Share icon]
@benoror
benoror / xor_validation.md
Last active May 17, 2019 19:13
Rails Model XOR Validation for "Custom" fields

XOR Validation

validate :disease_or_custom_disease

#...

private
def disease_or_custom_disease
  custom_disease.blank? ^ disease_id.blank?
@benoror
benoror / LIST.md
Last active February 26, 2019 05:05
JSON:API (jsonapi.org) resources for React + Redux
@benoror
benoror / draft_rfc_tech_spec_custom-forms-2.5.md
Last active January 18, 2018 03:15
(DRAFT) Pre-Tech Spec: Custom Forms 2.5

(DRAFT) Pre-Tech Spec: Custom Forms 2.5

ARCHITECTURE


As-is Now

img_20170406_122039339

Verifying my Blockstack ID is secured with the address 1DAj3qXbJRVG6WTSAJv7DSSN6f5uVwFqBG https://explorer.blockstack.org/address/1DAj3qXbJRVG6WTSAJv7DSSN6f5uVwFqBG

Tech Spec: Cumulus Alpha 0.1

Summary

As explained in the original purpose doc, Cumulus aims to provide a centralized way for sharing health records in a way that a diversity of systems (a.k.a. consumers) can pull & push patient data in an organized way, thus keeping the health records updated and relevant throughout different healthcare providers and the patient itself.

TL;DR; Digital health information should follow the patient throughout modern healthcare providers, and not the other way around

Technology / Components Architecture

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@benoror
benoror / model.json
Last active January 13, 2017 09:09
angular-formly with bootstrap's nav tabs (multiple formly-form)
{
"form": [
{
"type": "tabset",
"tabs": [
{
"title": "tab1",
"fields": [...]
},
{