Skip to content

Instantly share code, notes, and snippets.

View zyedidia's full-sized avatar

Zachary Yedidia zyedidia

View GitHub Profile
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/focal64"
config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder ".", "/home/vagrant/sync"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = 2
vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
vb.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]

Keybase proof

I hereby claim:

  • I am zyedidia on github.
  • I am zyedidia (https://keybase.io/zyedidia) on keybase.
  • I have a public key ASAIYsf3bp6frnnSMEtFQvJuEVGceRR8xpDQR4ALqbNP5wo

To claim this, I am signing this object:

Text Encoding

How are text files encoded, and what are the pros and cons of different encodings? This document introduces the ASCII and Unicode encodings to answer these questions. Some short pieces of Go code are provided which you can run yourself to see how strings are being encoded. Go is used because it has built-in support for Unicode, but you should be able to follow without any knowledge of Go.

ASCII

#!/usr/bin/env bash
set -e
OS=$1
INSTALLDIR=${2:-"."}
function githubLatestTag {
finalUrl=`curl https://github.com/$1/releases/latest -s -L -I -o /dev/null -w '%{url_effective}'`
echo "${finalUrl##*v}"
}