Skip to content

Instantly share code, notes, and snippets.

View dylanbeadle's full-sized avatar

Dylan Beadle dylanbeadle

View GitHub Profile
@wmerrifield
wmerrifield / build+archive.sh
Created November 8, 2010 17:53
A shell script to perform the equivalent of Xcode's "Build & Archive" command.
#!/bin/sh
#
# Copyright (c) 2010 Warren Merrifield
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@MonsieurDart
MonsieurDart / MFMailComposeViewController+URLRequest.h
Created January 20, 2011 15:46 — forked from futuretap/WebViewController.m
Intercept mailto URLs in a UIWebView and send them to a MFMailComposeViewController
#import <Foundation/Foundation.h>
#import <MessageUI/MessageUI.h>
@interface NSURL (MailComposeViewController)
// Is the given request a mailto URL.
- (BOOL)isMailtoRequest;
@end
@cjus
cjus / jsonval.sh
Created June 26, 2011 17:42
Extract a JSON value from a BASH script
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`
@sillygwailo
sillygwailo / Open in Chrome from Safari.scpt
Created September 23, 2011 07:16
Open in Chrome from Safari and vice versa
-- from http://www.tuaw.com/2011/03/14/use-applescript-to-open-current-safari-url-in-google-chrome/
-- install FastScripts http://www.red-sweater.com/fastscripts/ and place this AppleScript in the Scripts applications folder for Google Chrome.
-- For me that was ~/Library/Scripts/Applications/Safari
-- You can then assign it a keyboard shortcut. I went with Cmd-Shift-C
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "Google Chrome"
@ksm
ksm / UINavigationController+Fade.h
Created February 14, 2012 22:23
UINavigationController custom pop/push transition animation
/*
Copied and pasted from David Hamrick's blog:
Source: http://www.davidhamrick.com/2011/12/31/Changing-the-UINavigationController-animation-style.html
*/
@interface UINavigationController (Fade)
- (void)pushFadeViewController:(UIViewController *)viewController;
- (void)fadePopViewController;
anonymous
anonymous / wordcounters.m
Created April 18, 2012 12:45
Linguistic tagger examples.
#import <Foundation/Foundation.h>
void taggerCounter(NSString* string, NSString* scheme)
{
NSLog(@"=== %@", scheme);
NSArray* schemes = [NSLinguisticTagger availableTagSchemesForLanguage:@"en"];
NSLinguisticTagger* tagger = [[NSLinguisticTagger alloc] initWithTagSchemes:schemes
options:0];
[tagger setString:string];
__block NSUInteger words = 0;
@mbierman
mbierman / gist:3232318
Created August 2, 2012 01:36
Preview HTML from TextWrangler in Safari
-- Based on Sam Dutton's http://goo.gl/27XlZ script
-- which was based on Mike Piontek's script http://goo.gl/SBkkL
-- this is Safari specific
-- see https://gist.github.com/3232063 for a Chrome Script.
tell application "TextWrangler" to set theFile to file of document 1
tell application "TextWrangler" to save document 1
set appleScriptPath to theFile as text
set currentURL to POSIX path of appleScriptPath
@adamgit
adamgit / .gitignore
Last active January 13, 2025 19:07
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
@ryanmaxwell
ryanmaxwell / ryan-objc.cfg
Last active June 26, 2019 16:41
Objective-C Uncrustify Config
#
# Uncrustify Configuration File
# File Created With UncrustifyX 0.2 (140)
#
# Alignment
# ---------
## Alignment
@ndarville
ndarville / business-models.md
Last active February 27, 2025 10:00
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google