This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = $.browser; | |
if(b.msie) { | |
var v = b.version.split('.')[0]; | |
$('body').addClass("ie ie" + v); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Metis - A Divine Solution for Aliases | |
# by Stephen Coley @coleydotco 2012 | |
## Install ## | |
# %> git clone git://gist.github.com/1730076.git | |
# | |
# Initialized empty Git repository in ~/1730076/.git/ | |
# remote: Counting objects: 25, done. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function referid_filter($url, $refer_id) { | |
$regex = "%http[s]*\:\/\/www\.hccmis\.com\/[\w-\/]+\?referid=(\d*)%"; | |
if(preg_match($regex, $url, $matches)) { | |
if($matches[1] == "") { | |
return $url . $refer_id; | |
} else { | |
$url_arr = explode("?referid=", $url); | |
return $url_arr[0] . "?referid=" . $refer_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Author: Stephen Coley @coleydotco | |
# | |
# This script automates a Github deploy. | |
# I use it with Alfred to deploy http://coley.co. | |
# | |
# Change the stuff surrounded in [..] | |
# | |
# You must run git pull in the terminal and | |
# copy the line that asks you for your password. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* jQuery.centerToParent | |
* Centers an element within it's parent. | |
* | |
* Usage: | |
* | |
* To center along both x and y axes: $(el).centerToParent(); | |
* To center along the x axis only: $(el).centerToParent("x"); | |
* To center along the y axis only: $(el).centerToParent("y"); | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html, <html><head><style>html, body {height:100%;}#text-area {width: 100%;height: 100%;color: #868686;font-size: 18px;font-family: Helvetica;border: 0px;letter-spacing: 1px;outline: none;}</style></head><body><textarea id="text-area"></textarea><script type="text/javascript">function insertAtCursor(a,b){if(document.selection){var c;a.focus(),sel=document.selection.createRange(),c=sel.text.length,sel.text=b,0==b.length?(sel.moveStart("character",b.length),sel.moveEnd("character",b.length)):sel.moveStart("character",-b.length+c),sel.select()}else if(a.selectionStart||"0"==a.selectionStart){var d=a.selectionStart,e=a.selectionEnd;a.value=a.value.substring(0,d)+b+a.value.substring(e,a.value.length),a.selectionStart=d+b.length,a.selectionEnd=d+b.length}else a.value+=b}document.getElementById("text-area").onkeydown=function(a){a||9!=event.keyCode?9==a.keyCode&&(a.preventDefault(),insertAtCursor(document.getElementById("text-area")," ")):(event.returnValue=!1,insertAtCursor(document.getElementById("text-ar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var failedCount = null; | |
var checkFailedInterval; | |
function getNotificationPrivileges(){ | |
if (Notification.permission !== "granted") | |
Notification.requestPermission(); | |
} | |
function checkFailedCount(){ |