Skip to content

Instantly share code, notes, and snippets.

View seasonedgeek's full-sized avatar
💭
Active Referee. (Semi-retired) Developer.

Tom Stewart seasonedgeek

💭
Active Referee. (Semi-retired) Developer.
View GitHub Profile
@seasonedgeek
seasonedgeek / luaunit-1.3-1.rockspec
Created April 19, 2011 12:23
A rockspec for LuaUnit
package = "luaunit"
version = "1.3-1"
source = {
url = "http://luaforge.net/frs/download.php/2689/luaunit-v13.tar.gz",
file = "luaunit-v13.tar.gz",
dir = "luaunit_v13"
}
description = {
summary = "Luaunit is a testing framework for Lua, in the spirit of Extreme Programming",
detailed = [[
@seasonedgeek
seasonedgeek / generate-mit-license-file
Created August 15, 2013 13:18
Generate a MIT LICENSE file via a bash shell script.
#!/bin/bash
# -------------------------------------------------------
# A shell script that generates a MIT LICENSE file
# Written by: Tom Stewart
# Last updated on: 2013/15/08
# -------------------------------------------------------
# Verify the type of input and number of values
USAGE="USAGE: $0 copyright_year copyright_holders"
@seasonedgeek
seasonedgeek / dabblet.css
Created October 2, 2013 19:53
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #6f9;
background: linear-gradient(65deg, #6f9, #69f);
min-height: 100%;
@seasonedgeek
seasonedgeek / fizzbuzz.rb
Created October 15, 2016 01:15
A Simple Implementation of the FizzBuzz problem.
# A Simple Implementation of the FizzBuzz problem
# by Tom Stewart <seasonedgeek>
# My curious Ruby experimentation
# Identify numbers that are
# for multiples of 3
fz = Array.new
# for multiples of 5
bz = Array.new
# for multiples of 3 & 5
@seasonedgeek
seasonedgeek / zshrc.sh
Created January 5, 2019 02:34 — forked from kennethreitz/zshrc.sh
My zsh.rc configuration
setopt APPEND_HISTORY
unsetopt BG_NICE # do NOT nice bg commands
setopt CORRECT # command CORRECTION
setopt EXTENDED_HISTORY # puts timestamps in the history
setopt HIST_ALLOW_CLOBBER
setopt HIST_REDUCE_BLANKS
setopt INC_APPEND_HISTORY SHARE_HISTORY
setopt ALL_EXPORT
setopt MENUCOMPLETE
@seasonedgeek
seasonedgeek / classpath.sh
Created January 5, 2019 03:51 — forked from jcromartie/classpath.sh
classpath.sh -- build classpaths
#/bin/bash
# strings together all of its arguments into a Java classpath, useful for
# grabbing all of the jars in a directory like so:
# classpath.sh lib/*.jar
#
usage(){
echo "Usage: $0 /path/to/*.jar"
exit 1
}
@seasonedgeek
seasonedgeek / remake_symbolic_links.rb
Created December 16, 2019 11:16
Diving into FileUtils: Update various dotfiles' symbolic links after changing original directory.
@seasonedgeek
seasonedgeek / Squash_session_logs.py
Created December 30, 2019 08:46
Script removes yesterday's terminal generated session log files.
#!/usr/local/bin/python3
""" Squash Session Logs
This script removes yesterday's terminal generated session log files.
"""
import datetime
import glob
import os
@seasonedgeek
seasonedgeek / guess_number.rs
Created January 3, 2020 06:53
My experiment with "Programming A Guessing Game" @https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html
/// A game
pub mod guess_number {
/// Announces the game to be played
pub fn announce_game() {
println!("");
println!("--------------------------");
println!("| Guess A Number! |");
println!("--------------------------");
}
@seasonedgeek
seasonedgeek / multireader_issues_solutions.md
Created January 31, 2020 07:20
Solutions for {bound method; utf-8 decode} MultiReader.read & test.bz2: {UnicodeDecodeError} invalid start byte

MultiReader Issues/Solutions

While trying out the reader project code presented in Chapter 1 of The Python Journeyman, I problem solved a couple of issues. I'm certain that my issues are related to being a Java defector, and a pythonic newbie.
I'm running Python 3.8.1 on macOS 10.15.

My Issues:

  • UnicodeDecodeError: 'utf-8' codec can't decode byte ...: invalid start byte

    The invalid start byte, I assume is related to test.bz2 and the authors' bz2.open(..., mode='wt'). I used mode='wb'.

  • bound method MultiReader.read of <reader.multireader.MultiReader object at 0x10f4a8a90>