Skip to content

Instantly share code, notes, and snippets.

michiels / 0_site.conf
Last active Aug 29, 2015
Ideas for custom server configs
View 0_site.conf
server {
listen 80;
root /u/apps/intercity_site_production/current/public;
passenger_enabled on;
passenger_app_env production;
server {
michiels / deploy.rb
Last active Aug 29, 2015
intercity CLI deploy.rb
View deploy.rb
set :application, 'APPNAME'
set :repo_url, ''
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/u/apps/APPNAME'
# Use agent forwarding for SSH so you can deploy with the SSH key on your workstation.
michiels / kissmetrics_javascript_twitter_hooks.html
Created Jun 4, 2011
Hooking into the Twitter responses for Kissmetrics
View kissmetrics_javascript_twitter_hooks.html
<script type="text/javascript">'follow', function(event) {
_kmq.push(['record', 'Follow on Twitter']);
<script type="text/javascript">'tweet', function(event) {
_kmq.push(['record', 'Tweeted the post']);
michiels / track_facebook_comments_in_kissmetrics.html
Created Jun 8, 2011
Tracking Facebook comments in Kissmetrics
View track_facebook_comments_in_kissmetrics.html
<script type="text/javascript">
FB.Event.subscribe('comment.create', function(response) {
_kmq.push(['record', 'Comments on a post with Facebook Comments']);
michiels / time_based_property.html
Created Jun 15, 2011
Time-based property experiment example
View time_based_property.html
<script type="text/javascript">
_kmq.push(['record', "Viewed Blogpost", {"Displaying share buttons on bottom of single post": "true"}]);
View kioskfolio-embed-code.html
src="[themeforst template id]/badge.js"
michiels / attributes-default.rb
Created Dec 9, 2011
passenger-nginx default recipe
View attributes-default.rb
default[:ree][:version] = "1.8.7-2011.03"
default[:nginx][:version] = "1.1.10"
default[:passenger][:version] = "3.0.11"
case platform
when "debian","ubuntu"
set[:nginx][:dir] = "/etc/nginx"
set[:nginx][:log_dir] = "/var/log/nginx"
set[:nginx][:user] = "www-data"
set[:nginx][:binary] = "/usr/sbin/nginx"
View blog_testing_private_methods_2.rb
def test_build_creates_workspace_directories
assert File.exists?(File.expand_path("builds/cool_rails_project")), "Expected directory builds/cool_rails_project to exist."
View blog_unit_private_methods_groundcontrol_basic_test.rb
module GroundControl
class BuilderTest < Test::Unit::TestCase
def setup
if File.exists?(File.expand_path("builds/cool_rails_project"))
@builder ="cool_rails_project", {"git" => "test/repositories/dot_git_rails"}
View blog_test_private_method_3.rb
module GroundControl
class Builder
def new(project_name, config)
@workspace = File.expand_path(File.join("builds", project_name))
def build