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
# Vagrantfile | |
Vagrant.configure("2") do |config| | |
config.vm.box = "precise32" | |
config.vm.box_url = "http://files.vagrantup.com/precise32.box" | |
config.vm.network :forwarded_port, guest: 80, host: 8888 | |
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
# /db/migrate/20140119134739_add_hstore.rb | |
class AddHstore < ActiveRecord::Migration | |
def up | |
enable_extension 'hstore' | |
end | |
def down | |
disable_extension 'hstore' | |
end | |
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
/*** | |
* Handles uploading an image to a specified url | |
*/ | |
class ImageUploaderTask extends AsyncTask<Void, Void, Boolean> { | |
private String mUrl; | |
public ImageUploaderTask(String url) { | |
mUrl = url; | |
} | |
@Override |
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
class Queue | |
constructor:()-> | |
@dataStore = [] | |
enqueue:(element)-> | |
@dataStore.push(element) | |
dequeue:(element)-> | |
@dataStore.shift() | |
front:()-> | |
@dataStore[0] | |
back:()-> |
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
class Stack | |
constructor:()-> | |
@dataStore = [] | |
@top = 0 | |
push:(element)-> | |
@dataStore[++@top] = element | |
pop:()-> | |
@dataStore[--@top] | |
peek:()-> | |
@dataStore[@top-1] |
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
class List | |
constructor:()-> | |
@dataStore=[] | |
@pos=0 | |
@listSize = 0 | |
length:()-> | |
@listSize | |
clear:()-> | |
@dataStore = [] | |
@listSize = @pos = 0 |
NewerOlder