Skip to content

Instantly share code, notes, and snippets.

View johnrichardrinehart's full-sized avatar

John Rinehart johnrichardrinehart

View GitHub Profile
# Obtained from https://en.wikipedia.org/wiki/Telegrapher%27s_equations#Lossy_transmission_line
"
telegrapher(L,C,R=0,G=0,n=100)
returns an array of differential equations that can be
used to solve for the travelling voltages and currents as a function of time.
All quantities are expected to be per-length quantities (in S.I. units).
The problem is solved by discretizing the transmission line into n sections. If
the solution is too coarse then try changing n.
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 28 2017 20:53:07)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-685
Compiled by hp@HP-PC
Huge version with GUI. Features included (+) or not (-):
+acl +eval +mouse +syntax
+arabic +ex_extra +mouseshape +tag_binary
+autocmd +extra_search +multi_byte_ime/dyn +tag_old_static
+balloon_eval +farsi +multi_lang -tag_any_white
+browse +file_in_path +mzscheme/dyn +tcl/dyn
@johnrichardrinehart
johnrichardrinehart / session.bash
Created September 24, 2019 05:13
An example output of a bash session describing an "issue" with Go modules
johnrinehart@modie test $ tree -L 3
.
├── folder
│ └── pkg
│ └── pkg.go
└── go.mod
2 directories, 2 files
johnrinehart@modie test $ go test ./...
folder/pkg/pkg.go:4:2: git ls-remote -q https://github.com/a/folder in /Users/johnrinehart/go/pkg/mod/cache/vcs/0924eb5d08e2c012fe

Keybase proof

I hereby claim:

  • I am johnrichardrinehart on github.
  • I am fuzzybear3965 (https://keybase.io/fuzzybear3965) on keybase.
  • I have a public key ASAXywmzufkBfQrO1_FWdcAIIZYJy8z2DqfA114HODQamAo

To claim this, I am signing this object:

@johnrichardrinehart
johnrichardrinehart / broker.go
Last active May 14, 2020 18:48
A message broker using two concurrency primitives (channels and mutexes) in Go
package broker
import (
"sync"
"time"
"github.com/rs/zerolog/log"
)
type (
@johnrichardrinehart
johnrichardrinehart / broker_server.go
Created May 14, 2020 18:46
An HTTP server managing one subscription broker per URL path
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"time"
// This code is an attempt to solve (probslem description below) https://leetcode.com/explore/challenge/card/september-leetcoding-challenge/555/week-2-september-8th-september-14th/3459/
// A more efficient solution can be devised using dynamic programming: https://www.geeksforgeeks.org/count-ways-reach-nth-stair/
// ----- START Problem Description -----
// You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night.
// Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police.
// Example 1:
@johnrichardrinehart
johnrichardrinehart / LFS-compiler-bootstrapping.gv
Created September 16, 2020 23:15
A graphviz file outlining the LFS GCC compiler bootstrap sequence
digraph G {
// edges
subgraph cluster_degradedgcc {
style=filled;
color=lightgrey;
cc1 -> lapih -> glibc -> libstdcpp1;
label=< <b> cc1: Degraded bootstrap cross-compiler </b> >;
}
subgraph cluster_supgcc {
@johnrichardrinehart
johnrichardrinehart / webpack-dev-server_output
Created November 27, 2020 10:17
webpack-dev-server doesn't accept contentBase as a valid field
/home/john/Downloads/repos/project/app/.yarn/cache/schema-utils-npm-3.0.0-e97702da81-a084f593f2.zip/node_modules/schema-utils/dist/validate.js:104
throw new _ValidationError.default(errors, schema, configuration);
^
ValidationError: Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema.
- configuration has an unknown property 'contentBase'. These properties are valid:
object { bonjour?, client?, compress?, dev?, firewall?, headers?, historyApiFallback?, host?, hot?, http2?, https?, injectClient?, injectHot?, liveReload?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, openPage?, overlay?, port?, proxy?, public?, setupExitSignals?, static?, stdin?, transportMode?, useLocalIp? }
at validate (/home/john/Downloads/repos/project/app/.yarn/cache/schema-utils-npm-3.0.0-e97702da81-a084f593f2.zip/node_modules/schema-utils/dist/validate.js:104:11)
at new Server (/home/john/Downloads/repos/project/app/.
# build an ISO image that will auto install NixOS and reboot
# $ nix-build make-iso.nix
let
config = (import <nixpkgs/nixos/lib/eval-config.nix> {
system = "x86_64-linux";
modules = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
({ pkgs, lib, ... }:
let