Skip to content

Instantly share code, notes, and snippets.

@ltk
ltk / instructions.txt
Created Mar 9, 2018
[SXSW] React Native Workshop Instructions
View instructions.txt
Hi folks,
Thanks for RSVPing to the “Building iOS & Android Apps with React Native” workshop at SXSW!
This workshop is built around technical exercises. In order to participate in these exercises, we ask that you:
- Bring a computer and either an iOS or Android device with you to the workshop
- Install XDE (https://docs.expo.io/versions/latest/introduction/installation.html) on your computer before you arrive
- Install the Expo app (https://expo.io/tools#client) on your iOS or Android device before you arrive
Thanks, and we look forward to seeing you all Sunday!
@ltk
ltk / keybase.md
Created Aug 9, 2016
Keybase Proof
View keybase.md

Keybase proof

I hereby claim:

  • I am ltk on github.
  • I am ltk (https://keybase.io/ltk) on keybase.
  • I have a public key whose fingerprint is 3645 8287 A73B B0A6 8876 40F8 A6C4 FAE0 A291 54CE

To claim this, I am signing this object:

@ltk
ltk / notes.md
Last active Feb 10, 2016
Dev Lab Leadership | Alternative Structure
View notes.md

Ideas

Cabinet

2-3 elected & termed cabinet positions distribute management work typically assigned to managing director

  • Secretary of Staffing (POC for all staffing related affairs... could be combined with Sec of State, but probably would be too much)
  • Secratary of the Interior (leads internal team initiatives)
  • Secretary of State (ambassador to the rest of the company)
@ltk
ltk / test-processes.js
Created Feb 2, 2016
BaaS at Scale | Load Test Process Spawning
View test-processes.js
const spawn = require('child_process').spawn
// How many connections to build with Firebase
const maxChildren = 1250
// How long to keep child processes alive
const timeout = 10 * 60 * 1000 // 10 minutes
for (var i = 0; i < maxChildren; i++) {
// your-test.js should contain your application-specific test
@ltk
ltk / update-subscriptions.js
Created Feb 2, 2016
BaaS at Scale | Update Subscription Granularity
View update-subscriptions.js
// Method 1: High Data Usage
// =========================
const rootReference = new Firebase(firebaseUrl)
const itemsReference = rootReference.child('items')
itemsReference.on('value', function(data) {
// Update the UI with the items update
})
@ltk
ltk / rules.json
Last active Dec 9, 2015
puppy bowl firebase rules
View rules.json
{
"rules": {
".read": false,
".write": false,
"broadcast": {
".read": true,
".write": "root.child('users/' + auth.uid + '/admin').val() === true"
},
@ltk
ltk / post.md
Last active Aug 29, 2015
Connor Lay Blog Post 08/2015
View post.md

Slimming Down Your Models and Controllers with Concerns, Service Objects, and Tableless Models.

The Single Responsibility Principle

“A class should have one, and only one, reason to change.” - Uncle Bob

The single responsibility principle asserts that every class should have exactly one responsibility. In other words, each class should be concerned about one unique nugget of functionality, whether it be User, Post or InvitesController. The objects instantiated by these classes should be concerned with sending and responding to messages pertaining to their responsibility and nothing more.

Fat models, thin controllers

@ltk
ltk / responder.rb
Created Apr 6, 2015
Graba Slack Responder
View responder.rb
class Slack::Responder
def initialize(message)
@message = message
end
def respond?
response.present?
end
@ltk
ltk / _demo.js
Last active Aug 29, 2015
Web Audio Handbell Sound Component
View _demo.js
window.AudioContext = window.AudioContext || window.webkitAudioContext
var Bell = require('./Bell')
var bell = new Bell( new AudioContext() )
bell.ring('c4')
@ltk
ltk / config
Created Aug 5, 2014
Split Test Load Balancer Nginx Configuration
View config
map $split_test_cookie_name $split_test_cookie {
default $cookie_split_test_version;
}
upstream app.com {
server old.app.com;
}
split_clients "app${remote_addr}${http_user_agent}${date_gmt}" $upstream_variant {
10% "test";
You can’t perform that action at this time.