Skip to content

Instantly share code, notes, and snippets.

View NorikDavtian's full-sized avatar
🚢
Shipping

Norik Davtian NorikDavtian

🚢
Shipping
View GitHub Profile
killport(){
echo "checking PORT $1"
lsof -ti tcp:$1
lsof -ti tcp:$1 | xargs kill
}
@NorikDavtian
NorikDavtian / envify.sh
Last active September 9, 2022 23:08
load variables from the .env file to the terminal environment.
#!/bin/sh
# example: ./scripts/envify.sh .env.dev
envify() {
ENV_FILE="$(pwd)/.env"
if [ -n "$1" ]; then
echo "FILE: $1"
ENV_FILE="$(pwd)/${1}"
fi
if [ -f "$ENV_FILE" ]; then
# you dont have to include this in every repo when you use any of the intellij IDEs
echo ".idea" >> ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
@NorikDavtian
NorikDavtian / js-to-mjs.sh
Created May 21, 2019 05:09
Change the file extensions in project directory from `.js` to `.mjs`
for file in **/*.js; do mv "$file" "${file%.js}.mjs"; done
@NorikDavtian
NorikDavtian / NPM EACCESS.sh
Created April 17, 2019 22:42
Fix NPM ownership issue
echo $USER
sudo chown -R $USER /usr/local/lib/node_modules

This is due to Payment Detail not being available by the payment gateway for many reasons

  • Check the Adyen dashboard for the 803 transactions and prior transactions if any exist
@NorikDavtian
NorikDavtian / install-google-fonts.sh
Created March 16, 2019 01:29
Install Google fonts on Mac
curl https://raw.githubusercontent.com/qrpike/Web-Font-Load/master/install.sh | sh
@NorikDavtian
NorikDavtian / learn-go-lang-expedited.md
Last active August 7, 2020 05:48
My take on learning Go Language. https://git.io/fhLYE

Learn Go Lang: Expedited

This is my take on learning go and experimenting with it, again.
Learning a new language is often times a lot of back and forth between I got it and hmm what's next?
It is easy to get started but what is past the hello-word.go?
Is it a web server or is it a cli tool?
This is the never ending loop of being stuck on more hello world examples and more CRUD using different frameworks that I dont intend to use.
Sometimes it is difficult to do paradigm switching, but a working playground environment will make it easy to get it going and not get stuck. I hit my own share of roadblocks trying to learn go, hopefully this list will make it easy for someone else.

Let's not get stuck and get it going :)

# https://kubernetes.io/docs/reference/kubectl/cheatsheet/#zsh
source <(kubectl completion zsh) # setup autocomplete in zsh into the current shell
echo "if [ $commands[kubectl] ]; then source <(kubectl completion zsh); fi" >> ~/.zshrc # add autocomplete permanently to your zsh shell