Skip to content

Instantly share code, notes, and snippets.

View mckoss's full-sized avatar

Mike Koss mckoss

View GitHub Profile
@mckoss
mckoss / download_sp.py
Created December 5, 2009 00:29
SharePoint downloader for Python
"""
Download all document links from a web page.
Used to extract all the docouments from a Sharepoint document library.
by Mike Koss, September, 2009
Notes:
9/14/09 mck:
Using Beautiful soup version 3.0.7a. The current version (3.1.0.1) is NOT resilient
@mckoss
mckoss / gist:4211704
Created December 5, 2012 02:53
String-based Hierarchical Deterministic Bitcoin Keys

String-based Heirarchical Deterministic Keys

This is an alternate proposal to [BIP32].

Version History:

  • 12-7-2102: Addition of chain code (much as BIP32 uses).
  • 12-3-2012: Initial Proposal (version 1)

Motivation

import { resolve } from 'path';
import { defineConfig } from 'vite';
// const rewriteImports = {
// name: 'rewrite-imports',
// transform(code: string, id: string) {
// console.log(`Processing ${id} ...`);
// if (id.endsWith('.js') || id.endsWith('.ts')) {
// const importRegex = /import (.*) from ['"]chai['"]/g;
// const replacement = "import $1 from './chai/index.js'";
@mckoss
mckoss / enigma-test.html
Created December 7, 2009 19:46
Enigma Machine Simulator with Unit Tests
<html>
<head>
<title>Engima Test Page</title>
<script src="namespace.js"></script>
<script src="enigma.js"></script>
<script src="unit.js"></script>
</head>
<body>
<h1><script>document.write(document.title);</script></h1>
<SCRIPT>
@mckoss
mckoss / main.dart
Created April 4, 2021 19:09
Hello World
main () {
print("Hello, World!");
}
@mckoss
mckoss / tuple_iter.py
Created November 3, 2009 17:16
Some nice Tuple-Iterators for Python
class tuples(object):
"""
Iterator that generates all tuples in lexicographical order.
For example:
for t in tuples((2,3)):
print t
produces:
@mckoss
mckoss / vs_purchase-help.md
Last active April 12, 2017 17:41
VS_PURCHASE Custom Function Documentation

VS_PURCHASE(range)

Custom Function to compute versus purchase gains (FIFO).

The passed range should contain exactly three columns of data (in chronological order to preserve first-in/first-out ordering of transactions). The three columns should contain:

  • Date can be an actual date or id string (but rows of the range must be chronological).
  • Shares is the number of shares purchased (if positive) or sold (if negative).
  • Proceeds (in dollars) is the total received from sale (if positive) or paid to purchase (if negative).
@mckoss
mckoss / sdm.txt
Last active January 14, 2017 17:41
Exact calculation of the probability, p(n), that n = the sum of normally distributed decimal digits.
p(1) = 0.111111111111 = Fraction(1, 9)
p(2) = 0.123456790123 = Fraction(10, 81)
p(3) = 0.137174211248 = Fraction(100, 729)
p(4) = 0.152415790276 = Fraction(1000, 6561)
p(5) = 0.169350878084 = Fraction(10000, 59049)
p(6) = 0.188167642316 = Fraction(100000, 531441)
p(7) = 0.209075158129 = Fraction(1000000, 4782969)
p(8) = 0.232305731254 = Fraction(10000000, 43046721)
p(9) = 0.258117479171 = Fraction(100000000, 387420489)
p(10) = 0.175686087968 = Fraction(612579511, 3486784401)
@mckoss
mckoss / a-test.js
Last active December 24, 2015 22:03 — forked from anonymous/a-test.js
var assert = require('assert');
var a = require('./a');
suite("A", function() {
test("a", function() {
a.sub(function() {
assert.ok(true);
});
a.trigger();
});
@mckoss
mckoss / select_account.html
Created December 4, 2015 20:41
Firebase select_account option test
<html>
<head>
<script src="https://cdn.firebase.com/js/client/2.3.2/firebase.js"></script>
</head>
<body>
<input type="button" onClick="signIn()" value="Sign In">
<div id="output"></div>
<script>
var ref;
window.addEventListener('load', init);