Skip to content

Instantly share code, notes, and snippets.

View Ziqi-Yang's full-sized avatar
😎
让你事故死哦,baby

Meow King Ziqi-Yang

😎
让你事故死哦,baby
View GitHub Profile
In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.49, cairo version 1.18.2)
Repository revision: 5fee8a04335c0699d6072a9d775df2b197ad7c41
Repository branch: master
System Description: NixOS 25.05 (Warbler)
# References
# - https://github.com/davidhcefx/Modern-Nano-Keybindings
# - https://github.com/gabrielproencaalves/my-nanorc/blob/main/nanorc
# man nanorc
#### Options
set tabsize 4
set tabstospaces
@Ziqi-Yang
Ziqi-Yang / chatgpt_sql.md
Created March 21, 2023 11:26
chatgpt; sql;

Oneline Version

SELECT TABLE_NAME, COLUMN_NAME, DATA_TYPE, COLUMN_TYPE, IS_NULLABLE, COLUMN_DEFAULT, COLUMN_KEY, EXTRA FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'your_database_name' ORDER BY TABLE_NAME, ORDINAL_POSITION;

Multiple line Version

SELECT 
    TABLE_NAME, 
    COLUMN_NAME, 
 DATA_TYPE, 
@Ziqi-Yang
Ziqi-Yang / Util.java
Created March 9, 2023 14:20
tree structure ascii
import dsa.iface.*;
import dsa.impl.Tree;
import java.util.*;
import java.lang.StringBuilder;
/**
* dsa library
*
* ITree: tree
@Ziqi-Yang
Ziqi-Yang / hash_table.c
Last active January 17, 2023 13:46
c; hashtable;
// origin on leetcode: https://leetcode.cn/problems/count-nice-pairs-in-an-array/solutions/2064186/tong-ji-yi-ge-shu-zu-zhong-hao-dui-zi-de-ywux/
#include <uthash.h>
#include <stdbool.h>
#include <stdio.h>
typedef struct {
int key;
int val;
UT_hash_handle hh;
} HashItem;
@Ziqi-Yang
Ziqi-Yang / sed_output_only_match.sh
Last active January 7, 2023 01:45
sed; shell; text-processing;
# if you have multiple lines of input, this snipet allow you to only output the matched pattern
printf 'char * pass = "notapassword"\nasdf' | sed -n 's/.*"\(.*\)"/\1/p'
# -n: omit automatic output
# p the last character: print the match pattern
# range: 1-3 lines
printf 'char * pass = "notapassword"\nasdf' | sed -n '1,3s/.*"\(.*\)"/\1/p'
@Ziqi-Yang
Ziqi-Yang / driver.sh
Created December 22, 2022 00:30
linux; driver; GPU; nvidia; vulkan; nouveau; show the current running driver
lspci -nnk | grep -iA2 vga
@Ziqi-Yang
Ziqi-Yang / sed_if_else.sh
Created December 19, 2022 08:39
sed; if else statement in sed;
# https://getdocs.org/Sed/Branching-and-flow-control
# https://stackoverflow.com/questions/68320533/how-to-toggle-a-comment-in-a-line-using-sed#answer-72615471
sed -i "s/animations = true/animations = false/;t;\
s/animations = false/animations = true/" "$picom_config"
@Ziqi-Yang
Ziqi-Yang / country_anonym.js
Last active January 1, 2023 11:19
hide country / location ; 国家 地区 隐藏;
window.localStorage.removeItem(Object.keys(window.localStorage).find(i=>i.startsWith('@@auth0spajs')))
// usage: in the browser location bar:
// javascript:window.localStorage.removeItem(Object.keys(window.localStorage).find(i=>i.startsWith('@@auth0spajs')))
@Ziqi-Yang
Ziqi-Yang / Makefile
Last active February 25, 2023 01:40
Makefile; Java;
# Makefile for c/c++ program
#
# ========================================
# @author: Ziqi Yang<mr.ziqiyang@gmail.com>
# @reference: https://makefiletutorial.com/#makefile-cookbook
# ========================================
SRC_DIR := src
LIBS_DIR := libs
BUILD_DIR := target