Skip to content

Instantly share code, notes, and snippets.

View peisenmann's full-sized avatar

Patrick peisenmann

View GitHub Profile
@blak3r
blak3r / migration.js
Last active June 2, 2022 15:22
Create a gin gin_trgm_ops index, using a sequelize migration. Once created you can use this sql command to verify the index was created properly: `SELECT * FROM pg_indexes WHERE tablename = 'table_name';`
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.addIndex('Parties', {
fields: [Sequelize.literal('name gin_trgm_ops')], // <-- name = field name, gin_trgm_ops comes after the field name
using: 'gin',
indexName: 'party_name_gin_trgm_idx', // specify the index name manually otherwise sequelize will create party_
unique: false,
})
@nickcernis
nickcernis / docker-cleanup.md
Last active May 14, 2026 10:16
Docker commands to remove all containers and images

docker kill $(docker ps -q) to kill all running containers
docker rm $(docker ps -a -q) to delete all stopped containers.
docker volume rm $(docker volume ls -q) to delete all volumes.
docker rmi $(docker images -q) to delete all images.

Run all commands:

docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -q) && docker rmi $(docker images -q)

For fish shell, remove the $: