Skip to content

Instantly share code, notes, and snippets.

# rake spec
(in /home/petrushka/webdev/my_app)
/usr/lib/ruby/gems/1.9.1/gems/capybara-0.3.9/lib/capybara/cucumber.rb:4:in `<top (required)>': undefined method `World' for main:Object (NoMethodError)
from /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `block in require'
from /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.9.1/gems/akephalos-0.2.4/lib/akephalos/cucumber.rb:1:in `<top (required)>'
@petRUShka
petRUShka / gist:810394
Created February 3, 2011 22:52
List of gems
Using rake (0.8.7)
Using ZenTest (4.4.2)
Using aaronh-chronic (0.3.9)
Using activesupport (2.3.8)
Using rack (1.1.0)
Using actionpack (2.3.8)
Using actionmailer (2.3.8)
Using activerecord (2.3.8)
Using activeresource (2.3.8)
Using authlogic (2.1.6)
SQL (0.1ms) SET NAMES 'utf8'
SQL (0.1ms) SET SQL_AUTO_IS_NULL=0
User Columns (0.8ms) SHOW FIELDS FROM `users`
SQL (0.1ms) BEGIN
User Load (0.3ms) SELECT * FROM `users`
SQL (0.2ms) SAVEPOINT active_record_1
User Load (0.3ms) SELECT `users`.id FROM `users` WHERE (LOWER(`users`.`email`) = BINARY 'aric.smith@kautzergoyette.name') LIMIT 1
User Load (0.2ms) SELECT `users`.id FROM `users` WHERE (LOWER(`users`.`login`) = BINARY 'user') LIMIT 1
User Load (0.2ms) SELECT `users`.id FROM `users` WHERE (`users`.`persistence_token` = BINARY 'ecc763fb6656c60eb3415e6aa786425b0d93d0e8762935377801fd504823f5bef9f6361a3f70610739a2ec30730c7fa393c8918b83a6efd2ae9271f7fe674b37') LIMIT 1
User Create (0.3ms) INSERT INTO `users` (`name`, `last_request_at`, `created_at`, `crypted_password`, `updated_at`, `perishable_token`, `role`, `current_login_ip`, `current_company_id`, `id`, `password_salt`, `current_login_at`, `wanted_company_id`, `persistence_token`, `login_count`, `phone`, `last_login_ip`
@petRUShka
petRUShka / env.rb
Created February 3, 2011 23:06
cucumber config with spork
require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
@petRUShka
petRUShka / gist:4162610
Created November 28, 2012 17:13
ekopatch fail
[ 47%] Generating stdcxx-static-x86_64/atomic-cxx_S.o
[ 47%] Generating stdcxx-static-x86_64/assert_cpp.o
In file included from /tmp/yaourt-tmp-user/aur-path64-suite-git/src/path64-suite/compiler/stdcxx/include/ansi/wchar.h:202,
from /usr/include/_G_config.h:21,
from /usr/include/libio.h:33,
from /usr/include/../include/stdio.h:75,
from /tmp/yaourt-tmp-user/aur-path64-suite-git/src/path64-suite/compiler/stdcxx/include/ansi/stdio.h:93,
from /tmp/yaourt-tmp-user/aur-path64-suite-git/src/path64-suite/compiler/stdcxx/src/assert.cpp:33:
/tmp/yaourt-tmp-user/aur-path64-suite-git/src/path64-suite/compiler/stdcxx/include/rw/_mbstate.h:146: error: conflicting declaration 'typedef struct __mbstate_t __mbstate_t'
/usr/include/../include/wchar.h:94: error: '__mbstate_t' has a previous declaration as 'typedef struct __mbstate_t __mbstate_t'
@petRUShka
petRUShka / be_observed_by.rb
Last active August 29, 2015 14:06
be_observed_by matcher
require 'rspec/expectations'
RSpec::Matchers.define :be_observed_by do |observer_name|
match do |obj|
ActiveRecord::Base.observers.enable observer_name
observer = observer_class(observer_name)
# save old after_create and define new
was_defined = observer.method_defined?(:after_create)
@petRUShka
petRUShka / pre-commit
Last active September 22, 2016 12:43
Git hook which is prevent you from commit code with breakpoints or focus
#!/bin/sh
# Should be placed in .git/hooks/pre-commit inside project dir
# Do not forget to install The Silver Search: https://github.com/ggreer/the_silver_searcher#linux
ag_output=$(ag --color "(:focus\b)|(^[^#\\n]+(byebug|binding\.pry))" `git diff-index --cached HEAD --no-commit-id --name-only | grep ".*rb$"` 2> /dev/null)
if [ $? == 0 ]
then
echo "There are undeleted :focus or breakpoint (byebug or pry-byebug) in following files:"
echo "$ag_output"
exit 1
@petRUShka
petRUShka / get_certs.sh
Created January 25, 2017 17:48
get certificates
#!/bin/sh
SERVER=${1:-my.server.com}
PORT=${2:-993}
CERT_FOLDER=${3:-~/certs}
openssl s_client -connect ${SERVER}:${PORT} -showcerts 2>&1 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'| sed -ne '1,/-END CERTIFICATE-/p' > ${CERT_FOLDER}/${SERVER}.pem
@petRUShka
petRUShka / bibtex-to-latex-bibitem.sh
Last active August 26, 2018 09:28
Script that converts biblatex (bibtex) styled latex document bibliography to standard bibitem bibliography (thebibliography)
#!/bin/bash
###############################################################
# #
# BibTeX (BibLaTeX) to LaTeX \bibitem converter #
# #
###############################################################
# #
# This script converts a file containing #
# BibTeX (BibLaTeX) entries to a list of \bibitems, #

HEAD

header 1

  • [ ] list el 1
  • [ ] list el 2
  • [ ] list el 3
  • [ ] list el 4

header 2