Skip to content

Instantly share code, notes, and snippets.

@cjoudrey
cjoudrey / ASS.md
Created June 3, 2018 16:21 — forked from klaaspieter/ASS.md
Acronyms Seriously Suck - Elon Musk

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.

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
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
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 04:18 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;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 December 27, 2015 13:59
File uploads in Batman

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 September 13, 2012 19:13 — forked from remi/capybara.md
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@cjoudrey
cjoudrey / chef_solo_bootstrap.sh
Created June 16, 2012 16:39 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo (Ubuntu 12.04)
#!/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
language: node_js
node_js:
- 0.6
@cjoudrey
cjoudrey / twitter.js
Created November 5, 2011 16:37
Lazy-rendering in PhantomJS
// 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)