This file contains 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
(require 'pastie) | |
(global-set-key (kbd "C-x p r") 'pastie-buffer) | |
(global-set-key (kbd "C-x p b") 'pastie-region) | |
(global-set-key (kbd "C-x p o") 'pastie-browse) | |
(global-set-key (kbd "C-x p g") 'pastie-get) | |
(require 'gist) |
This file contains 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
class Category < ActiveRecord::Base | |
validates_presence_of :name | |
has_many :products | |
has_many :seconds, :through => :category_relationships, :foreign_key => 'first_id' | |
has_many :firsts, :through => :category_relationships, :foreign_key => 'second_id' | |
end |
This file contains 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
I have 2 models | |
Category | |
+----+-----------------+-------------------------+-------------------------+ | |
| id | name | created_at | updated_at | | |
+----+-----------------+-------------------------+-------------------------+ | |
| 1 | FistCategory1 | 2011-07-21 09:11:07 UTC | 2011-07-21 09:11:07 UTC | | |
| 2 | SecondCategory1 | 2011-07-21 09:11:20 UTC | 2011-07-21 09:11:20 UTC | | |
+----+-----------------+-------------------------+-------------------------+ |
This file contains 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
Started POST "/admin/categories/1/create_children" for 127.0.0.1 at 2011-07-27 10:11:43 +0300 | |
Processing by Admin::CategoriesController#create_children as JS | |
Parameters: {"utf8"=>"✓", "authenticity_token"=>"CSH+1K3iG59/TZZjxvHZ/O0A+F9I2gUqQHb8jn46ZUY=", "category"=>{"name"=>"ha ha ha2"}, "commit"=>"Create", "id"=>"1"} | |
ApplicationController::require_user | |
ApplicationController::current_user | |
ApplicationController::current_user_session | |
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 | |
CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 | |
(0.3ms) UPDATE "users" SET "last_request_at" = '2011-07-27 07:11:44.055414', "updated_at" = '2011-07-27 07:11:44.055813' WHERE "users"."id" = 1 | |
ApplicationController::current_user_session |
This file contains 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
When I go to the "The Godfather" review by url # features/step_definitions/web_steps.rb:48 | |
PGError: ERROR: current transaction is aborted, commands ignored until end of transaction block | |
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull | |
FROM pg_attribute a LEFT JOIN pg_attrdef d | |
ON a.attrelid = d.adrelid AND a.attnum = d.adnum | |
WHERE a.attrelid = '"taxons"'::regclass | |
AND a.attnum > 0 AND NOT a.attisdropped | |
ORDER BY a.attnum | |
(ActionView::Template::Error) | |
/var/lib/gems/1.8/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract_adapter.rb:207:in `log' |
This file contains 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
require 'spec_helper' | |
describe VolumePrice do | |
before(:each) do | |
puts "AAAA" | |
end | |
describe 'test' do | |
puts 'bbb' | |
end |
This file contains 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
<% | |
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" | |
%> | |
default: --drb <%= std_opts %> features | |
wip: --drb --tags @wip:3 --wip features | |
rerun: --drb <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip |
This file contains 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
if Rails.env.test? && defined?(Spork) && Spork.using_spork? | |
include HookHelper | |
include Spree::BaseHelper | |
include Admin::NavigationHelper | |
end |
This file contains 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
#!/bin/bash | |
DEV_DIR=$HOME/develop | |
PROJECT_DIR=$DEV_DIR/.project_dir | |
function add(){ | |
pwd=`pwd` | |
name=$(basename $pwd) | |
if [[ $(grep "^$name " $PROJECT_DIR) ]]; then | |
echo "This dir `pwd` already exists, but I can raplace path" |
This file contains 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
(defun open-developer-screen () | |
"Open the developer screen" | |
(interactive nil) | |
(shell-command "urxvtc -name EmacsDevScreen +sb -e screen -S dev") | |
) |
OlderNewer