Skip to content

Instantly share code, notes, and snippets.

View achempion's full-sized avatar
✍️
Writing software

Boris Kuznetsov achempion

✍️
Writing software
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')
@fabioyamate
fabioyamate / curb_ubuntu.txt
Created November 11, 2010 12:50
installing curb on ubuntu 10.04
# 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 February 22, 2012 14:24 — forked from shapeshed/unicorn
unicorn init.d
/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 February 25, 2012 05:16
Install qtbindings on Mac OS X Lion with homebrew
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 April 22, 2012 23:53
CoffeeScript, Jade and Stylus syntax highlighting in Sublime Text 2

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

@keeperofthenecklace
keeperofthenecklace / Testing REST APIs with Cucumber and Rack::Test
Created August 18, 2012 20:00
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 October 16, 2019 13:33
Ruby code folding using hideshow
(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 February 11, 2022 18:45
Install wkhtmltopdf on Centos 6 x64
$ 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
@kzaitsev
kzaitsev / carrierwave.rb
Created January 15, 2014 19:44
Carrierwave + Selectel
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 April 16, 2024 16:36
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

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