git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| #source: https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt | |
| parse_git_branch() { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
| } | |
| export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ " |
| .directive('trAutoFocus', ['$timeout', function($timeout) { // A new directive that auto focuses on an element based on a boolean expression. | |
| return { | |
| restrict: 'A', // restricts how the directive can be used, E = as an element, A = as an attribute, C = class, M = comment. | |
| scope: { isAutoFocus: '@trAutoFocus' }, // here we make an isolated child scope & assign a value to it, @ here works in case of attribute values of when using restrict: 'A' to get the value of the expression | |
| link: function(scope, element) { // a function for DOM manipulation, based on the value evaluated [isAutoFocus] we set the focus of the element we have. | |
| scope.$watch('isAutoFocus', function(value) { | |
| if(value === "true") { | |
| $timeout(function() { | |
| element[0].focus(); | |
| }); |
| var myArr = []; | |
| myArr.push({key: 0, value: "elem-0"}); | |
| myArr.push({key: 1, value: "elem-1"}); | |
| myArr.push({key: 2, value: "elem-2"}); | |
| myArr.push({key: 3, value: "elem-3"}); | |
| //Note: to my knowlage, the .filter function returns a new array with the filtered elements. | |
| console.log(myArr.filter(function(entry) { | |
| if(entry.key % 2 == 0) | |
| return true; |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
| # scala install | |
| wget www.scala-lang.org/files/archive/scala-2.11.7.deb | |
| sudo dpkg -i scala-2.11.7.deb | |
| # sbt installation | |
| echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823 | |
| sudo apt-get update | |
| sudo apt-get install sbt |