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 Mailer < ActionMailer::Base | |
def test | |
recipients "[email protected]" | |
from "[email protected]" | |
subject "Testing SendGrid" | |
end | |
end |
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
<%= my_helper %> |
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
module Foo | |
def foo | |
# This does not work: | |
# TYPES | |
# This works: | |
self.class.const_get('TYPES') | |
end | |
end |
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
Started GET "/assets/tiny_mce/themes/advanced/skins/default/content.css" for 127.0.0.1 at 2011-09-05 12:40:25 +0200 | |
Processing by Admin::DealsController#update as HTML | |
Parameters: {...}, "commit"=>"Update Deal", "id"=>"127", "locale"=>"en"} | |
User Load (0.6ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 165 LIMIT 1 | |
Served asset /tiny_mce/themes/advanced/skins/default/content.css - 304 Not Modified (3ms) | |
Organization Load (1.4ms) SELECT `organizations`.* FROM `organizations` INNER JOIN `configurations` ON `configurations`.`organization_id` = `organizations`.`id` WHERE `configurations`.`domain` = 'downtown.dev' LIMIT 1 | |
<snip> | |
(0.8ms) COMMIT | |
Redirected to http://localhost:3000/en/admin/deals/127 | |
Completed 302 Found in 1601ms |
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 Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new | |
can :manage, Post | |
cannot [:create, :update, :destroy], Post, :state => 'published' | |
if user.role?('moderator') |
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
#!/usr/bin/env ruby | |
begin | |
require 'rubygems' if RUBY_VERSION =~ /^1\.8/ | |
require 'open4' | |
rescue LoadError | |
puts "Please install the `open4` gem" | |
exit 1 | |
end |
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
# app/models/ability.rb | |
# All front end users are authorized using this class | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new | |
can :read, :all |
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
ActiveAdmin::Dashboards.build do | |
end |
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
watson% curl -I http://localhost:8080/v1/alive | |
HTTP/1.1 404 Not Found | |
Date: Sat, 04 Aug 2012 08:43:58 GMT | |
Connection: keep-alive | |
watson% curl -i http://localhost:8080/v1/alive | |
HTTP/1.1 200 OK | |
Date: Sat, 04 Aug 2012 08:43:59 GMT | |
Connection: keep-alive | |
Transfer-Encoding: chunked |
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
// This will break the program and exist to console with code 1 | |
var connect = require('connect'); | |
connect() | |
.use(function(req, res) { | |
setTimeout(function() { | |
// this is wrapped inside a setTimeout callback and will not get | |
// catched by the connect module. Instead node.js will see it as | |
// an uncaught exception and exist with code 1 |