I hereby claim:
- I am fphilipe on github.
- I am philipe (https://keybase.io/philipe) on keybase.
- I have a public key whose fingerprint is A081 196B 4236 5343 20B2 19EE F6F2 3962 F744 18A0
To claim this, I am signing this object:
-- Create users table with username as PK. | |
CREATE TABLE users_no_id (username varchar primary key, age int); | |
-- Create posts table with reference to users table using its PK and index on the reference. | |
CREATE TABLE posts_no_id (id serial primary key, username varchar references users_no_id (username), body text); | |
CREATE INDEX ON posts_no_id (username); | |
-- Create 1000000 users: | |
INSERT INTO users_no_id (username, age) SELECT substring(md5(random()::text) || md5(random()::text), (random()*32)::int, 16 + (random()*16)::int), 18 + (random()*70)::int FROM generate_series(1, 1000000); | |
-- Create 200000 posts for random users (multiple queries so users can have mutliple posts). | |
INSERT INTO posts_no_id (username, body) SELECT username, md5(random()::text) || md5(random()::text) FROM users_no_id ORDER BY random() LIMIT 25000; | |
INSERT INTO posts_no_id (username, body) SELECT username, md5(random()::text) || md5(random()::text) FROM users_no_id ORDER BY random() LIMIT 25000; |
Calculating ------------------------------------- | |
on_server_error :notify_honeybadger | |
90.832k i/100ms | |
on_server_error &Honeybadger.method(:notify) | |
96.540k i/100ms | |
on_server_error { |e| Honeybadger.notify(e) } | |
90.455k i/100ms | |
------------------------------------------------- | |
on_server_error :notify_honeybadger | |
2.007M (± 7.9%) i/s - 9.992M |
I hereby claim:
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Scroll Snap & Backdrop Filter</title> | |
<meta content='width=device-width, initial-scale=1.0' name='viewport' /> | |
<style> | |
body { | |
margin: 0; | |
padding-top: 10vh; |
A simple one-liner that results in this:
|-------------------------------+-------------+-------------------------|
| Badi | Wassertemp. | Öffnungszeit |
|-------------------------------+-------------+-------------------------|
| Flussbad Au-Höngg | 17 | geschlossen |
| Flussbad Oberer Letten | 16 | geschlossen |
CREATE EXTENSION btree_gist; | |
CREATE TABLE room_reservations ( | |
room_id integer, | |
reserved_at timestamptz, | |
reserved_until timestamptz, | |
canceled boolean DEFAULT false, | |
EXCLUDE USING gist ( | |
room_id WITH =, tstzrange(reserved_at, reserved_until) WITH && | |
) WHERE (not canceled) |
dropdb --if-exists postgis_test_1 | |
dropdb --if-exists postgis_test_2 | |
createdb postgis_test_1 | |
createdb postgis_test_2 | |
# Set up DB 1: | |
cat <<SQL | psql postgis_test_1 | |
CREATE EXTENSION postgis; | |
CREATE VIEW test_geometry AS | |
SELECT ST_Distance( |
The Voronoi tesselation shows the closest point on the plane for a given set of points. This example updates the Voronoi diagram in response to mouse interaction! Colors by Cynthia Brewer; algorithm by Steven Fortune; implementation based on work by Nicolas Garcia Belmonte; interaction inspired by Raymond Hill.