Skip to content

Instantly share code, notes, and snippets.

View seanlane's full-sized avatar

Sean Lane seanlane

View GitHub Profile
@seanlane
seanlane / minimal.py
Last active February 28, 2024 18:46
Polars 0.20.11 group_by bug
import polars as pl
bug_source = pl.read_csv('https://gist.githubusercontent.com/seanlane/658541735a08ad474962088b0ceaf5c2/raw/truncated_bug_source_exploded.csv')
polars_df = (
bug_source
.group_by(pl.col('disk_hex'))
.agg(
pl.mean('cell_tract_median_value').alias('disk_tract_median_value'),
pl.mean('cell_tract_mean_value').alias('disk_tract_mean_value'),
@seanlane
seanlane / bug_source_exploded.csv
Created February 28, 2024 18:10
Polars 0.20.11 group_by bug
We can't make this file beautiful and searchable because it's too large.
hex,cell_tract_median_value,cell_tract_mean_value,cell_item_count,disk_hex
612708440617254911,330800.0,330800.0,1,612708440617254911
612708440617254911,330800.0,330800.0,1,612708440598380543
612708440617254911,330800.0,330800.0,1,612708440589991935
612708440617254911,330800.0,330800.0,1,612708440608866303
612708440617254911,330800.0,330800.0,1,612708440604671999
612708440617254911,330800.0,330800.0,1,612708440613060607
612708440617254911,330800.0,330800.0,1,612708440678072319
612708440617254911,330800.0,330800.0,1,612708440675975167
612708440617254911,330800.0,330800.0,1,612708440596283391
@seanlane
seanlane / slack_delete.py
Last active February 8, 2019 22:24 — forked from jackcarter/slack_delete.py
Delete Slack files older than 30 days. Rewrite of https://gist.github.com/jamescmartinez/909401b19c0f779fc9c1
#!/usr/bin/env python3
import requests
import time
import json
token = ''
#Delete files older than this:
days = 15
@seanlane
seanlane / jrnl.py
Created May 10, 2018 17:59
Python script I use for Personal and Work journaling
#!/usr/bin/env python3
import argparse, datetime, os, re, sys, tempfile, time
from subprocess import call
EDITOR = os.environ.get('EDITOR') if os.environ.get('EDITOR') else 'vim'
def create_header():
"""
@seanlane
seanlane / fax.py
Created August 31, 2017 06:36
Python Fax via Phaxios
#!/usr/bin/env python3
from subprocess import call
import sys
if len(sys.argv) <= 2:
print("Usage: send_fax NUMBER FILENAME...")
exit(-1)
number = sys.argv[1]
api_key = 'put_api_key_here'
@seanlane
seanlane / keybase.md
Last active July 16, 2017 01:14
Keybase proof

Keybase proof

I hereby claim:

  • I am seanlane on github.
  • I am seanlane (https://keybase.io/seanlane) on keybase.
  • I have a public key whose fingerprint is C0A5 90BB 59F5 0948 3A56 AF8C 40F3 AF5E 1067 650C

To claim this, I am signing this object:

@seanlane
seanlane / domcomp_filter.js
Created February 20, 2017 06:15
Filter Domcomp.com results based on length, registration, and other factors
// Filter domcomp.com results to show what I'm interested in
function clr() {
// Google Global TLDs as of Jan 2017
var g_tlds = ['ad', 'as', 'bz', 'cc', 'cd', 'co', 'dj', 'fm', 'io',
'la', 'me', 'ms', 'nu', 'sc', 'sr', 'su', 'tv', 'tk', 'ws']
var rows = document.getElementsByClassName('price_table')[0].rows;
var re = /^[a-z0-9]+$/i;
for (var i = 1; i < rows.length; i++) {
if (rows[i].classList.contains('registered') || // Don't show registered TLDs
rows[i].attributes['tld'].value.length > 2 || // Don't show TLDs logner than 2 chars
@seanlane
seanlane / keybase.md
Last active July 16, 2017 01:11
KeyBase Proof

Keybase proof

I hereby claim:

  • I am seanlane on github.
  • I am seanlane (https://keybase.io/seanlane) on keybase.
  • I have a public key whose fingerprint is C0A5 90BB 59F5 0948 3A56 AF8C 40F3 AF5E 1067 650C

To claim this, I am signing this object:

@seanlane
seanlane / The Technical Interview Cheat Sheet.md
Last active November 25, 2018 05:50 — forked from tsiege/The Technical Interview Cheat Sheet.md
The Technical Interview Cheat Sheet

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This is my technical interview cheat sheet that I forked from TSiege. Please comment if you would like to have me edit, or send me a link from your fork. Probably a lot left to add and correct here, so take everything with a grain of salt. This list is meant to be both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

Array

Definition:

  • Stores data elements based on a sequential index, most commonly 0 based.
  • Based on tuples from set theory.