Skip to content

Instantly share code, notes, and snippets.

View lucky's full-sized avatar
🇺🇦

Jared Harper lucky

🇺🇦
View GitHub Profile
@lucky
lucky / 22-rules.md
Last active June 12, 2018 15:14
Pixar's 22 Rules of Storytelling

Pixar's 22 Rules of Storytelling

  1. You admire a character for trying more than for their successes.

  2. You gotta keep in mind what's interesting to you as an audience, not what's fun to do as a writer. They can be v. different.

  3. Trying for theme is important, but you won't see what the story is actually about til you're at the end of it. Now rewrite.

  4. Once upon a time there was ___. Every day, ___. One day ___. Because of that, ___. Because of that, ___. Until finally ___.

Keybase proof

I hereby claim:

  • I am lucky on github.
  • I am lucky (https://keybase.io/lucky) on keybase.
  • I have a public key ASCxvq7c46zLBP1ZwgO16dWp9cCONflB_vfraMNbzILH3Qo

To claim this, I am signing this object:

Broadcast message from root (Wed Feb 1 01:26:28 2012):
8=======D
scala> var foo:Object = null
foo: java.lang.Object = null
scala> foo
res0: java.lang.Object = null
scala> foo = new Object
foo: java.lang.Object = java.lang.Object@3b7c680
scala> foo
import time
def doit(sec):
time.sleep(sec)
for i in range(100):
print '\a'
time.sleep(0.5)
doit(240) # 4 minutes
@lucky
lucky / http_echo.py
Created December 16, 2010 00:22
Returns back exactly what you sent. Requires eventlet.
import eventlet
import traceback
from eventlet.greenio import socket
CRLF = "\r\n"
CRLF_2 = CRLF * 2
def _handler(sock, addr):
print "Got client on %s" % (addr,)
sock.settimeout(10)
@lucky
lucky / .vimrc
Created December 14, 2010 21:18
Make vim indent 2 spaces for ruby and scala files only
" Make vim indent 2 spaces for ruby and scala files only
filetype plugin indent on
set sw=4
set ts=4
:autocmd Filetype ruby set softtabstop=2
:autocmd Filetype ruby set sw=2
:autocmd Filetype ruby set ts=2
:autocmd Filetype scala set softtabstop=2
:autocmd Filetype scala set sw=2
def get_logger(name, level=logging.DEBUG):
logging.basicConfig(level=level)
return logging.getLogger(name)
# Why did I ever write this?
require 'rubygems'
require 'eventmachine'
module MyClient
def receive_data data
puts "Got back: #{data}"
end
$ ruby foo.rb
HURR
Hi there!
wat