Kyle Fox kylefox
- Edmonton, Alberta (Canada)
- Sign in to view email
- http://kylefox.ca
View find_unused_helpers.rb
#!/usr/bin/env ruby | |
# | |
# Shotgun approach (read: slow and dirty hack) to help find unused helpers in a Rails application | |
# | |
start = Time.now | |
# Build an array of filename globs to process. | |
# Only search file types that might use or define a helper. | |
extensions = %w[rb js haml erb jbuilder].map { |ext| "app/**/**/*.#{ext}" } |
View .gitignore
.vagrant |
View external.vanilla-forEach.js
// Array.forEach potentially faster than loop | |
// http://jsperf.com/testing-foreach-vs-for-loop | |
var links = document.querySelectorAll('a[href*="//' + window.location.host +'"]'); | |
[].slice.call(links).forEach(function(a) { | |
a.target = '_blank'; | |
}); |
View _media_queries.sass
=respond-to($device) | |
@if $device == handheld | |
@media only screen and (min-width : 320px) | |
@content | |
@if $device == handheld-landscape | |
@media only screen and (min-width : 321px) | |
@content |
View jquery-plugin-pattern.js
(function($) { | |
$.fn.thePlugin = function(options) { | |
// build main options before element iteration: | |
var opts = $.extend({}, $.fn.thePlugin.defaults, options); | |
var $this = $(this); | |
var thePlugin = { | |
index: 0, |