Skip to content

Instantly share code, notes, and snippets.

View tduyng's full-sized avatar
➡️
The next ...

Duy NG tduyng

➡️
The next ...
View GitHub Profile
@tduyng
tduyng / gitenv.md
Created June 5, 2021 07:17 — forked from wojteklu/gitenv.md
Perfect git environment on OS X

Perfect git environment on OS X

Global alias

Add the following to your ~/.bashrc:

alias g='git'

Branch auto-completion

@tduyng
tduyng / readme.md
Last active May 19, 2021 05:47 — forked from ChriRas/readme.md
Set up default audio device on Ubuntu 20.04 LTS

Problem

I have a notebook connected to a port replicator. I want to use the build-in speakers and microfone and not the external ones. If I boot my notebook in my port replicator Ubuntu changes the devices to external.

Solution

  1. Find your internal speaker
pactl list short sinks
@tduyng
tduyng / express-nginx.md
Last active March 18, 2021 06:51 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

How to configure HTTPS with Lets Encrypt, Nginx reverse proxy, Express and Node

  1. Have a Node app ready for production.
  2. Create an app.js file in your project directory:
const express = require('express');
const path = require('path');
const app = express();

// Allow dotfiles - this is required for verification by Lets Encrypt's certbot
@tduyng
tduyng / webdev_online_resources.md
Created February 27, 2021 08:42 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@tduyng
tduyng / node_nginx_ssl.md
Created February 27, 2021 07:32 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@tduyng
tduyng / tmux-cheatsheet.markdown
Created December 12, 2020 12:26 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@tduyng
tduyng / tmux.md
Created December 12, 2020 12:25 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@tduyng
tduyng / gitflow-breakdown.md
Created August 28, 2020 12:07 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

var users = [{"user": "👩🏻‍💻"},{"user": "👨🏾‍💻"},{"user": "💃"},{"user": "👨🏻‍🎓"},{"user": "🧑🏻‍🏫"},{"user": "🦸‍♂️"},{"user": "🧟‍♂️"}];
let resultDetails = users.map(user => {
let mark = Math.random() * 100;
user.mark = mark;
return user
});
//for me resultDetails
/*
0: {user: "👩🏻‍💻", mark: 76.03572182106969}
@tduyng
tduyng / css-media-queries-cheat-sheet.css
Created August 3, 2020 10:37 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }