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
➜ ~ curl -L get.rvm.io | bash -s stable | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 9248 100 9248 0 0 12208 0 --:--:-- --:--:-- --:--:-- 12208 | |
Downloading RVM from wayneeseguin branch stable | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 1023k 100 1023k 0 0 297k 0 0:00:03 0:00:03 --:--:-- 439k | |
Upgrading the RVM installation in /Users/admin/.rvm/ |
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
➜ / which rvm | |
rvm () { | |
typeset result current_result | |
export -a rvm_ruby_args > /dev/null 2> /dev/null | |
if (( ${rvm_ignore_rvmrc:=0} == 0 )) | |
then | |
: rvm_stored_umask:${rvm_stored_umask:=$(umask)} | |
for rvmrc in /etc/rvmrc "$HOME/.rvmrc" | |
do | |
if [[ -f "$rvmrc" ]] |
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
/Users/bryceneal/Documents/rails/juiceyjuice/config/initializers/sorcery.rb:86:in `block in <top (required)>': undefined method `twitter' for Sorcery::Controller::Config:Module (NoMethodError) | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/sorcery-0.7.12/lib/sorcery/controller.rb:193:in `call' | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/sorcery-0.7.12/lib/sorcery/controller.rb:193:in `configure!' | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/sorcery-0.7.12/lib/sorcery/controller.rb:15:in `included' | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/sorcery-0.7.12/lib/sorcery/engine.rb:11:in `include' | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/sorcery-0.7.12/lib/sorcery/engine.rb:11:in `block in <class:Engine>' | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec' | |
from /usr/local/Cellar/ruby/1.9.3-p0/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initi |
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
//Dictionary implemented using a Trie Tree. | |
public class Dictionary { | |
private HashMap<Character,Node> roots = new HashMap<Character,Node>(); | |
/** | |
* Search through the dictionary for a word. | |
* @param string The word to search for. | |
* @return Whether or not the word exists in the dictionary. | |
*/ | |
public boolean search(String string) { |
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 Node | |
attr_accessor :endOfWord, :children | |
def initialize() | |
@endOfWord = false | |
@children = {} | |
end | |
end | |
class Dictionary |
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
def findOperations(string) | |
operations = 0 | |
list = string.split("") | |
startIndex = 0 | |
endIndex = list.length-1 | |
while startIndex < endIndex | |
if list[endIndex]=="0" | |
if list[startIndex] == "1" | |
list[startIndex], list[endIndex] = list[endIndex], list[startIndex] | |
operations = operations+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
//Constants | |
PriorityQueue.MAX_HEAP = 0; | |
PriorityQueue.MIN_HEAP = 1; | |
/** | |
* This is an improved Priority Queue data type implementation that can be used to sort any object type. | |
* It uses a technique called a binary heap. | |
* | |
* For more on binary heaps see: http://en.wikipedia.org/wiki/Binary_heap | |
* |
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 QuickSort | |
def recurse(low, high) | |
i = low | |
j = high | |
pivot = @list[(low + (high-low)/2).floor] | |
while i <= j | |
while @list[i] < pivot | |
i+=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
def isPalindrome(value) | |
list = value.split("") | |
j = 0 | |
i = list.length-1 | |
while j <= i | |
if value[j] != value[i] | |
return false | |
end | |
j+=1 | |
i-=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
require 'open-uri' | |
require 'ImageUtilities' #ImageUtilities is a module that is used to grab screenshots of a given URL. It is an external API. | |
require 'cgi' | |
require 'LatestCache' #LatestCache is a module that is used to update the cache for entries that have been submitted recently. | |
class EntriesController < ApplicationController | |
before_filter :authenticate, :only => "destroy" #User must have admin privileges to destroy an entry. | |
# This index method is hit via ajax call from javascript. It is the "HOT", or front page entries. | |
def index | |
page = params[:page] #Url Param can tell us which entry to start from. This is in the case that the user is scrolling down the page. Eatch "batch" of entries is a "page". |
OlderNewer