Skip to content

Instantly share code, notes, and snippets.

@cmpadden
cmpadden / hn-userstyle.css
Last active February 26, 2022 18:58
Opinionated Minimalist HN UserStyle
/* ==UserStyle==
@name HN Minimalist
@description Opinionated minimalist styling for Hacker News
@match *://news.ycombinator.com/*
==/UserStyle== */
/********************************************************************************
* COLORS *
********************************************************************************/
:root {
@cmpadden
cmpadden / arrow-python-env.sh
Last active February 9, 2022 13:55
Apache Arrow Python Development Environment
#!/usr/bin/env bash
# Apache Arrow - Python Development Environment Configuration
###################################################################################################################
# Environment Setup #
###################################################################################################################
git clone https://github.com/apache/arrow.git
@cmpadden
cmpadden / pyspark_union_multiple_dfs.py
Created January 12, 2022 17:16
PySpark: Union Multiple Dataframes
from functools import reduce
from pyspark.sql import DataFrame, SparkSession
spark = SparkSession \
.builder \
.appName('Union DFs') \
.getOrCreate()
df1 = spark.createDataFrame(
[
@cmpadden
cmpadden / svg-to-pngs.sh
Created February 10, 2020 17:54
Generate common PNG sizes from an SVG
#!/bin/bash
# Generate common PNG sizes from an SVG using ImageMagick
SOURCE="example.svg"
SIZES=("16" "32" "64" "128" "256" "512" "1024")
for i in "${SIZES[@]}"; do
DESTINATION="${SOURCE/\.svg/-${i}.png}"
printf "%s\n" "Generating $DESTINATION..."
@cmpadden
cmpadden / csvs-to-xlsx.py
Created August 7, 2019 18:08
Convert CSVs into Excel Worksheet Tabs
"""
Convert CSVs into Excel sheets
"""
import glob
import pandas as pd
with pd.ExcelWriter("output.xlsx") as writer:
for file in glob.glob("*.csv"):
df = pd.read_csv(file)

Keybase proof

I hereby claim:

  • I am cmpadden on github.
  • I am colton (https://keybase.io/colton) on keybase.
  • I have a public key ASCwK3SQtS5XjIp74HiayYF2vH29XmcKl4wxHEnaNjw3OQo

To claim this, I am signing this object: