Skip to content

Instantly share code, notes, and snippets.

@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 ) ;
@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
% snippet from pubsub_srv.erl
%-----------
start_link() ->
{ok,PID} = eredis_sub:start_link(),
register(eredispid,PID),
_Receiver = spawn_link(fun () ->
eredis_sub:controlling_process(PID),
receiver(PID)
end),
io:format("Eredis server started~n"),
@skeeet
skeeet / xcode_ramdisk.sh
Created April 12, 2012 13:35 — forked from MaximKeegan/xcode_ramdisk.sh
Create a RAM disk for using with XCode
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@rolandoam
rolandoam / gist:2440784
Created April 22, 2012 01:58
enable webgl on embedded WebViews
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitWebGLEnabled"];
[[NSUserDefaults standardUserDefaults] synchronize];
@nikolaykasyanov
nikolaykasyanov / NULevelDB.podspec
Created June 17, 2012 14:30
Podspec for NULevelDB
Pod::Spec.new do |s|
s.name = 'NULevelDB'
s.version = '0.0.1'
s.license = 'New BSD and custom BSD-like'
s.summary = 'NULevelDB is a Objective-C wrapper for Google\'s LevelDB.'
s.homepage = 'https://github.com/nulayer/NULevelDB'
s.author = { 'Brent Gulanowski' => 'FILL IN' }
s.source = { :git => 'https://github.com/nulayer/NULevelDB.git', :commit => '08b6d4c7a67bfd5fb58b4658d5d5da6ba821b0e0' }
@alloy
alloy / Instructions.md
Created June 28, 2012 12:56
Run iOS unit tests (in a Xcode workspace) when a file changes and *only* those tests related to the changed file. Also trims otest output and colors test results.
@roberto
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@lpgauth
lpgauth / gist:3789152
Created September 26, 2012 16:53
basic auth with Cowboy
-module(auth_handler).
-compile({parse_transform, seqbind}).
-export([init/3, handle/2, terminate/2]).
-define(USERNAME, <<"admin">>).
-define(PASSWORD, <<"password">>).
%% public
init(_Transport, Req, []) ->
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell