Skip to content

Instantly share code, notes, and snippets.

View apathetic's full-sized avatar

wes hatch apathetic

View GitHub Profile
#
# fpath
#
# As per `brew info zsh-completions`
fpath=(/usr/local/share/zsh-completions $fpath)
#
# zsh shortcuts
#
#ZSH_THEME="agnoster"
ZSH_THEME="arrow"
. `brew --prefix`/etc/profile.d/z.sh
plugins=(
git
caniuse
atom_plugin
function setupControls(video, container) {
// console.log('setting up ctrls');
video.removeAttribute('controls');
var $plause = $(container).find('.plause');
var $progress = $(container).find('.progress');
var $played = $(container).find('.progress .played');
var $loaded = $(container).find('.progress .loaded');
var $current = $(container).find('.time .current');
@apathetic
apathetic / gist:4138255
Created November 24, 2012 03:39
Wordpress: general.php
<?php
/* --------------------------------
Enable/Disable WP stuff
------------------------------*/
// remove junk from head
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'index_rel_link');
@apathetic
apathetic / stickyColumn
Created November 8, 2012 00:55
jQuery: 3-State Sticky Column
/*
* jQuery 3-state Sticky element
* Description: sticks a DOM element to the top of viewport, unsticks when
* footer/header push it up/down
* author: wes hatch
*
*/
(function($, window, undefined){
@apathetic
apathetic / gist:3932930
Created October 22, 2012 17:49
jQuery: image popup
/*
* jQuery Image Popup
* Description: small, simple, lightweight image displayer.
*
*/
(function( $ ){
$.fn.popup = function(o) {
o = $.extend({
@apathetic
apathetic / gist:3932805
Created October 22, 2012 17:30
Wordpress / jQuery Scrubber gallery
/*
* Wordpress Scrubber Gallery
* Description: modifies the default WP gallery with an "image stack"
* that you can hover over and scrub through to view
*/
(function($){
$.fn.scrubbable = function () {
@apathetic
apathetic / gist:3932743
Created October 22, 2012 17:20
Structuring Javascript
(function( wes, $, undefined ) {
// ------------ private ------------
function privateFn() {
}
// ------------ public ------------
wes.publicFn = function() {
@apathetic
apathetic / gist:3648737
Created September 6, 2012 00:31
Wordpress: add radio button to admin Users table
/*
* Add a column to the Users table, with a radio button
* The radio button updates a usermeta field via ajax
*/
add_filter( 'manage_users_columns', 'add_display_column');
function add_display_column( $columns){
$columns['display_as'] = 'Display as';
return $columns;
}
@apathetic
apathetic / gist:3077930
Created July 9, 2012 18:04
jQuery: imageBook + gallery
/*
* imageBook and Gallery
* two simple, similar plugins which scroll through a set of images
*/
// -------------
// sample css
// -------------
/* imageBook */
#imageBook { height:360px; }