Skip to content

Instantly share code, notes, and snippets.

View restuu's full-sized avatar

restuu restuu

View GitHub Profile
@restuu
restuu / download-file.js
Created May 13, 2018 14:41 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@restuu
restuu / setting-up-babel-nodemon.md
Created July 24, 2018 03:08 — forked from sam-artuso/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@restuu
restuu / install-node-js.sh
Created May 14, 2019 07:31 — forked from ankurk91/install-node-js.sh
Install node-js, npm and yarn on Ubuntu/Mac using nvm
#!/bin/sh
# Install node and npm via nvm - https://github.com/creationix/nvm
# Run this script like - bash script-name.sh
# Define versions
INSTALL_NODE_VER=10
INSTALL_NVM_VER=0.34.0
@restuu
restuu / update-golang.md
Created March 10, 2020 23:58 — forked from nikhita/update-golang.md
How to update the Go version

How to update the Go version

System: Debian/Ubuntu/Fedora. Might work for others as well.

1. Uninstall the exisiting version

As mentioned here, to update a go version you will first need to uninstall the original version.

To uninstall, delete the /usr/local/go directory by:

@restuu
restuu / deploy_diff.sh
Created April 21, 2020 13:27
Bash script to deploy based on git diff
#!/bin/bash
set -e
# get package directories based on diff change from last 5 commits
list=$(git diff --name-only HEAD~5..HEAD . | grep -o "packages/\w*" | uniq)
# store root dir
pwd=$PWD
@restuu
restuu / tsconfig.json
Created April 24, 2020 04:47
tsconfig
{
"compilerOptions": {
"lib": ["es6", "es2016", "es2016.array.include", "es2017", "dom"],
"module": "commonjs",
"noImplicitReturns": true,
"sourceMap": true,
"target": "es2017",
"esModuleInterop": true,
"strictNullChecks": true,
"isolatedModules": true,
@restuu
restuu / .prettierrc
Created April 24, 2020 04:49
prettier config
{
"singleQuote": true,
"printWidth": 120,
"trailingComma": "all"
}
@restuu
restuu / .eslintrc
Created April 24, 2020 04:52
typescript eslint config
{
"env": {
"node": true,
"es6": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"sourceType": "module"
},

Set the base image to Ubuntu must be first instruction - use docker search to find images

FROM ubuntu # <image>
FROM ubuntu:latest # - <image>:<tag>
FROM ubuntu:precise (LTS)

Set the maintainer info

alias gcl="git clone"
alias gcm="git commit"
alias gps="git push"
alias gpl="git pull"
alias gck="git checkout"
alias gst="git status"
alias src="source"
alias srczsh="source ~/.zshrc"