Skip to content

Instantly share code, notes, and snippets.

@lexrus
lexrus / asicon.sh
Created March 6, 2012 08:48
AppStore Icons Generator
#!/bin/bash
# According to https://developer.apple.com/library/ios/#qa/qa1686/_index.html
# Install ImageMagick with MacPort: sudo port install ImageMagick
convert $1 -resize 512x512 iTunesArtwork.png # Ad Hoc iTunes
convert $1 -resize 144x144 [email protected] # Home screen for "The New iPad"
convert $1 -resize 114x114 [email protected] # Home screen for Retina display iPhone/iPod
convert $1 -resize 72x72 Icon-72.png # App Store and Home screen on iPad
convert $1 -resize 58x58 [email protected] # Spotlight and Settings for Retina display
convert $1 -resize 57x57 Icon.png # Home screen on non-Retina iPhone/iPod
convert $1 -resize 50x50 Icon-Small-50.png # Spotlight on iPad 1/2
@nielsbot
nielsbot / UIImage+JPEG2000.h
Created February 19, 2012 00:43
Decoding JPEG 2000 files to UIImage
#import <Foundation/Foundation.h>
extern UIImage * UIImageWithJPEG2000Data( NSData * data ) ;
@mrrooijen
mrrooijen / .gitignore
Created February 1, 2012 18:04
MiddleMan on Heroku configuration.
.DS_Store
*.swp
*.swo
Gemfile.lock
# config/initializers/active_admin_mongoid_patch.rb
require "active_admin"
require "active_admin/resource_controller"
require 'ostruct'
module ActiveAdmin
class Namespace
# Disable comments
def comments?
@l4u
l4u / gist:1611418
Created January 14, 2012 13:28
heroku snippets
heroku create --stack cedar
heroku rename new_app
heroku create new_app --stack cedar
heroku addons:add logging:expanded
heroku addons:upgrade logging:expanded
http://devcenter.heroku.com/articles/mongolab
heroku addons:add mongolab:starter
@gburd
gburd / haproxy.conf
Last active January 22, 2025 20:17
Recommended haproxy settings to balance Riak protobuf and http interfaces (note: WORK IN PROGRESS)
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
@psineur
psineur / UIWebViewWithDebug.m
Created December 12, 2011 17:35
UIWebView with js Debugger.
/** @class UIWebViewWithDebug UIWebView with additional js error on DEBUG.
* Tested on iPad with 4.3.5 & 5.0
*/
@interface UIWebViewWithDebug : UIWebView {} @end
#ifdef DEBUG
@class WebView;
@class WebScriptCallFrame;
@class WebFrame;
@haldun
haldun / quiet_assets.rb
Created December 9, 2011 16:38
rails remove assets logs
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def before_dispatch_with_quiet_assets(env)
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
end
alias_method_chain :before_dispatch, :quiet_assets
end
@rriemann
rriemann / pastie.rb
Created November 22, 2011 14:38
Paste script to paste to pastie.org from command line. Written in ruby
#!/usr/bin/env ruby
# kate: remove-trailing-space on; replace-trailing-space-save on; indent-width 2; indent-mode ruby; syntax ruby;
require 'net/http'
require 'optparse'
require 'timeout'
require 'cgi'
require 'uri'
class Hash
@nsxdavid
nsxdavid / Scale9SPrite.m
Created July 27, 2011 04:35
Scale9Sprite - A Cocos2d 9-Slice Sprite
//
// Scale9Sprite.m
//
// Creates a 9-slice sprite.
#import "Scale9Sprite.h"