Skip to content

Instantly share code, notes, and snippets.

alias ws="cd /Workspace"
alias fe="cd /end-user-frontend"
@lek890
lek890 / Full page height for body in next.js
Created March 11, 2021 16:27
In _document, give an override to normalize the styles
<style global jsx>{`
html,
body,
body > div:first-child,
div#__next,
div#__next > div {
height: 100%;
}
`}</style>
#!/bin/bash
function ssh_jump_aws {
if [[ -z $1 ]]; then
echo "jump hostname required as parameter 1"
return 1
fi
if [[ -z $2 ]]; then
echo "target hostname required as parameter 2"
@lek890
lek890 / re-clone.sh
Created May 17, 2021 10:12
Clone all existing git repos to a new folder
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "All subdirectories in the folder from which this script is run would be cloned to a new destination. Pass the destination url as the argument."
exit 0
fi
remoteurls=()
dirs=($(find . -maxdepth 1 \( ! -name . \) -type d))
for dir in "${dirs[@]}"; do
@lek890
lek890 / helpers.sh
Last active May 17, 2021 10:34
Shell helper functions - bashrc
pkgrefresh(){ rm -rf node_modules && yarn; }
//clones and renames boilerplate to the name passed as the first argument
function boilerplate() { git clone https://github.com/lek890/react-typescript-webpack-boilerplate.git; mv react-typescript-webpack-boilerplate $1; cd $1; yarn; yarn start;}
@lek890
lek890 / git-aliases.sh
Created May 17, 2021 10:31
Git Aliases
# ----------------------
# Git Aliases
# ----------------------
alias lasttag='git fetch --tags && git describe --tags `git rev-list --tags --max-count=1`'
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add --all'
alias gau='git add --update'
alias gb='git branch'
alias gbd='git branch --delete '
@lek890
lek890 / vscode-extensions.md
Created May 17, 2021 10:42
VS Code extentions list

Essentials:

  1. Wallaby
  2. Turbo console log
  3. Tech Debt Metrics
  4. SonarLint
  5. GitLens
  6. Import Cost
  7. Prettier
  8. ESLint
  9. TsLint

How to use personal tokens to connect to github from local.

  1. generate the tokens in the profile settings with necessary permissions
  2. use the following in local git remote set-url origin https://@github.com//.git

Enable auto import for js module in vscode

Add a jsconfig.json with checkJs true

{
    "compilerOptions": {
        "baseUrl": "src",
        "checkJs": true,
 "jsx": "react"
//localTesting/lambda-params.json
{
"body": "{\"url\": \"/test-page\"}"
}