Skip to content

Instantly share code, notes, and snippets.

View yungwarlock's full-sized avatar

Damian yungwarlock

View GitHub Profile
@enoonan
enoonan / Dockerfile
Last active June 23, 2025 08:04
pgvector Dockerfile which I'm using on Fly.io
FROM flyio/postgres-flex:17.2
# Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
curl \
postgresql-server-dev-all
# Set the pgvector version
@cameronrohani
cameronrohani / flytheme.css
Created February 1, 2024 20:43
Basic theme for fly machines API
/* basic theme */
.light-mode {
--theme-color-1: rgb(35 23 74);
--theme-color-2: rgb(76, 78, 103);
--theme-color-3: rgb(103, 107, 137);
--theme-color-accent: #845EEE;
--theme-background-1: #fff;
--theme-background-2: rgb(249, 249, 251);
--theme-background-3: rgb(241 242 249);
@yungwarlock
yungwarlock / main.dart
Last active September 4, 2023 13:26
SchedulerBinding
import 'package:flutter/material.dart';
import "package:flutter/scheduler.dart";
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@yungwarlock
yungwarlock / main.dart
Last active June 26, 2023 14:24
Dart Timer
import 'dart:async';
void main() {
int countDown = 60;
bool shouldShowResend = false;
Timer.periodic(const Duration(seconds: 1), (t) {
print(formatTime(countDown));
print(shouldShowResend);
});
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active June 20, 2025 08:50
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@decoupca
decoupca / thread_progress.py
Created August 10, 2022 15:44
Run a task in parallel with progress - ThreadPoolExecutor with TQDM
from typing import Callable, Iterable, Dict, List
from concurrent.futures import ThreadPoolExecutor
from tqdm import tqdm
def thread_progress(
worker: Callable,
items: Iterable,
threads: int = None,
result_handler: Callable = None,
worker_kwargs: Dict = None,
@asehmi
asehmi / stqdm-demo.py
Last active October 14, 2024 06:38
STqdm: A tqdm-like progress bar for Streamlit
# UPDATED: 5-MAY-2023
from multiprocessing import Pool, freeze_support
from time import sleep
import streamlit as st
# https://discuss.streamlit.io/t/stqdm-a-tqdm-like-progress-bar-for-streamlit/10097
# pip install stqdm
from stqdm import stqdm
@atrauzzi
atrauzzi / google-cloud-run-get-project-hash.sh
Last active May 25, 2023 00:41
Google Cloud Run Get Project Hash
#!/bin/bash
PROJECT=${1:-"$(gcloud config get-value project)"}
REGION=${2:-"us-central1"}
IMAGE="hub.docker.com/_/nginx"
{
gcloud services enable "run.googleapis.com" --project="${PROJECT}"
gcloud auth configure-docker --quiet
@yellow1912
yellow1912 / nginx.toml
Last active May 29, 2025 09:03
Sample Vector configuration for nginx
# be careful, you will gets tons of logs
# you may want to skip access logs or use sampling only here
[sources.nginx_access_logs]
type = "file"
include = ["/var/log/sites/*/*/*/*/nginx/access.log"] # supports globbing
ignore_older = 86400 # 1 day
# I'm configuring my nginx to use json logs, if you use another logging format you need to change this
[transforms.nginx_access_logs_json]
type = "json_parser"
@coryodaniel
coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
adexchangeseller.googleapis.com Ad Exchange Seller API
adexperiencereport.googleapis.com Ad Experience Report API