start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/sh | |
# on ubuntu: need some utils & dev libs | |
sudo apt-get install apache2-utils openssl libssl-dev libpcre3-dev | |
# compile nginx | |
cd /tmp | |
curl http://nginx.org/download/nginx-0.7.64.tar.gz | tar xz | |
cd nginx* | |
./configure --with-http_ssl_module --with-http_dav_module \ |
=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') |
require 'rubygems' | |
require 'httparty' | |
require 'curb' | |
require 'net/http' | |
require 'benchmark' | |
include Benchmark | |
RUNS = 1000 | |
url = 'http://localhost:4567/' |
# config/initializers/clear_logs.rb | |
# This snippet simply clears your logs when they are too large. | |
# Large logs mean looooong search in TextMate. You know it :) | |
# Every time you run rails server or rails console it checks log sizes | |
# and clears the logs for you if necessary. | |
if Rails.env.development? | |
MAX_LOG_SIZE = 2.megabytes | |
Git revision: 9b395bad80da30f0101e5df91cc9d18aeac2b3c1 | |
$ BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.0.rb DB=postgres bundle exec rake bench | |
------------------------------------------------------------------------ | |
Using ruby 2.0.0 AR 4.0.0 with postgres | |
Rehearsal ---------------------------------------------------------------------------------- | |
find (without FriendlyId) 0.340000 0.030000 0.370000 ( 0.473857) | |
find (in-table slug) 0.990000 0.040000 1.030000 ( 1.285145) | |
find (in-table slug; included FinderMethods) 0.420000 0.020000 0.440000 ( 0.663232) | |
find (external slug) 1.630000 0.050000 1.680000 ( 2.194663) |
# app/config/deploy.rb | |
# Most of the changes specific to your environment will be set in | |
# the `app/config/deploy/[env].rb` files. | |
# define multiple deployments | |
set :stages, %w(production staging) | |
set :default_stage, "staging" |
<% [:notice, :error, :alert].each do |level| %> | |
<% unless flash[level].blank? %> | |
<div class="alert-message <%= flash_class(level) %>"> | |
<a class="close" href="#">×</a> | |
<%= content_tag :p, flash[level] %> | |
</div> | |
<% end %> | |
<% end %> |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
#!/usr/bin/env bash | |
uninstall() { | |
list=`gem list --no-versions` | |
for gem in $list; do | |
gem uninstall $gem -aIx | |
done | |
gem list | |
gem install bundler | |
} |