Skip to content

Instantly share code, notes, and snippets.

View HackJack-101's full-sized avatar

Jean "HackJack" HackJack-101

View GitHub Profile
@smellman
smellman / my_postgre.conf
Last active March 18, 2025 21:07
OpenMapTiles 差分アップデート
listen_addresses = '*'
# Tuning at: https://pgtune.leopard.in.ua/
# DB Version: 9.6
# OS Type: linux
# DB Type: dw
# Total Memory (RAM): 16 GB
# CPUs num: 20
# Connections num: 100
# Hard drive type: ssd
@zcaceres
zcaceres / Include-in-Sequelize.md
Last active April 2, 2025 06:07
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query

@fwertz
fwertz / app.js
Created May 23, 2016 20:22
Basic load balancing NodeJS (Nginx + PM2 + Express)
import express from 'express';
// ... So much space for unstable dependency imports ...
let app = express();
// ... Insert your own routing magic ...
export default app;
@ruario
ruario / h264-vivaldi-linux.md
Last active September 17, 2024 01:50
How to enable HTML5 MP4 (H.264/AAC) video in Vivaldi for Linux, via an alternative FFMpeg library
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active April 19, 2025 04:37
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S