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
{{#svg}} | |
{{#selector}}.{{expression}}{{^last}}, | |
{{/last}}{{/selector}} { {{#sprite}} | |
background-position: {{position}};{{/sprite}}{{^common}} | |
background-repeat: no-repeat;{{#dimensions}} | |
display: block; | |
text-indent: -999em; | |
width: {{width}}px; | |
height: {{height}}px;{{/dimensions}} | |
background-image: url(/assets/sprite/{{#sprite}}{{sprite}}{{/sprite}}{{^sprite}}{{#encode}}"{{encoded}}"{{/encode}}{{^encode}}{{path}}{{/encode}}{{/sprite}});{{/common}} |
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
.vidicon(@size) { | |
@trisize: (@size / 3); | |
position: relative; | |
z-index: 1; | |
&:before, | |
&:after { | |
content: ""; | |
opacity: .7; | |
display: block; | |
position: absolute; |
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 readyStateCheckInterval = setInterval(function() { | |
if (document.readyState === "complete") { | |
// do stuff | |
init(); | |
clearInterval(readyStateCheckInterval); | |
} | |
}, 10); |
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
# hisrc: load low src image by default and on defined breakpoint load hires image | |
# html markup: <img data-breakpoint="450" data-hisrc="large-image.jpg" src="default-image.jpg" alt=" "> | |
# data-breakpoint="450" is not needed, 450 is default | |
hisrc = () -> | |
window_width = $(window).width() | |
$('[data-hisrc]').each () -> | |
$(this).attr('data-breakpoint', '450') if not $(this).attr('data-breakpoint') | |
$(this).attr('data-losrc', $(this).attr('src') ) if not $(this).attr('data-losrc') |
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
#!/bin/bash | |
# for an "svn pristine text not present" error like this: | |
# svn: E155010: Pristine text 'd6612ee6af5d9fb4459cbe7e2e8e18f7fb4201f8' not present | |
# you can delete the file and retrieve it with svn up | |
# (if you have local modifications, make up your own plan) | |
# - | |
# Run this script from the root of the working copy. | |
# It retrieves the file that's causing the error from wc.db | |
# usage example : ./svn-pristine-find.sh d6612ee6af5d9fb4459cbe7e2e8e18f7fb4201f8 |
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
rm -rf $(find . |grep .svn| grep -v svn/) |
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
$("a[href*=#]:not([href=#])").click -> | |
if location.pathname.replace(/^\//, "") is @pathname.replace(/^\//, "") and location.hostname is @hostname | |
scrollByClick = true | |
target = $(@hash) | |
target = (if target.length then target else $("[name=" + @hash.slice(1) + "]")) | |
offset_fix = -60 | |
if $(window).scrollTop() < 10 | |
offset_fix = -200 |
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
$('form :text').keydown(function(){ | |
if (!$(this).parents('form').children('.pl').length) { | |
var d = new Date(); | |
var n = d.getDay()*d.getDate(); | |
$(this).parents('form').append('<input type="hidden" name="pl" class="pl" value="'+n+'">'); | |
} | |
}); |
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
//Returns true if it is a DOM node | |
function isNode(o){ | |
return ( | |
typeof Node === "object" ? o instanceof Node : | |
o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string" | |
); | |
} | |
//Returns true if it is a DOM element | |
function isElement(o){ |
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
# replace "svg" in all image src's with png for browser without svg support | |
checkA = document.implementation?.hasFeature "http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1" | |
checkB = document.implementation?.hasFeature "http://www.w3.org/TR/SVG11/feature#Shape", "1.0" | |
if not checkA and not checkB | |
for image in document.images | |
image.src = image.src.replace(/\.svg/i, '.png') |