Skip to content

Instantly share code, notes, and snippets.

View nicinabox's full-sized avatar

Nic Haynes nicinabox

View GitHub Profile
@nicinabox
nicinabox / gist:955514
Created May 4, 2011 16:24
Padrino Rakefile
# Rakefile
require File.dirname(__FILE__) + '/config/boot.rb'
require 'thor'
require 'padrino-core/cli/rake'
PadrinoTasks.init
class AddAreasPortfolioEntries < ActiveRecord::Migration
def self.up
create_table "areas_portfolio_entries", :id => false do |t|
t.references :portfolio_entry
t.references :area
end
add_index :areas_portfolio_entries, :portfolio_entry_id
add_index :areas_portfolio_entries, :area_id
end
<!DOCTYPE html>
<html>
<head>
<title><%= browser_title(yield(:title)) %></title>
<meta charset='<%= ::Refinery::Application.config.encoding %>' />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<%= raw "<meta name=\"description\" content=\"#{@meta.meta_description}\" />" if @meta.meta_description.present? -%>
<%= raw "<meta name=\"keywords\" content=\"#{@meta.meta_keywords}\">" if @meta.meta_keywords.present? -%>
# $ deploy dev // Deploys to staging
# $ deploy // Deploys to production
function deploy() {
if [[ $@ != "" ]]; then
git push staging $@:master
else
git push production
fi
}
-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u;
<!DOCTYPE html>
<html>
<head>
<title><%= browser_title(yield(:title)) %></title>
<% unless Rails.env == "production" %>
<meta name="robots" content="noindex" />
<% end %>
<meta charset='<%= ::Refinery::Application.config.encoding %>' />
#!/usr/bin/env ruby
# Created by _zsh for r/trees
require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'growl'
class CanonicalRedirect
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
if request.host =~ /^example.com/
[301, {"Location" => request.url.sub("//", "//www.")}, self]
<table width="600" align="center" cellpadding="10" style="table-layout: fixed;">
<tr>
<td>
<table align="left" cellspacing="0" cellpadding="0" border="0" style="table-layout: fixed;">
<tr>
<td width="144" class="sidebar" style="padding-left: 10px;">
<h2 style="color: #ffffff; font-size: 14px;">In This Issue:</h2>
<ul id="contents" style="line-height: 15px; list-style-type: none; margin: 0; padding: 10px 0 0;">
<tableofcontents>
<li style="margin-bottom: 10px; padding-bottom: 10px; border-bottom-width: 1px; border-bottom-color: #77929f; border-bottom-style: solid; color: #ffffff">
<% [:en, :ru, :de].each do |locale| %>
<li>
<%= link_to Refinery::I18n.built_in_locales[locale], {:locale => locale}, :class => "flag #{locale.to_s}", :id => "locale_#{locale.to_s}" %>
</li>
<% end %>