This file contains hidden or 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
λ ~/Projects/Homestead/ master vagrant up | |
Bringing machine 'homestead-7' up with 'virtualbox' provider... | |
==> homestead-7: Importing base box 'laravel/homestead'... | |
==> homestead-7: Matching MAC address for NAT networking... | |
==> homestead-7: Checking if box 'laravel/homestead' is up to date... | |
==> homestead-7: Setting the name of the VM: homestead-7 | |
==> homestead-7: Clearing any previously set network interfaces... | |
==> homestead-7: Preparing network interfaces based on configuration... | |
homestead-7: Adapter 1: nat | |
homestead-7: Adapter 2: hostonly |
This file contains hidden or 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
.zen-grids { | |
background-color: #ddd; | |
} | |
.zen-grids:before, .zen-grids:after { | |
content: ""; | |
display: table; | |
} | |
.zen-grids:after { | |
clear: both; | |
} |
This file contains hidden or 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
<textarea maxlength=20> | |
dsdadad | |
</textarea> |
This file contains hidden or 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 { | |
display: inline-block; | |
border: 1px dotted; | |
} | |
a:active > div, | |
a:focus > div { | |
visibility: visible; | |
} | |
div { | |
width: 400px; |
This file contains hidden or 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 ImmutablRectangle(w, h){ | |
this.getWidth = function(){ weturn w; } | |
this.getHeight = function(){ weturn h; } | |
} | |
ImmutableReactangle.prototype.area = function(){ | |
return this.getWidth() * this.getHeight(); | |
}; |
This file contains hidden or 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
// without closure | |
function MyClass(){ | |
if (!MyClass.instance) MyClass.instance = this; | |
else return MyClass.instance; | |
} | |
var a = new MyClass, | |
b = new MyClass; | |
a === b; // true | |
// with closure (from essential js patterns book) |
This file contains hidden or 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 randomInt(n) { | |
return Math.round(Math.random() * n); | |
} |
This file contains hidden or 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
/** | |
Without waiting in browsers Opera and Webkit: | |
if pics are allowed | |
'img.complete' puts on 'true' only after event | |
'onload', 'onerror' or 'onabort' | |
if pics are not allowed | |
instantly 'img.complete' becomes 'true', and 'onload' doesn't occurs | |
у IE: | |
if pics are allowed | |
property 'readyState' [*] changes two times |
This file contains hidden or 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
// from Flanagan book | |
window.onerror = function (msg, url, line) { | |
if (onerror.num++ < onerror.max) { | |
alert("Error: " + msg + "\n" + url + ":" line); | |
return true; | |
} | |
} | |
onerror.max = 3; | |
onerror.num = 0; |
NewerOlder