Skip to content

Instantly share code, notes, and snippets.

View codenamev's full-sized avatar
🌩️

Valentino Stoll codenamev

🌩️
View GitHub Profile
@30equals
30equals / howto_zsh_noautocorrect
Created August 7, 2012 18:10
Ignore ZSH autocorrect for certain commands
1) List all the commands to not be corrected in ~/.zsh_nocorrect, 1 per line.
2) Add to ~/.zshrc:
if [ -f ~/.zsh_nocorrect ]; then
while read -r COMMAND; do
alias $COMMAND="nocorrect $COMMAND"
done < ~/.zsh_nocorrect
fi
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@chrisbloom7
chrisbloom7 / order_test_steps.rb
Created March 20, 2012 21:15
A cucumber/capybara step to test the order of elements in a list
Then /^I should see each item listed in alphabetical order in the items section$/ do
@items.each_with_index do |item, index|
find(:xpath, "//*[@id='items']/ul[@class='items']/li[#{index+1}]").inspect.should eq(find("li#item-#{item.friendly_id}").inspect)
@item = item
step "I should see the item listed in the items section"
end
end
Then /^I should( not)? see the item listed in the items section$/ do |negation|
assertion = negation ? :should_not : :should
@chetan
chetan / yardoc_cheatsheet.md
Last active April 13, 2025 14:08
YARD cheatsheet
@kylefiedler
kylefiedler / css.snippets
Last active November 7, 2019 16:42
Vim CSS Snippets
#Sass Snippets
snippet @i
@import "${1}";
snippet ext
@extend ${1};
snippet inc
@include ${1}(${2});${3}
snippet @m
@media ${1} {
${2}
@scottwb
scottwb / number_with_delimiter.js
Created February 11, 2011 04:10
Rails-like number_with_delimiter in javascript
Number.prototype.number_with_delimiter = function(delimiter) {
var number = this + '', delimiter = delimiter || ',';
var split = number.split('.');
split[0] = split[0].replace(
/(\d)(?=(\d\d\d)+(?!\d))/g,
'$1' + delimiter
);
return split.join('.');
};
@txus
txus / delegate_matcher.rb
Created February 2, 2011 09:19
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:month).to(:created_at) }
# it { should delegate(:year).to(:created_at) }
# end
@petros
petros / CampfireIcons.txt
Created January 25, 2011 23:36
Campfire icons
:sunny:
:zap:
:leaves:
:lipstick:
:cop:
:wheelchair:
:fish:
:hammer:
:moneybag:
:calling:
# extract_fixtures.rake
# by Paul Schreiber <paulschreiber at gmail.com>
# 15 June 2010
#
# I got this from Peter Gulezian <http://metoca.net/>
# Looks like another version is here
# <http://redmine.rubyforge.org/svn/trunk/lib/tasks/extract_fixtures.rake>
#
# This is the inverse of the built-in rake db:fixtures:load
#
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')