Skip to content

Instantly share code, notes, and snippets.

View dangh's full-sized avatar
🤖
I may be slow to respond.

Dang dangh

🤖
I may be slow to respond.
View GitHub Profile
@dangh
dangh / Celeste Dark.sublime-color-scheme
Last active October 26, 2018 10:20 — forked from Alanaktion/Celeste Dark.sublime-color-scheme
Celeste Dark Sublime Text Theme
{
// Rough modified version of Celeste to darken it up
"name": "Celeste Dark",
"author": "Sublime HQ Pty Ltd",
"variables":
{
// These colors are part of the hashed range
// and should only be used in non-source
"purple": "hsla(260, 50%, 70%, 1)",
"blue": "hsla(200, 70%, 55%, 1)",
@dangh
dangh / npm does not recognize binary files in node_modules folder.md
Last active December 11, 2018 04:39
Fix npm doesn't regconize node_modules binary files

Try to run bin file with and without extension:

.\node_modules\.bin\electron.cmd
.\node_modules\.bin\electron

If it's work with extension but not without, check PATHEXT environment variable.

@dangh
dangh / SketchSystems.spec
Last active December 26, 2018 18:16
Configure RE
Configure RE
Instruct user to power on device and scan QR code
cancel -> Exit
Scan QR
valid QR code -> Check CAP
wrong QR code -> Inform user about wrong QR code
Inform user about wrong QR code
OK -> Instruct user to power on device and scan QR code
Active
Check CAP
@dangh
dangh / SketchSystems.spec
Last active December 26, 2018 09:02
Configure CAP
Configure CAP
Instruct user to power on device and scan QR code
cancel -> Exit
Init
valid QR code -> Instruct user to connect wifi
wrong QR code -> Inform user about wrong QR code
Inform user about wrong QR code
OK -> Instruct user to power on device and scan QR code
Instruct user to connect wifi
Trying to connect

Keybase proof

I hereby claim:

  • I am dangh on github.
  • I am dangh (https://keybase.io/dangh) on keybase.
  • I have a public key ASDA3BIwCpFrFRdxfbDy8EKXYjuFyRg80azOpRAHoxk4bAo

To claim this, I am signing this object:

@dangh
dangh / machine.js
Last active July 30, 2019 07:11
Generated by XState Viz: https://xstate.js.org/viz
let booking = new Machine({
context: {
paymentState: 'new'
},
initial: 'new',
states: {
new: {
on: {
PAYMENT_NEW: 'paying',
PAYMENT_CHARING: 'paying',
công thức: chia ngày thành 3 khung thời gian: 7am -> 17pm, 17pm -> 24pm, 0am -> 7am
tính tổng {số giờ} * {hệ số} của mỗi khung thời gian
7am -> 17pm
{số giờ} = nếu bắt đầu trước 17pm : 17 - giờ bắt đầu (input)
ngược lại không tính (zero)
= if(AH40<17,17-AH40,0)
function abortableAsync(generator) {
return ({
[generator.name](...args) {
let halt = false;
try {
return () => { halt = true; };
} finally {
(async() => {
let g = generator.call(this, ...args);
let value, done, err;
@dangh
dangh / group_has_transient_sheet.md
Last active July 9, 2021 05:33
Prevent Sublime Text 3 close window on Command+W

Installation for ST3

curl -L https://gist.github.com/dangh/ffe9a735f441451f6e0c20f7e1e7c8f9/raw/group_has_transient_sheet.py -o "$HOME/Library/Application Support/Sublime Text 3/Packages/User/group_has_transient_sheet.py"

Usage

Add key binding to your .sublime-keymap

# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
export PATH="$HOME/.cargo/bin:$PATH"
# clone crossfont and alacritty
git clone --depth 1 https://github.com/alacritty/crossfont.git
git clone --depth 1 https://github.com/alacritty/alacritty.git
# patching
sed -i '' -E 's/(set_allows_font_smoothing|set_should_smooth_fonts)\(true\)/\1(!use_thin_strokes)/' crossfont/src/darwin/mod.rs