- Install Hubot locally
- Install Slack Adapter
- Configure integration on Slack
- Go to
[your-slack].slack.com/services/new/hubot
- Go to
- Deploy to Heroku
If you want to rename the automatically generated heroku domain name:
[your-slack].slack.com/services/new/hubotIf 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:
| # Additional translations at https://github.com/plataformatec/devise/wiki/I18n | |
| fr: | |
| devise: | |
| confirmations: | |
| confirmed: 'Votre compte a été validé.' | |
| send_instructions: 'Vous allez recevoir les instructions nécessaires à la confirmation de votre compte dans quelques minutes.' | |
| send_paranoid_instructions: 'Si votre e-mail existe dans notre base de données, vous allez bientôt recevoir un e-mail contenant les instructions de confirmation de votre compte.' | |
| failure: | |
| already_authenticated: "Vous êtes déjà connecté" |
| # iTerm2, OS X | |
| # 1. change 'your_app_production' to your application name | |
| # 1a. Tune the colors by your taste | |
| # 2. put these functions to your .bashrc, .zshrc | |
| # or anywhere where it gets loaded for your iTerm session | |
| # 3. restart iTerm or 'source ~/.zshrc' and use these functions | |
| set_color() { | |
| local HEX_FG=$1 | |
| local HEX_BG=$2 |