Skip to content

Instantly share code, notes, and snippets.

View codemonkey85's full-sized avatar

Michael Bond codemonkey85

View GitHub Profile
@codemonkey85
codemonkey85 / ConsoleDiLoggingTests.cs
Created November 15, 2023 19:51
Showcase of how to do .NET console apps with DI and logging.
using Logging;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
var builder = Host.CreateDefaultBuilder(args);
builder
.ConfigureLogging(logging => logging
.ClearProviders()
@codemonkey85
codemonkey85 / DbContext.cs
Created October 20, 2023 16:42
My approach to saving created / updated timestamps and user ID with Entity Framework Core in .NET
private void DatabaseContext_SavingChanges(object? sender, SavingChangesEventArgs e)
{
if (sender is not DatabaseContext dbContext)
{
return;
}
AddTimeStamps(dbContext.ChangeTracker, DateTime.UtcNow);
}
@codemonkey85
codemonkey85 / recursivepull.sh
Last active April 30, 2022 16:34
Recursively pull all repos
find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \;
@codemonkey85
codemonkey85 / dotnet_maui_appaction_setup_example.cs
Created February 25, 2022 13:32
.NET MAUI AppAction Setup Example
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureEssentials(essentials =>
{
foreach (var appAction in new AppAction[]
{
new ("AppAction1", "App Action 1"),
@codemonkey85
codemonkey85 / keybase.md
Created November 28, 2017 15:11
Keybase.io proof

Keybase proof

I hereby claim:

  • I am codemonkey85 on github.
  • I am codemonkey85 (https://keybase.io/codemonkey85) on keybase.
  • I have a public key ASAf1VPRwepFc5t4-VKFUQ_fpjdMhDrB6el_6Gsbrylsjgo

To claim this, I am signing this object:

@codemonkey85
codemonkey85 / Signatures.txt
Created May 20, 2017 01:31 — forked from SciresM/Signatures.txt
"Perfect" sighax signatures for every Boot9 modulus.
Retail NAND FIRM:
Perfect Signature:
B6724531C448657A2A2EE306457E350A10D544B42859B0E5B0BED27534CCCC2A4D47EDEA60A7DD99939950A6357B1E35DFC7FAC773B7E12E7C1481234AF141B31CF08E9F62293AA6BAAE246C15095F8B78402A684D852C680549FA5B3F14D9E838A2FB9C09A15ABB40DCA25E40A3DDC1F58E79CEC901974363A946E99B4346E8A372B6CD55A707E1EAB9BEC0200B5BA0B661236A8708D704517F43C6C38EE9560111E1405E5E8ED356C49C4FF6823D1219AFAEEB3DF3C36B62BBA88FC15BA8648F9333FD9FC092B8146C3D908F73155D48BE89D72612E18E4AA8EB9B7FD2A5F7328C4ECBFB0083833CBD5C983A25CEB8B941CC68EB017CE87F5D793ACA09ACF7
Exponentiated Message:
0002B31331C710412333A587890F9CF0B6A86E71C8A78F96B76082903B3E54EA9AB935978BBF2493BB829E9A5A6060B0C7811881176BCF9FE8B1C5C5E0A95327DB8B52EC178A884AD9CF28DB8BBF2922C05FD034AC81BD231AEB0CBEF6F7DE6F3A30812B9F9A83BF33251891BFA18FA38A64C6FF5F77DBE11C3780C23EA9F6D00F9C01D6FC8A878591D36C4F64ACA6B8D11BBEB21476103C6E86FF2196D465BA4DB78F81F1D3BCCA186BDDD56739A12DD36122F3F5B3DD518DDAC4FA29395EA4CD9DFD80AF8A399990F4FDD3CD6B07EC2122437CCFC3B62B1D1493A7DBB442003
@codemonkey85
codemonkey85 / photopicker2.py
Created May 6, 2016 13:48 — forked from omz/photopicker2.py
photopicker2.py
# Experimental photo picker using the Photos framework via objc_util. Compared to the photos module, this has the advantage of showing all photos, including iCloud photo library. Not very well tested!
from objc_util import *
import threading
from io import BytesIO
from PIL import Image
import sys
import ui
import ctypes
@codemonkey85
codemonkey85 / Trello-Pythonista.py
Created May 5, 2016 18:31
Access Trello data from python / Pythonista
# coding: utf-8
# Note to self: do proper authorization at: https://github.com/sarumont/py-trello/blob/master/trello/util.py
import sys
if sys.argv == [] or len(sys.argv) == 1:
sys.exit()
clArgs = sys.argv[1].split(',')
@codemonkey85
codemonkey85 / Pythonista-Trello-Tasks.py
Last active March 30, 2016 01:48
A python script, meant to run on iOS via Pythonista and from Workflow, to get a list of all of the Trello cards assigned to you with the provided app key and token, as well as the provided board ID and username.
# coding: utf-8
# Workflow script available here: http://bit.ly/1PEvd1S
import platform
if platform.system() == 'Darwin':
if platform.machine().startswith('iP'):
import console
import clipboard
import webbrowser
#!/usr/bin/env ruby
# Based on everwatch.rb by Brett Terpstra, 2011, a 2013 update by spetschu, and a 2014 update by regedor
# Write in Markdown in Evernote and Backup Markdown files in Dropbox
# Change the next two lines with your account number and the path to your backup folder
watch_folder = File.expand_path("/Users/USERNAME/Library/Containers/com.evernote.Evernote/Data/Library/Application Support/com.evernote.Evernote/accounts/www.evernote.com/YOUR-ACCOUNT-NUMBER/content/")
mark_folder = "~/Dropbox/Evernotes/"
counter = 0