Skip to content

Instantly share code, notes, and snippets.

View dm03514's full-sized avatar

dm03514

View GitHub Profile
INSERT INTO orders_enterprise
SELECT * FROM (
SELECT * FROM salesforce_contracts
UNION ALL
SELECT * FROM sales_invoices
)
INSERT INTO orders
SELECT * FROM (
SELECT * FROM orders_enterprise
UNION ALL
SELECT * FROM orders_saas
UNION ALL
SELECT * FROM orders_partner
)
I think Will Larson seems pretty amazing, I’ve never spoken to him, I don’t know him at a all, 
but I definitely feel confident after reading his blogs that I would be able to approach problems 
and make decisions in a similar manner that he describes. I think it’s really powerful how 
actionable his principles are.  I’d contrast this with a leader that is successful but isn’t able 
to convey their principles and able to enable other people (or computers) to make decisions or 
define structured approaches to problems solving.  I feel like he seems like a different class of
leader and that’s probably why book bookmarked like 100 different posts by him yesterday :stuck_out_tongue:

*Does anyone happen to know of any other leadership/managements/decision making writings that are 
@dm03514
dm03514 / index_analyzer.py
Created May 6, 2019 20:26
Elastic Search: Index Analyzer
import argparse
import collections
import json
import re
def service_name_from_index(index):
service_name = ''.join(re.split(r'-\d{4}.\d{2}.\d{2}', index))
return service_name
@dm03514
dm03514 / timing.go
Last active February 28, 2019 19:01
package main
import (
"flag"
"fmt"
"time"
)
func main() {
interval := flag.Duration("interval-timeout", time.Second, "timeout to use")
@dm03514
dm03514 / timing.js
Created February 28, 2019 17:58
Test to calculate rate of operations
// Averages the rate of operations over time since program started
const roundTo100ths = (num) => {
return Math.round(num * 100)/100;
};
const start = new Date();
let ticks = 0;
const timeout = process.env.INTERVAL_TIMEOUT_MS || 1000;
setInterval(() => {
@dm03514
dm03514 / gist:aee2e9fdbb99f6a1c1491fc542f64508
Last active December 4, 2018 20:39
application_level_buffer
# Enforces a buffer @ application level set lower than system level
class TextBufferedLogQueue {
// configured by client with "max number" of bytes allowed in this buffer could be set much lower than system
constructor(maxTextBytes=40000) {
statements = []
maxTextBytes = maxTextBytes
currentSize = 0
}
// checks if there is room for the # of bytes in the buffer
task estimated_time_to_complete estimated_savings return_interval savings_per_interval ROI break_even
automate manual deployment step 10h 2h/week quarter(13 weeks) 26h 1.6 5w
$ make start-service
make: Warning: File 'Makefile' has modification time 165 s in the future
aws --endpoint-url=http://localhost:4576 sqs delete-queue --queue-url http://localhost:4576/queue/deposits-in || true
An error occurred (AWS.SimpleQueueService.NonExistentQueue) when calling the DeleteQueue operation: AWS.SimpleQueueService.NonExistentQueue; see the SQS docs.
aws --endpoint-url=http://localhost:4576 sqs create-queue --queue-name deposits-in
{
"QueueUrl": "http://localhost:4576/queue/deposits-in"
}
(pprof) list Track
Total: 414.77MB
ROUTINE ======================== main.(*RequestTracker).Track in /vagrant_data/go/src/github.com/dm03514/grokking-go/simple-memory-leak/main.go
1.28MB 410.25MB (flat, cum) 98.91% of Total
. . 19:
. . 20:func (rt *RequestTracker) Track(req *http.Request) {
. . 21: rt.mu.Lock()
. . 22: defer rt.mu.Unlock()
. . 23: // alloc 10KB for each track
1.28MB 410.25MB 24: rt.requests = append(rt.requests, bytes.Repeat([]byte("a"), 10000))