Skip to content

Instantly share code, notes, and snippets.

View tdubs42's full-sized avatar
🐘
constantly coding

tdubs tdubs42

🐘
constantly coding
View GitHub Profile
@tdubs42
tdubs42 / default nginx configuration file
Last active February 19, 2024 01:06 — forked from xameeramir/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
@tdubs42
tdubs42 / js-query.js
Created September 23, 2021 14:44 — forked from samsch/js-query.js
Nested Knex query
knex
.select([
'users.*',
knex.raw('json_agg("posts") as posts')
])
.from('users')
.leftJoin(function () {
this.select(['posts.*', knex.raw('json_agg("comments") as comments')])
.from('posts')
.leftJoin('comments', { 'posts.id': 'comments.post' })