Skip to content

Instantly share code, notes, and snippets.

View node-notes
How to install node on Ubuntu
>> git clone
>> cd node/
>> ./configure
>> make
>> sudo make install
Install NPM
armstrongnate / angular-notes
Created Apr 18, 2013
Notes about Angular.js
View angular-notes
Raw angular app:
Make sure karma is installed
>> npm install -g karma
Clone bare angular app from angular tutorial
>> git clone git://
>> git checkout -f step-0
Run the server:
armstrongnate / typeahead comma
Last active Dec 16, 2015
set comma and space on typeahead selection.
View typeahead comma
message_input.on('typeahead:selected', function(e) {
query = $(this).val();
$(this).typeahead('setQuery', '');
$(this).val(query + ', ');
armstrongnate / install rmagick gem mac
Created May 13, 2013
Installing rmagick gem can be somewhat of a pain. Here's what ended up doing it for me.
View install rmagick gem mac
brew update
brew uninstall ImageMagick
brew install ImageMagick
gem uninstall rmagick
gem install rmagick
cd /usr/local/Cellar/imagemagick/6.8.0-10/lib
ln -s libMagick++-Q16.7.dylib libMagick++.dylib
ln -s libMagickCore-Q16.7.dylib libMagickCore.dylib
ln -s libMagickWand-Q16.7.dylib libMagickWand.dylib
armstrongnate / json request objective c
Last active Dec 17, 2015
JSON HTTP request in objective-c
View json request objective c
NSURL *wiresUrl = [NSURL URLWithString:@""];
NSData *jsonData = [NSData dataWithContentsOfURL:wiresUrl];
NSError *error = nil;
NSDictionary *dataDictionary = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
armstrongnate / rbenv 187 mountain lion
Created May 24, 2013
Install ruby 1.8.7 using rbenv on mountain lion.
View rbenv 187 mountain lion
Ultimately, this line did the trick:
$ CONFIGURE_OPTS="--without-tk" rbenv install 1.8.7-p370
Additional info:
armstrongnate / awakeFromNib
Created Jun 4, 2013
how to call awakeFromNib method inside View Controller (method that gets called before viewDidLoad, mostly used for geometry changes)
View awakeFromNib
// the following class inherits from UIViewController
@implementation MyCustomViewController
- (void)setup
// initialization that can't wait until viewDidLoad
- (void)awakeFromNib
armstrongnate / nsObjectInit
Last active Dec 18, 2015
base init method of NSObject
View nsObjectInit
@implementation MyCustomClass
- (id)init
self = [super init];
if (self) {
// custom initializations
// use underscore assignment (_date = [NSDate date]) instead of setters and getters
armstrongnate / mysql start
Created Jun 26, 2013
start mysql after reboot
View mysql start
mysql.server start
View add_index
class AddIndexOnCompanyIdInConcernsAndDepartmentsAndUsers < ActiveRecord::Migration
def change
add_index :departments, :company_id
add_index :concerns, :company_id
add_index :users, :company_id
You can’t perform that action at this time.