Skip to content

Instantly share code, notes, and snippets.

@tyrotinal
tyrotinal / gist:5625760
Created May 22, 2013 07:06
rails: twitter bootstrap initial setup
Twitter rails
gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "twitter-bootstrap-rails"
then do:
bundle install
then install
rails generate bootstrap:install less
@tyrotinal
tyrotinal / gist:5622710
Created May 21, 2013 19:54
rails: twitter bootstrap gem requirements
gem "therubyracer"
gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem "twitter-bootstrap-rails"
@tyrotinal
tyrotinal / Gemfile
Created May 21, 2013 19:52
rails: twitter bootstrap gem file
source 'https://rubygems.org'
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
@tyrotinal
tyrotinal / application_controller.rb
Created May 20, 2013 23:52
rails: devise redirecting users when logged in to another path. The function should be placed in application_controller.rb
def after_sign_in_path_for(resource)
user_videos_path
end
@tyrotinal
tyrotinal / gist:5606251
Created May 19, 2013 00:54
ruby: 1 - simple class Car
class Car
def initialize (gas,mile)
@gas = gas
@mile = mile
end
def get_gas
return @gas
end
@tyrotinal
tyrotinal / gist:5606236
Created May 19, 2013 00:42
ruby: 1-simple class initializer
require_relative 'Car'
car = Car.new(20,50)
puts "gas: #{car.get_gas} mile: #{car.get_mile}"
puts "\n"
car.set_gas = 22
car.set_mile = 55
puts "Now.. gas: #{car.get_gas} mile: #{car.get_mile}"
@tyrotinal
tyrotinal / gist:5530386
Created May 7, 2013 05:07
nodeHowTo: install node from source for a user
#Installing node for a local user
##install the dependcies
apt-get install python-software-properties python g++ make
##clone node and install
mkdir -p ~/local/src
cd ~/local/src
git clone git://github.com/joyent/node.git
cd node
@tyrotinal
tyrotinal / gist:5530384
Created May 7, 2013 05:07
lampHowTo: install lamp
#Install LAMP: Single Script
echo "######INSTALLING PHP and apache and all the requriemtns########"
sudo apt-get install apache2 libapache2-mod-php5 -y
sudo apt-get install php5 mysql-server php-pear php5-mysql php5-suhosin -y
echo "######GOING TO ASK FOR PASSWORD HERE#########"
sudo apt-get install mysql-client mysql-server mysql-navigator php5-mysql php5-gd -y
echo "######checking if everything is installed#########"
sudo apt-get install apache2 libapache2-mod-php5 php5 mysql-server php-pear php5-mysql php5-suhosin mysql-client mysql-server mysql-navigator php5-mysql php5-gd -y
@tyrotinal
tyrotinal / gist:5530381
Created May 7, 2013 05:07
railsHowTo: intalling Rails 3.2
#Installing RVM.
--------------------------------
RVM is used for managing GEM sets and ruby versions. There is a lot that you can do with it. For more information visit: [RVM website](https://rvm.io/)
##Installing RVM Prereq:
echo ######Installing pre pre reqs#########
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential zlib1g-dev libssl-dev libreadline-dev \
git-core curl libyaml-dev libcurl4-dev libsqlite3-dev apache2-dev -y
##Installing RVM more prereq
rake db:reset