I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
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 git-pull-safe() { | |
local currentBranch=$(git-branch-current) | |
local localLastCommit=$(git log --format="%H" $currentBranch | head -1) | |
local localLastPushCommit="$(git log --format="%H" origin/${currentBranch}.. | tail -n-1)^" | |
#local remoteLastCommit=$(git log origin/$currentBranch | head -1 | cut -f 2 -d ' ') | |
git fetch origin $currentBranch | |
local remoteHeadCommit=$(git log --format="%H" origin/$currentBranch | head -1) | |
if [ "$remoteHeadCommit" = "$localLastCommit" ] ; then | |
# Same message as git pull prints in this case |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 eachAsync(collection, iterator, callback) { | |
var iterate = function(i) { | |
setTimeout(function() { | |
iterator(collection[i]); | |
if (i < collection.length) { | |
iterate(i + 1); | |
} else { | |
callback(); | |
} | |
}, 0); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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
Moved to openjdk nashorn project. | |
Please check "samples" directory in http://hg.openjdk.java.net/jdk9/dev/nashorn. |
I've been asked a few times over the last few months to put together a full write-up of the Git workflow we use at RichRelevance (and at Precog before), since I have referenced it in passing quite a few times in tweets and in person. The workflow is appreciably different from GitFlow and its derivatives, and thus it brings with it a different set of tradeoffs and optimizations. To that end, it would probably be helpful to go over exactly what workflow benefits I find to be beneficial or even necessary.
- Two developers working on independent features must never be blocked by each other
- No code freeze! Ever! For any reason!
- A developer must be able to base derivative work on another developer's work, without waiting for any third party
- Two developers working on inter-dependent features (or even the same feature) must be able to do so without interference from (or interfering with) any other parties
- Developers must be able to work on multiple features simultaneously, or at lea
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
import mobx from 'mobx' | |
const DEFAULT_STYLE = 'color: #006d92; font-weight:bold;' | |
// Just call this function after MobX initialization | |
// As argument you can pass an object with: | |
// - collapsed: true -> shows the log collapsed | |
// - style -> the style applied to the action description | |
export const startLogging = ({ collapsed, style } = {}) => { | |
mobx.spy(event => { |