Skip to content

Instantly share code, notes, and snippets.

@hoangtranwork
hoangtranwork / asdf-install-python.sh
Last active March 7, 2021 04:32
problem with installing python on macOS 2021-03-07 (asdf)
# this helps: https://github.com/pyenv/pyenv/wiki/Common-build-problems
AR=/usr/bin/ar asdf install python 3.9.2
@hoangtranwork
hoangtranwork / change-hostname-no-restart.md
Last active November 28, 2017 09:32
Without restart. Retain across ssh sessions (pernament). This also help avoiding `sudo: unable to resolve host` warning

Steps:

  1. edit /etc/hostname: only 1 line with the new-hostname
new-hostname
  1. edit /etc/hosts: 2 lines
127.0.0.1 localhost new-hostname
127.0.1.1 new-hostname
@arekolek
arekolek / KotlinFunctions.md
Last active February 22, 2019 05:20 — forked from cbeyls/KotlinFunctions.md
Comparison of Kotlin functions: also, apply, let, run, with

Receiver vs. return value:

Returns block result Returns receiver
Receiver available as it let also
Receiver available as this run apply

How to read the table:

@hoangtranwork
hoangtranwork / tmux.md
Created July 21, 2017 04:54 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@ammario
ammario / ipint.go
Last active February 7, 2025 05:24
Golang IP <-> int conversion
func ip2int(ip net.IP) uint32 {
if len(ip) == 16 {
return binary.BigEndian.Uint32(ip[12:16])
}
return binary.BigEndian.Uint32(ip)
}
func int2ip(nn uint32) net.IP {
ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, nn)
@xfanwu
xfanwu / xxf.zsh-theme
Last active December 18, 2024 15:39
Yet another theme for oh-my-zsh
# Copy and self modified from ys.zsh-theme, the one of default themes in master repository
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background and the font Inconsolata.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
# http://xiaofan.at
# 2 Jul 2015 - Xiaofan
# Machine name.
function box_name {
@addyosmani
addyosmani / LICENSE.txt
Last active April 8, 2024 20:15 — forked from 140bytes/LICENSE.txt
Offline Text Editor in < 140 bytes (115 bytes). Powered by localStorage & contentEditable
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Copyright (C) 2014 ADDY OSMANI <addyosmani.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@hofmannsven
hofmannsven / README.md
Last active February 7, 2025 13:12
Git CLI Cheatsheet