Skip to content

Instantly share code, notes, and snippets.

@twalker
twalker / email-conditional
Last active August 29, 2015 14:13
email-conditional
<!--[if !mso]><!-->
GOOD
<script type="text/plain">
<!--<![endif]-->
BAD
<!--[if !mso]><!-->
</script>
<!--<![endif]-->
@twalker
twalker / parse-attr-options.js
Last active August 29, 2015 14:13
Parses a string of semi-colon delimited options into a plain object.
/**
* parseAttrOptions
* Parses a string of semi-colon delimited options into a plain object.
*
* @example
* parseAttrOptions('align: center; width: 300; neat: true; yagni: [1,2,3]');
* >> {align: 'center', width: 300, neat: true, yagni: [1,2,3]}
*/
export default function parseAttrOptions(sOptions){
var opts = {};
/**
* Consolidates routes into a single router for using.
*
* Nearly all routes re-use the single page application (spa) view;
* Specific routes are to use different middleware per url (i.e. restrictTo, title, bootstrap).
*
*/
var express = require('express');
var router = express.Router();
var middle = require('../middleware');
// create an array from arrayish lists
function arrayFrom(nodelist){ return [].slice.call(nodelist); }
@twalker
twalker / config.json
Last active February 26, 2020 09:34
inline-styles using phantomjs
{
"ignoreSslErrors": true,
"localToRemoteUrlAccessEnabled": true,
"webSecurityEnabled": false
}
@twalker
twalker / extend.js
Last active August 29, 2015 14:04
tiny extend
// utility to assign defaults to options
function extend(target, source){
target = target || {};
for (var prop in source) {
if(!target.hasOwnProperty(prop)) target[prop] = source[prop];
}
return target;
}
@twalker
twalker / index.html
Created July 22, 2014 03:57
A Pen by tim walker.
<video data-wfedit="video" poster="http://www.transgenomic.com/files/shared/common/img/video_poster" controls>
<source src="" type="video/mp4" />
<source src="" type="video/webm" />
<source src="" type="video/ogg" />
<a href=""><img src="" /></a>
</video>
<div>video's next sibling (non-video)</div>
@twalker
twalker / lokis-manifesto.txt
Created July 17, 2014 03:12
loki's manifesto
ioooooooooooooooooooooooooooooooooooooooooooooooooooooooooyuhhhhhhhhhhhh
@twalker
twalker / gitconfig-merge.txt
Last active August 29, 2015 14:02
merge window arrangement for the absent minded
[merge]
cmd = meld "$LOCAL" "$MERGED" "$REMOTE"
tool = meld
# photo at: https://www.dropbox.com/s/jiox4pojpp1fmo6/merge-reminder.png
@twalker
twalker / confirm-styles.js
Created June 18, 2014 20:13
Choose a fav confirm style--E, C, or P?
/* E */
// Event style (current implementation)
var confirm = notifier.confirm('Are you sure?');
this.listenTo(confirm, 'confirm', function(){
// do something
});
this.listenTo(confirm, 'cancel', function(){
// recover
});