Skip to content

Instantly share code, notes, and snippets.

View jsun969's full-sized avatar
๐ŸŒž

Justin Sun jsun969

๐ŸŒž
View GitHub Profile
@jsun969
jsun969 / remove-maxwidth.user.js
Last active August 24, 2024 03:43
UofA Remove myuni max width
// ==UserScript==
// @name Remove myuni max width
// @namespace https://jsun.lol/
// @version 2024-03-03
// @description lol
// @author jsun969 & chatgpt
// @match https://myuni.adelaide.edu.au/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=adelaide.edu.au
// @grant none
// ==/UserScript==
@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 October 19, 2024 10:41
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-header-guard.json
Last active August 28, 2024 11:19
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 / .prettierrc.cjs
Last active December 2, 2024 16:01
Typescript Project Formatter & Linter & Git Hooks
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions & import('@trivago/prettier-plugin-sort-imports').PluginConfig} */
module.exports = {
singleQuote: true,
trailingComma: 'all',
useTabs: true,
plugins: [
'@trivago/prettier-plugin-sort-imports',
'prettier-plugin-tailwindcss',
],
importOrder: ['<THIRD_PARTY_MODULES>', '^[./]'],
@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