Skip to content

Instantly share code, notes, and snippets.

View AnuchitO's full-sized avatar

Anuchit Prasertsang AnuchitO

View GitHub Profile
@AnuchitO
AnuchitO / .skhdrc
Created February 11, 2025 13:14 — forked from cbrgm/.skhdrc
yabai + skhd + spacebar dotfiles
####### Shortcut Hotkeys #############
# open terminal
alt - return : open -n /Applications/Alacritty.app
# restart Yabi, SpaceBar, and SKHD
alt + shift - r : \
launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"; \
skhd --reload
@AnuchitO
AnuchitO / kong-real-ip.env
Created October 19, 2024 01:36 — forked from narate/kong-real-ip.env
Kong Real IP from Cloudflare
# Cloudflare IPv4 https://www.cloudflare.com/ips-v4/
# Cloudflare IPv6 https://www.cloudflare.com/ips-v6/
KONG_REAL_IP_HEADER=Cf-Connecting-Ip
KONG_TRUSTED_IPS=173.245.48.0/20,103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,141.101.64.0/18,108.162.192.0/18,190.93.240.0/20,188.114.96.0/20,197.234.240.0/22,198.41.128.0/17,162.158.0.0/15,104.16.0.0/13,104.24.0.0/14,172.64.0.0/13,131.0.72.0/22,2400:cb00::/32,2606:4700::/32,2803:f800::/32,2405:b500::/32,2405:8100::/32,2a06:98c0::/29,2c0f:f248::/32
KONG_REAL_IP_RECURSIVE=on
@AnuchitO
AnuchitO / nginx.conf
Created August 24, 2024 14:12 — forked from dome/nginx.conf
nginx proxy evm rpc
user nginx;
worker_processes auto;
error_log /dev/stderr warn;
pid /var/run/nginx.pid;
worker_rlimit_nofile 100000;
events {
worker_connections 102400;
@AnuchitO
AnuchitO / sse.go
Created March 22, 2019 10:52 — forked from ismasan/sse.go
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@AnuchitO
AnuchitO / Storing-Images-On-Github.md
Created February 21, 2019 05:19 — forked from joncardasis/Storing-Images-On-Github.md
Storing Images and Demos in your Repo

Storing Images and Demos in your Repo

In this quick walkthough you'll learn how to create a separate branch in your repo to house your screenshots and demo gifs for use in your master's readme.

How to

1. Clone a fresh copy of your repo

In order to prevent any loss of work it is best to clone the repo in a separate location to complete this task.

2. Create a new branch

Create a new branch in your repo by using git checkout --orphan assets

@AnuchitO
AnuchitO / web-servers.md
Created February 13, 2019 14:34 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@AnuchitO
AnuchitO / notes.md
Created May 15, 2018 15:34 — forked from mindscratch/notes.md
One Day Advanced Ultimate Go Notes

Still need to organize and cleanup.


  • pointers provide efficiency b/c we can reference things on heap, tradefoff is having to have GC
  • value symantics mean things use the stack, doesn't use heap
  • data segment - globals, literals
  • stack - go routine (2k per go routine)
@AnuchitO
AnuchitO / translate.go
Created June 22, 2016 11:38 — forked from hvoecking/translate.go
Golang reflection: traversing arbitrary structures
// Traverses an arbitrary struct and translates all stings it encounters
//
// I haven't seen an example for reflection traversing an arbitrary struct, so
// I want to share this with you. If you encounter any bugs or want to see
// another example please comment.
//
// The MIT License (MIT)
//
// Copyright (c) 2014 Heye Vöcking
//
@AnuchitO
AnuchitO / .vimrc
Created November 10, 2015 08:13 — forked from wingyplus/.vimrc
"
" activate pathogen
"
set runtimepath+=~/.vim/autoload/pathogen.vim
execute pathogen#infect()
filetype on
filetype plugin indent on
"

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname