Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-caskIf you get the error "already installed", follow the instructions to unlink it, then install again:
| Sublime regex for remove _id from export | |
| , "_id" : \{ "\$oid" : ".*?" \} | |
| Regex not greedy | |
| * - zero or more | |
| *? - zero or more (non-greedy) | |
| + - one or more |
| var log = Function.prototype.call.bind(console.log, console); | |
| var error = Function.prototype.call.bind(console.error, console); | |
| var info = Function.prototype.call.bind(console.info, console); |
| //Syntatic sugar to add methods to any function faster | |
| Function.prototype.method = function (name, func) { | |
| this.prototype[name] = func; | |
| return this; | |
| }; | |
| //Example | |
| //for any class... | |
| function HelloClass(){ |
| var oldObj = { | |
| first: function() {}, | |
| second: function() {} | |
| }; | |
| var newObj = Object.create(oldObj); | |
| newObj.third = function() {}; |
| //In this way we prevent 2 things: | |
| // 1- Polute the global scope | |
| // 2- The creation of the array name each time digitToName is called | |
| var digitToName = (function(digit){ | |
| var names = ['one', 'two', 'tree'] | |
| return function(){ | |
| return names[digit]; | |
| } | |
| }()); |
| Show the filename without line breaking, and wait for changes. | |
| less -S +F filename |
| console.table({ | |
| "01 - moment('2016-04-14T00:00:00+00:00').format()": moment('2016-04-14T00:00:00+00:00').format(), | |
| "02 - moment.utc('2016-04-14T00:00:00+00:00').format()": moment.utc('2016-04-14T00:00:00+00:00').format(), | |
| "03 - moment('2016-04-14T00:00:00+01:00').format()": moment('2016-04-14T00:00:00+01:00').format(), | |
| "05 - new Date('2016-04-14T00:00:00+00:00')": new Date('2016-04-14T00:00:00+00:00'), | |
| "04 - new Date(Date.parse('2016-04-14T00:00:00+00:00'))": new Date(Date.parse('2016-04-14T00:00:00+00:00')), | |
| "09 - moment('2016-04-14T00:00:00+00:00').tz('Europe/London').format()": moment('2016-04-14T00:00:00+00:00').tz('Europe/London').format(), | |
| "10 - moment.utc('2016-04-14T00:00:00+00:00').tz('Europe/London').format()": moment.utc('2016-04-14T00:00:00+00:00').tz('Europe/London').format(), | |
| }); |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Resources: | |
| # Setup an user | |
| user: | |
| Type: AWS::IAM::User | |
| Properties: | |
| UserName: !Join | |
| - '-' | |
| - - 'changeme' |
| [alias] | |
| ready = !"git fetch --all && git checkout develop && git pull --rebase && git fetch-main && git branch --no-color | grep -v main | grep -v develop | xargs -r git branch -D" | |
| graph1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
| graph2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
| graph = !"git graph1" | |
| fetch-develop = fetch origin develop:develop | |
| fetch-master = fetch origin master:master | |
| fetch-main = fetch origin main:main | |
| amend = commit -a --amend | |
| undo = reset --soft HEAD~1 |
Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-caskIf you get the error "already installed", follow the instructions to unlink it, then install again: