This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
namespace :db do | |
namespace :test do |schema| | |
schema[:clone_structure].abandon | |
desc "OVERWRITTEN - load the development_structure file using psql shell" | |
task :clone_structure => ["db:structure:dump", "db:test:purge"] do | |
config = ActiveRecord::Base.configurations['test'] | |
cmd = "psql #{psql_options} < db/development_structure.sql" | |
system cmd | |
end |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> | |
<title>*|Giver|* bought you a coffee tasting box subscription!</title> | |
</head> | |
<body leftmargin="0" marginheight="0" marginwidth="0" offset="0" topmargin="0" style="background-color:#bba993;-webkit-text-size-adjust:none;padding:0;margin:0;width:100%"> | |
<center> | |
<table border="0" cellpadding="0" cellspacing="0" height="100%" id="backgroundTable" width="100%" style="margin:0;padding:0;width:100%;height:100%;background-color:#669999"><tr> | |
<td align="center" valign="top" style="border-collapse:collapse"> |
# | |
# Insert an automatic text MIME part into HTML e-mail. | |
# (c) Daniel Doubrovkine, Art.sy 2012 | |
# MIT License | |
# | |
class ActionMailerWithTextPart < ActionMailer::Base | |
def collect_responses(headers) | |
responses = super(headers) | |
html_part = responses.detect { |response| response[:content_type] == "text/html" } |
This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head>
of your document
<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
!function(n,t){n.GoogleAnalyticsObject=t,n[t]=n[t]||function(){(n[t].q=n[t].q||[]).push(arguments)},n[t].l=1*new Date}(window,"ga");
ga('create', 'UA-XXXX-Y', 'auto'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
ga('send', 'pageview');
license: gpl-3.0 | |
height: 600 |