Action | HTTP Verb | URL |
---|---|---|
Find | GET | /people/123 |
Find All | GET | /people |
Update | PUT | /people/123 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u root -p -e"show processlist;"|awk '{print $3}'|awk -F":" '{print $1}'|sort|uniq -c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template = require 'views/templates/hostels/search' | |
CollectionView= require 'views/base/collection-view' | |
HostelItemView = require 'views/hostels/item' | |
module.exports = class HostelSearchView extends CollectionView | |
className: 'search-results' | |
itemView: HostelItemView | |
template: template | |
listSelector: '.hostels' | |
fallbackSelector: '.empty-message' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Include the authorization tokens if we're issuing an API request. | |
# By doing this, we can call the API and the system will include the authorization headers for us. | |
# http://api.jquery.com/jQuery.ajaxPrefilter/ | |
$.ajaxPrefilter (options, originalOptions, xhr) -> | |
is_request_to_api = (options.url.indexOf('<%= Settings.API.URL %>') == 0) | |
if is_request_to_api | |
xhr.setRequestHeader('Authorization', "Token token=\"<%= Settings.API.TOKEN %>\", signature=\"<%= Settings.API.SIGNATURE %>\", timestamp=\"<%= Settings.API.TIMESTAMP %>\"") | |
return | |
# Get the user location using our API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias fucking='sudo' | |
alias be='bundle exec' | |
alias r='bundle exec rake' | |
alias fs='bundle exec foreman start' | |
alias rs='bundle exec rails server' | |
alias rg='bundle exec rails generate' | |
alias rc='bundle exec rails console' | |
alias log='tail -f log/*.log' | |
alias c='clear' | |
alias v='vim' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pushes to heroku origin | |
# Call like this: | |
# >> rake deploy:heroku staging | |
# >> rake deploy:heroku production | |
namespace :deploy do | |
task :heroku do | |
current_branch = `git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`.gsub("\n", "").gsub("* ", "") | |
deploy_to = ARGV[1].try(:dup) || 'staging' | |
sh "git push #{deploy_to} #{current_branch}:master -f" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.logo | |
+at2x(logo-mams, 74px, 84px) |
After upgrading to Mountain Lion, I got this message when trying to run my local rails server:
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
Users/user/.rvm/rubies/ruby-1.9.3-rc1/bin/ruby extconf.rb
brew install iftop
ifconfig -l
>>> et0 et1 ....
sudo iftop -i et1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery selectbox plugin | |
* | |
* Copyright (c) 2007 Sadri Sahraoui (brainfault.com) | |
* Licensed under the GPL license and MIT: | |
* http://www.opensource.org/licenses/GPL-license.php | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* The code is inspired from Autocomplete plugin (http://www.dyve.net/jquery/?autocomplete) | |
* |