Skip to content

Instantly share code, notes, and snippets.

View dhigginbotham's full-sized avatar
😸
happycat

David Higginbotham dhigginbotham

😸
happycat
View GitHub Profile
@dhigginbotham
dhigginbotham / EmailClients.json
Created November 14, 2013 21:50
EmailClients.json
{
"@media": {
"Outlook 2007/10/13 +": "No",
"Outlook 03/Express/Mail": "No",
"iPhone iOS 7/iPad": "Yes",
"Outlook.com": "No",
"Apple Mail 6.5": "Yes",
"Yahoo! Mail": "No",
"Google Gmail": "No",
"Android 4 (Gmail) +": "No"
$('#contact-send').click(function(){
if($.browser.msie && window.XDomainRequest) {
// Use Microsoft XDR
var xdr = new XDomainRequest();
xdr.open("POST", "functions/db-contact-xdr.php");
xdr.send("&contact_name="+$('#contact-name').val()+"&contact_email="+$('#contact-email').val()+"&contact_subject="+$('#contact-subject').val()+"&contact_message="+$('#contact-message').val()+"");
xdr.onload = function () {
var dom = new ActiveXObject("Microsoft.XMLDOM");
dom.async = false;
dom.loadXML(xdr.responseText);
var array = [0,2,4]
undefined
~array.indexOf(6)
0
~array.indexOf(4)
-3
~array.indexOf(3)
0
var tf = (~array.indexOf(3)) ? true : false
undefined
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="building">
<echo>
---------------------------------------------------
app.directive('colorPicker', function() {
return {
scope: {
color: '=colorPicker'
},
link: function(scope, element, attrs) {
element.colorPicker({
// initialize the color to the color on the scope
pickerDefault: scope.color,
// update the scope whenever we pick a new color
{
"header": [
"StyleElement",
"Outlook2007/10/13+",
"Outlook03/Express/Mail",
"iPhoneiOS7/iPad",
"Outlook.com",
"AppleMail6.5",
"Yahoo!Mail",
"GoogleGmail",
// absolute url creator
var merge = require('./merge');
var abs = function (opts) {
this.tld = null;
this.protocol = null;
this.vhost = null;
@dhigginbotham
dhigginbotham / flash.coffee
Created October 27, 2013 01:11
my req.flash replacement for express
module.exports = (req, res, next) ->
# check for existence of deprecated `req.flash`
if req.hasOwnProperty('flash') == true and typeof req.flash == 'object'
res.locals.flash = req.flash
if req.session.hasOwnProperty('messages') == true
res.locals.flash = req.session.messages
<ul class="cross-sell-list">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
@dhigginbotham
dhigginbotham / helpers.js
Last active December 25, 2015 15:59
a little test driven development stringhelper fun
var helpers = {};
helpers.removeTrailingSlash = function (string, fn) {
var s = string || null;
var callback = ((typeof fn != 'undefined') && (typeof fn == 'function')) ? fn : null;
var sanitized, hasTrailingSlash, ln;