Skip to content

Instantly share code, notes, and snippets.

@jorishr
jorishr / setup_temp_swap.sh
Last active December 29, 2023 20:47
Add a temporary swap file to a Ubuntu server
#!/bin/bash
set -e
echo -e "\e[1;34m╔══════════════════════════════════════════╗"
echo -e "║ \e[1;36mSwap File Setup Script\e[1;34m ║"
echo -e "╚══════════════════════════════════════════╝\e[0m\n"
echo -e "\e[1;34mStep 1: Setup the Swap File\e[0m"
echo -e "Creating swap file..."
SWAP_FILE="/swapfile"
@jorishr
jorishr / deploy_latest_npm_webapp.sh
Last active December 16, 2023 10:50
deploy_latest_npm_webapp.sh
#!/bin/sh
echo -e "\033[1;36m-----------------------------------"
echo -e "| Deploying the latest release... |"
echo -e "-----------------------------------\033[0m\n"
set -e
echo -e "=== Start backup existing files... ===\n"
DIR_PATH_BASE="<your_folder>"
BACKUP_FOLDER="$DIR_PATH_BASE/backup/backup_$(date +%Y-%m-%d_%H-%M)"
[]
#--------------------------------------------------
# [ FEAT BUG CHG REFAC PERF DATA TOOL COPY DOC SPEC WIP ]
# Do not exceed above line in commit txt length (50 char)
#--------------------------------------------------
# This is the empty space to separate the title from the body
#---------------------------------------------------------------------
#---------------------------------------------------------------------
@jorishr
jorishr / bash-colors.md
Created March 9, 2023 09:51 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@jorishr
jorishr / colors.py
Created January 6, 2023 09:39 — forked from rene-d/colors.py
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@jorishr
jorishr / gulpfile.js
Last active June 17, 2019 17:14
Gulp+BrowserSync+Nodemon
const { series, watch, parallel, src, dest} = require('gulp'),
nodemon = require('nodemon'),
browserSync = require('browser-sync');
function startNodemon (cb) {
let called = false;
return nodemon({
script: './app/app.js',
// watch core server file(s) that require server restart on change
watch: ['./app/app.js']
@jorishr
jorishr / newProject.sh
Last active June 14, 2019 16:17
website development workflow setup automation
#!/bin/bash
###################
# What it does:
# - setup the basic folder structure for a website development project
# - setup a local and remote (private) Github repo with readme and gitignore
# - configure NPM and basic setup for using GULP or WEBPACK
# - install NPM dev dependency packages
###################
# Requirements: