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
| ; destructering nested map with let bindings | |
| (defn my-transformer | |
| [event] | |
| (let [{type :type, {id :id} :data} event] | |
| {:type type :data {:id id}})) |
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
| ## template expressions | |
| <h1>{{title}}</h1> -> interpolation binding syntax (represent's components title property value as String) | |
| {{1+1}} -> template expression - evaluated and then converted to a string | |
| {{1 + 1 + getVal()}} -> getVal is method on host component | |
| <div *ngFor="let hero of heroes">{{hero.name}}</div> -> hero property is defined in the template's context | |
| ## template statements | |
| button (click)="deleteHero()">Delete hero</button> -> template statement used in event bindings, deleteHero is a side effect |
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
| def knowsHowToUseGit(user:User) = { | |
| if(isAbleToExplainWhyNotToPushToMaster(user) && | |
| knowsHowToWorkOnBranches(user) && | |
| isFamiliarWithInteractiveRebasing(user) && | |
| knowsHowToScopeACommit(user)) | |
| true | |
| false | |
| } | |
| def workOnFork(user:User,repository:Repository) = { |
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
| IntStream.of(3, 4, 5, 6). | |
| filter(this::even). | |
| map(i -> i * 2). | |
| reduce(Integer::sum); |
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
| public class PortfolioInteractor { | |
| private final PortfolioService portfolioService; | |
| public PortfolioInteractor(@Inject PortfolioService portfolioService){ | |
| this.portfolioService = portfolioService; | |
| } | |
| public void addToPortfolio(final Isin isin, final Integer count) { | |
| Optional<PortfolioEntry> existingEntry = portfolioService.get(isin); | |
| PortfolioEntry newEntry = existingEntry.map(e -> e.count = e.count + count).orElse(PortfolioEntry.of(isin,count)) |
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
| #Highlight usage of marked variable | |
| Command + Shift + F7 | |
| #Find next occurence of marked variabel or search result: | |
| F3 | |
| #Find previous occurence | |
| Shift + F3 | |
| #Find next highlighted error | |
| F2 | |
| #Find previous highlighted error | |
| Shift + F2 |
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
| # only diff staged files | |
| git diff --staged | |
| # add all files indepent of folder - skips unix file resolution | |
| git add '.txt' | |
| # change the author of the last commit | |
| git commit --amend --author "yilaziys <fun.fun.fun@fun.fun>" | |
| ## change the author of the last three commits | |
| git rebase -i HEAD~3 | |
| #mark the commit that needs re-autoring with e |
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
| brew | |
| /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew tap caskroom/cask | |
| brew cask install java | |
| brew cask install google-chome | |
| * Adblock plugin | |
| brew cask install iterm2 | |
| * https://coderwall.com/p/h6yfda/use-and-to-jump-forwards-backwards-words-in-iterm-2-on-os-x | |
| * powerline font https://gist.github.com/baopham/1838072 |
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
| #docker-compose start/stop | |
| docker-compose up | |
| docker-compose stop | |
| #create docker container with name | |
| docker run --name yil-mysql-5.6 --env="MYSQL_ROOT_PASSWORD=password" -v /yilazius/var/lib/mysql:/var/lib/mysql -p 3306:3306 -d mysql/mysql-server:5.6 | |
| #start/stop by _name_ or _container id_ | |
| docker start mysql-5.6 | |
| docker stop mysql-5.6 | |
| #list running docker container |