Skip to content

Instantly share code, notes, and snippets.

View jleedev's full-sized avatar
🧙‍♀️

Josh Lee jleedev

🧙‍♀️
  • Pittsburgh
View GitHub Profile
size=512
print(f'''<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="{size//2}" height="{size//2}" viewBox="0 0 {size} {size}">
<rect width="{size}" height="{size}"/>
<path d="M0,0''')
for i in range(size//2):
print(f'V{size}h1V0zm2 0')
print('M0,0')
for i in range(size//2):
print(f'H{size}v1H0zm0 2')
@jleedev
jleedev / Dockerfile
Created May 24, 2022 20:53
extremely normal shell script
FROM ubuntu
RUN apt-get update
RUN apt-get -y install gdal-bin
RUN apt-get -y install jq
RUN >x.csv printf 'id,WKT\n1,%s\n' "$(echo '[[0.2,0.2],[0.75,0.75],[0.25,0.75],[0.2,0.2]]' \
| jq '(2*(-1|acos)*6378137)as$c|[.[]|[(.[0]-0.5)*$c,(0.5-.[1])*$c]|join(" ")]|join(",")|"LINESTRING("+.+")"')"; \
echo EPSG:3857 >x.prj
mysql> create table t(f float);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t(f) values (999999),(1000000),(1000001);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from t;
+---------+
| f |
<!doctype html>
<meta charset=utf-8>
<script type=🧩 id=lodash>
import content from "lodash/content";
const p = document.createElement("p");
p.textContent = content;
export default () => p.cloneNode(true);
</script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python3
import io
import json
import socket
def q(s):
# For double quotes
return json.dumps(s, ensure_ascii=False)
import os
import sys
arg = sys.argv[1]
start = os.getcwd()
os.mkdir('tmp')
os.chdir('tmp')
@jleedev
jleedev / .gvimrc
Last active January 23, 2019 13:33
dark mode
function! SetMode()
call system("defaults read -g AppleInterfaceStyle")
if v:shell_error
se bg=light
else
se bg=dark
endif
endfunction
call SetMode()
@jleedev
jleedev / pa.sh
Created September 1, 2018 14:05
#!/bin/bash
# vi: ts=2 sw=2 et
set -eu
type node || source "$NVM_DIR/nvm.sh"
type pip || source ./venv/bin/activate
type curl osmtogeojson tippecanoe aws
set -x
query='[out:json];
@jleedev
jleedev / delete.stupid.apple.garbage.plist
Created March 30, 2018 01:16
Library/LaunchDaemons/delete.stupid.apple.garbage.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>delete.stupid.apple.garbage</string>
<key>Program</key>
<string>/bin/sh</string>
<key>ProgramArguments</key>
<array>