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
| List Branches Merged into a Target Branch | |
| git branch --merged <Target Branch name> | |
| See the changes of a file: | |
| git log -p <path_to_the_file> | |
| Apply patch: | |
| git am | |
| Creating patch: |
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 Notes | |
| If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
| you may need to remove the previous version first. See: | |
| https://github.com/mxcl/homebrew/issues/issue/2510 | |
| To build plpython against a specific Python, set PYTHON prior to brewing: | |
| PYTHON=/usr/local/bin/python brew install postgresql | |
| See: | |
| http://www.postgresql.org/docs/9.1/static/install-procedure.html |
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
| https://developers.facebook.com/apps | |
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
| Migrating data between plans: | |
| https://devcenter.heroku.com/articles/migrating-data-between-plans | |
| postgresql | |
| https://devcenter.heroku.com/articles/heroku-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
| module SolrFilter | |
| module ClassMethods | |
| def do_guess_what(*args) | |
| args.each do |arg| | |
| define_method "#{arg.to_s}_solr_filtered" do | |
| send(arg).gsub /\'/, '' | |
| end | |
| end | |
| 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
| sale = Sale.new | |
| Item.where("brand LIKE '%Barney%'").where(:deleted_at => nil).each do |item| | |
| doc1 = AWSCloudSearch::Document.new(true) | |
| doc1.id = item.id | |
| sale.destroy_doc(doc1) | |
| item.deleted_at = Time.now | |
| item.save | |
| end | |
| sale.flush_batch |
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
| ENV["RAILS_ENV"] = "test" | |
| require File.expand_path('../../config/environment', __FILE__) | |
| require 'rubygems' | |
| gem 'minitest' | |
| require 'minitest/autorun' | |
| require 'action_controller/test_case' | |
| require 'miniskirt' | |
| require 'capybara/rails' |
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
| ssh -i ~/.ec2/gsg-keypair [email protected] | |
| pg_dump -a -F c -U search_server search_server_production > db.out | |
| scp -i ~/.ec2/gsg-keypair [email protected]:/mnt/search_server-production/current/db.out db.out | |
| scp -i ~/.ec2/gsg-keypair db.out [email protected]:/mnt/search_server_staging-production/current/db.out | |
| pg_restore -a -d search_server_staging_production -U search_server_st db.out |
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
| constraint = lambda { |request| request.env["warden"].authenticate? and request.env['warden'].user.admin? } | |
| constraints constraint do | |
| mount Sidekiq::Web, :at => '/admin/sidekiq' | |
| 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
| aliases = Tire::Configuration.client.get(Tire::Configuration.url + '/_aliases').body | |
| prod = Product.create long_description: 'alma' | |
| price1 = Price.new price:1, agreement_id:1 | |
| price2 = Price.new price:2, agreement_id:2 | |
| prod.prices<< price1 | |
| prod.prices<< price2 | |
| prod.tire.update_index | |
| prod.touch |
OlderNewer