Skip to content

Instantly share code, notes, and snippets.

View marcuswestin's full-sized avatar

Marcus Westin marcuswestin

  • New York
View GitHub Profile

Keybase proof

I hereby claim:

  • I am marcuswestin on github.
  • I am marcuswestin (https://keybase.io/marcuswestin) on keybase.
  • I have a public key whose fingerprint is D640 9FCE E76E 8614 3617 BA7E 3CE0 9344 0879 EB0D

To claim this, I am signing this object:

location ~ ^/log/(\w+)/(\w+) {
set $log_component '$1';
set $log_level '$2';
access_log logs/$log_component-$log_level.log;
proxy_pass http://127.0.0.1:15000/ok?$1;
}
# Logging service
#################
log_format component_log '[$log_component $time_iso8601 $log_level] $request_body';
server {
listen 127.0.0.1:15000;
server_name localhost;
error_log logs/log-error.log;
access_log logs/log-access.log;
location = /log/api/alert {
set $log_component 'api'; set $log_level 'ALERT!!';

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@marcuswestin
marcuswestin / react-without-jsx.js
Created February 12, 2015 14:34
React.js without jsx
lightbox.Show({
closable: true,
content: div(W(240),
div(Fill,
div('How did it go?', Font(18)),
div(style({ margin:px(8,0) }),
div(style({ border:'1px solid #666', marginBottom:24+8, borderRadius:4 }),
textarea(id('EndChatComment'), style({ margin:4, width:'90%', border:'none', resize:'none', height:80 }))
)
)
@marcuswestin
marcuswestin / git-checkout-force.sh
Created February 6, 2015 16:59
Git checkout --force (checkout, or create if it doesn't exist)
(git show-branch foo1 &>/dev/null) && (git checkout foo1) || (git checkout -b foo1)
# ASAPP stuff
#############
# awsm prompt. Optional
PS1="\n\w λ "
# Change this next line to wherever your ASAPP repo is/will be
export ASAPP_REPO=${HOME}/code/asapp
# brew
export PATH=/usr/local/bin:$PATH
# mysql
export PATH=/usr/local/mysql/bin:$PATH
class Foo:
def __init__(self):
self.bar = Bar()
class Bar:
def __init__(self):
pass
foo = Foo()
print foo.bar
@marcuswestin
marcuswestin / class-within-class.py
Created December 19, 2014 18:40
class within class
class Foo:
class Bar:
def __init__(self):
pass
def __init__(self):
self.bar = Foo.Bar()
foo = Foo()
print foo.bar
@marcuswestin
marcuswestin / gist:9a8154cb97c03b5243db
Created December 12, 2014 02:49
How to paint walls fast, without tape
First, corners and edges (same as with windows really):
https://www.youtube.com/watch?v=g-uBQrbs6Ls
Then, the walls:
https://www.youtube.com/watch?v=bvJ90XnO2KM