Skip to content

Instantly share code, notes, and snippets.

@n00dl3
n00dl3 / parse_dotenv.bash
Created June 16, 2020 11:08 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
:w !sudo tee %
# :w = Write a file.
# !sudo = Call shell sudo command.
# tee = The output of the vi/vim write command is redirected using tee.
# % = Triggers the use of the current filename.
# Simply put, the ‘tee’ command is run as sudo and follows the vi/vim command on the current filename given.
@n00dl3
n00dl3 / detach-attach.ts
Created November 17, 2016 15:37
detach child component and attach to parent
this.renderer.detachView(this.stepperSteps.map(el => el.elementRef.nativeElement));
this.renderer.attachViewAfter(this.elementRef.nativeElement, [this.stepperSteps.map(el => el.elementRef.nativeElement)[this.currentStepNumber]]);