Skip to content

Instantly share code, notes, and snippets.

# encoding: utf-8
# This file is dependent of Cucumber Rails project (https://github.com/cucumber/cucumber-rails/tree/master/lib/generators/cucumber/install/templates/step_definitions)
# Copy it to cucumber-rails/lib/generators/cucumber/install/templates/step_definitions/web_steps_fr.rb.erb
<%= embed_file('support/web_steps_warning.txt') %>
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "selectors"))
# Single-line step scoper
Lorsque /^(.*) est dans ([^:]+)$/ do |step, parent|
@nowhereman
nowhereman / awesome_nested_set_helper.rb
Created August 26, 2010 12:32
Awesome Nested Set Helper who returns options for select with only one DB query.
# Copy this file in RAILS_ROOT/config/initializers/awesome_nested_set_helper.rb
module CollectiveIdea::Acts::NestedSet::Helper
# Like #nested_set_options helper but with only one DB query
#
# Returns options for select.
# You can exclude some items from the tree.
# You can pass a block receiving an item and returning the string displayed in the select.
#
# == Params
@nowhereman
nowhereman / README.md
Created April 23, 2010 15:08
Transform TextMate Snippets into NetBeans Code Templates

!!! Obselete Gist !!! Go to http://github.com/nowhereman/snippets-converter

Convert TextMate Snippets into NetBeans Code Templates.

How to use (for Ubuntu):

Copy your TextMate Snippets directory into the tmsnippets2netbeans folder, run ruby tmsnippets2netbeans.rb This will convert all you need and create a XML file.

@nowhereman
nowhereman / inherited_resources_controller_instead_of_application_controller.diff
Created January 25, 2010 16:04
Patch nifty scaffold generator to add --skip-actions option for controller only. Patch nifty layout generator to used jQuery and Jammit
# Use Inherited Resources controller instead of Application controller
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
--- /opt/ree/lib/ruby/gems/1.8/gems/nifty-generators-0.3.0/rails_generators/nifty_scaffold/templates/controller.rb
+++ /home/nowhereman/project1/vendor/generators/nifty_scaffold/templates/controller.rb
@@ -1,3 +1,4 @@
-class <%= plural_class_name %>Controller < ApplicationController
+class <%= plural_class_name %>Controller < InheritedResources::Base
+ respond_to :html, :xml, :json
@nowhereman
nowhereman / autotest_installation.sh
Created October 26, 2009 11:44
Install Autotest with notifications on Ubuntu
#!/usr/sh
#Install Autotest on Ubuntu with notifications
sudo apt-get install libnotify-bin
sudo gem install ZenTest autotest-rails autotest-notification redgreen phocus
#Run
an-install
#In ~/.autotest, add :
require 'redgreen/autotest'
@nowhereman
nowhereman / rails_footnotes_with_netbeans_on_linux.rb
Created October 25, 2009 21:10
Rails Footnotes with Netbeans on Linux
#Rails Footnotes with Netbeans on Linux
#Put these lines in environment.rb
if defined?(Footnotes)
Footnotes::Filter.prefix = "editor://open?url=file://%s&amp;line=%d"
end
@nowhereman
nowhereman / netbeans_in_english.sh
Created October 16, 2009 07:49
Netbeans ML always in English local
#!/bin/sh
netbeans --locale en:US
@nowhereman
nowhereman / rewrite_a_specific_commit_message_in_git.bash
Created October 14, 2009 13:45
Git - Rewriting a specific commit message in history
#!/bin/bash
#Rewriting a specific commit message in Git history
#If you have this message 'Namespace refs/original/ not empty'
#Remove the sub folders of your $GIT_REPO_ROOT/.git/refs/original
#Replace <commit-id> by your commit id !
git filter-branch --msg-filter '
test $GIT_COMMIT = <commit-id> && echo "My new commit message" || cat
' HEAD
@nowhereman
nowhereman / open_current_directory_in_git_cola.bash
Created October 14, 2009 12:13
Nautilus - Open the current directory in Git Cola
#Put this file in ~/.gnome2/nautilus-scripts directory
#!/bin/bash
#Open the current directory of Nautilus in git cola
if [ "x$NAUTILUS_SCRIPT_CURRENT_URI" = "x" ]; then
workdir=$(pwd) #FIXME
else
workdir=$(echo $NAUTILUS_SCRIPT_CURRENT_URI| sed 's/file:\/\///g')
fi
@nowhereman
nowhereman / Better solution.sh
Created October 1, 2009 15:36
Fix ruby-oci8 gem install on Ubuntu 8.10
sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ORACLE_HOME=$ORACLE_HOME gem install ruby-oci8