Skip to content

Instantly share code, notes, and snippets.

View michael-wolfenden's full-sized avatar

Michael Wolfenden michael-wolfenden

View GitHub Profile
@g0t4
g0t4 / notes.md
Last active March 4, 2022 01:02
Docker Cheat Sheet

Windows Containers notes

anonymous
anonymous / webpack.config.js
Created March 31, 2017 07:32
const webpack = require('webpack')
const fs = require('fs')
// NODE_ENV
const nodeEnv = process.env.NODE_ENV || 'development'
const isProd = nodeEnv === 'production'
module.exports = (options) => {
let entryFile, outputPath, isClient, isServer
@brendanzab
brendanzab / reactive_systems_bibliography.md
Last active October 10, 2022 06:36
A reading list that I'm collecting while building my Rust ES+CQRS framework: https://github.com/brendanzab/chronicle

Functional, Reactive, and Distributed Systems Bibliography

Books

@developit
developit / unistore.js
Last active September 8, 2020 15:13
Update: the newer & better version of this is published: https://github.com/developit/unistore
import { h, Component } from 'preact';
/** Creates a new store, which is a tiny evented state container.
* @example
* let store = createStore();
* store.subscribe( state => console.log(state) );
* store.setState({ a: 'b' }); // logs { a: 'b' }
* store.setState({ c: 'd' }); // logs { c: 'd' }
*/
@aggieben
aggieben / dotnet-versions
Last active July 20, 2017 21:52
List installed .NET Core SDK versions
#!/bin/sh
# Benjamin Collins <[email protected]>
# Requires GNU readlink (get on macOS with `brew install coreutils`)
READLINK=${READLINK:-readlink}
cliPath=$(which dotnet)
netDir=$(dirname $($READLINK -f $cliPath))
ls -1 "$netDir/sdk"
@jcansdale
jcansdale / GetAssemblies.cs
Last active August 14, 2016 21:57
.NET Core implementation of AppDomain.GetAssemblies()
public Assembly[] GetAssemblies()
{
var assemblies = new List<Assembly>();
foreach(ProcessModule module in Process.GetCurrentProcess().Modules)
{
try
{
var assemblyName = AssemblyLoadContext.GetAssemblyName(module.FileName);
var assembly = Assembly.Load(assemblyName);
assemblies.Add(assembly);
@gertjvr
gertjvr / Autofac.SignalR.md
Last active August 4, 2023 06:56
Autofac.SignalR hub scoped dependencies per instance.

SignalR generates a hub for each method invoke ie onConnected, onDisconnect or any other methods on the hub. Autofac.SignalR all hub dependencies are resolved from the root container making them singletons.

I did find another solutions https://github.com/lethek/SignalR.Extras.Autofac but this required inheriting from a special lifetimehub, retro fitting this into an large existing solution would take a lot of work an re-testing.

The solutions below allows you to scope all dependencies per hub instance.

  • Install-Package Autofac.SignalR
  • Install-Package Castle.Core
@kosamari
kosamari / _ServiceWorker_for_github_pages.md
Last active March 19, 2025 18:02
ServiceWorker for github pages.

ServiceWorker for github pages

This is a ServiceWorker template to turn small github pages into offline ready app.

Why ?

Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html file with all the nessesary CSS and JavaScript in it (or maybe 2-3 html/css/js files). I wanted to cache these files so that I can access my tools offline as well.

Notes

Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS of your repository.

@forest
forest / git-workflow.md
Created February 22, 2016 18:15
Git Feature Branch Workflow

We subscribe to the Git Featrue Branch workflow, briefly described in that link.

In practice, it works as follows:

FEATURE DEVELOPMENT

Steps to Follow:

  1. Start with an updated local development branch -- by checking out the dev branch and pulling changes:
    git checkout development
    git pull origin development
@bahmutov
bahmutov / README.md
Last active October 4, 2023 08:35
Single command to run Node with local file access

Goal: run a simple NodeJS application inside a Docker container

Subgoal: give it access to local files.

docker run -it --rm --name example -v "$PWD":/usr/src/app -w /usr/src/app node:5-slim node index.js

output: