This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Module dependencies | |
*/ | |
var express = require('express'); | |
var fs = require('fs'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
// img path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./db-connect'), | |
Schema = mongoose.Schema, | |
ObjectId = Schema.ObjectId, | |
uuid = require('node-uuid'), | |
Validator = require('validator').Validator, | |
val = new Validator(), | |
bcrypt = require('bcrypt'); | |
Validator.prototype.error = function(msg) { return false; }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIImage (Screenshot) | |
+ (UIImage *)screenshot; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define APP_DELEGATE ((AppDelegate *)[[UIApplication sharedApplication] delegate]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git submodule update --init --recursive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* place in pch | |
from http://stackoverflow.com/questions/9621143/debuglog-format-string-is-not-a-string-literal | |
*/ | |
#ifdef DEBUG | |
#define DebugLog(s, ...) NSLog(s, ##__VA_ARGS__) | |
#else | |
#define DebugLog(s, ...) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//from Urban Airship iOS SDK "1.1.2" | |
#define SINGLETON_INTERFACE(CLASSNAME) \ | |
+ (CLASSNAME*)shared; \ | |
#define SINGLETON_IMPLEMENTATION(CLASSNAME) \ | |
\ | |
static CLASSNAME* g_shared##CLASSNAME = nil; \ | |
\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES) | |
#define IS_OS_5_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 5.0) | |
#define IS_OS_6_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) | |
#define IS_OS_7_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://stackoverflow.com/questions/15757872/manually-color-fading-from-one-uicolor-to-another | |
- (UIColor *)colorFromColor:(UIColor *)fromColor toColor:(UIColor *)toColor amount:(float)amount // 0 < amount < 1 | |
{ | |
float dec = amount; | |
CGFloat fRed, fBlue, fGreen, fAlpha; | |
CGFloat tRed, tBlue, tGreen, tAlpha; | |
CGFloat red, green, blue, alpha; | |
if(CGColorGetNumberOfComponents(fromColor.CGColor) == 2) { | |
[fromColor getWhite:&fRed alpha:&fAlpha]; |