Skip to content

Instantly share code, notes, and snippets.

View thisandagain's full-sized avatar

Andrew Sliwinski thisandagain

View GitHub Profile
@thisandagain
thisandagain / gist:3411499
Created August 21, 2012 04:20
4.2 to 4.3 Symlinks
# Developer directory
sudo ln -s /Applications/Xcode.app/Contents/Developer/ /Developer
# Private frameworks
sudo ln -s /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsCore.framework /Developer/Library/PrivateFrameworks/
sudo ln -s /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsCParsing.framework /Developer/Library/PrivateFrameworks/
sudo ln -s /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsFoundation.framework /Developer/Library/PrivateFrameworks/
sudo ln -s /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsInterface.framework /Developer/Library/PrivateFrameworks/
sudo ln -s /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsKit.framework /Developer/Library/PrivateFrameworks/
sudo ln -s /Applications/Xcode.app/Contents/OtherFrameworks/DevToolsRemoteClient.framework /Developer/Library/PrivateFrameworks/
@thisandagain
thisandagain / install-redis.sh
Created August 29, 2012 02:19
Woo! Redis party!
#!/bin/bash
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server
###############################################
# To use:
# wget https://raw.github.com/gist/2776679/04ca3bbb9f085b192f6aca945120fe12d59f15f9/install-redis.sh
# chmod 777 install-redis.sh
# ./install-redis.sh
###############################################
echo "*****************************************"
@thisandagain
thisandagain / UIImage+Storage.h
Created August 31, 2012 18:06
Remove runtime hacking
//
// UIImage+Storage.h
// storage
//
// Created by Andrew Sliwinski on 6/23/12.
// Copyright (c) 2012 DIY, Co. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "EDStorageManager.h"
@thisandagain
thisandagain / runtimeHack.m
Created September 18, 2012 20:11
Dictionary to properties for class init
#import <Foundation/NSObjCRuntime.h>
#import <objc/runtime.h>
#import "Underscore.h"
- (id)initWithDict:(NSDictionary *)dict
{
self = [super init];
if (self) {
// Storage object
NSMutableArray *propertyList;
@thisandagain
thisandagain / pumpkin.js
Created October 27, 2012 02:01
Pumpkin-O-Meter
/**
* Pumpkin-o-meter
*
* @package pumpkin
* @author Andrew Sliwinski <andrew@diy.org>
*/
/**
* Dependencies
*/
@thisandagain
thisandagain / client.js
Created November 5, 2012 20:18
API Client for DIY
var cork = require('cork');
module.exports = (function (key) {
cork.register('diy', {
base: 'https://api.diy.org',
headers: {
'x-diy-api-key': key
},
json: {}
});
return function (args, callback) {
@thisandagain
thisandagain / hash.js
Created December 13, 2012 00:25
Hash stuff for jlord
// Starting point
var array = [
{
id: 1,
title: 'Hello',
tools: [1,2,3]
},
{
id: 2,
title: 'World',
@thisandagain
thisandagain / subl.sh
Created January 26, 2013 04:15
Sublime CLI install
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@thisandagain
thisandagain / encode.js
Created February 21, 2013 17:43
Encode / decode example for Paul
/**
* This function takes any words and splits them up into individual letters.
*
* @param {String} Input string
*
* @return {Array}
*/
function tokenize (input) {
return input.split('');
}
@thisandagain
thisandagain / health.json
Last active December 14, 2015 15:49
DIY's API /health route
{
"head": {
"code": 200,
"status": "OK",
"url": "/health",
"method": "GET",
"stamp": "2013-03-07T18:21:26.569Z"
},
"response": {
"uptime": 23,