Skip to content

Instantly share code, notes, and snippets.

View jsun969's full-sized avatar
🟢

Justin Sun jsun969

🟢
View GitHub Profile
@jsun969
jsun969 / uofa.tex
Last active March 30, 2024 04:27
Harvard UofA reference (by Cubic Nyan)
\documentclass[]{whatever}
\usepackage[backend=biber,citestyle=authoryear,style=authoryear,sorting=nyvt,maxnames=1,maxbibnames=99]{biblatex}
\usepackage[style=british]{csquotes} % biblatex quote styling
\usepackage{xpatch}
\usepackage{sectsty}
\usepackage{times}
...
@jsun969
jsun969 / .clang-format
Last active April 30, 2024 13:39
Clang Format Config
BasedOnStyle: LLVM
UseTab: Always
IndentWidth: 2
TabWidth: 2
BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: WithoutElse
IndentCaseLabels: true
ColumnLimit: 0
NamespaceIndentation: All
FixNamespaceComments: false
@jsun969
jsun969 / cpp.json
Created March 20, 2024 13:46
Header guard code snippet
{
"Header guard": {
"prefix": "guard",
"body": [
"#ifndef ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}/}}_H",
"#define ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}/}}_H",
"",
"$0",
"",
"#endif // ${1:${TM_FILENAME_BASE/(.*)/${1:/upcase}/}}_H"
@jsun969
jsun969 / useMount.ts
Created November 2, 2023 20:26
use f**king mount
import { useEffect, useRef } from 'react'
export const useMount = (fn: React.EffectCallback) => {
const isMounted = useRef(false)
useEffect(() => {
if (!isMounted.current) {
fn()
isMounted.current = true
}
}, [])
@jsun969
jsun969 / config.lua
Created January 25, 2023 12:13
Lunar Vim Config
vim.opt.relativenumber = true
lvim.log.level = "warn"
lvim.format_on_save = {
enabled = true,
timeout = 60000,
}
lvim.colorscheme = "lunar"
lvim.leader = "space"
@jsun969
jsun969 / .eslintrc.cjs
Last active February 2, 2024 11:07
Typescript Project Formatter & Linter & Git Hooks
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
@jsun969
jsun969 / enable_clash_proxy.sh
Created December 25, 2022 10:34
Enable Clash Proxy in WSL
# Get Host IP
cat /etc/resolv.conf | grep -oP '(?<=nameserver\ ).*'
# Enable Proxy
export http_proxy="http://:7890/"
export https_proxy="http://:7890/"
@jsun969
jsun969 / ssh_config
Created June 30, 2022 07:53
GitHub SSH Proxy
# Proxy For GitHub
Host github.com
ProxyCommand "C:/Program Files/Git/mingw64/bin/connect.exe" -H <proxy_url> %h %p
IdentityFile "C:\Users\Administrator\.ssh\id_ed25519"
TCPKeepAlive yes
IdentitiesOnly yes