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 collections | |
import itertools | |
# Before you can call send, you have to call next to drive it to the first | |
# yield point. What if it never yields? Then the first call to next will raise | |
# StopIteration on it. | |
def parse_message(): | |
print('parse_message') | |
ret = [] |
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
[out:json]; | |
rel[type=route][route=road][network="US:I"][ref]; | |
way(r)[ref!~"^I "]; | |
rel(bw)[type=route][route=road][network="US:I"][ref]; | |
out tags; | |
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
package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"sync" | |
"time" |
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
number of times every unique US:* network is seen | |
number of times every unique token is seen after splitting on colons |
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
FROM debian:bullseye AS builder | |
RUN apt-get update && apt-get -y install gdal-bin build-essential git curl libsqlite3-dev zlib1g-dev | |
WORKDIR /build | |
RUN git clone https://github.com/mapbox/tippecanoe | |
RUN cd ./tippecanoe && make && make install | |
RUN curl -OL https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries_lakes.zip | |
RUN ogr2ogr ne_10m_admin_0_countries_lakes.geojson /vsizip/ne_10m_admin_0_countries_lakes.zip |
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
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') |
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
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 |
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
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 | |
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
.class public final enum LShrubbery; | |
.super Ljava/lang/Enum; | |
.source "Shrubbery.java" | |
# annotations | |
.annotation system Ldalvik/annotation/Signature; | |
value = { | |
"Ljava/lang/Enum", | |
"<", |
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 python3 | |
import io | |
import json | |
import socket | |
def q(s): | |
# For double quotes | |
return json.dumps(s, ensure_ascii=False) |
NewerOlder