start new:
tmux
start new with session name:
tmux new -s myname
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# Public: Stubs partial search | |
# Examples => | |
# stub_partial_search(:node, 'name:web*').and_return([{ 'fqdn' => 'web01.example.com' }]) | |
# | |
def stub_partial_search(type, query) | |
allow(Chef).to receive(:partial_search).and_call_original | |
expect(Chef).to receive(:partial_search).with(type, query, any_args) | |
end |
machine: | |
services: | |
- 'postgresql' | |
- 'redis' | |
environment: | |
REDIS_URL: 'redis://localhost:6379/0' | |
dependencies: | |
pre: | |
- 'git config user.email deploy+$CIRCLE_USERNAME@brandfolder.com' | |
- 'git config user.name $CIRCLE_USERNAME' |
(function() { | |
var gs = document.createElement('script'), gsc = document.createElement('div'), interval; | |
gs.type = 'text/javascript'; gs.async = true; gsc.id = 'getsatisfaction'; | |
gs.src = document.location.protocol + '//s3.amazonaws.com/getsatisfaction.com/javascripts/feedback-v2.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(gs); | |
(document.getElementsByTagName('body')[0]).appendChild(gsc); | |
interval = setInterval(function() { | |
if (window.GSFN !== undefined) { | |
new GSFN.feedback_widget({ |
cd ~ | |
sudo apt-get install unzip | |
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jre sun-java6-plugin -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz |
#!/usr/bin/env bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -xvzf ruby-1.9.3-p194.tar.gz | |
cd ruby-1.9.3-p194/ | |
./configure --prefix=/usr/local | |
make | |
make install |
gem 'tire', '~> 0.4.1'
Bonsai provisions one ElasticSearch index per application. Tire, however, assumes that each model is using its own index.
Currently the best way to work around this is to set the Tire.configuration.url
and the model's index_name
manually.
if (typeof console === "undefined" || typeof console.log === "undefined") { | |
console = { | |
log: function() { | |
} | |
}; | |
} |
class AddCountTriggers < ActiveRecord::Migration | |
def up | |
execute %q{ | |
CREATE OR REPLACE FUNCTION update_task_counters (taskid integer) | |
RETURNS void AS $$ | |
BEGIN | |
update tasks set | |
users_count = coalesce((select count(9) from taskships where task_id = taskid), 0) | |
where id = taskid; | |
END; |