Skip to content

Instantly share code, notes, and snippets.

@fabiolimace
fabiolimace / fn_tsid_milli.sql
Last active April 25, 2024 04:23
Function for generating Time Sortable ID with millisecond precision on PostgreSQL
/**
* Returns a Time Sortable ID with millisecond precision.
*
* Time component: 42 bits (2^42 = ~69 years)
*
* Random component: 22 bits (2^22 = 4,194,304)
*
* The time component is the count of milliseconds since 2020-01-01T00:00:00Z.
*
* Tags: tsid ulid snowflake id-generator generator time sortable sort order id
@sindresorhus
sindresorhus / esm-package.md
Last active April 25, 2024 04:20
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@Carlosvva
Carlosvva / Guatemala.json
Last active April 25, 2024 04:13
Objeto Json Departamentos y Municipios de Guatemala
[
{
"title" : "Alta Verapaz",
"mun" : [
"Chahal",
"Chisec",
"Cobán",
"Fray Bartolomé de las Casas",
"Lanquín",
"Panzós",
# Source: https://gist.github.com/fda147804b59fd2a0cbb5fb5deb4d00b
##################################################################
# The Best Performance And Load Testing Tool? k6 By Grafana Labs #
# https://youtu.be/wfanR-Ps-lk #
##################################################################
# Additional Info:
# - k6: https://k6.io
# - Google Cloud Run (GCR) vs Azure Container Instances (ACI) vs AWS ECS with Fargate: https://youtu.be/Jq8MY1ZGjno
@diogox
diogox / hs.lua
Created March 19, 2023 15:27
My Hammerspoon setup
-- Make sure commandline client (/usr/local/bin/hs) is installed
-- and IPC module is running.
require("hs.ipc")
local logger = hs.logger.new("ipc", "info")
local path = "/usr/local"
-- On Macs with Apple chips, install cli in /opt/homebrew/ with Homebrew
-- as /usr/local doesn't seem to be writable.
@bmaupin
bmaupin / free-database-hosting.md
Last active April 25, 2024 04:02
Free database hosting
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@kohya-ss
kohya-ss / gradio_llm.py
Last active April 25, 2024 04:01
gradioでLLMを利用する簡易クライアント
# Apache License 2.0
# 使用法は gist のコメントを見てください
import argparse
from typing import List, Optional, Union, Iterator
from llama_cpp.llama_chat_format import _convert_completion_to_chat, register_chat_completion_handler
import llama_cpp.llama_types as llama_types
from llama_cpp.llama import LogitsProcessorList, LlamaGrammar
from llama_cpp import Llama, llama_chat_format
import gradio as gr
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'