This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# This shell script passes all its arguments to the binary inside the | |
# MacVim.app application bundle. If you make links to this script as view, | |
# gvim, etc., then it will peek at the name used to call it and set options | |
# appropriately. | |
# | |
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This | |
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico | |
# Weber and Bjorn Winckler, Aug 13 2007. Some mediocre hacking by Paul Kehrer Sep 30 2009). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
function() { | |
function getSrcUri() { | |
return window.location; | |
} | |
function getSrc() { | |
return document.getElementsByClassName('lfFrame')[0].getAttribute('src'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
function() { | |
function getSrc() { | |
var el = document.querySelector('div[role=dialog]'); | |
if (el == null) { | |
el = document; | |
} | |
var media = el.querySelector('video'); | |
if (media == null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Swap fn and left ctrl on internal keyboard", | |
"rules": [ | |
{ | |
"description": "Change fn to left ctrl", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"type": "device_if", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": "Set up cmd and option on Nixeus keyboard", | |
"rules": [ | |
{ | |
"description": "[Nixeus] Change left cmd to option", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"type": "device_if", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = open('sausage.html').read.gsub('&', '&') | |
matches = t.scan(/(?:<h3>([^<]*)<\/h3>)|<strong>([^<]*)<\/strong>\s*\(([^)]*)\)/) | |
def addr(str) | |
str.sub!(/,\s+(no phone|\d{3}-\d{3}-\d{4}).*/, '') | |
last = str.split(', ')[-1] | |
return str if last == "NJ" | |
return str + ", NY" if ["Brooklyn", "Queens", "Bronx", "Staten Island"].include? last | |
return str + ", New York, NY" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year | ppm | |
---|---|---|
1679 | 276.712 | |
1680 | 276.669 | |
1681 | 276.627 | |
1682 | 276.587 | |
1683 | 276.549 | |
1684 | 276.512 | |
1685 | 276.478 | |
1686 | 276.447 | |
1687 | 276.418 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
set -o pipefail | |
screen_name=$1 | |
twurl "/1.1/statuses/user_timeline.json?screen_name=$screen_name&trim_user=true&exclude_replies=true&count=200&include_rts=false" | | |
jq -r '.[] | |
| select(.extended_entities.media != null) | |
| .id_str as $tweet_id | |
| .extended_entities.media |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
# CSV cleaner-upper to change CRLF terminations to LF, and to avoid quoting empty strings | |
# inspired by https://github.com/mhus/mhus-lib/blob/master/mhu-lib-core/src/main/java/de/mhus/lib/core/io/CSVReader.java | |
# usage: python csvfix.py < in.csv > out.csv | |
def parse_field(char, state="start", acc=""): # returns (new_state, new_acc) | |
if state == "start": | |
if char == ",": | |
return ("eof_u", acc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# expects you to have your twitter archive folders in $dir | |
# with folder names like "acct1 2019-01-26" so they sort nicely | |
set -euo pipefail | |
dir='path/to/archives' | |
accts='acct1 acct2' | |
query="$*" |
OlderNewer