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
class ApplicationController < ActionController::Base | |
# ... | |
unless Rails.application.config.consider_all_requests_local | |
rescue_from Exception, with: lambda { |exception| render_error 500, exception } | |
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception } | |
end | |
private | |
def render_error(status, exception) |
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
// Usb control: http://openkinect.org/wiki/Protocol_Documentation#Control_Packet_Structure | |
#include <XnUSB.h> | |
#include <cstdio> | |
#include <cstring> | |
#ifdef _WIN32 | |
#include <Windows.h> | |
void sleep_ (int s) | |
{ |
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
@PageSpinner = | |
spin: (ms=500)-> | |
@spinner = setTimeout( (=> @add_spinner()), ms) | |
$(document).on 'page:change', => | |
@remove_spinner() | |
spinner_html: ' | |
<div class="modal hide fade" id="page-spinner"> | |
<div class="modal-head card-title">Please Wait...</div> | |
<div class="modal-body card-body"> | |
<i class="icon-spinner icon-spin icon-2x"></i> |
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
## | |
# Fazendo deploy com o capistrano de uma aplicação Rails | |
# usando servidores da Amazon ec2 e unicorn como servidor | |
# o versionamento do ruby no ambiente de produção foi feito | |
# com o rbenv ( https://github.com/sstephenson/rbenv ), o SO | |
# esta com o Centos 5.3 x64 | |
# | |
# Primeiramente é necessario instalar a gem com o comando: | |
# gem install capistrano | |
# ou adicione a linha: gem "capistrano", :group => :development |