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
| import { connect } from 'react-redux'; | |
| import _ from 'lodash'; | |
| function reduxConnected(reduxTreeQuery, fallbackValue, propName) { | |
| return connect(state => ({ | |
| [propName]: _.get(state, reduxTreeQuery, fallbackValue) | |
| })); | |
| } | |
| export default reduxConnected; |
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
| /* | |
| No need to use the ES5 version | |
| (function () { | |
| var tmp = ···; | |
| ··· | |
| }()); | |
| */ |
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
| tree -I 'node_modules' -L 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
| const userReducer = (state={}, action) => { | |
| switch(action.type) { | |
| case 'CHANGE_NAME': { | |
| // Immutable way | |
| state = {...state, name: action.payload} | |
| break; | |
| } | |
| case "CHANGE_AGE": { | |
| state = {...state, age: action.payload} | |
| break; |
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
| <!DOCTYPE html> | |
| <html lang="en" id="dark"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>:target for alternate layouts</title> | |
| <style> | |
| #dark:target body { | |
| background: black; | |
| color: white; | |
| } |
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.prototype.method = function (name, func) { | |
| this.prototype[name] = func; | |
| return this; | |
| }; | |
| /* | |
| http://stackoverflow.com/questions/3966936/method-method-in-crockfords-book-javascript-the-good-parts | |
| */ |
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
| <div class="flex"> | |
| <section> | |
| <img src="img.jpg" alt="description" /> | |
| <h2>Product</h2> | |
| <p>Description</p> | |
| <aside> | |
| <ul> | |
| <li>Spec</li> | |
| <li>Spec</li> | |
| </ul> |
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
| .flex { | |
| display: flex; /* Make products flex in row direction (default) */ | |
| flex-wrap: wrap; /* Make products overflow on new row */ | |
| justify-content: center; /* Or space-between or space-around */ | |
| } | |
| .flex > section { | |
| flex: 1 1 0; /* Prevent the extra space around content */ | |
| text-align: center; /* Align text on center */ | |
| display: flex; /* Display as 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
| img { display: none; } /* Sorry! */ | |
| p { text-align: justify; } | |
| a { | |
| color: #0066B3; | |
| text-decoration: none; | |
| } | |
| a:hover { |
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 | |
| sips -Z 200 img.jpg |