This file contains hidden or 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
const childProcess = require("child_process"); | |
function gitCmd(args) { | |
const cmd = childProcess.spawnSync("/usr/local/bin/git", args); | |
return cmd.stdout.toString().split("\n"); | |
} | |
function commitsForPath(path) { | |
return gitCmd(["rev-list", "--format=oneline", "--all", path]) | |
.map(x => [x.substr(0, 40), x.substr(41)]) |
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 16 columns, instead of 7 in line 8.
This file contains hidden or 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
PID,Designation,State,County,Latitude,Longitude,USGS Quad,First City,Second City,Beacon #,Airport?,Arrow?,Airway,Status,Report, | |
TT6703,LADD FIELD AIRWAY BEACON,AK, ,64.8393467,-147.6422778,FAIRBANKS D-2, , , ,N,N, ,Undetermined NGS beacon/arrow,, | |
UV1481,MENDENHALL PENPOLE OBS LT,AK, ,58.36027612,-134.6373542,JUNEAU B-2, , , , , , ,Undetermined NGS beacon/arrow,, | |
UV1482,MENDENHALL PEN TWR OBS LT,AK, ,58.36558586,-134.6345829,JUNEAU B-2, , , , , , ,Undetermined NGS beacon/arrow,, | |
UV1489,MENDENHALL PENINSULA AWY BCN,AK, ,58.35891469,-134.6378411,JUNEAU B-2, , , ,N,N, ,Undetermined NGS beacon/arrow,, | |
UV8118,BETHEL CAA AIRFIELD AIRWAY BCN,AK, ,60.77455235,-161.7225519,BETHEL D-8, , , ,Y,N, ,Undetermined NGS beacon/arrow,, | |
UV8494,ANIAK AIRWAY BEACON,AK, ,61.5781849,-159.5386466,RUSSIAN MISSION C-2, , , ,N,N, ,Undetermined NGS beacon/arrow,, | |
UW5259,AIR BCN,AK, ,71.32724161,-156.6789262,BARROW B-4, , , ,N,N, ,Undetermined NGS beacon/arrow,, | |
BG4136,ATLANTA MOBILE AWY BCN 15,AL,BALDWIN,30.96132667,-87.70389309,DYAS (19 |
This file contains hidden or 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 INTO for GTFS data (e.g. http://transitfeeds.com/p/mta/87) | |
create table agencies ( | |
agency_id int primary key, | |
agency_name string, | |
agency_url string, | |
agency_timezone string, | |
agency_phone string, | |
agency_lang string | |
); |
This file contains hidden or 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
def basis_door(width, height, cx=2.0, cy=2.0) | |
# Measurements from https://www.reformcph.com/us/design/basis/ | |
lin_depth = 5.0/64 | |
oak_depth = 3.0/4 | |
hole_depth = 5.0/8 | |
radius = (1 + 5.0/8) / 2 | |
model = Sketchup.active_model | |
door = model.active_entities.add_group |
This file contains hidden or 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 | |
set -x | |
for city in ginza shenzhen beijing; do | |
for room in {a..z} ; do | |
pic=0 | |
while true; do | |
((pic++)) | |
fn="${room}_${pic}.jpg" | |
curl --fail "https://hotel.muji.com/${city}/wp-content/themes/mujihotel${city}/img/rooms_type_$fn" -o "${city}_${fn}" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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="$*" |
This file contains hidden or 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 hidden or 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 hidden or 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
manufacturer | model | name | width | depth | thickness | weight | screensize | screenwidth | screenheight | |
---|---|---|---|---|---|---|---|---|---|---|
Lenovo | 20KH002KUS | X1 Carbon 6th Gen | 12.73 | 8.54 | 0.62 | 2.49 | 14 | 2560 | 1440 | |
Lenovo | X1 Carbon 7th Gen | 12.71 | 8.54 | 0.58 | 2.4 | 14 | 3840 | 2160 | ||
Apple | A1466 | MacBook Air 13" 2013 | 12.8 | 8.94 | 0.68 | 2.96 | 13.3 | 1440 | 900 | |
Apple | A1534 | MacBook 12" 2017 | 11.04 | 7.74 | 0.52 | 2.03 | 12 | 2304 | 1440 | |
Apple | A1932 | MacBook Air 13" 2018 | 11.97 | 8.36 | 0.61 | 2.75 | 13.3 | 2560 | 1600 | |
Apple | MacBook Air 13" 2020 | 11.97 | 8.36 | 0.63 | 2.8 | 13.3 | 2560 | 1600 | ||
Apple | MacBook Pro 16" 2019 | 14.09 | 9.68 | 0.64 | 4.3 | 16 | 3072 | 1920 | ||
Dell | 9380 | XPS 13 2019 | 11.9 | 7.8 | 0.46 | 2.7 | 13.3 | 3840 | 2160 | |
Dell | XPS 13 2020 | 11.64 | 7.82 | 0.58 | 2.64 | 13.4 | 1920 | 1200 |