http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
http://guides.rubyonrails.org/migrations.html
| # Install Git needed for Git based gems | |
| packages: | |
| yum: | |
| git: [] | |
| // Disable Mouse scrolling | |
| $('input[type=number]').on('mousewheel',function(e){ $(this).blur(); }); | |
| // Disable keyboard scrolling | |
| $('input[type=number]').on('keydown',function(e) { | |
| var key = e.charCode || e.keyCode; | |
| // Disable Up and Down Arrows on Keyboard | |
| if(key == 38 || key == 40 ) { | |
| e.preventDefault(); | |
| } else { | |
| return; |
| // layout file | |
| <body> | |
| <div class="container"> | |
| <%= flash_messages %> | |
| <%= yield %> | |
| </div><!-- /container --> | |
| </body> |
| ``` | |
| 255.times { puts '#%06x'%(rand*0xffffff) } | |
| ``` | |
| #3df5bd | |
| #55e6a6 | |
| #52c4e4 | |
| #c5fc45 | |
| #07debb | |
| #3a29eb | |
| #e7a501 |
filename.rb file for which you’d like to create a filename_spec.rbrspec --init from the same working directory as to where you have filename.rb.rspec file for youspec_helper.rb where you need continually require the ruby files that you would want to write specs forfilename_spec.rb within the spec directory.rspec file to add the option: --format documentation| # Make sure you have java 7+, git and a beer cause its going to be awhile :) # | |
| wget http://getspigot.org/build.sh && sudo bash build.sh |
This guide explains the way to setup a production server using Capistrano.
# Gemfile
# Use Capistrano for deployment| # I have the following string and needed to extract just the values from it. | |
| # Thus removing the key and =/& symbols and return the values in an array | |
| # | |
| # I did it like so. | |
| str = "str1=lolf839Di8FjliWBfcceBab8PvD9AuqY1b7ISjVL43XeOh7yaUA&str2=OAW8mb1x7lEl0s5OUCz7vdZtMVzYXI9j8IYkxhKfCbQ" | |
| str.split('&').each{|b| b.gsub!(/.*?=(?=)/im, "")} | |
| # > ["lolf839Di8FjliWBfcceBab8PvD9AuqY1b7ISjVL43XeOh7yaUA", "OAW8mb1x7lEl0s5OUCz7vdZtMVzYXI9j8IYkxhKfCbQ"] |
| require 'oauth_util.rb' | |
| require 'net/http' | |
| o = OauthUtil.new | |
| o.consumer_key = 'examplek9SGJUTUpocjZ5QjBJmQ9WVdrOVVFNHdSR2x1TkhFbWNHbzlNQS0tJnM9Y29uc3VtkZXJzZWNyZXQmeD0yYg--'; | |
| o.consumer_secret = 'exampled88d4109c63e778dsadcdd5c1875814977'; | |
| url = 'http://query.yahooapis.com/v1/yql?q=select%20*%20from%20social.updates.search%20where%20query%3D%22search%20terms%22&diagnostics=true'; |