Skip to content

Instantly share code, notes, and snippets.

View mckoss's full-sized avatar

Mike Koss mckoss

View GitHub Profile
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 / main.dart
Created April 4, 2021 19:09
Hello World
main () {
print("Hello, World!");
}
@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);
@mckoss
mckoss / Test Gist
Last active November 28, 2015 17:49
# This is a Title
Here is a paragraph of text. Here is a paragraph of text. Here is a paragraph of text. Here is a paragraph of text. Here is a paragraph of text
Here is a paragraph of text. Here is a paragraph of text. Here is a paragraph of text.
# Another Title
- A list
- Of things.
- That appear.
T-Mobile: We have received your information and will connect you with a T-Mobile Chat Specialist soon.
T-Mobile: A Chat Specialist will be with you soon.
T-Mobile: Thank you for waiting. A Chat Specialist will be available shortly. For assistance with payment processing or account cancellation, please call Customer Care at (877) 746-0909.
T-Mobile: We appreciate your patience. A Chat Specialist will be assigned to you soon.
DarrenC: Hi, Mike!
You: HI
You: Hello?
DarrenC: Thank you for contacting T-Mobile. I'm sorry to know that you're having issues with your order.
DarrenC: No worries, I am here to help you out.
DarrenC: Let me pull up your account real quick.
@mckoss
mckoss / gist:a56114f27c4a90f51502
Created March 26, 2015 21:40
Firebase Promise Wrappers
// Get Firebase value from a query as a Promise.
function getValue(ref, allowNull) {
return new Promise(function(resolve, reject) {
ref.once('value',
function(snap) {
var result = snap.val();
if (result === null && !allowNull) {
reject(new Error("No data at location: " + ref.toString()));
return;
}
@mckoss
mckoss / goodbye
Created August 8, 2014 20:56
My little sumpin'
I am not here.