Skip to content

Instantly share code, notes, and snippets.

@bromanko
bromanko / UIImage+Retina4.h
Created September 26, 2012 14:55 — forked from bstahlhood/UIImage+Retina4.h
Swizzled UIImage imageNamed for iPhone 5
//
// UIImage+Retina4.h
// StunOMatic
//
// Created by Benjamin Stahlhood on 9/12/12.
// Copyright (c) 2012 DS Media Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
@bromanko
bromanko / test.js
Created July 24, 2012 18:05
node restify HTTPClient multipart form upload
it('should return a BadRequestError if photo is not sent on post to /users/me/photos', function(done) {
var options = {
path: '/users/me/photos',
headers: {
'Content-Type': 'multipart/form-data; boundary=Boundary+0xAbCdEfGbOuNdArY'
}
};
common.httpClient(testUser).post(options, function(err, req) {
req.on('result', function(err, res) {
@bromanko
bromanko / gist:2695108
Created May 14, 2012 17:07
ARC or Not
#if !__has_feature(objc_arc)
#define NonatomicRetainedSetToFrom(a, b) do{if(a!=b){[a release];a=[b retain];}}while(0)
#define NonatomicCopySetToFrom(a, b) do{if(a!=b){[a release];a=[b copy];}}while(0)
#else
#define NonatomicRetainedSetToFrom(a, b) do{if(a!=b){a=b;}}while(0)
#define NonatomicCopySetToFrom(a, b) do{if(a!=b){a=[b copy];}}while(0)
#endif
#!/usr/bin/env node
require('coffee-script');
var env = require('./config/env')
, restify = require('restify')
, repl = require('repl').start()
, util = require('util');
repl.context.inspect = util.inspect;
** [out :: dashboard.onpremisewine.com] config/schedule.rb:50:in `block in initialize'
** [out :: dashboard.onpremisewine.com] : undefined local variable or method `send_broken_pos_notifications' for #<Whenever::JobList:0x00000001a35f60> (NameError)
** [out :: dashboard.onpremisewine.com] from /www/tastevin-web/shared/bundle/ruby/1.9.1/gems/whenever-0.7.3/lib/whenever/job_list.rb:38:in `every'
** [out :: dashboard.onpremisewine.com] from config/schedule.rb:49:in `initialize'
** [out :: dashboard.onpremisewine.com] from /www/tastevin-web/shared/bundle/ruby/1.9.1/gems/whenever-0.7.3/lib/whenever/job_list.rb:19:in `instance_eval'
** [out :: dashboard.onpremisewine.com] from /www/tastevin-web/shared/bundle/ruby/1.9.1/gems/whenever-0.7.3/lib/whenever/job_list.rb:19:in `initialize'
** [out :: dashboard.onpremisewine.com] from /www/tastevin-web/shared/bundle/ruby/1.9.1/gems/whenever-0.7.3/lib/whenever.rb:15:in `new'
** [out :: dashboard.onpremisewine.com] from /www/tastevin-web/shared/bundle/ruby/1.9.1/gems/
@bromanko
bromanko / clone-rackspace-container.js
Created February 20, 2012 16:28
Cloudfiles Copy Container
var cloudfiles = require('cloudfiles');
request = require('request');
// CloudFiles client configuration
var configCloudFiles = {
auth: {
username: '',
apiKey: '',
host: 'auth.api.rackspacecloud.com'
}
@bromanko
bromanko / gist:1520474
Created December 26, 2011 03:24
GCD Implementation
- (AQGridViewCell *)gridView:(AQGridView *)gridView cellForItemAtIndex:(NSUInteger)index {
switch ([self numberOfItemsInGridView:gridView] - index) {
case 2:
// Favorites cell
return [TopicListViewController favoritesCell];
case 1:
// Add cell
return [TopicListViewController addCell];
default: {
// Topic cells