Skip to content

Instantly share code, notes, and snippets.

View viktorchukhantsev's full-sized avatar

Viktor Chukhantsev viktorchukhantsev

View GitHub Profile
@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')
@dblock
dblock / assert_url_helper.rb
Last active September 18, 2018 03:47
A monkey patch for serving compressed assets for Rails 3.0 (asset_tag_helper.rb) and another for Rails 3.1 (asset_paths.rb).
# Rails 4
require 'action_view/helpers/asset_url_helper'
module ActionView
module Helpers
module AssetUrlHelper
def accept_encoding?(encoding)
request = self.request if respond_to?(:request)
return false unless request
@slayer
slayer / rbenv-install-system-wide.sh
Created December 23, 2011 11:17
rbenv install and system wide install on Ubuntu to /opt/rbenv
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /opt/rbenv
# Add rbenv to the path:
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@rwdaigle
rwdaigle / newrelic.yml
Last active November 24, 2015 07:54 — forked from wuputah/newrelic.yml
New Relic config file for apps on Heroku Cedar
#
# This file configures the New Relic Agent. New Relic monitors
# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead.
# For more information, visit www.newrelic.com.
#
# Generated June 03, 2013
#
# This configuration file is custom generated for Barsoom
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 17, 2024 15:03
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@growse
growse / uploadmaildir.pl
Created June 25, 2012 22:30
A way to incrementally upload a maildir to gmail's IMAP servers. Originally by Andreas Kammlott, with some changes
#!/usr/bin/perl
# by Andreas Kammlott, thanks to perl and its community
use IO::Socket::SSL;
use Data::Dumper;
use HTTP::Date qw(str2time);
use HTTP::Date qw(parse_date);
use Date::Format;
use Mail::IMAPClient;
use Mail::Box::Maildir;
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@adamgit
adamgit / .gitignore
Last active July 17, 2024 12:58
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#