Skip to content

Instantly share code, notes, and snippets.

View mikedamage's full-sized avatar

Mike Green mikedamage

View GitHub Profile
@mikedamage
mikedamage / jquery.climb-ancestry.coffee
Created March 31, 2014 20:49
Ancestry climber jQuery plugin
###
jQuery Ancestry Climber Plugin
Defines a class that traces an element's ancestry, executing
a callback on each ancestor.
###
class AncestryClimber
constructor: (@elem, @callback = $.noop) ->
throw new Error 'Please supply a DOM element' unless @elem
@mikedamage
mikedamage / jquery.climb-ancestry.js
Created March 31, 2014 20:51
Ancestry climber plugin in plain JS
/*
jQuery Ancestry Climber Plugin
Defines a class that traces an element's ancestry, executing
a callback on each ancestor.
*/
(function() {
var AncestryClimber;

Keybase proof

I hereby claim:

  • I am mikedamage on github.
  • I am mikegreen (https://keybase.io/mikegreen) on keybase.
  • I have a public key whose fingerprint is 5B5D 819D 06C0 24E8 0B85 E6FF 7035 DE92 01C7 6011

To claim this, I am signing this object:

/**
* Innovate Debug Functions
*/
/**
* Descends through an element's children, their children's children, etc. and
* prints a list of their bound event handlers to console.
*
* ex. $('.sub-nav').parent().boundEventsTree();
*/
@mikedamage
mikedamage / ie_fixes.less
Created April 23, 2014 17:22
Files to change in IEEE Innovate for mobile nav IE compatibility
// MSIE Overrides
html.lt-ie10 {
#mobile-navigation nav {
right: -17.5em;
&.open {
right: 0;
}
}
@mikedamage
mikedamage / gist.php
Created May 1, 2014 14:42
pods image field
<?php
$pod = pods('image', 12);
$src = $pod->field('source');
$url = pods_image_url($src);
?>
<img src="<?php echo $url; ?>">
@mikedamage
mikedamage / gist.php
Last active August 29, 2015 14:00
WP taxonomy terms
<?php
$terms = get_the_terms($post->ID, 'industry');
// Terms is now an array filled with taxonomy term objects.
var_dump($terms);
// Loop through terms using foreach
foreach ($terms as $term):
$term_link = get_term_link($term->term_id, 'industry');
?>
@mikedamage
mikedamage / instructions.md
Last active August 29, 2015 14:03
Pimp your prompt

Setting up ZSH and Installing Prezto

1. Install a newer version of ZSH

The version of ZSH that comes with OS X is outdated. Grab the most recent one with Homebrew:

brew update
brew install zsh
@mikedamage
mikedamage / passwd.md
Created December 2, 2014 15:30
Changing your Ubuntu password

Changing Your Ubuntu Password

  1. Hit Ctrl-Alt-T to open a Terminal window.
  2. Type passwd and hit Enter.
  3. Type your current password and hit Enter. Nothing will show up on the screen when you type. This is for security.
  4. Type a new password and hit Enter.
  5. Retype the new password and hit Enter again.
  6. Close the Terminal window.
@mikedamage
mikedamage / java-watcher.sh
Created February 6, 2015 15:08
Java class auto-compiler
#!/bin/bash
#
# Inotify Java Watcher
# by Mike Green <mike.is.green@gmail.com>
#
# Automatically compiles Java classes when their files are saved.
#
# = Installation: Save this script into the root folder of your Java projects, then run:
# $ cd whatever-your-folder-is-called && chmod +x java-watcher.sh
#