Skip to content

Instantly share code, notes, and snippets.

View mikey-t's full-sized avatar

Mike Thompson mikey-t

View GitHub Profile
@mikey-t
mikey-t / ConsoleOutputLog.cs
Last active April 5, 2024 13:21
Simple C# utility class to output to both console and a log file at the same time. Use it by simply calling Output.Write() and Output.WriteLine().
public class Output
{
private readonly string LogDirPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs");
private static Output _outputSingleton;
private static Output OutputSingleton
{
get
{
if (_outputSingleton == null)
@mikey-t
mikey-t / SoftwareDevelopmentPhilosophiesAndRants.md
Last active August 2, 2023 16:44
Software development philosophies and rants

Software Development Philosophy and Rants

This is somewhere for me to rant about software development on the internet. I'm not necessarily good at always following my own advice, but what I say here is what I aspire to.

Best Practices

Must watch video by Ben Awad: Software Engineering "Best Practices".

Ben worded this really well, in my opinion:

@mikey-t
mikey-t / gulp-auto-start-wsl-docker.js
Created August 31, 2022 19:31
Auto start docker in wsl if it's not running. This is using @mikeyt23/node-cli-utils for waitForProcess/defaultSpawnOptions and assumes you'll use this task in a gulp series or parallel call.
async function startDockerIfNotRunning() {
const args = [
'-u',
'root',
'-e',
'sh',
'-c',
'"service docker status || service docker start"'
]
await waitForProcess(spawn('wsl', args, defaultSpawnOptions))
:root {
/* Modify these to change your theme colors: */
--primary: #61AFEF;
--text: #ABB2BF;
--background: #202020;
--background-elevated: #242424;
/* These should be less important: */
--background-hover: rgba(255, 255, 255, 0.1);
--background-light: #AAA;
--background-bright: #FFF;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="MikesJavaStyle" version="1">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@mikey-t
mikey-t / knockoutjs_output_context.html
Last active December 27, 2016 23:37
Knockoutjs output context
<pre data-bind="text: ko.toJSON($data, null, 2)"></pre>