Skip to content

Instantly share code, notes, and snippets.

View wileywimberly's full-sized avatar

Wiley Wimberly wileywimberly

View GitHub Profile
@wileywimberly
wileywimberly / add2readinglist.scpt
Created August 1, 2011 21:27
Automator Service - Add to Reading List - lax version
--
-- Automator Service - Add to Reading List - lax version
--
-- http://warmfuzzyapps.com/2011/07/add-to-reading-list-lax-version/
-- Wiley Wimberly <wiley@warmfuzzyapps.com>
--
-- The default service that adds links to Safari's Reading List is a
-- bit on the strict side when deciding what constitutes a URL and it
-- doesn't work well for adding shortened URLs from apps like twitter.
-- This version is more tolerant and will prepend http:// if the
hippies $ hugo new site highmaintenancehippies.com
hippies $ cd highmaintenancehippies.com/
highmaintenancehippies.com $ git init
highmaintenancehippies.com $ git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke
highmaintenancehippies.com $ echo 'theme = "ananke"' >> config.toml
highmaintenancehippies.com $ vim config.toml
highmaintenancehippies.com $ hugo new posts/hello-world.md
highmaintenancehippies.com $ vim content/posts/hello-world.md
highmaintenancehippies.com $ hugo server -D
@wileywimberly
wileywimberly / gist:1171553
Created August 25, 2011 19:20
stringByEvaluatingJavaScriptFromString: example
NSString *js = @"document.getElementById('output').innerHTML = 'hello from Objective-C';";
NSString *res = [webView stringByEvaluatingJavaScriptFromString:js];
NSLog(@"%@", res);
@wileywimberly
wileywimberly / BNRLine.h
Last active August 29, 2015 14:01
Map a value from one range to another. In this example map the angle of a line to a hue.
#import <Foundation/Foundation.h>
@interface BNRLine : NSObject
@property (nonatomic) CGPoint begin;
@property (nonatomic) CGPoint end;
- (CGFloat)angleInRadians;
- (CGFloat)angleInDegrees;