Skip to content

Instantly share code, notes, and snippets.

View rdmurphy's full-sized avatar
🔴
Red pandas are the best.

Ryan Murphy rdmurphy

🔴
Red pandas are the best.
View GitHub Profile
@rdmurphy
rdmurphy / combine_mbtiles.py
Created March 6, 2023 21:33 — forked from ache051/combine_mbtiles.py
Combine MBTiles
#-------------------------------------------------------------------------------
# Name: combine_mbtiles.py
# Purpose: Processes multiple sqlite .mbtiles files into single file (or by level? or by degree grids?)
#
# Author: joshn. Modified by ache015
#
# Created: 18/11/2014
#
# Last Modified: 10/11/2018
#-------------------------------------------------------------------------------
@rdmurphy
rdmurphy / filters.txt
Last active September 22, 2022 22:12
Two targeted filters to make Twitter less bad for me (and maybe you too)
! Hide everything in Twitter's sidebar except the search bar and footer (just for visual balance, not because we care about copyright notices)
twitter.com##div[aria-label="Trending"] > div > div:nth-child(n+3):not(:last-child)
! Hide my follower total wherever it appears on Twitter for my sanity (swap in your username, of course)
twitter.com##[href="/rdmurphy/followers"]
@rdmurphy
rdmurphy / TOOLS.md
Last active April 19, 2022 18:07
Ryan's favorite command line tools

My favorite command line tools (2021-09-09)

I wrote this in response to Gurman's tweet. I remember answering in News Nerdery, but it was sadly lost to the void. :(

The CSV Swiss-army knife that trumps all others. Written in Rust, so it's absurdly fast in a way that's still kind of shocking.

@rdmurphy
rdmurphy / build.js
Created June 13, 2021 06:10
An example of bundt@1.1.3 outputting incorrect default modules.
module.exports =(n) {
return n * n;
}
<script>
import Paragraph from "./Paragraph.svelte";
export let name = "Abe";
</script>
<h1>Hello, {name}!</h1>
<Paragraph />
This is only a test.
@rdmurphy
rdmurphy / aggregates.py
Created May 5, 2018 16:14
PostgreSQL specific Django Median aggregation function
from django.db.models import Aggregate, FloatField
class Median(Aggregate):
function = 'PERCENTILE_CONT'
name = 'median'
output_field = FloatField()
template = '%(function)s(0.5) WITHIN GROUP (ORDER BY %(expressions)s)'

Keybase proof

I hereby claim:

  • I am rdmurphy on github.
  • I am rdmurphy (https://keybase.io/rdmurphy) on keybase.
  • I have a public key ASDXBSBlRQGK-fCF57E7mwTjmqMrV59MNjFeJfxLh0tzSwo

To claim this, I am signing this object:

@rdmurphy
rdmurphy / index.html
Created June 23, 2016 03:17 — forked from d3noob/.block
Sankey diagram with horizontal and vertical node movement
<!DOCTYPE html>
<meta charset="utf-8">
<title>SANKEY Experiment</title>
<style>
.node rect {
cursor: move;
fill-opacity: .9;
shape-rendering: crispEdges;
}
@rdmurphy
rdmurphy / computations.py
Last active November 1, 2015 19:50
A test run of adding basic geographic features to agate.
#!/usr/bin/env python
from agate.computations import Computation
from agate.data_types import Number
from agate.exceptions import DataTypeError
from agategeo.utils import haversine
class Distance(Computation):