Skip to content

Instantly share code, notes, and snippets.

View trangcongthanh's full-sized avatar
👀
Bug Breeder

Thành Trang trangcongthanh

👀
Bug Breeder
View GitHub Profile
@trangcongthanh
trangcongthanh / create-query-options.ts
Created February 24, 2026 15:54
Create Query Options
import type {
DataTag,
QueryFunction,
QueryFunctionContext,
} from '@tanstack/react-query'
const PRIMARY_KEY = 'queryKey' as const
type Config = (...args: any) => {
queryKey: any
@trangcongthanh
trangcongthanh / compose.yaml
Created October 29, 2024 07:44
Moodle Postgres Docker Compose
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: moodle
volumes:
- postgres_data:/data/postgresql
ports:
- 5432:5432
@trangcongthanh
trangcongthanh / .kt
Created May 20, 2020 10:40 — forked from titoaesj/.kt
Android convert int to dp
OBS: O var_number_int é a varável que recebera o valor a ser convertido em DP
(int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, var_number_int, getResources().getDisplayMetrics())
##KOTLIN
val Int.dp: Int
get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt()
val Float.dp: Int