Skip to content

Instantly share code, notes, and snippets.

View bookwyrm's full-sized avatar

Matt Vanderpol bookwyrm

View GitHub Profile
@bookwyrm
bookwyrm / HTML5-base-template.html
Created January 22, 2012 23:50
HTML5 base template based on HTML5 Boilerplate
<!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script>
@bookwyrm
bookwyrm / HTML5B-1.html
Created February 8, 2012 14:44
HTML5B - doctype and html tag
<!doctype html>
<!--[if lt IE 7]> <html class="ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
@bookwyrm
bookwyrm / HTML5B-2.html
Created February 8, 2012 16:21
HTML5B - head
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<script>
var _gaq=[['_setAccount','UA-XXXXX-Y'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
@bookwyrm
bookwyrm / HTML5B-3.html
Created February 8, 2012 19:53
HTML5B - body
<body>
<div id="container">
<header>
</header>
<div id="main" role="main">
</div>
<footer>
@bookwyrm
bookwyrm / HTML5B-4.html
Created February 8, 2012 19:55
HTML5B - scripts
<script src="/js/libs/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="/js/plugins.js" type="text/javascript"></script>
<script src="/js/script.js" type="text/javascript"></script>
@bookwyrm
bookwyrm / tracking.js
Created March 8, 2012 17:57
GA 404 tracking
if (is_404) {
_gaq.push(['_trackPageview', "/404.html?page=" \
+ document.location.pathname \
+ document.location.search \
+ "&from=" + document.referrer
]);
} else {
_gaq.push(['_trackPageview']);
}
@bookwyrm
bookwyrm / gist:2004110
Created March 8, 2012 23:26
Minify HTML and CSS for Jekyll
# Usage: rake minify
desc "Minify files"
task :minify do
system "java -jar _build/yuicompressor.jar --verbose --type css -o assets/themes/the-program/css/style.min.css assets/themes/the-program/css/style.css"
system "java -jar _build/htmlcompressor.jar -r --type html -o _site _site"
end # task :minify
@bookwyrm
bookwyrm / vcr-configure.rb
Last active December 22, 2015 07:18
Filter sensitive data in a VCR request
VCR.configure do |c|
c.cassette_library_dir = "#{root}/spec/vcr"
c.filter_sensitive_data('<PIVOTAL_TOKEN>') do |interactive|
$ticket_integration_settings['pivotal-token']
end
c.filter_sensitive_data('<PIVOTAL_REPO>') do |interactive|
$ticket_integration_settings['pivotal-repository']
end
c.filter_sensitive_data('<PIVOTAL_REPO_ID>') do |interactive|
$ticket_integration_settings['pivotal-repository-id']
describe TicketIntegration::Providers::Pivotal do
context "when authorizing" do
let(:session) { Hash.new }
it "builds authorize url" do
expect(pivotal.auth_link_url(resource_identifier, session)).to eq("/auth/pivotal/token/#{resource_identifier}")
end
context "with an invalid token" do
before :all do
mv spec/vcr/TicketIntegration_Providers_Pivotal spec/vcr/TicketIntegration_Providers_Pivotal-bak
mkdir spec/vcr/TicketIntegration_Providers_Pivotal
rspec spec/ticket_integration/providers/pivotal_spec.rb