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
/* | |
It can be difficult to size an iframe properly. The inherit problem | |
with iframes is that your page controls the size, yet the iframe itself | |
takes up space. Fortunately, communication is possible across domains | |
using something called postMessage. This javascript is simply a | |
cross-browser implementation on how to receive Prefinery's message | |
containing the form's height so that your iframe's height is set automatically. | |
You should remove the "height" attribute from your iframe declaration and | |
post this code in your page's <head> |
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
attr_accessible :invitation_code | |
attr_accessor :invitation_code | |
validate :validate_invitation_code, on: :create | |
def validate_invitation_code | |
if self.invitation_code == Digest::SHA1.hexdigest('YOUR-SECRET-DECODER-KEY' + self.email) | |
true | |
else | |
errors.add(:invitation_code, "is invalid") |
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
gem 'prefinery' |
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
package :iptables, :provides => :firewall do | |
description 'Configure IPTables Firewall' | |
# Need to run some commands, don't see how to do this unless I hook into a package install | |
# So, faking a push_text | |
push_text '', '/dev/null' do | |
# | |
# Allow SSH connections on tcp port 22 | |
# |
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 | |
require 'rubygems' | |
require 'daemons' | |
dir = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
daemon_options = { | |
:multiple => false, | |
:dir_mode => :normal, | |
:dir => File.join(dir, 'tmp', 'pids'), | |
:backtrace => true |