Skip to content

Instantly share code, notes, and snippets.

View jgarber623's full-sized avatar
:atom:

Jason Garber jgarber623

:atom:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jgarber623 on github.
  • I am jgarber (https://keybase.io/jgarber) on keybase.
  • I have a public key whose fingerprint is 35A3 1BAF B39E 1B75 7C44 AD51 9B42 99FC 6226 685E

To claim this, I am signing this object:

@jgarber623
jgarber623 / tag_page_generator.rb
Last active August 29, 2015 14:05
Generate tag pages in Jekyll at /tags/tag_name_with_underscores/index.html.
module Jekyll
class TagPage < Page
def initialize(site, base, dir, data = {})
@site = site
@base = base
@dir = dir
@name = 'index.html'
data['layout'] = 'posts-list'
data['title'] = "Posts tagged “#{data['tag']}”"
@jgarber623
jgarber623 / aaronparecki.com.html
Created August 28, 2014 19:16
Microformats comments examples
<li data-url="http://waterpigs.co.uk/notes/4WXEyS/" id="external_http_waterpigs_co_uk_notes_4WXEyS_" class="h-cite">
<div class="inner">
<div class="minicard h-card vcard author p-author">
<div style="position: relative; width: 48px; height: 48px; float: left; margin-right: 6px;">
<img width="48" alt="Barnaby Walters" src="http://waterpigs.co.uk/photo.jpg" class="photo logo u-photo">
</div>
<a class="u-url" href="http://waterpigs.co.uk">waterpigs.co.uk</a>
<a href="http://waterpigs.co.uk" class="p-name fn value name">Barnaby Walters</a>
</div>
<div class="quote-text">
@jgarber623
jgarber623 / FrancisCMS Import Scripts.md
Last active August 29, 2015 14:10
Useful scripts for converting and preparing data for FrancisCMS.

Detailed instructions on how to use these scripts coming soon!

@jgarber623
jgarber623 / application.html.erb
Last active August 29, 2015 14:13
A derivation of Filament Group's cookie-based critical CSS technique implemented in a Rails app.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>My Great Rails App!</title>
<%- if include_full_css? -%>
<%= stylesheet_link_tag 'application' %>
<%- else %>
@jgarber623
jgarber623 / asset-pipeline.md
Last active August 29, 2015 14:16
Answering some of @mrmrs_ questions about Rails' Asset Pipeline

I'd like to have an easily modular and configurable build system with proper logs set up. Seems non-trivial.

I'm not totally sure what you have in mind. Can you expand on what you mean by "configurable build system with proper logs"…?

I'd also like visibility into how these includes work and where some of the imported third party stuff actually comes from.

Ah, yes. The Asset Pipeline's load paths situation is a bit of black magic. To my knowledge, there are at least four places a Rails app will look for assets:

  1. In gems (e.g. Compass, Breakpoint, etc.). This is the least obvious since the files you want to include don't appear in the folder structure of your project. You simply include them in, say application.css.scss by doing @import 'breakpoint';.
  2. In lib/assets.
@jgarber623
jgarber623 / template.html
Created July 11, 2010 03:07
A sample (X)HTML5 template for use at Viget Labs
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6 lte8 lte7 lte6" lang="en"><![endif]-->
<!--[if IE 7 ]><html class="ie ie7 lte8 lte7" lang="en"><![endif]-->
<!--[if IE 8 ]><html class="ie ie8 lte8" lang="en"><![endif]-->
<!--[if !IE]><!--><html lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8" />
<title></title>
@jgarber623
jgarber623 / template.html
Created July 19, 2010 03:38
A sample (X)HTML5 template for personal use
<!DOCTYPE html>
<html lang="en" id="example-com">
<head>
<meta charset="utf-8" />
<title></title>
<link rel="profile" href="http://microformats.org/profile/hcard" />
<link rel="stylesheet" media="screen" href="http://yui.yahooapis.com/3.1.1/build/cssreset/reset-min.css" />
<link rel="stylesheet" media="screen" href="stylesheets/screen.css" />
@jgarber623
jgarber623 / application.js
Created July 19, 2010 03:40
A sample JavaScript structure for larger web applications
/*
* Based on Paul Irish's "Markup-based unobtrusive comprehensive DOM-ready execution"
* http://paulirish.com/2009/markup-based-unobtrusive-comprehensive-dom-ready-execution/
*/
SITE_NAMESPACE = {
common: {
init: function() {
}
@jgarber623
jgarber623 / gridhelper.js
Created July 20, 2010 02:36
Grid Helper bookmarklet for web development
javascript:(function() {
if ( !document.getElementById( "__grid" ) ) {
d = document.createElement( "div" );
d.setAttribute( "id", "__grid" );
d.setAttribute( "style", "background: url('http://" + window.location.hostname + "/images/grid.png') repeat-y 50% 0; height: " + document.height + "px; left: 0; position: absolute; top: 0; width: 100%; z-index: 16000000;" );
document.body.appendChild( d );
} else {
document.body.removeChild( document.getElementById( "__grid" ) );
}