Gist created from https://github.com/arturoherrero/command-line-one-liners
$ !!
$ sudo !!
Gist created from https://github.com/arturoherrero/command-line-one-liners
$ !!
$ sudo !!
Array::equals = (array) -> | |
return false unless array | |
return false unless @length is array.length | |
i = 0 | |
while i < @length | |
if this[i] instanceof Array and array[i] instanceof Array | |
# Check and recurse into the nested arrays | |
return false unless this[i].equals(array[i]) | |
else if this[i] instanceof Object and array[i] instanceof Object | |
# Stringify objects for comparison |
This handy piece of code allows you to create a full width/height div according to the viewport. The code also handles window resizing. Great for modal dialogs or popups.
// global vars
var winWidth = $(window).width();
var winHeight = $(window).height();
// set initial div height / width
$('div').css({
I hereby claim:
To claim this, I am signing this object: