Skip to content

Instantly share code, notes, and snippets.

View scottwater's full-sized avatar

Scott Watermasysk scottwater

View GitHub Profile
# Pass in the name of the site you wich to create a cert for
domain_name = ARGV[0]
if domain_name == nil
puts "Y U No give me a domain name?"
else
system "openssl genrsa -out #{domain_name}.key 1024"
system "openssl req -new -key #{domain_name}.key -out #{domain_name}.csr -subj '/C=US/ST=NJ/L=Monroe/O=MyCompany/OU=IT/CN=#{domain_name}'"
system "cp #{domain_name}.key #{domain_name}.key.bak"
@scottwater
scottwater / brew.config
Created July 20, 2011 14:13
brew install libtiff
HOMEBREW_VERSION: 0.8
HEAD: 6d15547fa6d422fd55e3c7c7dcf617176afe55da
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_LIBRARY_PATH: /usr/local/Library/Homebrew
Hardware: 8-core 64-bit sandybridge
OS X: 10.7
Kernel Architecture: x86_64
Ruby: 1.8.7-249
@scottwater
scottwater / domain.rb
Created August 27, 2011 18:08
Subdomains and Domains in Rails 3.0
class Domain
def self.matches?(request)
# ROOT_DOMAIN is a configurable value so we don't catch skip www.kickofflabs.com
request.host.downcase != KickoffLabs::ROOT_DOMAIN
end
end
@scottwater
scottwater / postmarker.rb
Created September 4, 2011 13:32
Supporting Multiple SMTP Servers in Rails
module Postmarker
def postmark_mail(*args)
mail_message = mail(*args)
if can_use_postmark?(mail_message.From.to_s)
mail_message.delivery_method.settings.merge!(
:address => 'smtp.postmarkapp.com',
@scottwater
scottwater / adwords.html
Created October 6, 2011 13:40
Google Conversion Tracking With KickoffLabs
<script>
$(document).ready(function(){
$("#signup_form").bind("kol:success", function(e, data, status, xhr) {
$div = $('<div style="display:inline;">');
$div.append('<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/992175653/?value=20&amp;label=J_1oCKunogMQpcyN2QM&amp;guid=ON&amp;script=0"/>');
$div.appendTo('body');
});
});
</script>
@scottwater
scottwater / css.css
Created October 6, 2011 21:17
Adding Google+ To KickoffLabs
#socialmessage, #socialnetworks{float:none;}
#gplus{float:left;}
#socialnetworks #Twitter, #socialnetworks #Facebook {float:left; !important}
@scottwater
scottwater / hide.html
Created October 12, 2011 19:34
Hiding the signup form
<script>
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.href);
if(results == null)
return null;
else
@scottwater
scottwater / favicon.html
Created October 18, 2011 13:36
KickoffLabs Favicon
<link href="http://a_domain.com/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
@scottwater
scottwater / gist:1301070
Created October 20, 2011 12:55
Easy bundle exec (I owe someone else credit for this).
function be {
if [[ -a Gemfile ]]; then
bundle exec $*
else
command $*
fi
}
alias heroku="be heroku"
alias rake="be rake"
@scottwater
scottwater / curl
Last active February 15, 2021 04:07
Quick KickoffLabs API
curl -d 'email=scott@kickofflabs.com&api_key=your_api_key' https://api.kickofflabs.com/v1/1905/subscribe
curl -G -d "email=scott@kickofflabs.com" https://api.kickofflabs.com/v1/1905/info