Skip to content

Instantly share code, notes, and snippets.

View darekaze's full-sized avatar
☄️
☮️

DaRwin darekaze

☄️
☮️
  • Trust your Intuition
  • Macau
View GitHub Profile
@darekaze
darekaze / repository.ts
Created April 18, 2024 12:22 — forked from cayter/repository.ts
Drizzle ORM Type-Safe Repository With PgTable
import { startSpan } from "@sentry/remix";
import type { StartSpanOptions } from "@sentry/types";
import {
type AnyColumn,
type AnyTable,
type BuildQueryResult,
type DBQueryConfig,
type DrizzleTypeError,
type Equal,
type ExtractTablesWithRelations,
@darekaze
darekaze / on-air.json
Last active February 16, 2021 15:04
Bangumi List example for anifish
{
"year": 2021,
"season": "Winter",
"entries": [
{
"sub": "喵萌奶茶屋",
"title": "奇蛋物語",
"rss": "https://bangumi.moe/rss/search/1080p%20%E7%B9%81%E9%AB%94%20%E5%96%B5%E8%90%8C%E5%A5%B6%E8%8C%B6%E5%B1%8B%20%E5%A5%87%E8%9B%8B%E7%89%A9%E8%AA%9E"
}
]
@darekaze
darekaze / telegram_notify.py
Last active August 11, 2020 10:11
Simple python gist for sending messages to telegram channel
import requests
BOT_API_KEY = '<xxx>'
REGULAR_CH = '<xxx>'
CRITICAL_CH = '<xxx>'
def send_notification(message, critical=False, parse_mode='MarkdownV2'):
"""Run notification and send to tg. Return results"""
urlString = f"https://api.telegram.org/bot{BOT_API_KEY}/sendMessage"
@darekaze
darekaze / mongodb-obj-to-arrobj.js
Last active August 30, 2019 04:48
Mongodb transform object to array of object
// arrOfObj: new array of object
// originalObj: original object that needs transform
// RUN$ env-cmd node index.js
const MongoClient = require('mongodb').MongoClient;
const url = process.env.DB_URL;
MongoClient.connect(
url,
{ useNewUrlParser: true, useUnifiedTopology: true },

Keybase proof

I hereby claim:

  • I am darekaze on github.
  • I am darekaze (https://keybase.io/darekaze) on keybase.
  • I have a public key ASAGXa5zET5r8DMfkS7OzoiHpSGHv-_zggxbk0WUPJdjTQo

To claim this, I am signing this object: