- C-a == Ctrl-a
- M-a == Alt-a
:q close
:w write/saves
:wa[!] write/save all windows [force]
:wq write/save and close
| # these can all be npm scripts, but anything can be an npm script | |
| # a | |
| echo $(cat ./package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]') | |
| # b | |
| echo $(cat ./package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed -E 's/(version)|[:,\",]//g' | tr -d '[[:space:]]') | |
| # c | |
| echo $(node --eval="process.stdout.write(require('./package.json').version)") |
| <?php | |
| class Parenthesis extends TerminalExpression { | |
| protected $precidence = 6; | |
| public function operate(Stack $stack) { | |
| } | |
| public function getPrecidence() { | |
| return $this->precidence; |
| import express from 'express'; | |
| import { ApolloServer } from 'apollo-server-express'; | |
| import { ApolloServerPlugin } from 'apollo-server-plugin-base'; | |
| import * as Sentry from '@sentry/node'; | |
| Sentry.init({ | |
| environment: process.env.APP_ENV, | |
| // see why we use APP_NAME here: https://github.com/getsentry/sentry-cli/issues/482 | |
| release: `${process.env.APP_NAME}-${process.env.APP_REVISION}` || '0.0.1', | |
| dsn: process.env.SENTRY_DSN, |
If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.
Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.
The simplest way to add an alias for a specific git command is to use a standard bash alias.
# .bashrc