Skip to content

Instantly share code, notes, and snippets.

View ahogen's full-sized avatar

Alex H ahogen

View GitHub Profile
#!/usr/bin/env python3
"""
The idea here is to have one demo of each common argparse format
type. This is useful for me to be able to copy/paste into a new
script and have something to quickly edit and trim down to get
the functionality I need.
Expect this file to grow/change as I need new options.
This is, however, a working example. I hate examples that don't

CHOCOLATE CHIP COOKIES

From back of Ambrosia Semi Sweet Chocolate Chip bag, which used to be sold at Costco. Translated from a blurry image on Pinterest to this text file by Alex Hogen.

INGREDIENTS:

Amount Ingredient
1 cup Butter
3/4 packed Brown sugar
@ahogen
ahogen / build-sys-img.jl
Created November 14, 2017 17:21
Build system-specific Julia image
# From: #7 http://www.stochasticlifestyle.com/7-julia-gotchas-handle/
Pkg.update()
if is_windows()
Pkg.add("WinRPM");
using WinRPM
WinRPM.install("gcc", yes=true)
WinRPM.install("winpthreads-devel", yes=true)
end
@ahogen
ahogen / julia-install-pyplot-windows.jl
Last active January 24, 2018 20:32
Install and setup Plots with PyPlot backend using system Python in for Julia. Then builds system-specific Julia image for faster performance in the future.
# Note: Both Julia and Python must be of the same architecture type. If Julia
# is 64-bit, so must your Python distribution.
#
# I tested this with a clean Julia install, by installing Julia and
# deleting "C:\Users\<username>\.julia".
#
# Julia: v6.1
# Python: v3.6.3 for Windows
#
#!/bin/bash
#####################################################################
# Alex Hogen (https://github.com/ahogen)
#
# Run the command provided, redirecting STDERR to STDOUT, effectivly
# reducing all output to a single output pipe, hence the name "spipe".
# This script is also capable of capturing some common kill codes
# and forwarding them to the child process.
#
#!/bin/bash
#####################################################################
# Download and install Icarus Verilog 10.2 on a Debian-based system.
# I wrote and executed this script on Linux Mint 18.3, which is based
# on Ubuntu 16.4.
#
# Author: Alex Hogen <https://github.com/ahogen>
# Created: 2017-12-12
#####################################################################

PlantUML Graph [link]

@startuml
INIT_BRIDGE : updateRoleDisabledTree()

ROLE_SELECTION : clearReselectTree()
ROLE_SELECTION : updateRolesTree()
ROLE_SELECTION : setSelectedTree()
@ahogen
ahogen / win-hostnames-on-linux.md
Created July 12, 2018 17:56
How to enable Linux machines to resolve Windows hostnames
@ahogen
ahogen / usb-rescan-print.sh
Created July 25, 2018 05:54
Automatically scan and print dev list when USB device added or removed.
#!/bin/bash
###############################################################################
# Author: Alex Hogen <code.ahogen@outlook.com>
# https://github.com/ahogen
# Date Created: 2018-07-19
#
# Copyright (c) 2018, Alexander Hogen.
#
# Usage:
@ahogen
ahogen / pylint-exit-handler.sh
Created November 9, 2018 17:27
Parse and filter PyLint exit codes. Useful for Gitlab CI, Jenkins, or other continuous integration scripting which uses PyLint for Python.
#!/bin/bash
################################################################################
# Alex Hogen (code.ahogen@outlook.com)
# https://github.com/ahogen
#
# A basic script to inspect the return code from pylint, filter it based on our
# needs, and return with a non-zero exit code when appropriate.
#
# PyLint returns non-zero exit codes for things that aren't errors. For example,
# if a warning message was issued, 0x4 is OR'd into the exit code.