Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@therealadam
therealadam / Gemfile
Created June 18, 2010 18:45
An example of how to authorize your app with Gowalla's OAuth API
source :rubygems
gem 'sinatra', '1.0'
gem 'oauth2'
gem 'json'
group :development do
gem 'shotgun'
end
@noonat
noonat / gist:1649543
Created January 20, 2012 21:02
Rake Quick Reference
# Rake Quick Reference
# by Greg Houston
# http://ghouston.blogspot.com/2008/07/rake-quick-reference.html
# -----------------------------------------------------------------------------
# Running Rake
# -----------------------------------------------------------------------------
# running rake from the command-line:
# rake --help
@ramnathv
ramnathv / gh-pages.md
Created March 28, 2012 15:37
Creating a clean gh-pages branch

Creating a clean gh-pages branch

This is the sequence of steps to follow to create a root gh-pages branch. It is based on a question at [SO]

cd /path/to/repo-name
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
echo "My GitHub Page" > index.html
@mikeash
mikeash / test.m
Created July 9, 2012 21:15
Cocoa array slicing
// clang -framework Foundation -fobjc-arc -O3 test.m
#import <Foundation/Foundation.h>
@interface Slice : NSObject
@property NSInteger start;
@property NSInteger length;
@end
@implementation Slice
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@adamwiggins
adamwiggins / end-of-a-chapter.md
Last active November 24, 2022 11:40
End of a chapter: my Heroku departure message

It's with a heavy heart that I announce that Friday, May 31 2013 will be my last day at Heroku.

How can I possibly put into words what Heroku has meant to me these last six years? I can say it was a tremendous experience; or the opportunity of a lifetime; or the greatest thing I have ever been a part of. I can say that Heroku has been my life's work, as I did recently in a public blog post. All of those things are true, but none seem to capture the enormity of what's transpired these past six years.

I tend to focus on mechanical elements of a company: product, code, design, process. But what has surprised me the most at Heroku is that none of these things is the best part. The best part is the team.

I've never had the chance to work with a more singular group of people. Talented, passionate, skilled, dedicated. Most of all, sharing a set of values: elegance, craft, maniacal focus on simplicity; and an uncompromising belief that the future will be made of software, and how that software gets made will shape

@jwilling
jwilling / JNWThrottledBlock.h
Last active October 26, 2020 17:02
Simple throttling of blocks using dispatch sources.
#import <Foundation/Foundation.h>
@interface JNWThrottledBlock : NSObject
// Runs the block after the buffer time _only_ if another call with the same identifier is not received
// within the buffer time. If a new call is received within that time period the buffer will be reset.
// The block will be run on the main queue.
//
// Identifier and block must not be nil.
+ (void)runBlock:(void (^)())block withIdentifier:(NSString *)identifier throttle:(CFTimeInterval)bufferTime;
@schacon
schacon / git-http-proto.txt
Created July 26, 2013 22:16
Git HTTP transport protocol documentation
HTTP transfer protocols
=======================
Git supports two HTTP based transfer protocols. A "dumb" protocol
which requires only a standard HTTP server on the server end of the
connection, and a "smart" protocol which requires a Git aware CGI
(or server module). This document describes both protocols.
As a design feature smart clients can automatically upgrade "dumb"
protocol URLs to smart URLs. This permits all users to have the
@mattt
mattt / UIImageForSwatchOfColorWithSize.h
Created September 27, 2013 01:25
Create a UIImage swatch of a color with a specified size.
static UIImage * UIImageForSwatchOfColorWithSize(UIColor *color, CGSize size) {
UIImage *image = nil;
CGRect rect = CGRectMake(0.0f, 0.0f, size.width, size.height);
UIGraphicsBeginImageContext(rect.size);
{
CGContextRef c = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(c, [color CGColor]);