start new:
tmux
start new with session name:
tmux new -s myname
=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') |
#!/bin/sh | |
# | |
# Salve este script no diretório /etc/cron.hourly e dê permissão | |
# de execução a ele. Desse modo a cada hora sera verificada se a | |
# porcentagem de memória utilizada pelo sistema atingiu o valor definido | |
# na variável 'percent'. Caso positivo, o script informará ao kernel | |
# que este deverá alterar o valor da opção 'drop_caches' para 3. | |
# | |
# Mais detalhes: 'man proc' -> /proc/sys/vm/drop_caches. | |
PATH="/bin:/usr/bin:/usr/local/bin" |
pt-BR: | |
views: | |
admin: | |
home: | |
name: Home | |
pagination: | |
previous: "« Anterior" | |
next: "Próximo »" | |
truncate: "…" | |
misc: |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
module Wysihtml5Helper | |
def fill_in_wysihtml5(text) | |
#js must be enabled | |
page.execute_script("editor.setValue('#{text}')") | |
end | |
end |
require 'clipboard' #gem install clipboard | |
def cbcopy(value) | |
Clipboard.copy value unless value.empty? | |
flash_message = value.empty? ? "Sorry, nothing to copy" : "Copied to clipboard" | |
print "# #{flash_message}: " | |
puts %Q("#{value}") | |
end | |
# Copy last result to the Clipboard |
"Russian-Doll Caching" is great. It embraces the Rails (and Ruby) goal to "make the developer happy". And it does. Not having to worry about cache expiration is superb.
It has its limits, though. If you're trying to avoid any database queries, russian-doll caching will not work for you. If you are trying to represent thousands, or even hundreds, of objects under a single cache fragment, russian-doll caching is not the best option.
We use it whenever it makes sense, but sometimes we just have to bite the bullet and expire a cache fragment manually. When you want to start manually expiring cache on a fairly busy website, you have to start considering race conditions. I recently ran into the following scenario:
class Post < ActiveRecord::Base
after_save :expire_cache
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |