View threesixty-js-example.js
$(document).ready(function(){ | |
$('.threesixty').threeSixty({ | |
dragDirection: 'horizontal' | |
}); | |
}); |
View threesixty-html-example.html
<div class="threesixty" data-path="assets/img/src/gem{index}.JPG" data-count="61"></div> |
View amdconditional.js
var myModule = { | |
awesome: 'not really' | |
}; | |
if (typeof define === 'function' && define.amd) { | |
define('myModule', [], function() { | |
return myModule; | |
}); | |
} |
View isretina.js
isRetina = ((window.devicePixelRatio===undefined?1:window.devicePixelRatio)>1); |
View orphan.js
var orig = 'My sample body text', | |
split = orig.split(' '), | |
lastTwo = split.splice(split.length - 2); | |
lastTwo = lastTwo.join(' '); | |
split = split.join(' ') + ' ' + lastTwo; | |
orig = split; | |
// orig = 'My sample body text' |
View ssh_easy_access.sh
cat ~/.ssh/id_rsa.pub | ssh user@server 'mkdir -p ~/.ssh; cat >> .ssh/authorized_keys' |
View gist:5531169
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards | |
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh |
View analyzespectrum.py
import math | |
import struct | |
import wave | |
import sys | |
w = wave.open(sys.argv[1], 'rb') | |
# We assume 44.1k @ 16-bit, can test with getframerate() and getsampwidth(). | |
sum = 0 | |
value = 0; | |
delta = 0; |
View keyframe-animation.scss
@import "compass/css3/transform"; | |
@import "compass/css3/transition"; | |
@mixin animation($animate...) { | |
$max: length($animate); | |
$animations: ''; | |
@for $i from 1 through $max { | |
$animations: #{$animations + nth($animate, $i)}; |
View bubbles-dom.js
// updates the position of a bubble element | |
updatePosition: function($elem, x, y){ | |
var value = 'translate3d(' + x + 'px, ' + y + 'px, 0.1px)'; | |
// use Modernizr to get all the vendor prefixes | |
value = Modernizr._prefixes.join('transform' + ':' + value + '; '); | |
value = value.split(';'); | |
var props = {}; | |
// create an object to apply the vendor prefixed CSS properties | |
for(var i = 0; i < value.length; i++){ | |
var thisVal = value[i].split(':'); |
OlderNewer