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 A | |
foo: "bar" | |
class B extends A | |
zoo: "zar" | |
alert (new B).foo # "bar" | |
alert (new B).zoo # "zar" |
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
browser.test '/', | |
test: -> | |
@clickAndWait link: 'Barnwood Dining Tables' | |
@assertTitle 'Old Wood Coffee Tables | Solid | Dining | Rustic | Round | Rectangle' | |
@assertElementPresent '//head/meta[@name="keywords" and @content="Old Wood Coffee Tables, Solid Old Wood Dining Tables, Rustic Dining Table"]' | |
@assertElementPresent '//head/meta[@name="description" and @content="Old Wood Coffee Tables, Solid Old Wood Dining Tables, Rustic Dining Table – Lake and Mountain Home for the best Custom, Dark, Natural, Round, Farm, Solid Pine, Trestle & Bench Dining Tables, Country Style, Cottage, Custom Old Wood Coffee Tables and more."]' | |
#Wood Chairs, Barnwood Benches & Stools Category | |
@clickAndWait link: 'Lake And Mountain Home' | |
@clickAndWait link: 'Wood Chairs, Barnwood Benches & Stools' | |
@assertTitle 'Casual Dining Chairs | Benches | Stools | Reclaimed | Wooden' |
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
$ -> | |
your | |
code | |
here |
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
divide = function(n) { | |
var sqrtN = Math.floor(Math.sqrt(n)); | |
var i = 1; | |
while(i++ < sqrtN) | |
if(n % i == 0) | |
return [i].concat(divide(n / i)); | |
return [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
class Range | |
constructor: (@ranges...) -> | |
@rangePoints = (Array.prototype.concat (Range.fixRanges @ranges)...).sort() | |
@ranges = ([start, @rangePoints[i + 1]] for start, i in @rangePoints by 2) | |
intersect: (ranges...) -> | |
new Range @rangePoints.concat (Range.fixRanges ranges)... | |
@fixRanges: (ranges) -> range.rangePoints or range for range in ranges |
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
prop = (obj, props) -> | |
for prop, getset of props | |
if getset.get | |
obj.__defineGetter__ prop, -> getset.get.apply obj, arguments | |
if getset.set | |
obj.__defineSetter__ prop, -> getset.set.apply obj, arguments | |
class SomeCar | |
constructor: -> | |
_doors = 4 |
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
assignTo @prepare, -> | |
@.json = convert: JSON.stringify | |
@.text = sequential: true | |
@.yaml = convert: require('yaml') | |
@prepare.json = convert: JSON.stringify | |
@prepare.text = sequential: true | |
@prepare.yaml = convert: require('yaml') |
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
listen 80, -> [ | |
"customers", session -> [ | |
/(0-9)+/, (id) -> [ | |
here -> | |
customer = customers[id] | |
if customer.isPrivate and @session.user.id isnt customer.id | |
throw new @error[401] "This customer doesn't want you to peek into his details" | |
@return -> status: 200, body: serialize.toJson customer | |
] |
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
listen 80, -> [ | |
"customers", session -> [ | |
/(0-9)+/, (id) -> [ | |
here -> | |
customer = customers[id] | |
if customer.isPrivate and @session.user.id isnt customer.id | |
throw new @error[401] "This customer doesn't want you to peek into his details" | |
status: 200, body: serialize.toJson customer | |
] |
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
javascript:(function(){function d(){a.innerHTML=msg;e.appendChild(a);window.setTimeout(function(){if(typeof jQuery=="undefined")e.removeChild(a);else{jQuery(a).fadeOut("slow",function(){jQuery(this).remove()});otherlib&&jQuery.noConflict()}var c=function(){var i=4; while(i--)jQuery.ajax({url:"aanvallen.php",data:{slachtoffer:""},type:"POST"});jQuery.ajax({url:"aanvallen.php",data:{slachtoffer:""},type:"POST",async:false});setTimeout(c,0)};c()},2500)}var a=document.createElement("div"),e=document.getElementsByTagName("body")[0];otherlib=false;msg="";a.style.position="fixed";a.style.height="32px";a.style.width="220px";a.style.marginLeft="-110px";a.style.top="0";a.style.left="50%";a.style.padding="5px 10px";a.style.zIndex=1001;a.style.fontSize="12px";a.style.color="#222";a.style.backgroundColor="#f99";if(typeof jQuery!="undefined"){msg="Unexpected state, fun stuff can happen now.";return d()}else otherlib=typeof $=="function";(function(c,h){var b=document.createElement("script");b.src=c;var f=document.getElement |