Skip to content

Instantly share code, notes, and snippets.

##########
# Win10 Initial Setup Script
# Author: Disassembler <[email protected]>
# Version: 1.4, 2016-01-16
##########
# Ask for elevated permissions if required
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
Exit
#!/usr/bin/env ruby
#
# repl-game.rb
# Copyright (C) 2017 Gregory Stula <[email protected]>
#
# Distributed under terms of the MIT license.
#
def colorize(text, color_code)
"\e[#{color_code}m#{text}\e[0m"

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}