Skip to content

Instantly share code, notes, and snippets.

View eoghanmurray's full-sized avatar

Eoghan Murray eoghanmurray

View GitHub Profile
commit 9f5431270c352577df3982cef54262f600dad133
Merge: a128758a9 70dae8fba
Author: Eoghan Murray <eoghan@getthere.ie>
Date: Tue Jun 4 11:49:51 2024 +0100
WIP on removing-global-document-references: a128758a9 Add a test to ensure that we don't regress to using `document` in place of the passed in `doc`
diff --cc packages/rrweb-snapshot/test/rebuild.test.ts
index 097ff0989,097ff0989..6e5155532
--- a/packages/rrweb-snapshot/test/rebuild.test.ts
@eoghanmurray
eoghanmurray / caol-le-leathan.txt
Created April 5, 2023 10:16
Focal le ardmhinicíocht a bhriseann 'caol le caol agus leathan le leathan'
aerach
aeráid
aerárthach
aerfort
ainmfhocal
aisghair
aisghairm
aneas
aniar
aníos
This file has been truncated, but you can view the full file.
"[{\"type\":4,\"data\":{\"href\":\"https://stackoverflow.com/questions/54824036/useeffect-hook-with-socket-io-state-is-not-persistent-in-socket-handlers\",\"width\":982,\"height\":624},\"timestamp\":1633131320829},{\"data\":{\"source\":1,\"positions\":[{\"timeOffset\":0,\"x\":85,\"y\":164,\"id\":4912}]},\"timestamp\":1633131321152,\"type\":3},{\"type\":2,\"data\":{\"initialOffset\":{\"left\":0,\"top\":0},\"node\":{\"type\":0,\"childNodes\":[{\"publicId\":\"\",\"systemId\":\"\",\"id\":2,\"type\":1,\"name\":\"html\"},{\"type\":2,\"tagName\":\"html\",\"attributes\":{\"itemscope\":\"\",\"itemtype\":\"https://schema.org/QAPage\",\"class\":\"html__responsive \"},\"childNodes\":[{\"tagName\":\"head\",\"attributes\":{},\"childNodes\":[{\"type\":3,\"textContent\":\"\\n\\n \",\"id\":5},{\"id\":6,\"type\":2,\"tagName\":\"title\",\"attributes\":{},\"childNodes\":[{\"type\":3,\"textContent\":\"reactjs - UseEffect hook with socket.io state is not persistent in socket handlers - Stack Overflow\",\"id\":7}]},{\"textCo
This file has been truncated, but you can view the full file.
[{"type":4,"data":
{"href":"https://stackoverflow.com/questions/54824036/useeffect-hook-with-socket-io-state-is-not-persistent-in-socket-handlers","width":982,"height":624},"timestamp":1633131320829},{"data":
{"source":1,"positions":[{"timeOffset":0,"x":85,"y":164,"id":4912}]},"timestamp":1633131321152,"type":3},{"type":2,"data":
{"initialOffset":
{"left":0,"top":0},"node":
{"type":0,"childNodes":[{"publicId":"","systemId":"","id":2,"type":1,"name":"html"},{"type":2,"tagName":"html","attributes":
{"itemscope":"","itemtype":"https://schema.org/QAPage","class":"html__responsive "},"childNodes":[{"tagName":"head","attributes":
{},"childNodes":[{"type":3,"textContent":"\n\n ","id":5},{"id":6,"type":2,"tagName":"title","attributes":
{},"childNodes":[{"type":3,"textContent":"reactjs - UseEffect hook with socket.io state is not persistent in socket handlers - Stack Overflow","id":7}]},{"textContent":"\n ","id":8,"type":3},{"type":2,"tagName":"link","attributes":
{"href":"https://cdn.sstatic.net/Sites/s
from cssutils import parseStyle
def find_node_by_id(tree, search_id):
recursive_priority = []
for childNode in tree['childNodes']:
if childNode['id'] == search_id:
return childNode
elif 'childNodes' in childNode:
if childNode['id'] < search_id:
var xxxtime = 0;
var xxxcount = 0;
var yyytime = 0;
var yyycount = 0;
var rrwebRecord = (function () {
[...snip...]
if (m.attributeName === 'style') {
osm_gb=# SELECT op, count(*) FROM (
SELECT way, tags->'operator' op FROM planet_osm_polygon WHERE tags->'amenity' = 'university'
UNION
SELECT way, tags->'operator' op from planet_osm_point where tags->'amenity' = 'university') x
WHERE st_dwithin(geography(st_transform(way, 4326)),
geography(st_transform((select way from planet_osm_point
where tags->'place' = 'city' and name = 'Cambridge' limit 1), 4326)), 20000)
GROUP BY op
ORDER BY count(*) DESC;
op | count
<relation id="4007477" version="1" timestamp="2014-09-02T14:28:18Z" changeset="25183275" uid="2185740" user="mprhode">
<member type="way" ref="145078273" role="outer"/>
<member type="way" ref="113970233" role="outer"/>
<tag k="type" v="multipolygon"/>
<tag k="amenity" v="university"/>
<tag k="tourism" v="attraction"/>
</relation>
<way id="113970233" version="12" timestamp="2014-09-02T14:28:18Z" changeset="25183275" uid="2185740" user="mprhode">
<nd ref="2142852432"/>
-- postgresql-9.5-postgis-2.2
create table test (name character varying, p geometry(point, 900913), a geometry(Geometry, 900913));
insert into test values ('a', '010100002031BF0D00713D0AD7F54711C1A4703D1A3D965941', null);
insert into test values ('b', '010100002031BF0D0002FB34FAC62E11C1FAF7FB8141965941', '010300002031BF0D00010000000D0000009A9999998B3211C114AE47F13D965941295C8FC2863211C1A4703D5A569659418FC2F528D33011C1EC51B84E5A9659417B14AE47B62F11C1B81E851B5A965941295C8FC2BC2F11C18FC2F5F85D96594114AE47E10D2C11C1295C8FE26F965941EC51B81EF32B11C1666666D6699659417B14AE47D12C11C1F6285CFF139659418FC2F528BA2F11C1F6285C7F14965941B81E85EBBE2F11C11F85EB01279659415C8FC2F5DB2F11C1D7A3702D2C965941F6285C8F2F3011C15C8FC235309659419A9999998B3211C114AE47F13D965941');
select name, st_contains(ST_CollectionHomogenize(c.g), u.p)
from test u,
(select unnest(st_clusterwithin(coalesce(u2.a, st_expand(u2.p, 350)), 250)) g
from test u2) c order by name;
$ ./osm2pgsql -v -C 20000 --number-processes 4 -s -S ../default.style -U postgres -H localhost -P 5432 -W --hstore-all --hstore-add-index -d osm_gb great-britain-latest.osm
osm2pgsql version 0.91.0-dev (64 bit id space)
Password:
Using built-in tag processing pipeline
Using projection SRS 3857 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads