Skip to content

Instantly share code, notes, and snippets.

View wprater's full-sized avatar
💾
Building

Will Prater wprater

💾
Building
View GitHub Profile
@fpillet
fpillet / gist:270266
Created January 6, 2010 13:18
A UIViewController subclass which automagically releases its UIView-derived instance variables upon -dealloc and -viewDidUnload
/* Base UIViewController subclass for your iPhone applications which automatically
* releases your instance variables pointing to UIView objects or UIView-subclassed objects,
* limiting the work you have to do in -dealloc and -viewDidUnload
*
* All you have to do is make your UIViewController subclasses inherit from BaseUIViewController
* instead of UIViewController
*
* The helper function that disposes of objects is generalized and can be used for other
* types of objects as well.
*
#!/usr/bin/env ruby -Ku
# encoding: utf-8
require 'rubygems'
require 'dm-core'
require 'dm-migrations'
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, 'sqlite3::memory:')
@rafaelss
rafaelss / Gemfile
Created May 20, 2010 22:18 — forked from rmanalan/.gems
rack static site
source "http://rubygems.org"
gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'rack-rewrite'
@SFEley
SFEley / deploy.rb
Created August 31, 2010 20:39
Vlad config file with Hoptoad and Unicorn
set :application, "_____"
set :repository, "git@github.com:_____/#{application}.git"
begin
# Parsing the annoying multi-line output of 'git branch'...
set :branch, `git branch --no-color`.match(/\* (.+)/)[1]
rescue Exception => e
set :branch, '(none)'
end
@zerobearing2
zerobearing2 / embedded_callbacks.rb
Created September 5, 2010 19:01
bubble down callbacks to embedded associations with mongoid
# encoding: utf-8
module Mongoid #:nodoc:
module Associations #:nodoc:
module EmbeddedCallbacks
# bubble callbacks to embedded assocaitions
def run_callbacks(*args)
# now bubble callbacks down
self.associations.each_pair do |name, meta|
if meta.association == Mongoid::Associations::EmbedsMany
NSString *urlString = @"http://yourserver.com/upload_huge_file";
NSString *filename = @"filename";
NSString * pathToHugeFileToPost = @"hugeFile";
NSMutableURLRequest * request= [[[NSMutableURLRequest alloc] init] autorelease];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
NSString *boundary = @"---------------------------14737809831466499882746641449";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
@jonah-williams
jonah-williams / build.sh
Created April 30, 2011 17:46
Command line iOS project builds and over-the-air distribution
#!/bin/bash
# https://gist.github.com/949831
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/
# command line OTA distribution references and examples
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html
@ZhangHanDong
ZhangHanDong / gist:1033906
Created June 19, 2011 07:52
MongoId Counter Cahce
#
# lib/mongoid/counter_cache.rb
# ruby
#
# Created by Zhang Alex on 2011-06-17.
# Copyright 2011 __ZhangHanDong__. All rights reserved.
#
# ===================================
# class Forum
# references_many :topics
@we4tech
we4tech / stage.js
Created August 6, 2011 08:21
Using node-control i've built my deployment script, it was fun and easy to do and go :)
var control = require('control'),
script = process.argv[1],
perform = control.perform,
task = control.task;
var ProjectConfig = {
rootDir: 'staging',
git: 'git://github.com/we4tech/restaurant-review.git',
branch: 'master',
serverPort: 4000
@xjones
xjones / TransitionController.h
Created November 26, 2011 03:48
TransitionController for animating iOS view controller transitions w/o a controller stack
//
// TransitionController.h
//
// Created by XJones on 11/25/11.
//
#import <UIKit/UIKit.h>
@interface TransitionController : UIViewController