git checkout <master>
git merge origin <master>
git checkout <feature>
git rebase <master>
- deal with any conflicts
git add .
git rebase --continue
git push origin <feature> --force
- 😎
This file contains 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
/** | |
* Rhythm | |
* ------------------------------------------------------------------------ | |
* rhythm() | |
* @version 1.0 | April 25th 2013 | |
* @author Beau Charman | @beaucharman | http://www.beaucharman.me | |
* @link https://gist.github.com/beaucharman/5459188/ | |
* @param {em} $fontsize | em unit value | |
* @param {float} $lineheight | decimal value | |
* @return {em} em unit value |
This file contains 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
<?php | |
/** | |
* Simple Capture Form | |
* | |
* <input type="hidden" name="first_name" value="" /> | |
* <input type="hidden" name="form_submitted" value="true" /> | |
* | |
* May need to consider using https://github.com/PHPMailer/PHPMailer | |
* with an SMTP server if mail from this form goes to spam folder | |
*/ |
This file contains 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
// Chapter two - exercise one | |
// c2e1(); | |
function c2e1() { | |
var hashCount = 1; | |
var hashes = '#'; | |
for (;hashCount <= 7; hashCount++) { | |
console.log(hashes); | |
hashes += '#'; | |
} | |
} |
This file contains 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 forEach(obj, callback) { | |
Object.keys(obj).forEach((item) => { | |
return callback(obj, item) | |
}) | |
} | |
// usage | |
let obj = { a: 1, b: 2, c: 3 } | |
let array = [] | |
forEach(obj, function(obj, item) { |
This file contains 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 recursiveFlatten(array, ignoreObjects = false) { | |
let current = [] | |
const arrayLength = array.length | |
function isType(obj, type = 'Object') { | |
return Object.prototype.toString.call(obj).indexOf(type) !== -1 | |
} | |
for (let i = 0; i < arrayLength; i++) { | |
let result |
This file contains 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
// https://gist.github.com/sebmarkbage/ef0bf1f338a7182b6775#gistcomment-1770639 | |
// "If your higher order component need state or lifecycle methods use this:"" | |
const hoc = C => class _hoc extends React.Component { | |
render() { | |
return <C {...this.props}/>; | |
} | |
} | |
// "If you don´t need state or lifecycle methods on your HOC this snip is more functional:"" | |
const hoc = C => _hoc(props) => { | |
return <C { ...props }/>; |
This file contains 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 Revived = () => { | |
createStore = (reducer) => { | |
let state | |
let listeners = [] | |
const getState = () => state | |
const dispatch = (action) => { | |
state = reducer(state, action) |
This file contains 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 compose = (...functions) => (...start) => ( | |
functions.reduce((result, f) => ( | |
(typeof result === 'object') ? f(...result) : f(result) | |
), start) | |
) | |
/** | |
* Usage |
This file contains 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 { unionBy, isArray, merge, find } = _ | |
const deepArrayMerge = (initial, replacement, key) => unionBy(initial, replacement, key) | |
.map(item => merge({}, item, find(isArray(replacement) ? replacement : [replacement], { [key]: item[key] }))) |