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
¯\_(ツ)_/¯ |
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
// Convert Array-like object to Array: | |
var unboundSlice = Array.prototype.slice; | |
var slice = Function.prototype.call.bind(unboundSlice); | |
function list() { | |
return slice(arguments); | |
} | |
var list1 = list(1, 2, 3); // [1, 2, 3] |
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 http://csshexagon.com, natch! */ | |
.hexagon { | |
position: relative; | |
width: 300px; | |
height: 173.21px; | |
background-color: #64C7CC; | |
margin: 86.60px 0; | |
} | |
.hexagon:before, |
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
/* | |
Insert a line break after inline element | |
(not the same as display:block) | |
from CSS Secrets by Lea Verou | |
*/ | |
.u-line-break::after { | |
content: '\A'; | |
white-space: pre; | |
} |
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
/* | |
Vertically center | |
From http://csstricks.com | |
No styles needed on parent. | |
*/ | |
.u-vertical-center { | |
position: relative; | |
top: 50%; | |
-webkit-transform: translateY(-50%); |
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
.u-center-vertical-flex { | |
display: flex; | |
align-items: center; | |
} | |
/* to include IE10: */ | |
.u-center-vertical-flex { | |
display: -ms-flex; | |
display: flex; |
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
#!/bin/sh | |
DATE="`date +%Y%m%d"-"%H%M`" |
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
#!/bin/sh | |
ditto -c -k --rsrc --keepParent ~/Documents/ Docs.zip |
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
// Merging objects via jQuery | |
var defaults = { validate: false, limit: 5, name: "foo" }; | |
var options = { validate: true, name: "bar" }; | |
// merged objects not modified -- creates new object `settings` | |
var settings = $.extend( {}, defaults, options ); |
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
Markup in React | |
Javascript: | |
return React.createElement("p", {className: "foo"}, "Hello, world!"); | |
JSX: | |
return (<p className="foo">Hello, world!</p>); |