⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
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
//create the file in /etc/yum.repos.d/10gen-mongodb.repo | |
[10gen] | |
name=10gen Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 | |
gpgcheck=0 |
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
NB: Ran into issues provisioning EC@ servers today where my EBS storage was sticking at the default 8gb storage level. I allocated double that and was wondering where the storage was. Long story short you need to resize the attached hardware so it knows how to do this. | |
sudo resize2fs /dev/sda1 | |
The above command will resize everything nicely. |
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
var Chimera = require('chimera').Chimera; | |
var c = new Chimera(); | |
var pageUrl = "http://www.google.com"; | |
c.perform({ | |
url: pageUrl, | |
locals: { | |
}, | |
run: function(callback) { |
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
//Basic query examples in iOS | |
UGQuery * query = [[UGQuery alloc] init]; | |
//select * wehre name = 'Fred' | |
[query addUrlTerm:@"name" equals:@"Fred"]; | |
//select * where content contains 'foo' | |
[query addRequiredContains:@"content" value:@"foo"]; | |
//select * where NOT a = 5 | |
[query addRequirement:@"NOT a=5"]; |
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
UGQuery * query = [[UGQuery alloc] init]; | |
//This performs a geolocation query on the App Services platform. | |
//Note that geolocation queries are no different then other queries that can be performed | |
//on the App Services platform | |
[query addRequiredWithin:@"restaurants" latitude:37.776753 longitude:-122,407846 distance:16093.00]; | |
//An alternate way to perform this query is to use the SDK method that takes a CLLocation object. | |
//Set up the CLLocation object with a lat and lon, and simply pass it into the SDK Method | |
CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:37.776753 longitude:-122.407846]; | |
[query addRequiredWithinLocation:@"restaurants" location:myLocation distance:16093.00]; |
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
// Following a user currently logged in as fred. | |
NSString *username = @"barney"; | |
UGClientResponse *response = [usergridClient connectEntities:@"users" | |
connectorID:@"fred" | |
connectionType:@"following" | |
connecteeType:@"users" | |
connecteeID:username]; |
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
//Get the first 30 users that fred is following | |
UGQuery *query = [[UGQuery alloc] init]; | |
[query addURLTerm:@"limit" equals:@"30"]; | |
UGClientResponse *response = [usergridClient getEntityConnections: @"users" | |
connectorID:@"fred" | |
connectionType:@"following" | |
query:query]; | |
//This array contains the entities fred is following | |
NSArray * following = [response.response objectForKey:@"entities"]; |
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
// Have fred "like" a dog with an entity connection | |
NSString *username = @"dino"; | |
UGClientResponse *response = [usergridClient connectEntities:@"users" | |
connectorID:@"fred" | |
connectionType:@"likes" | |
connecteeType:@"dogs" | |
connecteeID:username]; |