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 light_or_dark = function(hex) { | |
var rgb = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex), | |
luma = Math.sqrt( | |
0.299 * parseInt(rgb[1], 16) + | |
0.587 * parseInt(rgb[2], 16) + | |
0.144 * parseInt(rgb[3], 16) | |
); | |
return (luma > 13) ? "light" : "dark"; | |
}; |
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
@mixin animation($options...) { | |
$random: random(9999); | |
$animation_name: "animation_#{$random}"; | |
-webkit-animation: $animation_name $options; | |
-moz-animation: $animation_name $options; | |
-ms-animation: $animation_name $options; | |
animation: $animation_name $options; | |
@at-root { |
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 set_document_hash = function(hash) { | |
var id = hash, | |
temp_id = "TEMP-" + hash, | |
target = $("#" + id); | |
if (target.length) target.attr("id", temp_id); | |
document.location.hash = hash; | |
if (target.length) target.attr("id", id); | |
} |
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
// Usage: | |
// var randomiser = new Unrandom(["alpha", "bravo", "charlie", "delta"]); | |
// console.debug(randomiser.get()); | |
var Unrandom = function(_items) { | |
var items, | |
last_item, | |
marker = 0; |
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
// Usage: | |
// @include prefix(transform-origin, 0 0 0, webkit o moz); | |
@mixin prefix($property, $value, $prefixes) { | |
@each $prefix in $prefixes { | |
-#{$prefix}-#{$property}: $value; | |
} | |
#{$property}: $value; | |
} |
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
@mixin breakpoint($points) { | |
@if index($points, large) { | |
@media screen and (min-width: 1000) { @content; } | |
html.ie-large & { @content; } | |
} | |
@if index($points, medium) { | |
@media screen and (max-width: 999) and (min-width: 600) { @content; } | |
} | |
@if index($points, small) { | |
@media screen and (max-width: 599) { @content; } |
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
Array.prototype.shuffle = function() { | |
var l = this.length, t, r; | |
if (l == 0) return; | |
while (l--) { | |
r = Math.floor(Math.random() * l + 1); | |
t = this[l]; | |
this[l] = this[r] | |
this[r] = t; | |
} |
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
# truncate text without chopping words | |
# where d = text to truncate | |
# x = maximum amount of characters | |
(d.length <= x) ? d : d[0..x].split()[0...-1].join(' ') + '...' |
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
$('.scroll-to').click(function(e) { | |
target = $($(this).attr('href')); | |
if (target.offset()) { | |
$('html, body').animate({scrollTop: target.offset().top + 'px'}, 500); | |
} | |
e.preventDefault(); | |
}); |
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
find . -type f -name "* conflicted *" -exec rm -f {} \; |
NewerOlder