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
#!/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
.vagrant
@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…
// 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
=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
(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,