Skip to content

Instantly share code, notes, and snippets.

@samnm
samnm / ABSpringDemoViewController.m
Created April 20, 2014 03:03
A super-quick clone of Facebook Paper's springy table view
//
// ABSpringDemoViewController.m
// Springy
//
#import "ABSpringDemoViewController.h"
@interface ABSpringDemoViewController () <UITableViewDataSource, UITableViewDelegate> {
UITableView *_tableView;
CADisplayLink *_displayLink;

Keybase proof

I hereby claim:

  • I am samnm on github.
  • I am sam (https://keybase.io/sam) on keybase.
  • I have a public key whose fingerprint is F8E6 586A 8125 EE52 F479 155E E192 3B97 C95F 5994

To claim this, I am signing this object:

@samnm
samnm / quine.go
Created December 11, 2012 22:24
A super simple quine written in Go. This takes advantage of the '%q' format verb to print strings as they are represented in source. Run `go run quine.go | diff quine.go -` to diff the output and source.
package main
import "fmt"
func main() {
s0 := "package main\n\nimport \"fmt\"\n\nfunc main() {\n\ts0 := %q\n\tfmt.Printf(s0, s0)\n}\n"
fmt.Printf(s0, s0)
}
@samnm
samnm / Octocat!
Created November 28, 2012 00:47
Put this at the end of your .bash_profile
cat ~/.octocat
(curl https://api.github.com/octocat > ~/.octocat &) 2> /dev/null