Skip to content

Instantly share code, notes, and snippets.

View AndrewThian's full-sized avatar
🎯
Focusing

AndrewThian AndrewThian

🎯
Focusing
  • Singapore
View GitHub Profile
@AndrewThian
AndrewThian / docker-help.md
Created October 2, 2018 07:25 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

// another approach is used by libraries such as jQuery
// similar to annoymouns-closure.js but now we passing global variables as parameters
var $ = { window: {} };
(function (globalVariable) {
// Keep this variables private inside this closure scope
var privateFunction = function() {
console.log('Shhhh, this is private!');
}

Hyper config

Installing hyper-material-theme. Just follow these instructions.

Set Hyper to use WSL's Bash by default

  • Open up Hyper and type Ctrl + ,
  • Scroll down to "shell" in the config and change it to C:\\Windows\\System32\\bash.exe
  • Reload Hyper
@AndrewThian
AndrewThian / decorators.js
Created August 15, 2018 06:55
A simple gist to explain using HoF
// Simple logging functionality
const sqrt = Math.sqrt;
console.log("result", sqrt(16))
console.log("result", sqrt(9))
// ======= logging ====== //
// Introducing logging within the function
# find various file extensions and copy to provided directory
# https://stackoverflow.com/questions/5241625/find-and-copy-files
find / \( -name "*.html" \) -exec cp {} /<directory>;
# grep to find emails
# https://stackoverflow.com/questions/2898463/using-grep-to-find-all-emails
grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | sort | uniq > <filename>.txt