Skip to content

Instantly share code, notes, and snippets.

Avatar
✍️
Writing software

Boris Kuznetsov achempion

✍️
Writing software
View GitHub Profile
View 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')
@fabioyamate
fabioyamate / curb_ubuntu.txt
Created Nov 11, 2010
installing curb on ubuntu 10.04
View curb_ubuntu.txt
# installing curb gem on Ubuntu require libcurl
sudo apt-get install libcurl3-dev
Or new version, but it conflicts if some libraries.
sudo apt-get install libcurl4-dev
(some other packages libcurl4-openssl-dev libcurl4-gnutls-dev)
gem install curb
@tomazzlender
tomazzlender / unicorn
Created Feb 22, 2012 — forked from shapeshed/unicorn
unicorn init.d
View unicorn
/usr/sbin/update-rc.d -f unicorn defaults
chmod +x /etc/init.d/unicorn
/usr/sbin/update-rc.d -f unicorn remove
@siuying
siuying / gist:1906600
Created Feb 25, 2012
Install qtbindings on Mac OS X Lion with homebrew
View gist:1906600
brew install qt
brew install cmake
# Change 4.8.0 to the QT version installed
for DIR in /usr/local/Cellar/qt/4.8.0/lib/*.framework; do
ln -s $DIR/Headers ${DIR%%/lib/*}/include/$(basename $DIR .framework);
done
gem install qtbindings
@liamdon
liamdon / gist:2467603
Created Apr 22, 2012
CoffeeScript, Jade and Stylus syntax highlighting in Sublime Text 2
View gist:2467603

Step 1: Clone the bundles into your Sublime Text packages directory

cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus

Step 2: Restart Sublime Text 2

View Testing REST APIs with Cucumber and Rack::Test
# First attempting to use Capybara directly, you will ran into issues when trying to set HTTP header.
# Using Basic HTTP Authentication requires that we needed to set the header.
# Also we need to set the Content-Type and Accept headers to ensure that Rails handles the input and output correctly.
# When using Rack, Capybara delegates request and response handling down to Rack::Test.
# So I used Rack::Test directly in my step definitions, and it works.
# Rack::Test has a module called Rack::Test::Methods that can be mixed into a class to provide it
# with methods for get, post, put, delete as well as last_request, last_response, header and more.
# I mixed Rack::Test::Methods into the Cucumber world at the top of our API steps file like so:
##############################
@chrisbarrett
chrisbarrett / ruby-hideshow.el
Last active Oct 16, 2019
Ruby code folding using hideshow
View ruby-hideshow.el
(eval-after-load "hideshow"
'(add-to-list 'hs-special-modes-alist
`(ruby-mode
,(rx (or "def" "class" "module" "{" "[")) ; Block start
,(rx (or "}" "]" "end")) ; Block end
,(rx (or "#" "=begin")) ; Comment start
ruby-forward-sexp nil)))
@nghuuphuoc
nghuuphuoc / gist:8282411
Last active Feb 19, 2021
Install wkhtmltopdf on Centos 6 x64
View gist:8282411
$ wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-amd64.tar.bz2
$ tar xvjf wkhtmltopdf-0.9.9-static-amd64.tar.bz2
$ mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
// In case you got the issue
// wkhtmltopdf: error while loading shared libraries:
// libfontconfig.so.1: cannot open shared object file: No such file or directory
//
// run the command below:
$ yum install urw-fonts libXext libXrender fontconfig libfontconfig.so.1
@Bugagazavr
Bugagazavr / carrierwave.rb
Created Jan 15, 2014
Carrierwave + Selectel
View carrierwave.rb
CarrierWave.configure do |config|
if Rails.env.development? || Rails.env.test?
config.storage = :file
else
config.storage = :fog
config.fog_credentials = {
:provider => 'OpenStack',
:openstack_auth_url => 'https://auth.selcdn.ru/v1.0',
:openstack_username => Rails.application.secrets.openstack_username,
:openstack_api_key => Rails.application.secrets.openstack_api_key
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active Mar 3, 2021
A comparison of using `git flow` commands versus raw `git` commands.
View gitflow-breakdown.md

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository