Skip to content

Instantly share code, notes, and snippets.

View mike10004's full-sized avatar

Mike Chaberski mike10004

View GitHub Profile
@mike10004
mike10004 / .gitignore
Last active March 17, 2022 20:14
Python requests SSLError on MacOS - resolution
.idea/
__pycache__/
@mike10004
mike10004 / copy-letsencrypt-files-on-renewal.sh
Last active August 25, 2021 22:14
Copy certificates somewhere else on renewal by letsencrypt certbot
#!/bin/bash
# IMPORTANT: set TARGET and DEST_DIR according to your use case
TARGET="example.com"
DEST_DIR="/etc/ssl/private/active"
set -e
echo "Renewal hook running to copy certificate and private key to appropriate directory..."
@mike10004
mike10004 / AnsiCodes.java
Last active April 5, 2021 17:00
Clean and parse Maven dependency:list output
import org.apache.commons.io.input.ReaderInputStream;
import org.fusesource.jansi.AnsiColors;
import org.fusesource.jansi.AnsiMode;
import org.fusesource.jansi.AnsiType;
import org.fusesource.jansi.io.AnsiOutputStream;
import org.fusesource.jansi.io.AnsiProcessor;
import java.io.ByteArrayOutputStream;
@mike10004
mike10004 / README.md
Last active June 19, 2020 15:53
Classes and slicing in C++

Because I always forget this stuff, I'm putting it here.

Output of program:

cool
cool
cool
not cool

Because slicing ain't cool.

@mike10004
mike10004 / hw12.py
Last active April 12, 2020 02:53
Doodlebugs
#!/usr/bin/env python3
import itertools
import sys
from typing import NamedTuple, List, Optional, Callable, Iterable, Collection
from random import Random
from argparse import ArgumentParser
_DOODLEBUG_GESTATION = 8
_ANT_GESTATION = 3
@mike10004
mike10004 / .gitignore
Last active March 4, 2020 03:08
HW8 Counting
/.idea/
__pycache__/
/*.txt
@mike10004
mike10004 / .gitignore
Last active February 28, 2020 03:37
HW7 confirmations
/venv/
/*.txt
/.idea/
__pycache__/
@mike10004
mike10004 / README.md
Last active February 13, 2020 15:29
Two's Complement in Python

Two's Complement in Python

Command line interface

  • enter a twos-complement number with the 0b prefix to convert to decimal
  • enter a decimal value and the width (in bits) to convert to two's complement
@mike10004
mike10004 / ManualWebdrivingHarness.java
Created February 5, 2020 20:55
Program that allows you to test out webdriver API while the browser is open
package manualwebdrivingharness;
import com.github.mike10004.seleniumhelp.*;
import io.github.mike10004.nanochamp.server.NanoControl;
import io.github.mike10004.nanochamp.server.NanoResponse;
import io.github.mike10004.nanochamp.server.NanoServer;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
@mike10004
mike10004 / README.md
Created January 17, 2020 15:38
Visual Studio v140 toolset linker error from Googletest

Visual Studio v140 toolset linker error from Googletest

This example demonstrates a linker error observed when building a Google Test project with the v140 platform toolset.