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
import os | |
def relpath(path, root=''): | |
if not root: | |
root=os.curdir | |
path=os.path.normpath(path) | |
root=os.path.normpath(root) | |
common=os.path.commonprefix((path, root)) | |
tail=root[len(common):] |
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 Tabs=new Class({ | |
Implements: [Events, Options], | |
options: { | |
}, | |
initialize: function(options){ |
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
v\:*{ | |
behavior:url(#default#VML); | |
} |
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
splitter.py img.gif 10 10 | |
splitter.py img.gif 10 15 20 12 |
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
git push origin master:refs/heads/test | |
#creates test branch | |
#or | |
git push origin local_branch:new_remote_branch |
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
h2, h3, h4{ | |
font-weight:normal; | |
font-family:Georgia, serif; | |
padding-left:.5em; | |
} | |
h2{ | |
background:#c3c3c3; | |
border-bottom:solid 1px #959595; | |
color:#6a6a6a; |
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
XML.getNodes=function(node, xpath){ | |
var found=[], foundNodes; | |
var root=node.ownerDocument||node; | |
if(Browser.Engine.trident){ | |
root.setProperty("SelectionLanguage","XPath"); | |
foundNodes=node.selectNodes(xpath) | |
for(var i=0, l=foundNodes.length; i<l; i++) found.push(foundNodes[i]); | |
}else{ | |
foundNodes=root.evaluate(xpath, node, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); | |
for (var i=0, l=foundNodes.snapshotLength; i<l; i++) found.push(foundNodes.snapshotItem(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
var SVG={ | |
ns: 'http://www.w3.org/2000/svg' | |
} | |
var svg = document.createElementNS(SVG.ns, 'svg').inject(document.body); | |
svg.setAttribute('width',100); | |
svg.setAttribute('height',100); | |
svg.setStyles({ | |
position: 'absolute', | |
left:10, | |
top:10 |
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://habrahabr.ru/blogs/svg/37595/ | |
SVG = { | |
_NS: 'http://www.w3.org/2000/svg', | |
_regexp: { | |
istext: /text|tspan|tref/i, | |
translate: /translate\(([-\d\.]+),?\s*([-\d\.]*?)\)/i, | |
rotate: /rotate\(([\d\.]+),?.*?\)/i, | |
scale: /scale\(([\d\.]+),?.*?\)/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
function vmlImage(props){ | |
var left=(props.left||0)-1; | |
var top=(props.top||0)-1; | |
var width=props.width+1; | |
var height=props.height+1; | |
var rect=new Element('v:rect',{ | |
styles:{ | |
width: width, | |
height: height, | |
left: left, |
NewerOlder