Skip to content

Instantly share code, notes, and snippets.

@djpnewton
djpnewton / wsl2_docker_notes.md
Last active June 16, 2022 01:20
my notes using docker with WSL2

Where are the docker volumes mounted in windows?

\\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes

Where are the docker desktop bind mounts in windows?

\\wsl$\docker-desktop-data\mnt\wsl\docker-desktop-bind-mounts\Ubuntu-22.04

How do I deal with the following issue with a bind mount?

What is the probability of having a stalemate with 5 players in paper sissors rock?

1 player

Obviously 1/1

2 players

Obviously 1/3 (1/1 * 1/3)

<html>
<body>
<div id="mediv">
</div>
<script>
var mediv = document.findElementById("mediv");
localStorage.setItem("bob", "the builder");
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);

Keybase proof

I hereby claim:

  • I am djpnewton on github.
  • I am djpnewton (https://keybase.io/djpnewton) on keybase.
  • I have a public key ASBTMSW1y2bnoOc8Jgg6kPpaL1Uvbgpo11WWLtjOe6h5tgo

To claim this, I am signing this object:

@djpnewton
djpnewton / k2o3.py
Last active August 15, 2017 23:32
simple method of splitting a key into a 2 of 3 set of keys
#!/usr/bin/env python
import os
import binascii
VERSION=2
def random_number(bits):
return int(binascii.hexlify(os.urandom(bits/8)), 16)
Verifying that +djpnewton is my blockchain ID. https://onename.com/djpnewton
@djpnewton
djpnewton / mic_output.ino
Last active August 29, 2015 14:25
freetronic sound input module test
/*
Analog input, serial output
Reads an analog input pin, maps the result to a range from 0 to 255
and prints the results to the serial monitor.
The circuit:
* freetronics sound input module with SPL connected to analog pin 0.
* freetronics sound input module with SPL connected to analog pin 2.
*/
@djpnewton
djpnewton / vimrc
Created March 5, 2013 02:06
My vimrc file
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
package main
import (
"fmt"
"flag"
"image"
"image/png"
"math"
"os"
)
@djpnewton
djpnewton / parallel_fib.go
Created October 11, 2011 04:30
Testing scaling of parallelism in Go
package main
import (
"fmt"
"time"
"flag"
"runtime"
)
// basic fibonacci routine