Skip to content

Instantly share code, notes, and snippets.

View dankempster's full-sized avatar
🤓
Working... always working

Dan Kempster dankempster

🤓
Working... always working
View GitHub Profile
@dankempster
dankempster / index.html
Created May 26, 2017 13:17
Mag : Slider as header [WIP]
<!--
<div class="slider">
<div class="slider__header">
<div class="slider__copy">
</div>
<div class="slider__viewport">
<ul class="slider__rail">
<li class="slider__rail__item"><img src="http://lorempixel.com/777/548/technics" /></li><li class="slider__rail__item"><img src="http://lorempixel.com/777/548/people" /></li><li class="slider__rail__item"><img src="http://lorempixel.com/777/548/nature" /></li>
</ul>
</div>
@dankempster
dankempster / Inflect.php
Created May 16, 2017 12:47 — forked from tbrianjones/Inflect.php
A PHP Class for converting English words between Singular and Plural.
<?php
// original source: http://kuwamoto.org/2007/12/17/improved-pluralizing-in-php-actionscript-and-ror/
/*
The MIT License (MIT)
Copyright (c) 2015
Permission is hereby granted, free of charge, to any person obtaining a copy

OS X Preferences


#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
@dankempster
dankempster / clean-mac-crap.sh
Created November 19, 2012 12:20
Clean Mac Meta (Crap) Files
#!/bin/bash
find . -type f -name ".DS_Store" -delete
find . -type f -name "._*" -delete
find . -type f -name ".FBC*" -delete
find . -type f -name ".fseventsd" -delete
find . -type f -name ".Trashes" -delete
# There is other 'detritus' that could be removed such as the following folders, but they don't generally cause trouble so I leave them alone.
#find . -type f -name ".Spotlight-V100" -delete
@dankempster
dankempster / gist:2030754
Created March 13, 2012 18:56
isNumeric function for JavaScript
/**
* This function was sourced from http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
*/
function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
@dankempster
dankempster / gist:1050870
Created June 28, 2011 10:33
Get Query String value with jQuery
/**
* Sourced from http://stackoverflow.com/questions/901115/get-query-string-values-in-javascript#answer-3855394
* @author BrunoLM <brunolm at codingwise dot com>
*/
(function($) {
$.queryString = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
@dankempster
dankempster / jquery.sloweach-1.1.js
Created June 28, 2011 09:29
Iterates over an array of objects passing each one to callback after interval.
(function($){
/**
* Iterates over an array of objects passing each one to callback after interval.
* Calls doneCallback when complete.
*/
var version = '1.1';
var timeout = null;
@dankempster
dankempster / gist:949740
Created April 30, 2011 15:14
Using ssh-agent with ssh in Cywgin (.bash_profile)
## Only ask for my SSH key passpharase once!
# Sourced from http://mah.everybody.org/docs/ssh
SSH_ENV="${HOME}/.ssh/environment"
# Function to start the SSH-Agent
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
@dankempster
dankempster / gist:944921
Created April 27, 2011 18:52
My .screenrc File
# Useful Resources:
# http://www4.informatik.uni-erlangen.de/~jnweiger/screen-faq.html
term xterm
# Turn off the splash screen
startup_message off
# This makes the shells think they are login shells and have to do full initialisation - It also slows down screen when creating a new screen :(