Skip to content

Instantly share code, notes, and snippets.

View GeorgeErickson's full-sized avatar

George Erickson GeorgeErickson

View GitHub Profile
@octplane
octplane / README.md
Last active July 25, 2018 22:25
Reese Tag-Sync
  • Reese kafka migration script
  • chef to shell converter for the VPC migration
@GeorgeErickson
GeorgeErickson / Makefile
Last active December 12, 2017 22:41
protobuf makefile
OS := $(shell uname -s)
PROTO_VERSION := 3.0.2
PROTO_ZIP_FILE := /tmp/protoc-$(PROTO_VERSION).zip
PROTOC := /usr/local/bin/protoc-$(PROTO_VERSION)
ifeq ($(OS),Darwin)
PROTO_URL := https://github.com/google/protobuf/releases/download/v$(PROTO_VERSION)/protoc-$(PROTO_VERSION)-osx-x86_64.zip
PROTO_CHECKSUM := 06f7401ffe5211340692b0a16dc53f3d8f9dc8ef3c1f74378110ee222e36436d
else
PROTO_URL := "https://s3.amazonaws.com/dd-public-oss-mirror/protoc-$(PROTO_VERSION)-linux-x86_64.zip"
@anvk
anvk / psql_useful_stat_queries.sql
Last active June 1, 2025 16:17
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@pmbauer
pmbauer / gitlab_job_highlighter.js
Last active March 16, 2018 20:54
grease monkey script to highlight personal jobs in the gitlab pipeline view, because linear search is a drag
// ==UserScript==
// @name gitlab pipeline job highlighter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description highlight personal jobs, customize for your url (match)
// @author pmbauer
// @match https://gitlab.ddbuild.io/*/pipelines*
// @grant none
// ==/UserScript==
@aclements
aclements / trigger-error.go
Created July 18, 2017 20:03
Plot GC pacer trigger error function
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"image/color"
"math"
"os"
@5agado
5agado / Pandas and Seaborn.ipynb
Created February 20, 2017 13:33
Data Manipulation and Visualization with Pandas and Seaborn — A Practical Introduction
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dusenberrymw
dusenberrymw / spark_tips_and_tricks.md
Last active January 10, 2025 07:36
Tips and tricks for Apache Spark.

Spark Tips & Tricks

Misc. Tips & Tricks

  • If values are integers in [0, 255], Parquet will automatically compress to use 1 byte unsigned integers, thus decreasing the size of saved DataFrame by a factor of 8.
  • Partition DataFrames to have evenly-distributed, ~128MB partition sizes (empirical finding). Always err on the higher side w.r.t. number of partitions.
  • Pay particular attention to the number of partitions when using flatMap, especially if the following operation will result in high memory usage. The flatMap op usually results in a DataFrame with a [much] larger number of rows, yet the number of partitions will remain the same. Thus, if a subsequent op causes a large expansion of memory usage (i.e. converting a DataFrame of indices to a DataFrame of large Vectors), the memory usage per partition may become too high. In this case, it is beneficial to repartition the output of flatMap to a number of partitions that will safely allow for appropriate partition memory sizes, based upon the
anonymous
anonymous / main.go
Created December 28, 2016 02:16
package main
import (
"bufio"
"bytes"
"errors"
"flag"
"fmt"
"log"
"os"
@tdunning
tdunning / td-in-r.r
Last active November 26, 2018 20:05
A simplified implementation of a merging t-digest in R with some visualization of the results
### x is either a vector of numbers or a data frame with sums and weights. Digest is a data frame.
merge = function(x, digest, compression=100) {
## Force the digest to be a data.frame, possibly empty
if (!is.data.frame(digest) && is.na(digest)) {
digest = data.frame(sum=c(), weight=c())
}
## and coerce the incoming data likewise ... a vector of points have default weighting of 1
if (!is.data.frame(x)) {
x = data.frame(sum=x, weight=1)
}
@isaksky
isaksky / Working-with-SQL-syntax-trees-in-F.md
Last active June 25, 2021 19:21
Working with SQL syntax trees in F#

Working with SQL syntax trees in F#

Update 12/15/2016 - Added Sql generation

Welcome to my blog post for #FsAdvent 2016.

If you're using a relational database, as your application grows in size, at some point you may find yourself looking for an SQL parser. This can give you lots of leverage, for example allowing you to:

  • Do permission checks on queries before executing them
  • Rewrite incorrect or inefficient queries