gem install mysql2 -v 'x.x.x' -- --with-mysql-config=/usr/local/Cellar/mysql/y.y.y/bin/mysql_config
x.x.x = version of the mysql2 gem you want to install
[your-slack].slack.com/services/new/hubot
If you want to rename the automatically generated heroku domain name:
require 'rake' | |
# http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html | |
require 'net/http' | |
desc "this is a test" | |
task :testing_rake do | |
puts "Hello from rake!" | |
end | |
namespace :remote_file do |
$ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Solved by :
rm /usr/local/var/postgres/postmaster.pid
link_to 'Reset', message_path(@message), :data => {:confirm => 'Are you sure?'} |
DISABLED_TASKS = [ | |
'db:drop', | |
'db:migrate:reset', | |
'db:schema:load', | |
'db:seed', | |
# ... | |
] | |
namespace :db do | |
desc "Disable a task in production environment" |
def generate_random_string(length) | |
rand(36**length).to_s(36) | |
end |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
from http://trentrichardson.com/2013/12/16/sort-dom-elements-jquery/
I wanted to share a quick snippet that I worked up for a unique scenario. Occasionally you want to sort or display DOM elements in a certain order. For instance, what if you have a list of names. A feature of your site may be that you can sort the list by first name, or last name. There are a few ways you can approach this.
One approach may be using a javascript framework like Backbone or Angular, where you have a model and collection. Then simply sort the collection, magic happens, and your list is essentially regenerated.
The other could be that you’re not using a framework and not want to regenerate the entire list, but to move the nodes. It is actually rather simple. Lets say you have a list like the following: