Skip to content

Instantly share code, notes, and snippets.

View huaminghuangtw's full-sized avatar
:octocat:
Lifelong Learning Machine

Hua-Ming Huang huaminghuangtw

:octocat:
Lifelong Learning Machine
View GitHub Profile
@huaminghuangtw
huaminghuangtw / autohotkey-media-control.ahk
Last active April 28, 2023 09:52
Keyboard shortcuts for media control in Windows 10 using AutoHotkey
^!Space::Media_Play_Pause ;"Ctrl + Alt + Space" to play/pause/resume media
^!Shift::Volume_Mute ;"Ctrl + Alt + Shift" to toggle mute/unmute
^!Left::Media_Prev ;"Ctrl + Alt + ⭠" to play previous clip
^!Right::Media_Next ;"Ctrl + Alt + ⭢" to play next clip
^!Up::Volume_Up ;"Ctrl + Alt + ⭡" to increase volume
^!Down::Volume_Down ;"Ctrl + Alt + ⭣" to reduce volume
@huaminghuangtw
huaminghuangtw / myTeX.tex
Last active May 13, 2022 15:46
Usage of the 'glossaries-extra' package
\documentclass[a4paper,12pt]{article}
\usepackage[acronym,automake]{glossaries-extra}
\makeatletter
\newrobustcmd*{\myGls}{\@gls@hyp@opt\@myGls}
\newcommand*{\@myGls}[2][]{%
\new@ifnextchar[{\@myGls@{#1}{#2}}{\@myGls@{#1}{#2}[]}%
}
\def\@myGls@#1#2[#3]{%
@huaminghuangtw
huaminghuangtw / main.tex
Created May 5, 2022 10:03
Generate dummy text/images with LaTeX for testing
\documentclass{article}
\usepackage{mwe}
\usepackage{graphicx} % Or: \usepackage[draft]{graphicx}
\usepackage{lipsum}
\usepackage[english]{babel}
\usepackage{blindtext}
@huaminghuangtw
huaminghuangtw / keybindings.json
Last active April 28, 2022 12:34
Configuration for LaTeX-Workshop (VS Code Extension)
[
{
"key": "ctrl+shift+B",
"command": "editor.action.insertSnippet",
"when": "editorHasSelection && resourceExtname == .tex",
"args": {
"snippet": "\\textbf{${TM_SELECTED_TEXT}}$0"
}
},
{
@huaminghuangtw
huaminghuangtw / optpdf.sh
Created April 1, 2022 08:32
Shell script to optimize a given pdf file on Linux
#!/bin/bash
#
# 1. Install ghostscript
# sudo apt-get update
# sudo apt-get install ghostscript
# 2. Use this shell script to optimize the given pdf
# sh optpdf.sh <filename>.pdf
file="$1"
filebase="$(basename "$file" .pdf)"
@huaminghuangtw
huaminghuangtw / .editorconfig
Created October 25, 2021 09:12
My .editorconfig Template
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org
# Use top-most EditorConfig file
root = true
[*]
# Unix-style newlines at the bottom of every file
@huaminghuangtw
huaminghuangtw / .gitignore
Created October 25, 2021 09:10
My .gitignore Template
# Ignore everything
*
# Unignore all files with extensions
!*.*
# Unignore all directories
!*/
### Above combination will ignore all files without extension (e.g., Linux Executable Files) ###
@huaminghuangtw
huaminghuangtw / EvaluatePrefixAndPostfix.cpp
Created October 21, 2021 16:12
Evaluation of Postfix & Prefix Expressions in C++
/*
* Evaluation of Postfix & Prefix Expressions in C++.
* Input Postfix expression must be in a desired format:
* Operands must be single-digit integers (i.e., 0-9) and there should be space/comma in between two characters.
* (If we start considering integers > 9 then 2 single-digit integer might get interpreted as 1 two-digit integer and we will get segmentaion error because PerformOperation function is expecting two integers in stack whereas only 1 is found.)
* Only '+', '-', '*' and '/' operators are expected.
*
* Test case for Postfix expression: 23*54*+9+ -> 35
* Test case for Prefix expression: ++*23*549 -> 35
*/
@huaminghuangtw
huaminghuangtw / .gitconfig
Last active March 10, 2024 16:22
My Git Configuration
[user]
name = Hua-Ming Huang
email = huaming.huang.tw@gmai.com
[github]
user = huaminghuangtw
tokentype = ssh
[include]
path = ~/.git-sendemail
@huaminghuangtw
huaminghuangtw / my-readme-template.md
Last active January 25, 2022 17:51
My README Template

Project Name

Open Source Love