This file contains hidden or 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 (window) {"use strict"; | |
// by WebReflection - WTFPL License | |
var | |
prefixes = "r webkitR mozR msR oR".split(" "), | |
process = "process", | |
nextTick = "nextTick", | |
i = 0, | |
p = window[process] || (window[process] = {}) | |
; | |
while (!p[nextTick] && i < prefixes.length) |
This file contains hidden or 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 dnode = require('../../lib/dnode'); | |
var net = require('net'); | |
var d = new dnode(); | |
d.on('remote', function (remote) { | |
remote.transform('beep', function (s) { | |
console.log('beep => ' + s); | |
d.end(); | |
}); | |
}); |
This file contains hidden or 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
josh@onix:/tmp/http-repl$ curl -sSNT. localhost:8000 | |
Actual repl over http. NOW WITH A LIMITED CONTEXT!! | |
>> help | |
'Exits are North, South and Dennis.' | |
>> .exit | |
Terminal exiting. | |
You'll want to mash ctrl-c. | |
^C | |
josh@onix:/tmp/http-repl$ |
This file contains hidden or 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
/* Responsive Images */ | |
.r-img { | |
background-size: 100%; | |
display: inline-block; | |
zoom: 1; | |
*display: inline; /* Mimic inline-block on old IE */ | |
} | |
@media screen and (max-width: 600px) { /* Hide background on low res */ |
This file contains hidden or 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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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
// Make SVG Play nice with bad browsers | |
$(document).ready(function() { | |
if (Modernizr.inlinesvg) { | |
//SVG. | |
$('#logo').html('<img src="/assets/img/logo.svg" alt="Crafty Devil" />'); | |
} else { | |
//No SVG. | |
$('#logo').html('<img src="/assets/img/logo.png" alt="Your Company" />'); |
This file contains hidden or 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
cssTo = (elem, prop, time, easing, callback)-> | |
time = "#{time / 1000}s" | |
transitions = [] | |
for key, value of prop | |
transitions.push "#{key} #{time} #{easing}" | |
transition = transitions.join ', ' | |
listener = (e)-> | |
elem.removeEventListener 'webkitTransitionEnd', listener | |
elem.style['-webkit-transition'] = '' |
This file contains hidden or 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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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
// Example of a whole load of mixins to make round corners | |
// (including individual corners) easy to remember in SASS | |
@mixin roundcorners($radius) { | |
-moz-border-radius: $radius; // firefox | |
-webkit-border-radius: $radius; // safari/chrome | |
border-radius: $radius; // CSS3, works in IE9 | |
} | |
@mixin roundcorner1($radius, $corner: "top-left") { | |
-moz-border-#{$corner}-radius: $radius ; // firefox |
This file contains hidden or 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 jsdom = require('jsdom'); | |
window.log = console.log; | |
var window = jsdom.jsdom('<a href="javascript:log(\'clicked!\');">click me</a>').createWindow(); | |
var a = window.document.getElementsByTagName('a')[0]; | |
a.addEventListener('click', function(e) { | |
if (e.target.href.substring(0,10) === "javascript") { | |
window.run(e.target.href.substring(11), 'click-handler'); | |
} | |
}); |