Skip to content

Instantly share code, notes, and snippets.

View codekipple's full-sized avatar

codekipple

View GitHub Profile
@codekipple
codekipple / jsmc homework part 1
Created March 4, 2011 14:23
javascript master class with Amy Hoy and Thomas Fuchs: Homework part 1
// 1. Write a class to support the following code:
// var thomas = new Person('Thomas');
// var amy = new Person('Amy');
// thomas.name // --> "Thomas"
var Person = function( name ){
this.name = name;
};
var thomas = new Person('Thomas');
var amy = new Person('Amy');
console.log( thomas.name ) // --> "Thomas"
@codekipple
codekipple / jsmc homework part 2
Created March 4, 2011 17:33
javascript master class with Amy Hoy and Thomas Fuchs: Homework part 1
// Part 1.
// Implement a function prototype extension that caches function results for
// the same input arguments of a function with one parameter.
//
// For example:
// Make sin(1) have the result of Math.sin(1), but use a cached value
// for future calls.
//
// Part 2.
// Use this new function to refactor the code example.
@codekipple
codekipple / toggle-hidden-finder
Created January 2, 2012 13:35
apple script to toggle the visibility of files in finder, copied from here: http://www.macworld.com/article/51830/2006/07/showallfinder.html#recommend428845
set dotVisible to do shell script "defaults read com.apple.Finder AppleShowAllFiles"
if dotVisible = "0" then
do shell script "defaults write com.apple.Finder AppleShowAllFiles 1"
else
do shell script "defaults write com.apple.Finder AppleShowAllFiles 0"
@codekipple
codekipple / gist:1552264
Created January 2, 2012 21:49
changing maximum speed of mouse tracking on osx using the terminal
# get the current mouse tracking value on osx, default was set to 3
defaults read -g com.apple.mouse.scaling
# set a new mouse tracking speed
defaults write -g com.apple.mouse.scaling your_mouse_speed
@codekipple
codekipple / gist:1861809
Created February 19, 2012 03:25
post reveive hook for git
#!/bin/sh
# Update the working tree after changes have been pushed here
cd ..
env -i git reset --hard
@codekipple
codekipple / gist:2420042
Created April 19, 2012 09:56
WP custom user taxonomies
<?php
// http://justintadlock.com/archives/2011/10/20/custom-user-taxonomies-in-wordpress
// http://justintadlock.com/archives/2011/10/20/custom-user-taxonomies-in-wordpress#comment-568682
/* class to make it easy to add user taxonomies
* Useage:
* $tax = new User_Taxonomy( array('taxonomy_name'=> 'profession', 'singular_label' => 'Profession', 'plural_label' => 'Professions') );
/*------------------------------------------------------------------------------------------------*/
class User_Taxonomy{
" Set syntax on
syntax on
" Indent automatically depending on filetype
filetype indent on
set autoindent
" Case insensitive search
set ic
@codekipple
codekipple / gist:3979639
Created October 30, 2012 11:11
running js functions on media query breakpoints
/*
* module: breakpoints
* description: module for working with breakpoints,
* used within other modules
---------------------------------------- */
var WIRED = (function (module) {
module.breakpoint = function(){
var actions = {};
@codekipple
codekipple / i really wanna see those dangleys
Created December 13, 2012 10:40
Git command to find dangling commits
git fsck --lost-found
@codekipple
codekipple / gist:4285311
Created December 14, 2012 12:58
Command line snippets
cal 12 2012 #display a visual calender
dscacheutil -flushcache #clear your DNS Cache.