Skip to content

Instantly share code, notes, and snippets.

@tmaybe
tmaybe / README.md
Last active September 26, 2018 08:05
Scrubbable Moving Image

A simulated scrubbable animated gif.

Mouse over the video to scrub it. Works by rapidly changing the position of a jpeg sprite sheet in the background of a div.

Inspired by GIFCTRL

@tmaybe
tmaybe / gist:5357731
Created April 10, 2013 19:34
Snippet for a quick UIButton in Objective-C
UIButton *tmpButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
tmpButton.frame = CGRectMake(0, 0, 100, 50);
[tmpButton addTarget:self action:@selector(pressButton:) forControlEvents:UIControlEventTouchUpInside];
[tmpButton setTitle:@"TEST" forState:UIControlStateNormal];
[self.view addSubview:tmpButton];
@tmaybe
tmaybe / parse.py
Created February 24, 2013 05:02
Simple Python script for reading from a file, changing something about it with a regular expression, and writing the result to a new file.
import re
read_in = open("original.plist")
write_out = open("new.plist","w")
minus = 280
pat = re.compile('\t\t\t\t<real>([0-9]*)<')
for line in read_in:
mo = pat.search(line)
if mo:
value = int(mo.group(1))