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
module.exports = React.createClass({ | |
displayName : 'LazyRender', | |
getInitialState() { return { props : this.props } }, | |
componentWillReceiveProps(newProps) { setTimeout(() => this.setState(newProps), 10) }, | |
shouldComponentUpdate(newProps, newState) { return this.state !== newState; }, | |
render() { return React.cloneElement(React.Children.only(this.props.children), this.state); } | |
}); |
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($) { | |
$.fn.shush = function($btn) { | |
// First, validation | |
// Cache global variables | |
var $form = $(this); | |
// Default $btn to input[type=submit] | |
$btn = $btn || 'input[type=submit]'; |
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
* { padding: 0; margin: 0; } | |
body { background: #eeeeee; } | |
img { | |
-webkit-filter: grayscale(100%); | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-top: -150px; | |
margin-left: -150px; | |
-webkit-animation: down 1s ease, scale 1s ease .5s; |
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
* { padding: 0; margin: 0; box-sizing: border-box; /*(Needed to make content look nice with padding)*/ } | |
.header { | |
height: 60px; | |
background: grey; | |
} | |
.page { | |
position: absolute; | |
top: 60px; | |
bottom: 0; |
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
/** | |
* @adamwhitcroft's "dot" effect in pure css. http://adamwhitcroft.com | |
* I made it as reall as possible, but the grid lines are darker, rather | |
* than the spaces between them, like in Adam's version. | |
* Compare to http://adamwhitcroft.com/wp-content/themes/Fifth/img/dot.png | |
*/ | |
/* Make sure the image stays in it's container */ | |
img { max-width: 100%; } |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
* { padding: 0; margin: 0; box-sizing: border-box; } | |
body { | |
font-family: "Helvetica Neue", Arial, sans-serif; | |
background: #eee; |
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
/** | |
* Fluid + Fixed divs | |
* To use this method, firstly you need to set the container's box-sizing | |
* to border-box. This method wil still work without it, but it helps | |
* to prevent a horizontal scrollbar that may exist due to the use | |
* of this method. | |
* Secondly, add a padding-right or padding-left (depending on | |
* where the sidebar is) of the width of your sidebar to the | |
* container. Also, add a relative position to it. |
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
key: func1 func2 x, (-> | |
doStuff() | |
) |