Skip to content

Instantly share code, notes, and snippets.

View nikeasyanzi's full-sized avatar

Craig (Chia Jung) Yang nikeasyanzi

  • Hewlett Packard Enterprise
View GitHub Profile
@nikeasyanzi
nikeasyanzi / grokking_to_leetcode.md
Created February 4, 2024 18:32 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# Disable rainbow image at boot
disable_splash=1
@nikeasyanzi
nikeasyanzi / .clang-format
Created June 27, 2023 06:24 — forked from idelsink/.clang-format
Clang format file.
# clang-format
# Made by: Ingmar Delsink
# idelsink.com
# See http://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Tested with: clang-format version 3.7.1
# General
#########
# The style used for all options not specifically set in the configuration.
#!/bin/bash
# Changelog
# ---------------------------------------------------------------------------------------------
# | Release | Date | Description
# ---------------------------------------------------------------------------------------------
# | v3 | 20221111 | Add function for differnt runlist input.
# ---------------------------------------------------------------------------------------------
# | v2 | 20211125 | Updated to fix failed to initialize STAF issue for Agent 8.0.
# ---------------------------------------------------------------------------------------------
@nikeasyanzi
nikeasyanzi / script-template.sh
Created February 6, 2022 17:06 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@nikeasyanzi
nikeasyanzi / remove_old_builds.sql
Created August 20, 2021 17:43 — forked from david-zw-liu/remove_old_builds.sql
Keep 1000 builds per repos for DroneCI (sqlite3 version >= 3.25 required)
-- Thank @sbengo to figure out foreign_keys constraints is defaults to false in sqlite
-- Enable to delete logs by cascading delete
PRAGMA foreign_keys = ON;
WITH n_build_ids_per_repo as (
SELECT build_id
FROM (
SELECT
build_id,
build_repo_id,
@nikeasyanzi
nikeasyanzi / make_ipxe_uefi_usb.md
Created July 16, 2021 09:52 — forked from AdrianKoshka/make_ipxe_uefi_usb.md
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
import telnetlib
import sys
import Account #My file. It contains Account.id, Account.password
import time
tn = telnetlib.Telnet('ptt.cc')
time.sleep(1)
content = tn.read_very_eager().decode('big5','ignore')
print("首頁顯示...")
if "請輸入代號" in content:
print("輸入帳號...")