Skip to content

Instantly share code, notes, and snippets.

@cjoudrey
cjoudrey / ASS.md
Created Jun 3, 2018 — forked from klaaspieter/ASS.md
Acronyms Seriously Suck - Elon Musk
View ASS.md

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

View example_trace.rb
file = File.open('graph.dot', 'w')
CodeMapper.trace(filter: /^GraphQL/, start_at: 'GraphQL::Query.valid?',
max_depth: 4, output: CodeMapper::Output::Dot.new(file)) do
ExampleGraphQLSchema.execute(query_string)
end
file.close
View tracepoint.rb
class Dog
def initialize; end
def bark; end
end
trace = TracePoint.new(:call, :return) do |tp|
p [tp.event, tp.defined_class, tp.method_id]
end
trace.enable do
View bpf.go
package main
import (
"fmt"
"github.com/google/gopacket"
"github.com/google/gopacket/pcap"
)
func main() {
handle, err := pcap.OpenLive("en0", 1600, true, pcap.BlockForever)
@cjoudrey
cjoudrey / SMBDIS.ASM
Created May 30, 2017 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
View SMBDIS.ASM
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@cjoudrey
cjoudrey / README.md
Last active Dec 27, 2015
File uploads in Batman
View README.md

File uploads in Batman

Problem

When you use input type="file" in Batman, the change event is observed and node.files is used to obtain the file when it changes.

In browsers that do not support the FileReader API node.files will be undefined.

Strategy used in Shopify

@cjoudrey
cjoudrey / capybara.md
Created Sep 13, 2012 — forked from remi/capybara.md
RSpec Matchers
View capybara.md

Capybara

save_and_open_page

Matchers

have_button(locator)
@cjoudrey
cjoudrey / chef_solo_bootstrap.sh
Created Jun 16, 2012 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo (Ubuntu 12.04)
View chef_solo_bootstrap.sh
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
make install
View .travis.yml
language: node_js
node_js:
- 0.6
@cjoudrey
cjoudrey / twitter.js
Created Nov 5, 2011
Lazy-rendering in PhantomJS
View twitter.js
// This example shows how to render pages that perform AJAX calls
// upon page load.
//
// Instead of waiting a fixed amount of time before doing the render,
// we are keeping track of every resource that is loaded.
//
// Once all resources are loaded, we wait a small amount of time
// (resourceWait) in case these resources load other resources.
//
// The page is rendered after a maximum amount of time (maxRenderTime)