Skip to content

Instantly share code, notes, and snippets.

Writing software

Boris Kuznetsov achempion

Writing software
View GitHub Profile
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);
gem install qtbindings
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias gco='git checkout '
alias gp='git push '
alias gpf='git push --force '
alias gpr='git pull --rebase '
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:// CoffeeScript
git clone Jade
git clone 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:
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
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
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
,(rx (or "def" "class" "module" "{" "[")) ; Block start
,(rx (or "}" "]" "end")) ; Block end
,(rx (or "#" "=begin")) ; Comment start
ruby-forward-sexp nil)))
Bugagazavr / carrierwave.rb
Created Jan 15, 2014
Carrierwave + Selectel
View carrierwave.rb
CarrierWave.configure do |config|
if Rails.env.development? || Rails.env.test? = :file
else = :fog
config.fog_credentials = {
:provider => 'OpenStack',
:openstack_auth_url => '',
:openstack_username => Rails.application.secrets.openstack_username,
:openstack_api_key => Rails.application.secrets.openstack_api_key
leemour / carrierwave_selectel.rb
Last active May 5, 2020
Carrierwave integration with Selectel using fog-openstack
View carrierwave_selectel.rb
CarrierWave.configure do |config|
if Rails.env.test? || Rails.env.cucumber? = :file
config.enable_processing = false
config.asset_host = Rails.application.secrets.asset_host
config.fog_provider = 'fog/openstack'
config.fog_credentials = {
provider: 'OpenStack',
openstack_auth_url: '',
nghuuphuoc / gist:8282411
Last active Feb 19, 2021
Install wkhtmltopdf on Centos 6 x64
View gist:8282411
$ wget
$ 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:
// cannot open shared object file: No such file or directory
// run the command below:
$ yum install urw-fonts libXext libXrender fontconfig