Skip to content

Instantly share code, notes, and snippets.

View timarnold's full-sized avatar

Tim Arnold timarnold

View GitHub Profile
@timarnold
timarnold / gist:3151932
Created July 20, 2012 17:08
TextExpander Snippet (using AppleScript) to open the currently visible page in Safari in Chrome
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
if appIsRunning("Google Chrome") then
tell application "Google Chrome"
make new window
set URL of active tab of window 0 to theURL
activate
end tell
@timarnold
timarnold / gist:4111052
Created November 19, 2012 14:50
TextExpander Snippet (using AppleScript) to open Wikipedia’s page of a TV show’s episode list using DuckDuckGo
tell application "Safari"
make new document at end of documents
set url of document 1 to "http://duckduckgo.com/?q=\\list+of+episodes+wiki+%fill:Show Name%"
end tell
return " "
@timarnold
timarnold / gist:4111071
Created November 19, 2012 14:52
TextExpander Snippet (using AppleScript) to open Wikipedia’s page of a TV show’s episode list using Google
tell application "Safari"
make new document at end of documents
set url of document 1 to "http://www.google.com/search?q=list of episodes wiki %fill:Show Name%&btnI=Im+Feeling+Lucky"
end tell
return " "
@timarnold
timarnold / Alfred-Pinboard-Safari.applescript
Last active July 7, 2019 12:37
Inspired by Tim Bueno (http://www.timbueno.com/2012/06/27/pinboard-plus-alfred), this is an AppleScript script for Alfred to save the front-facing tab in Safari (or Chrome) to Pinboard with some tags, and get a success or failure notification from Notification Center.
-- ***********************************
-- Many thanks to Tim Bueno at http://www.timbueno.com/2012/06/27/pinboard-plus-alfred
-- for the inspiration to create this script.
-- ***********************************
on alfred_script(q)
try
-- Set this to be your Pinboard token, found here: https://pinboard.in/settings/password
set token to "MY_PINBOARD_TOKEN"
@timarnold
timarnold / gist:5337684
Last active December 15, 2015 23:08
CADisplayLink setup
CADisplayLink *link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update:)];
link.frameInterval = 60; // every 60 frames = 1 second send the update: message
link.paused = NO; // default is NO
[link addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
- (void)update:(CADisplayLink *)displayLink {
// Do all the things!
}
Game with Javier Soto Bustos
played with Tall Chess
1. d4 d5
2. c4 e6
3. ♘f3 ♞c6
4. ♘c3 ♝b4
5. ♕c2 ♞f6
6. a3 ♝xc3+
7. bxc3 0–0
@timarnold
timarnold / Star.m
Last active December 19, 2015 13:29
UIImage *im = [UIImage imageNamed:@"8n2ty.jpg"];
UIImageView *iv = [[UIImageView alloc] initWithImage:im];
[self.view addSubview:iv];
CGFloat w = im.size.width / 2.;
CGFloat h = im.size.height / 2.;
UIImage *q1, *q2, *q3, *q4;
CGRect r1 = CGRectMake(0, 0, w, h);
CGRect r2 = CGRectMake(w, 0, w, h);
CGRect r3 = CGRectMake(0, h, w, h);

ReactiveCocoa

A lot is being written these days about ReactiveCocoa and the paradigms it introduces. In my opinion, there are only two sides giving their opinion: the ones that know a lot about it and are therefore obviously biased, and the ones that refuse to learn it.

I decided to write something myself because I think I'm right in the middle. A few months ago I knew nothing about it, and now I know enough to want to use it every day. I hope that by not being an expert, I can actual introduce a few really simple ideas in a much easier way to pick up by newcomers, to show why I think ReactiveCocoa is an incredibly powerful tool to help us write better, cleaner, and more maintainable code.

It's signals all the way down

The base of everything that happens in ReactiveCocoa is signals. I'm going to try to explain what they represent and why they fit in the way we think about what happens on an app. A lot of the things you may read about Functional Reactive Programming end up confusing you when t

require 'rubygems'
require 'json'
require 'cgi'
require "net/http"
require "uri"
# Find your store here: http://www.ifoapplestore.com/store-number-list/
stores =
{
"Towson" => "R063",

Keybase proof

I hereby claim:

  • I am timcamber on github.
  • I am timcamber (https://keybase.io/timcamber) on keybase.
  • I have a public key whose fingerprint is CFB3 7C3F 33A3 9FEF 176D 9842 5293 C403 EEE0 C3C8

To claim this, I am signing this object: