Skip to content

Instantly share code, notes, and snippets.

View 41y08h's full-sized avatar
💫
nullius in verba

Piyush 41y08h

💫
nullius in verba
View GitHub Profile
select posts.id,
title,
(case when count(c) = 0 then cast('[]' as json) else array_to_json(array_agg(c.obj)) end) AS comments
from posts
left join (select post_id, json_build_object('id', id, 'message', message) as obj from comments) c on posts.id = c.post_id
group by posts.id
order by title
@41y08h
41y08h / cssresetextended.css
Created November 25, 2020 11:25
CSS Resets extended
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html,
body,
div,
span,
applet,