start new:
tmux
start new with session name:
tmux new -s myname
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
sudo cp nginx /etc/init.d/ | |
sudo update-rc.d nginx defaults | |
sudo chmod +x /etc/init.d/nginx | |
/etc/init.d/nginx start |
# | |
# NOTE: This gist is now deprecated and has been moved into a gem: https://github.com/reidmorrison/mongo_ha | |
# | |
require 'mongo/collection' | |
module Mongo | |
class Collection | |
alias_method :find_one_original, :find_one | |
def find_one(*args) |
# encoding: utf-8 | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require 'rvm/capistrano' | |
set :application, "hirefireapp" | |
set :repository, "[email protected]:meskyanichi/myapp.git" | |
set :branch, "develop" | |
set :rvm_ruby_string, "1.9.2" |
Spork.each_run do | |
load "#{Rails.root}/config/routes.rb" | |
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f } | |
end |
#Stories are embedded docs in a Feed | |
class Feed | |
include MongoMapper::Document | |
many :stories | |
end | |
class Story | |
include MongoMapper::EmbeddedDocument | |
key :title, String |