Skip to content

Instantly share code, notes, and snippets.

View kylefox's full-sized avatar
🥊
programming

Kyle Fox kylefox

🥊
programming
View GitHub Profile
@kylefox
kylefox / find_unused_helpers.rb
Created March 28, 2019 21:49 — forked from kennethkalmer/find_unused_helpers.rb
Find unused helpers in a Rails app
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}" }
@kylefox
kylefox / .gitignore
Created December 9, 2018 02:33 — forked from jbergler/.gitignore
Acestream on Mac
@kylefox
kylefox / external.vanilla-forEach.js
Last active February 6, 2016 16:33 — forked from bastianallgeier/external.js
For those "external links should open in new tabs" clients…
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';
});
@kylefox
kylefox / _media_queries.sass
Created March 1, 2012 18:37 — forked from jcroft/layout.sass
How easy responsive design can be with Sass
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,