Skip to content

Instantly share code, notes, and snippets.

View carltongibson's full-sized avatar
🌳
Looking forward to Spring 🐇

Carlton Gibson carltongibson

🌳
Looking forward to Spring 🐇
View GitHub Profile
@prestontimmons
prestontimmons / Manifest.in
Created May 8, 2012 15:25
Minimal setup.py file
include README.md
global-include *.html
global-include *.js
global-include *.css
global-include *.json
global-include *.txt
global-include *.sql
@zen4ever
zen4ever / gist:2327666
Created April 7, 2012 11:13
Print available video capture formats on iOS
AVCaptureVideoDataOutput *videoOutput = [[AVCaptureVideoDataOutput alloc] init];
NSDictionary *formats = [NSDictionary dictionaryWithObjectsAndKeys:
@"kCVPixelFormatType_1Monochrome", [NSNumber numberWithInt:kCVPixelFormatType_1Monochrome],
@"kCVPixelFormatType_2Indexed", [NSNumber numberWithInt:kCVPixelFormatType_2Indexed],
@"kCVPixelFormatType_4Indexed", [NSNumber numberWithInt:kCVPixelFormatType_4Indexed],
@"kCVPixelFormatType_8Indexed", [NSNumber numberWithInt:kCVPixelFormatType_8Indexed],
@"kCVPixelFormatType_1IndexedGray_WhiteIsZero", [NSNumber numberWithInt:kCVPixelFormatType_1IndexedGray_WhiteIsZero],
@"kCVPixelFormatType_2IndexedGray_WhiteIsZero", [NSNumber numberWithInt:kCVPixelFormatType_2IndexedGray_WhiteIsZero],
@"kCVPixelFormatType_4IndexedGray_WhiteIsZero", [NSNumber numberWithInt:kCVPixelFormatType_4IndexedGray_WhiteIsZero],
@dch
dch / couchdb-1.2.0.diff
Created March 21, 2012 13:56
NB the recipes below are now in homebrew apart from OpenSSL 1.0.1 and modified Erlang
diff --git i/Library/Formula/couchdb.rb w/Library/Formula/couchdb.rb
index 3352b28..7c1203d 100644
--- i/Library/Formula/couchdb.rb
+++ w/Library/Formula/couchdb.rb
@@ -1,9 +1,14 @@
require 'formula'
class Couchdb < Formula
- url 'http://www.apache.org/dyn/closer.cgi?path=couchdb/1.1.1/apache-couchdb-1.1.1.tar.gz'
homepage "http://couchdb.apache.org/"
@nielsbot
nielsbot / README
Created February 25, 2012 02:31 — forked from PlacePop/README
Adds support for loading UIImage's from PDF files. I think it's a great way to add resolution-independent graphics to your apps, and also remove the "export to bitmap" step from your workflow. Just save directly from Illustrator!
Adds support for loading UIImage's from PDF files. I think it's a great way to add resolution-independent graphics to your apps, and also remove the "export to bitmap" step from your workflow. Just save directly from Illustrator!
What it does:
- You can pass the name of a PDF file (with or without the '.pdf') to +[UIImage imageNamed:]
- You can use the name of a PDF file inside Interface Builder, in your UIImageView's
- Turn a multi-page PDF into an array of UIImage's... good for animation.
Feedback to gists @nielsbot.com. Thanks!
@nielsbot
nielsbot / ShakeAnimation.m
Created February 21, 2012 18:59
Shake animation on UIView
// this code will cause a UIView to shake--good for "login error"
CAKeyframeAnimation * anim = [ CAKeyframeAnimation animationWithKeyPath:@"transform" ] ;
anim.values = [ NSArray arrayWithObjects:
[ NSValue valueWithCATransform3D:CATransform3DMakeTranslation(-5.0f, 0.0f, 0.0f) ],
[ NSValue valueWithCATransform3D:CATransform3DMakeTranslation(5.0f, 0.0f, 0.0f) ],
nil ] ;
anim.autoreverses = YES ;
anim.repeatCount = 2.0f ;
anim.duration = 0.07f ;
@remy
remy / README.md
Created February 18, 2012 12:06
Waits for functions to complete before running complete

Unfinished and not tested beyond my own case.

Usage

var wait = new Wait();
wait.complete(function () {
  console.log('we are done - now report');
});
@fyaconiello
fyaconiello / django-lion-setup.md
Created February 9, 2012 17:22
Django Lion Setup
Step 1 - download and install macosx pkgs
  • download and install xcode
  • XCode and enable Command Line Tools
  • download and install mysql-server
Step 2
nano ~/.bash_profile

add the following

@rwilcox
rwilcox / to_worksheet.applescript
Created November 15, 2011 02:55
Save current open BBEdit documents to Unix Worksheet for later
tell application "BBEdit"
set output to ""
set docs to every project document
repeat with current in docs
repeat 1 times
if file of current is missing value then
exit repeat
end if
set asAlias to file of current as alias
@paulirish
paulirish / data-markdown.user.js
Last active October 22, 2024 14:19
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.
@benspaulding
benspaulding / Application.applicationWillSwitchOut.applescript
Created October 14, 2011 17:56
AppleScript that will save all documents with unsaved changes when BBEdit loses focus.
(*
File:
Application.applicationWillSwitchOut.scpt
Abstract:
This script will automatically save all on-disk text documents with unsaved
changes when BBEdit loses focus.
Version: