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
function currentHostname() { | |
isset($_SERVER['HTTPS']) ? $pageURL = 'https://' : $pageURL = 'http://'; | |
$pageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"] : $_SERVER['SERVER_NAME']; | |
return $pageURL; | |
} |
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
function getElementsByClassName(node,classname) { | |
if (node.getElementsByClassName) { | |
// use native implementation if available | |
return node.getElementsByClassName(classname); | |
} else { | |
return (function getElementsByClass(searchClass,node) { | |
if ( node == null ) | |
node = document; | |
var classElements = [], | |
els = node.getElementsByTagName("*"), |
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
function isFunction(functionToCheck) { | |
var getType = {}; | |
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; | |
} |
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
#!/bin/bash | |
sha=0 | |
previous_sha=0 | |
commitmsg="online changes (autogit)" | |
if [ $1 ]; then | |
repo=$1 | |
else | |
repo='.' |
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
# 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') |
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
//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 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 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 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 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 |
OlderNewer