This file contains hidden or 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 Address < ActiveRecord::Base | |
ADDRESS_TYPES = %w(Office Postal Shipping) | |
default_scope order('created_at DESC') | |
scope :active, where(active: true) | |
validates_inclusion_of :address_type, in: ADDRESS_TYPES, message: "must be one of #{ADDRESS_TYPES.to_sentence(last_word_connector: ' or ')}" | |
belongs_to :source, polymorphic: true |
This file contains hidden or 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
# _job | |
<div> | |
<%= fields_for :job do | f | | |
<%= render :partial => 'waypoints/waypoint', :locals => {:job_form => f} %> | |
</div> | |
-------------------------------- | |
# _waypoint |
This file contains hidden or 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
- form_for :branch, @branch, :url => {:action => :create, :id => @branch.id} do |f| | |
= render :partial => 'form', :locals => {:f => f, :submit_button_caption => "Create Branch"} |
This file contains hidden or 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
require 'rubygems' | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
# inspired by https://gist.github.com/794915 | |
# I've changed it a bit, it works fine for me now | |
# but i'm still searching for a better solution | |
def require_without_bundler(*gems) | |
unless defined?(::Bundler) | |
gems.each { |g| require g } |
This file contains hidden or 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
# activerecord logging methods | |
# very useful for digging into | |
# queries | |
require 'logger' | |
require 'activerecord' if rails?(2) | |
def enable_logger | |
log_to(Logger.new(STDOUT)) | |
end |
This file contains hidden or 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 QueueDaemon | |
class << self | |
def start! | |
Thread.new do | |
EventMachine.run do | |
puts "Asimov: Attempting Connection" | |
AMQP.connect( | |
:on_possible_authentication_failure => Proc.new {puts("Asimov: Possible Authentication Failure")}, |
This file contains hidden or 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 QueueDaemon | |
class << self | |
def start! | |
Thread.new do | |
EventMachine.run do | |
puts "Asimov: Attempting Connection" | |
AMQP.connect( | |
:on_possible_authentication_failure => Proc.new {puts("Asimov: Possible Authentication Failure")}, |
This file contains hidden or 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
require 'rubygems' | |
require 'eventmachine' | |
require 'amqp' | |
class QueueDaemon | |
class << self | |
def exchange | |
@exchange |
This file contains hidden or 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
<html> | |
<head> | |
<title>Slide Example</title> | |
<style> | |
.viewport { | |
position: relative; | |
overflow: hidden; | |
width: 150px; | |
height: 200px; | |
border: 1px solid maroon; |
This file contains hidden or 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
<html> | |
<body> | |
<div> | |
<img style="width:30px;height:60px;vertical-align:middle;border:1px solid blue;"> | |
<span style="">Works.</span> | |
</div> | |
</body> | |
</html> |
OlderNewer