Skip to content

Instantly share code, notes, and snippets.

View heijmerikx's full-sized avatar

Rutger Heijmerikx heijmerikx

View GitHub Profile
@heijmerikx
heijmerikx / forcessl.rb
Created February 23, 2012 12:39 — forked from dodeja/forcessl.rb
Root Domain to WWW redirection in Rails 3.1 before forcing SSL on Heroku
# in config/environments/production.rb
# config.force_ssl = true
# config.middleware.use "Forcessl"
# Make sure redirection happens before forcing ssl
# config.middleware.insert_before 'Rack::SSL', 'Forcessl'
# in lib/forcessl.rb
# change *. to your domain
class Forcessl
@heijmerikx
heijmerikx / installation.sh
Created September 7, 2011 19:20 — forked from mikhailov/installation.sh
Nginx+passenger application config: ssl redirection, http headers, passenger optimal settings. see details: http://mikhailov.posterous.com/nginx
$ cd /usr/src
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz
$ tar xzvf ./nginx-0.8.52.tar.gz
$ rm ./nginx-0.8.52.tar.gz
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc
$ passenger-install-nginx-module
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52
# Where do you want to install Nginx to?: /opt/nginx
!!! 5
%html
%head
%title= 'Zetetic - ' + yield_for(:title, 'Blog')
%meta{:name => 'description', :content => yield_for(:description, "blarf blarf dorf dorf dorf, hooray it's our blog!")}/
...
!!! 5
%html
%head
%title= 'Zetetic - ' + yield_for(:title, 'Blog')
%meta{:name => 'description', :content => yield_for(:description, "blarf blarf dorf dorf dorf, hooray it's our blog!")}/
...
!!! 5
%html
%head
%title= 'Zetetic - ' + yield_for(:title, 'Blog')
%meta{:name => 'description', :content => yield_for(:description, "blarf blarf dorf dorf dorf, hooray it's our blog!")}/
...
<% form_tag :search, :url => asdf, :html => { :id => 'search_form' } do %>
<%= text_field_tag :search %>
<%= submit_tag 'zoeken' %>
<% end %>
<div id="search_results"></div>
$('#search_form').live('submit', function(event) {
event.preventDefault();
$.post($(this).attr('action'), $(this).serialize(), null, 'script');
});
#!/bin/bash -xe
# Run this script from machine with the credintials and the latest api tools installed
EBS_DEVICE='/dev/sdh'
INSTANCE_ID=$1
AKI=${2:-'aki-5f15f636'}
ARI=${3:-'ari-0915f660'}
ARCH=${4:-'i386'}
SIZE=${5:-10}