Skip to content

Instantly share code, notes, and snippets.

View saikocat's full-sized avatar
🍂
Improving the code, one commit at a time

Duc Hoa, Nguyen saikocat

🍂
Improving the code, one commit at a time
View GitHub Profile
@saikocat
saikocat / atomic_habits.md
Last active May 31, 2023 21:19
[Advice] Summary of Atomic Habits
@saikocat
saikocat / combo.def
Created September 12, 2022 14:44
QMK Combo def
COMB(WORD_BSPC_KL, C(KC_BSPC), KC_I, KC_O)
COMB(SFT_OS_ASCLN, OSM(MOD_LSFT), KC_A, KC_SCLN)
COMB(SFT_OS_WE, OSM(MOD_RSFT), KC_W, KC_E)
COMB(SFT_OS_SD, OSM(MOD_LSFT), KC_S, KC_D)
COMB(CTL_OS_DF, OSM(MOD_LCTL), KC_D, KC_F)
COMB(ALT_OS_ZX, OSM(MOD_LALT), KC_Z, KC_X)
COMB(GUI_OS_OP, OSM(MOD_LGUI), KC_O, KC_P)
COMB(RET_PLOVER, KC_ENT, KC_F, KC_J)
@saikocat
saikocat / qemu_usage_with_spice_cp.md
Last active January 4, 2021 10:27
QEMU + Spice with Copy & Paste

Create a runner shell script in host -> init with:

  • 2GB RAM
  • Host CPU with 2 Cores
  • Localhost port 2222 traffic redirect to guest port 22
  • Spice display with copy and paste enabled
#!/bin/sh
SPICE_PORT=5924
SPARK_IMG=/home/hoa/spark-training.qcow2
FROM debian:buster-slim AS builder
ARG XAR_VERSION=19.4.22
WORKDIR /src
RUN set -ex; \
apt-get update; \
apt-get install -y g++ curl cmake squashfs-tools; \
curl -L https://github.com/facebookincubator/xar/archive/${XAR_VERSION}.tar.gz | tar -zxv --strip-components=1 --directory .; \
@saikocat
saikocat / vim.md
Created August 3, 2020 13:19
Vim tips

Movements

  • Pressing j will move the cursor down 1 physical line.
  • Pressing gj will move the cursor down 1 displayed line.
  • Alt to `. is g;

Formating

  • Wrap lines after setting textwidth: in visual mode, gq
  • set shiftround

Searching

@saikocat
saikocat / howto.md
Created July 16, 2020 02:15
JGit and invalid private key
Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@e4487af

The root cause was discovered to be the ssh private key mismatch. The exception only happened for users with key of newer kind ed25519, which outputs this key header:

-----BEGIN OPENSSH PRIVATE KEY-----

The Best Medium-Hard Data Analyst SQL Interview Questions

Source

By Zachary Thomas (zthomas.nc@gmail.com, Twitter, LinkedIn)

**Tip: **See the Table of Contents (document outline) by hovering over the vertical line on the right side of the page

Background & Motivation

group: travis_latest
language: python
cache: pip
python:
#- 2.7
- 3.6
#- nightly
#- pypy
#- pypy3
matrix:
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR ZO_CMD:zo
SETUVAR Z_CMD:z
SETUVAR Z_DATA:/home/hoa/\x2elocal/share/z/data
SETUVAR Z_DATA_DIR:/home/hoa/\x2elocal/share/z
SETUVAR Z_EXCLUDE:/home/hoa
SETUVAR __fish_classic_git_prompt_initialized:\x1d
SETUVAR __fish_init_2_39_8:\x1d
SETUVAR __fish_init_2_3_0:\x1d
# https://github.com/harterrt/cookiecutter-python-etl/blob/master/README.md#benefits
# https://github.com/mozilla/python_mozetl/tree/master/tests
import pytest
from pyspark.sql import SparkSession
import json
@pytest.fixture(scope="session")
def spark():
spark = (