Skip to content

Instantly share code, notes, and snippets.

@derekforeman
derekforeman / HttpLoggingHandler.cs
Created July 25, 2023 09:24 — forked from flobaader/HttpLoggingHandler.cs
Log HTTP Requests with Refit
public class HttpLoggingHandler : DelegatingHandler
{
public HttpLoggingHandler(HttpMessageHandler innerHandler = null)
: base(innerHandler ?? new HttpClientHandler())
{
}
async protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{
import SwiftUI
import PlaygroundSupport
struct ContentView: View {
var body: some View {
Text("Hello World")
}
}
PlaygroundPage.current.setLiveView(ContentView())
@derekforeman
derekforeman / tmux.md
Created March 5, 2020 16:33 — forked from hugodahl/tmux.md
Clean tmux cheat-sheet

Clean tmux cheat-sheet

By resources

sessions

list-sessions        ls         -- List sessions managed by server
new-session          new        -- Create a new session
@derekforeman
derekforeman / FreeNAS.md
Created April 18, 2017 15:30 — forked from jacobblock/FreeNAS.md
Ultimate FreeNAS Setup

FreeNAS

I started using FreeNAS in August 2013. It is fantastic piece of software and I have been really impressed by the upgrades just in the few months I've been using it. It looks like they recently went to a plugin system as of version 9 to make installing software easier for end users. I've ran into several issues related to plugins and user + group permissions so I decided to just use the available FreeBSD port system. After fiddling for a few days (now turned into months) I believe I have created something helpful for the community and anyone interested in picking up the port system. The sandbox nature of FreeNAS's jail system is especially helpful for playing around without having any consequence on your core system.

Here are straight-forward instructions to setting up a bunch of different software on FreeNAS. If you make a terrible error, just throw up another plugin sandbox and repeat.

ToC

@derekforeman
derekforeman / DumpAllWindowsCerts.cs
Created May 11, 2016 13:34 — forked from codingoutloud/DumpAllWindowsCerts.cs
Dump all digital certificates in Windows certificate store to stdout
// Iterates through all of the X.509 digital certificates installed in the certificate store
// on a Windows operating system, dumping out some metadata about each. Each certificate, in
// each Certificate Store, from each Certificate Location is included.
//
// Bill Wilder | @codingoutloud | Oct 2012
// Original: https://gist.github.com/4005661
using System;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
@derekforeman
derekforeman / logging2.json
Created February 4, 2016 19:29 — forked from pmav99/config2.json
Python 3 logging configuration using JSON
{
"logging": {
"version": 1,
"disable_existing_loggers": true,
"formatters": {
"brief": {
"class": "logging.Formatter",
"datefmt": "%I:%M:%S",
"format": "%(levelname)-8s; %(name)-15s; %(message)s"
},
@derekforeman
derekforeman / 0_reuse_code.js
Created January 20, 2014 15:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console