Skip to content

Instantly share code, notes, and snippets.

View andelink's full-sized avatar
😶‍🌫️

Kyle Andelin andelink

😶‍🌫️
View GitHub Profile
@andelink
andelink / tasks.jsonc
Last active September 8, 2024 04:09
Zed "Filter Through Command" - Context: https://github.com/zed-industries/zed/issues/12598
[
{
"label": "filter-through-command",
"command": "~/bin/zed-filter-through-command",
"reveal": "always",
"hide": "on_success",
"shell": { "program": "sh" }
},
{
"label": "filter-through-jq",
@andelink
andelink / uncensored-homebrew-fortune.md
Last active September 9, 2024 21:50
Uncensored Homebrew fortune

Uncensored Homebrew fortune

Homebrew fortune doesn't include the full database of quotes. They removed the offensive category database several years ago:

You are greeted with an error when trying to use the offensive category:

❯ brew install fortune
14437.0
0.655902 802364 13648.7
0.658094 8702.45
@andelink
andelink / show-resolved-pr-comments.user.js
Created March 4, 2023 01:03
Show all resolved PR comments
// ==UserScript==
// @name Show all resolved PR comments
// @namespace http://tampermonkey.net/
// @version 0.3
// @description try to take over the world!
// @author You
// @match https://github.com/*/*/pull/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andelink
andelink / pyspark-sql-table-metadata.md
Created July 26, 2022 13:23
pyspark-sql-table-metadata.md

Describe table output:

>>> spark.sql('describe table extended test.sample').show(truncate=False, n=100)
+----------------------------+--------------------------------------------------------------+----------------------------+
|col_name                    |data_type                                                     |comment                     |
+----------------------------+--------------------------------------------------------------+----------------------------+
|some_id                     |bigint                                                        |some identifier column      |
|created_at                  |timestamp                                                     |when this record was created|
|status                      |string                                                        |status of this record       |
@andelink
andelink / script.py
Last active November 5, 2021 17:57
Haversine Distance Spark SQL
"""
https://gist.github.com/pavlov99/bd265be244f8a84e291e96c5656ceb5c
"""
from pyspark.sql import SparkSession
from pyspark.sql import functions as F
CITIES = [
('HKG', 'Hong Kong', 22.308919, 113.914603),
('SYD', 'Sydney', -33.946111, 151.177222),
('YYZ', 'Toronto', 43.677223, -79.630556),