git initCreates a new git repository in the directory
git add <file name>Adds a specific file to staging
git add .orgit add -AAdds the full directory and its contents to staging
| #require 'sidekiq/api' | |
| # 1. Clear retry set | |
| Sidekiq::RetrySet.new.clear | |
| # 2. Clear scheduled jobs | |
| Sidekiq::ScheduledSet.new.clear |
| class Change | |
| def change(amount) | |
| available_coins = [100,50,25,10,5,1] # http://en.wikipedia.org/wiki/Coins_of_the_United_States_dollar | |
| coins = [] | |
| index = 0 | |
| coin = available_coins[index] | |
| remaining_amount = amount | |
| until remaining_amount == 0 | |
| until remaining_amount >= coin | |
| index = index + 1 |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new(STDERR) | |
| ActiveRecord::Base.colorize_logging = false | |
| ActiveRecord::Base.establish_connection( | |
| :adapter => "sqlite3", | |
| :dbfile => ":memory:" | |
| ) |
| <h2><%= plural_table_name.titleize %></h2> | |
| <p id="notice"><%%= notice %></p> | |
| <hr> | |
| <div> | |
| <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %> | |
| <div class="content"> | |
| <% attributes.reject(&:password_digest?).each do |attribute| -%> |
| http://jimneath.org/2010/01/04/cryptic-ruby-global-variables-and-their-meanings.html | |
| ------------incase the link above stops working--------------------- | |
| Environmental Global Variables | |
| $: (Dollar Colon) | |
| $: is basically a shorthand version of $LOAD_PATH. $: contains an array of paths that your script will search through when using require. |
| def append(ary, n) | |
| return ary if n < 0 | |
| return append((ary.push n), n-1) | |
| end | |
| appended = append [], 2 | |
| puts appended.inspect # => [2, 1, 0] | |
| def prepend(ary, n) | |
| return ary if n < 0 |