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
class Utilities | |
@findPos: (obj) -> | |
obj = obj.get(0) if obj.html? | |
curLeft = curTop = 0 | |
if obj.offsetParent | |
loop | |
curLeft += obj.offsetLeft | |
curTop += obj.offsetTop | |
break unless obj = obj.offsetParent | |
{ x: curLeft, y: curTop } |
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 version="1.0" encoding="UTF-8"?> | |
<filetype binary="false" default_extension="" description="CoffeeScript" name="CoffeeScript"> | |
<highlighting> | |
<options> | |
<option name="LINE_COMMENT" value="#" /> | |
<option name="COMMENT_START" value="`" /> | |
<option name="COMMENT_END" value="`" /> | |
<option name="HEX_PREFIX" value="" /> | |
<option name="NUM_POSTFIXES" value="" /> | |
<option name="HAS_BRACKETS" value="true" /> |
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/sh | |
if [ ! `which rlwrap` ]; then | |
echo "Please sudo port install rlwrap" | |
exit | |
fi | |
rlwrap coffee -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
// query: select * from html where url="http://some.url.com" and xpath='//title' | |
var yql_url = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22" + encodeURIComponent(url) + "%22%20and%0A%20%20%20%20%20%20xpath%3D'%2F%2Ftitle'&format=json&callback=?"; | |
$.getJSON(yql_url, function(json) { | |
if (json && json.query && json.query.results && json.query.results.title) { | |
$('#page_title').html(json.query.results.title); | |
} | |
}); |
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
# Ruby's TSort requires that you implement | |
# tsort_each_node and tsort_each_child. I | |
# extend Array so that it knows how to | |
# TSort instances of Project, which has a | |
# child_project_id pointing to another | |
# Project. | |
require 'tsort' | |
class Array |
NewerOlder