This file contains 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
// | |
// UIView+frameAdjust.h | |
// fenbi | |
// | |
// Created by Tang Qiao on 12-5-31. | |
// Copyright (c) 2012年 Fenbi.com . All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains 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
// | |
// CoreTextLabel.h | |
// Frost | |
// | |
// Created by David Kasper on 10/1/12. | |
// | |
#import <UIKit/UIKit.h> | |
#import <CoreText/CoreText.h> |
This file contains 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
/* | |
File: Reachability.h | |
Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. | |
Version: 2.2 - ARCified | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. | |
("Apple") in consideration of your agreement to the following terms, and your | |
use, installation, modification or redistribution of this Apple software |
This file contains 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 UILabel (dynamicSizeMe) | |
-(float)resizeToFit; | |
-(float)expectedHeight; | |
@end |
This file contains 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
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
This file contains 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 http://qiita.com/Oakbow/items/3374175d76d82792134d | |
(function () { | |
if (!("indexOf" in Array.prototype)) { | |
Array.prototype.indexOf = function (find, i) { | |
var n; | |
if (i === undefined) i = 0; | |
if (i < 0) i += this.length; | |
if (i < 0) i = 0; | |
n = this.length; |
This file contains 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
//Lazy Function Definition Pattern | |
// form http://michaux.ca/articles/lazy-function-definition-pattern | |
var getScrollY = function () { | |
if (typeof window.pageYOffset == 'number') { | |
getScrollY = function () { | |
return window.pageYOffset; | |
}; | |
} else if ((typeof document.compatMode == 'string') && (document.compatMode.indexOf('CSS') >= 0) && (document.documentElement) && (typeof document.documentElement.scrollTop == 'number')) { | |
getScrollY = function () { |
This file contains 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
// form http://stackoverflow.com/questions/5916900/detect-version-of-browser | |
navigator.userBrowser = (function(){ | |
var N= navigator.appName, ua= navigator.userAgent, tem; | |
var M= ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); | |
if(M && (tem= ua.match(/version\/([\.\d]+)/i))!= null) M[2]= tem[1]; | |
M= M? [M[1], M[2]]: [N, navigator.appVersion,'-?']; | |
return M; | |
})(); |
This file contains 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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |
This file contains 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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |