Skip to content

Instantly share code, notes, and snippets.

View timnovinger's full-sized avatar

Tim Novinger timnovinger

View GitHub Profile
@timnovinger
timnovinger / jquery.navigable_collapsed_list.js
Created November 23, 2011 17:14
Colorjar: Navigable collapsed list of posts
/*
*
* Navigable collapsed list of posts
* Author: Tim Novinger
* Email: [email protected]
* #colorjar
*/
// ---------------------------------
// PREV/NEXT Content Navigation
@timnovinger
timnovinger / jquery.external_links.js
Created November 18, 2011 03:12
ColorJar: Force all external links to open in a new page
@timnovinger
timnovinger / neat_trim.php
Created November 10, 2011 06:32
ColorJar: PHP neat_trim()
function neat_trim($str, $n, $delim='...') {
$len = strlen($str);
if ($len > $n) {
preg_match('/(.{' . $n . '}.*?)\b/', $str, $matches);
return rtrim($matches[1]) . $delim;
}
else {
return $str;
}
}
@timnovinger
timnovinger / jquery.modernizr.placeholder.js
Last active September 27, 2015 16:48
ColorJar: Add HTML5 input placeholder support to older browsers only when HTML5 not supported
// ------------------------------
// Form Input Placeholder
// ------------------------------
if (!Modernizr.input.placeholder)
{
$('input[placeholder], textarea[placeholder]').each(function(i, input){
var $input = $(input);
// Initially load the placeholder value
if ($input.val() === '') { $input.val($input.attr('placeholder')); }
@timnovinger
timnovinger / lobster.css
Created October 17, 2011 23:09
Lobster font-face
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: normal;
src: local('Lobster'), url('http://themes.googleusercontent.com/static/fonts/lobster/v4/NIaFDq6p6eLpSvtV2DTNDQLUuEpTyoUstqEm5AMlJo4.woff') format('woff');
}
@timnovinger
timnovinger / scrobble.py
Created August 31, 2011 18:13 — forked from jonpierce/scrobble.py
Last.fm scrobbling for Pianobar, the command-line Pandora client.
#!/usr/bin/env python
"""
Last.fm scrobbling for Pianobar, the command-line Pandora client. Requires Pianobar, Python, pyLast and Last.fm API credentials.
https://github.com/PromyLOPh/pianobar/
http://code.google.com/p/pylast/
http://www.last.fm/api/account
Installation:
1) Copy this script and pylast.py to the Pianobar config directory, ~/.config/pianobar/, and make sure this script is executable
@timnovinger
timnovinger / .irbrc
Last active September 26, 2015 19:47 — forked from tjh/.irbrc
# *****************************************
# .irbrc
#
# Tim Harvey - Literacy5
# http://literacy5.com/
#
# Includes tons of visual sugar, based on the
# work of:
#
# UnixMonkey - http://gist.github.com/254551
@timnovinger
timnovinger / post-commit.sh
Created October 6, 2010 20:59
My personal post-commit Git hook
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
: Nothing
afplay ~/.git/happykids.wav > /dev/null 2>&1 &
@timnovinger
timnovinger / jsl.textmate.conf
Created August 2, 2010 18:15
JS Lint Configuration Settings
#
# Configuration File for JavaScript Lint 0.2.6
# Developed by Matthias Miller (http://www.JavaScriptLint.com)
#
# This configuration file can be used to lint a collection of scripts, or to enable
# or disable warnings for scripts that are linted via the command line.
#
#### NOTE TO TEXTMATE BUNDLE USERS:
#### Feel free to experiment with enabling/disabling individual warnings to
@timnovinger
timnovinger / proxy.pac
Created May 10, 2010 04:19
Proxy PAC file for watching UK telly outside of the UK
// ========================================================
// Route traffic through UK based proxy
// ========================================================
function FindProxyForURL(url, host) {
// --------------------------------------------------------
// No longer work still it seems
// --------------------------------------------------------
// 92.52.125.20:80