Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Helping improve the Windows developer platform.

Rich Turner bitcrazed

💭
Helping improve the Windows developer platform.
View GitHub Profile
@bitcrazed
bitcrazed / settings.json
Last active Feb 1, 2021
Windows Terminal Settings
View settings.json
// This file was initially generated by Windows Terminal Preview 1.4.2652.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@bitcrazed
bitcrazed / hello.bat
Created Aug 12, 2020
Simple Cmd batch script containing numeric Unicode code-points and VT (color) sequences
View hello.bat
@echo off
chcp 65001 > nul
call :setESC
REM: Note - No easy way to escape a numeric Unicode code-point so embed emoji etc. by copy/paste or Win10 emoji keyboard (Win + .)
echo 🎵 Hello %ESC%[31mWorld%ESC%[0m, %ESC%[32mis%ESC%[0m %ESC%[33mit%ESC%[0m %ESC%[34mme%ESC%[0m %ESC%[35myou're%ESC%[0m %ESC%[36mlooking%ESC%[0m %ESC%[37mfor%ESC%[0m? 🎶
REM `setESC` courtesy of https://github.com/mlocati in https://gist.github.com/mlocati/fdabcaeb8071d5c75a2d51712db24011#file-win10colors-cmd
:setESC
@bitcrazed
bitcrazed / hello.ps1
Created Aug 12, 2020
Simple PowerShell script containing numeric Unicode code-points and VT (color) sequences
View hello.ps1
$esc = [char]27
"`u{1F3B5} Hello $esc[31mWorld$esc[0m, $esc[32mis$esc[0m $esc[33mit$esc[0m $esc[34mme$esc[0m $esc[35myou're$esc[0m $esc[36mlooking$esc[0m $esc[37mfor$esc[0m? `u{1F3B6}"
View boxstarter-lite.ps1
# Description: Boxstarter Script
# Author: Rich Turner <rich@bitcrazed.com>
# Last Updated: 2018-10-26
#
# Run this Boxstarter by calling the following from an **ELEVATED PowerShell instance**:
# `set-executionpolicy Unrestricted`
# `. { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force`
# `Install-BoxstarterPackage -DisableReboots -PackageName <URL-TO-RAW-GIST>`
#---- TEMPORARY ---
View proc.go
package main
import (
"fmt"
"syscall"
"time"
)
type backgroundProcess struct {
readPipeHandle syscall.Handle
@bitcrazed
bitcrazed / setup-ubuntu.sh
Last active Jun 1, 2019
Script to setup basic Ubuntu dev environment, esp. for Ubuntu on Windows Subsystem for Linux (WSL)
View setup-ubuntu.sh
#!/bin/bash
# Author: Rich Turner [rich@bitcrazed.com]
# Source: https://gist.github.com/bitcrazed/79594a6f28e7f76ae45ad1ccfb554755
# License: WTFPL: http://www.wtfpl.net/
# Instructions: Install using the following: $ source <(curl -s <URL-TO-THIS-RAW-FILE>)
# Let's get apt up to date:
sudo apt update -y
View setup-suse.sh
# Grab some of the essentials
sudo zypper install -y fortune cowsay ruby-dev htop caca-utils gcc gcc-c++ make
# Grab some fun tools from https://software.opensuse.org/download.html?project=utilities&package=cmatrix
sudo zypper addrepo https://download.opensuse.org/repositories/utilities/openSUSE_Leap_42.3/utilities.repo
sudo zypper refresh
sudo zypper install cmatrix
# LOLCAT ... because SUSE doesn't have a Zypper package for Lolcat!
wget https://github.com/busyloop/lolcat/archive/master.zip
View keybase.md

Keybase proof

I hereby claim:

  • I am bitcrazed on github.
  • I am bitcrazed (https://keybase.io/bitcrazed) on keybase.
  • I have a public key whose fingerprint is 3020 64B4 AAA9 C645 7035 A9DF 8EA1 F422 9BFA 51FF

To claim this, I am signing this object:

@bitcrazed
bitcrazed / .vimrc
Last active Nov 8, 2020
Vim settings for Bash on Windows & Windows Console
View .vimrc
set number
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set mouse=a
syntax enable
@bitcrazed
bitcrazed / InternetConnectionTweeter.py
Created Feb 1, 2016
Rasberry Pi Internet Connection Speed Tweeter
View InternetConnectionTweeter.py
#!/usr/bin/python
# Based on https://www.reddit.com/r/technology/comments/43fi39/i_set_up_my_raspberry_pi_to_automatically_tweet/
import os
import sys
import csv
import datetime
import time
import twitter