| /* | |
| Given an array of size n, find the majority element. | |
| The majority element is the element that appears more than floor(n/2) times. | |
| You may assume that the array is non-empty and the majority element always exist in the array. | |
| */ | |
| /* | |
| This solution complexity is | |
| worst case : o(n) | |
| best case: o(n/2) => though it is said as o(n), there is nothing wrong to mention as n/2 in best case |
| const streets = [ | |
| 'Абельмановская улица', | |
| 'площадь Абельмановская Застава', | |
| 'Абрамцевская просека', | |
| 'Абрамцевская улица', | |
| 'Абрикосовский переулок', | |
| 'Авангардная улица', | |
| 'улица Авиаконструктора Микояна', | |
| 'улица Авиаконструктора Миля', | |
| 'улица Авиаконструктора Сухого', |
| /** | |
| * @typedef {Object} Person | |
| * @property {String} login Идентификатор сотрудника. | |
| * @property {Number} floor "Домашний" этаж сотрудника. | |
| * @property {String} avatar Ссылка на аватар. | |
| */ | |
| /** | |
| * @typedef {Object} Room | |
| * @property {Number} id Идентификатор переговорки. |
Иногда при работе с несколькими удалёнными репозиториями в git, может произойти страшное: git push --force в не тот remote и/или не в ту ветку.
Такое может случиться, например, если вы используете [Deis], в котором деплой запускается при git push нужного коммита в сборщик, когда при отладке деплоя после очередного git commit --amend по запарке вместо git push deis master --force делается просто git push --force. Упс.
Как результат, последние коммиты коллег безвозвратно потеряны, и вы чувствуете неотвратимость их ярости…
Но это git, а значит всё можно починить!
| -- Истина | |
| true === \t f -> t | |
| -- Ложь | |
| false === \t f -> f | |
| -- Ветвления |
| ### Aliases | |
| ## ssh to dev server | |
| alias sshj='ssh jeff@git.dev.lan' | |
| alias sshg='ssh git@git.dev.lan' | |
| ## project scripts | |
| alias cnp="~/bin/createproject2.sh" | |
| alias installPackages="~/bin/installPackages.sh" | |
| alias installbower="~/bin/installbower.sh" |
(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)
The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.
pdanford - April 2020
Update: https://www.cyanhall.com/posts/notes/7.homebrew-cheatsheet/#java
on El Capitan, after installing the brew...
$ brew update
$ brew tap caskroom/cask
$ brew install Caskroom/cask/java
And Java 8 will be installed at /Library/Java/JavaVirtualMachines/jdk1.8.xxx.jdk/
| sudo curl -o /usr/local/bin/imgcat -O https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat && sudo chmod +x /usr/local/bin/imgcat | |
| # If you have a better way to fix the permissions, comment below! |
