Skip to content

Instantly share code, notes, and snippets.

View kevinold's full-sized avatar

Kevin Old kevinold

View GitHub Profile
@kevinold
kevinold / application_helper.rb
Created March 24, 2012 23:12 — forked from sjungling/application_helper.rb
Zurb Foundation Pagination styles with WillPaginate 3.x on Rails 3.2.x
#
# Concept from https://gist.github.com/1205828
#
module ApplicationHelper
class FoundationLinkRenderer < ::WillPaginate::ActionView::LinkRenderer
protected
def html_container(html)
tag(:ul, html, container_attributes)
end
@kevinold
kevinold / simple-twitter-timeline.html
Created June 29, 2012 15:25 — forked from bchhun/simple-twitter-timeline.html
Simple Twitter Timeline with AngularJS
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Twitter widget</title>
@kevinold
kevinold / gist:3152879
Created July 20, 2012 19:59 — forked from igrigorik/gist:3148848
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os
@kevinold
kevinold / my_git_workflow.md
Created July 31, 2012 15:20 — forked from trey/my_git_workflow.md
My Git Workflow

My (somewhat outdated) Git Workflow

Local Branches

There are some common hickups I see in the day-to-day use of Git that can be fairly easily remedied by the liberal use of local branches.

When I start any new work (or at the very least before I commit my work), I create a new local branch named for the feature on which I'm working.

$ git co -b robotic-turtles
@kevinold
kevinold / lessjs.rb
Created October 19, 2012 19:43
Jekyll plugin to render less.js - fixed for new versions of jekyll
module Jekyll
class LessCssFile < StaticFile
def write(dest)
# do nothing
end
end
# Expects a lessc: key in your _config.yml file with the path to a local less.js/bin/lessc
# Less.js will require node.js to be installed
@kevinold
kevinold / lessjs.rb
Created October 19, 2012 19:43
Jekyll plugin to render less.js
require 'pathname'
module Jekyll
class LessCssFile < StaticFile
def write(dest)
# do nothing
end
end
package Mojolicious::Plugin::MicroPipeline::CSSCompressor;
use Mojo::Base 'Mojolicious::Plugin';
use CSS::Compressor 'css_compress';
sub register {
my ($self, $app) = @_;
# Register "css_compressor" filter
$app->filter(css_compressor => sub { css_compress shift });
@kevinold
kevinold / README.md
Created October 28, 2012 17:58 — forked from simenbrekken/README.md
Super simple Backbone + Express + MongoDB REST backend application

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage:

@kevinold
kevinold / screenshots.js
Created November 13, 2012 02:42 — forked from nhoizey/screenshots.js
Take screenshots at different viewport sizes using CasperJS
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.