Skip to content

Instantly share code, notes, and snippets.

View william8th's full-sized avatar

William Heng william8th

  • william [at] williamheng [dot] com
  • London, United Kingdom
View GitHub Profile
@william8th
william8th / vim-plugins.txt
Created February 6, 2018 22:47
My Vim Plugins
vim-go
nerdtree
ctrlp
@william8th
william8th / .tmux.conf
Last active April 21, 2025 15:44
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@william8th
william8th / arch-linux-installation
Created August 6, 2018 03:27
ArchLinux installation guide
# Boot into Live CD/USB
# Use UK keyboard
loadkeys uk
# Check partitions available
fdisk -l
# Use fdisk to format partitions
# o to overwrite the disk
# n to create new partition
@william8th
william8th / dev-kafka.sh
Last active December 23, 2018 03:01
Dev Kafka Cluster
# Get license.json from Landoop
docker run -p 3030:3030 -p 9092:9092 -p 2181:2181 -p 3031:3031 --rm \
-e LICENSE="$(cat ./license.json)" \
-e SAMPLEDATA=0 \
-e KAFKA_AUTO_CREATE_TOPICS_ENABLE=false \
-e KAFKA_ADVERTISED_HOST_NAME=localhost \
landoop/kafka-lenses-dev
@william8th
william8th / consumer.py
Last active March 15, 2019 15:12
Kafka Avro Consumer Python
from confluent_kafka.avro import AvroConsumer
from confluent_kafka.avro.serializer import SerializerError
c = AvroConsumer({
'bootstrap.servers': 'localhost:9092',
'group.id': 'groupid',
'schema.registry.url': 'http://127.0.0.1:8081'
})
c.subscribe(['reddit_posts'])
@william8th
william8th / .zshrc
Created February 4, 2020 21:16
My custom zshrc
export PROMPT="%F{green}%n%f@%m %F{magenta}%~%f$ "
export CLICOLOR=1
export LS_COLORS="di=31;41:ln=31;41:so=31;41:pi=31;41:ex=31;41:bd=31;41:cd=31;41:su=31;41:sg=31;41:tw=31;41:ow=31;41:"
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
setopt BEEP NO_AUTOLIST BASH_AUTOLIST NO_MENUCOMPLETE