Skip to content

Instantly share code, notes, and snippets.

View geekuillaume's full-sized avatar

Guillaume Besson geekuillaume

View GitHub Profile
@geekuillaume
geekuillaume / esphome-lilygot5.yaml
Created January 5, 2022 21:19
Configuration for ESPHome + LilyGo T5 4.7"
esphome:
name: lilygo-t5
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
PID: 2759 (sway)
UID: 1000 (geekuillaume)
GID: 1000 (geekuillaume)
Signal: 7 (BUS)
Timestamp: Sun 2020-04-05 14:53:31 CEST (41min ago)
Command Line: sway -d
Executable: /usr/bin/sway
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
PID: 2847 (sway)
UID: 1000 (geekuillaume)
GID: 1000 (geekuillaume)
Signal: 7 (BUS)
Timestamp: Sun 2020-04-05 14:54:05 CEST (39min ago)
Command Line: sway -d
Executable: /usr/bin/sway
Control Group: /user.slice/user-1000.slice/session-2.scope
Unit: session-2.scope
Slice: user-1000.slice
+------+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+
| id | name | items |
|------+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------|
| 0 | methodologies capacitor | [{"id": 0, "name": "maroon open-source"}, {"id": 1, "name": "matrix Suriname"}, {"id": 2, "name": "e-tailers Kyat"}] |
| 1 | Music workforce | [{"id": 3, "name": "violet SSL"}, {"id": 4, "name": "Beauty European Unit of Account 17(E.U.A.-17)"}, {"id": 5, "name": "vortals Michigan"}] |
| 2 | Concrete Fantastic | [{"id": 6, "name": "Frozen indigo"}, {"id": 7, "name": "wireless Assistant"}, {"id": 8, "name": "ar
SELECT todo_lists.id AS id,
todo_lists.name,
jsonb_agg(to_jsonb(todo_items) - 'todo_list_id') AS items
FROM todo_lists
LEFT JOIN todo_items ON todo_items.todo_list_id = todo_lists.id
GROUP BY todo_lists.id;
[
{
"id": 0,
"name": "List 1",
"items": [{
"id": 0,
"name": "todo 1"
}, {
"id": 1,
"name": "todo 2"
+----------------+-------------------------+----------------+-----------------------------------------------+
| todo_list_id | name | todo_item_id | name |
|----------------+-------------------------+----------------+-----------------------------------------------|
| 0 | methodologies capacitor | 0 | maroon open-source |
| 0 | methodologies capacitor | 1 | matrix Suriname |
| 0 | methodologies capacitor | 2 | e-tailers Kyat |
| 1 | Music workforce | 3 | violet SSL |
| 1 | Music workforce | 4 | Beauty European Unit of Account 17(E.U.A.-17) |
| 1 | Music workforce | 5 | vortals Michigan |
| 2 | Concrete Fantas
@geekuillaume
geekuillaume / classic_join.sql
Created August 3, 2018 12:28
classic_join.sql
SELECT todo_lists.id AS todo_list_id,
todo_lists.name,
todo_items.id AS todo_item_id,
todo_items.name
FROM todo_ LISTS
LEFT JOIN todo_items ON todo_items.todo_list_id = todo_lists.id;
SELECT todo_lists.id AS todo_list_id,
todo_lists.name,
jsonb_agg(to_jsonb(todo_items) - 'todo_list_id') AS items
FROM todo_lists
LEFT JOIN todo_items ON todo_items.todo_list_id = todo_lists.id
GROUP BY todo_lists.id;

Keybase proof

I hereby claim:

  • I am geekuillaume on github.
  • I am geekuillaume (https://keybase.io/geekuillaume) on keybase.
  • I have a public key ASC6AGZsnHDb0zqxARg5-1ct0gMqsy0pmTW44Ywg0Ei7Cgo

To claim this, I am signing this object: