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
$(document).ready(function() { | |
var scroll = function() { | |
$("html, body").scrollTop(Math.round($('#myDIv').parent('section').offset().top)); | |
console.log($('#myDIv').offset().top); | |
clearTimeout(t); | |
} | |
var t = setTimeout(scroll,20); | |
}); |
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 myDiv = dojo.byId("myID"), | |
thresh = 230; | |
dojo.style(myDiv,{ opacity: 0, display:"none" }); | |
dojo.connect(window,"onscroll",function(e) { | |
var scroll = -dojo.position(dojo.body()).y; | |
dojo.style(myDiv, { opacity: (Math.min(Math.max(0, scroll - thresh) / thresh, 1)), display:"inline" }); | |
}); |
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
window.myApp = this.angular.module('myApp', ['ngSanitize']); | |
var monthDays = ['array stuff']; | |
myApp.controller('MyCtrl', function($scope) { | |
var dates = []; | |
for (var i = 0; i < monthDays.length; i++ ) { | |
if (i % 5 == 0) dates.push([]); | |
dates[dates.length-1].push(monthDays[i]); | |
} |
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
%header | |
%h1 Say “hello” to my sticky div! | |
#stickySpace | |
#sticky | |
“Hello.” | |
%p scroll down ↓ | |
%p scroll down ↓ | |
%p scroll down ↓ |
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
<!-- | |
_____________________________________________ | |
//:::::::::::::::::::::::::::::::::::::::::::::\\ | |
//:::_______:::::::::________::::::::::_____:::::::\\ | |
//:::_/ _-"":::_--""" """--_::::\_ ):::::::::\\ | |
//:::/ /:::::_" "-_:::\/:::::|^\:::\\ | |
//:::/ /~::::::I__ \:::::::::| \:::\\ | |
\\:::\ (::::::::::""""---___________ "--------" /:::// | |
\\:::\ |::::::::::::::::::::::::::::""""==____ /:::// | |
\\:::"\/::::::::::::::::::::::::::::::::::::::\ /~:::// |
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
#viewport | |
#world | |
.speaker | |
#face-1.face("data-x" = "250", "data-y" = "0", "data-z" = "0") | |
a(href = "#") | |
img(src = "http://lorempixel.com/500/500/animals/") | |
.speaker |
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
//http://bost.ocks.org/mike/shuffle/ | |
function shuffle(array) { | |
var m = array.length, t, i; | |
// While there remain elements to shuffle… | |
while (m) { | |
// Pick a remaining element… | |
i = Math.floor(Math.random() * m--); |
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
$total-padding: 8; | |
@media only screen { | |
@for $x from 0 through $total-padding { | |
@for $y from 0 through $total-padding { | |
.small-padding-#{$x}-#{$y} { | |
padding-top: $x * 1em; | |
padding-bottom: $y * 1em; | |
} | |
} |
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
eq = (val1, val2) -> | |
i = undefined | |
l = undefined | |
return true if val1 is val2 | |
return false if typeof val1 isnt typeof val2 | |
if val1.length and val1.splice and val2.length and val2.splice | |
return false unless val1.length is val2.length | |
i = 0 | |
l = val1.length |
OlderNewer