Skip to content

Instantly share code, notes, and snippets.

View yduman's full-sized avatar

Yadullah Duman yduman

View GitHub Profile
@yduman
yduman / docker-compose.yml
Last active June 12, 2022 21:09
PostgreSQL docker-compose
version: "3.8"
services:
db:
container_name: my-pg-container
image: postgres
restart: always
ports:
- "5432:5432"
environment:
- POSTGRES_USER=postgres
@yduman
yduman / reusableArraySearchPredicates.js
Created June 6, 2021 21:47
Reusable array search predicates
// CREDIT TO: https://jasonformat.com/reusable-array-search-predicates/
// Given an Array of objects:
const blogPosts = [
{ name:'one', tags:['a', 'b'], published: '2016-10-31' },
{ name:'two', tags:['c'], published: '2019-01-05' },
{ name:'three', tags:['b'], published: '2021-06-06' },
...
];
// Create reusable search predicates using `this`: