This file contains hidden or 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 'nokogiri' | |
| require 'open-uri' | |
| class Post | |
| attr_reader :title | |
| def initialize(title, url, points) | |
| @title = title | |
| @url = url | |
| @points = points |
This file contains hidden or 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 | |
| def initialize | |
| @store = [] | |
| @max_size = 5 | |
| end | |
| def enqueue(x) | |
| raise "Stack is full!" if full? | |
| @store.push x | |
| end |
This file contains hidden or 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
| plugins=(bundler common-aliases git postgres rails vagrant zsh_reload) | |
| export PATH=~/.rbenv/shims | |
| export PATH='$HOME/.rbenv/bin:$PATH' | |
| JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home | |
| # JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home | |
| export JAVA_HOME | |
| # export EDITOR='subl' | |
| export PATH=/Users/oafridi/.cabal/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/local/sbin:$PATH | |
| export PATH=$PATH:/Users/oafridi/dev/play-2.2.0 |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'net/ssh' | |
| Net::SSH.start('host', 'user' ) do|ssh| | |
| result = ssh.exec!('') | |
| puts result | |
| end |
This file contains hidden or 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
| # All installs | |
| sudo apt-get install build-essential | |
| sudo apt-get install libssl-dev | |
| #therubyracer | |
| gem uninstall libv8 | |
| $ gem install therubyracer | |
| # nokogiri requirements | |
| sudo apt-get install libxslt-dev libxml2-dev |
This file contains hidden or 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
| development: | |
| adapter: postgresql | |
| encoding: unicode | |
| host: localhost | |
| database: proj_development | |
| username: postgres | |
| password: | |
| test: | |
| adapter: postgresql |
This file contains hidden or 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
| workid and personalid: | |
| 1. Edit the ~/.ssh/config file | |
| Add an alias for each identity combination for example: | |
| Host workid | |
| HostName bitbucket.org | |
| IdentityFile ~/.ssh/workdid | |
| Host personalid | |
| HostName bitbucket.org |
This file contains hidden or 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
| bundle update - update all gems | |
| bundle update 'gemname' - update gem AND all dependencies | |
| bundle update ––source gemname - update only gem |
This file contains hidden or 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
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |
This file contains hidden or 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
| <%= debug(params) if Rails.env.development? %> |