Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Park Hee Chan channprj

View GitHub Profile
channprj /
Created January 9, 2024 07:38 — forked from lopspower/
Hexadecimal color code for transparency

Hexadecimal color code for transparency


How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

channprj /
Last active August 25, 2023 07:45 — forked from ruanbekker/
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
channprj / simulate.js
Created October 11, 2022 11:27 — forked from cs09g/simulate.js
Mouse/Touch Event Simulation
* @desc It triggers mouse event.
* @param {HTMLElement} element target DOM element
* @param {string} type type of event
* @param {number} x clientX of event
* @param {number} y clientY of event
export function simulateEvent(element, type, x, y) {
const mouseEvent = new MouseEvent(type, {
screenX: 0,
channprj / safari-hacks.css
Created February 11, 2022 10:15
Hacks for Safari
@media not all and (min-resolution:.001dpcm) {
@supports (-webkit-appearance:none) {
div.something.annoying {
line-height: 18px;
channprj /
Last active May 12, 2022 07:34
Simple SSH Login Notifier via PAM
# Create trigger file
touch /etc/ssh/
chmod +x /etc/ssh/
vim /etc/ssh/
# /etc/ssh/
channprj / deep-link-from-browser.js
Created November 24, 2021 13:36 — forked from diachedelic/deep-link-from-browser.js
Deep link to a native app from a browser, with a fallback
channprj /
Last active August 3, 2021 16:24 — forked from dayreiner/
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here:

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

channprj / notion-worker.js
Last active November 28, 2021 18:33
Publish Notion homepage using
/* Step 1: enter your domain name like */
const MY_DOMAIN = '';
* Step 2: enter your URL slug to page ID mapping
* The key on the left is the slug (without the slash)
* The value on the right is the Notion page ID
🌞 Morning 52 commits █▏░░░░░░░░░░░░░░░░░░░ 5.6%
🌆 Daytime 426 commits █████████▋░░░░░░░░░░░ 46.3%
🌃 Evening 349 commits ███████▉░░░░░░░░░░░░░ 37.9%
🌙 Night 94 commits ██▏░░░░░░░░░░░░░░░░░░ 10.2%
channprj /
Created April 13, 2021 10:24
Turn off macbook (linux) screen
echo 0 > /sys/class/backlight/nv_backlight/brightness