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
| history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -r |
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
| rake auth:gen:site_key # Generates config/initializers/site_keys.rb | |
| rake cruise:test # Run all the specifications after resetting test database | |
| rake db:abort_if_pending_migrations # Raises an error if there are pending migrations | |
| rake db:charset # Retrieves the charset for the current environment's database | |
| rake db:collation # Retrieves the collation for the current environment's database | |
| rake db:create # Create the database defined in config/database.yml for the current RAILS_ENV | |
| rake db:create:all # Create all the local databases defined in config/database.yml | |
| rake db:development:backup # backs up the development database to development.pristine | |
| rake db:development:load # load the local development database from the models specified in 'load_for'. | |
| rake db:development:restore # restore the state of the deve |
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
| # app/controllers/application.rb | |
| class ApplicationController < ActionController::Base | |
| before_filter :modify_protocol | |
| private | |
| def modify_protocol | |
| returning(true) do | |
| if Rails.configuration.protocol_modifier |
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
| # Usage: git-doc-up 1.6.1 | |
| function git-doc-up() { | |
| wget http://www.kernel.org/pub/software/scm/git/git-manpages-$1.tar.bz2 | |
| sudo tar xjv -C /usr/share/man -f git-manpages-$1.tar.bz2 | |
| rm git-manpages*bz2 | |
| echo "Be sure to run 'sudo periodic weekly'" | |
| } |
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
| def request(verb, path, options = {}, body = nil, attempts = 0, &block) | |
| Service.response = nil | |
| process_options!(options, verb) | |
| response = response_class.new(connection.request(verb, path, options, body, attempts, &block)) | |
| Service.response = response | |
| Error::Response.new(response.response).error.raise if response.error? | |
| response | |
| # Once in a while, a request to S3 returns an internal error. A glitch in the matrix I presume. Since these | |
| # errors are few and far between the request method will rescue InternalErrors the first three times they encouter them |
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
| build do | |
| copy 'src/specs', 'target/specs' do |filter| | |
| filter.created_at < Time.now && filter.version == current_version | |
| end | |
| 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
| var links = Dom.getElementsBy(function (el) { | |
| return el.href.match(/pica9/); | |
| }, 'A', 'menu_travel_tools'); | |
| if (links && 0 < links.size) { | |
| Dom.get('pica-link').href = links[0].href; | |
| } |
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
| Dom.getElementsBy(function (el) { | |
| return el.tagName.match(/^H[16]$/) && el.className.match(/title/i); | |
| }, null, 'frame', Cufon.replace); |
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
| // The fastest way to reverse a string.... | |
| String.prototype.reverse = function () { | |
| return this.split("").reverse().join(""); | |
| }; |