Skip to content

Instantly share code, notes, and snippets.

View productdevbook's full-sized avatar
🖥️
Learning

Wind productdevbook

🖥️
Learning
View GitHub Profile
@fabiolimace
fabiolimace / UUIDv6.sql
Last active April 2, 2025 00:39
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023-2024 Fabio Lima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@garethrees
garethrees / format.sh
Created April 28, 2020 15:32
Format USB drive from the command line macOS
diskutil list
diskutil unmountDisk /dev/disk2
diskutil eraseDisk FAT32 SANDISK /dev/disk2
@kjmph
kjmph / A_UUID_v7_for_Postgres.sql
Last active April 23, 2025 13:45
Postgres PL/pgSQL function for UUID v7 and a bonus custom UUID v8 to support microsecond precision as well. Read more here: https://datatracker.ietf.org/doc/rfc9562/
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/
create or replace function uuid_generate_v7()
returns uuid
as $$
begin
-- use random v4 uuid as starting point (which has the same variant we need)
-- then overlay timestamp
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string
return encode(
@web-padawan
web-padawan / index.js
Created October 17, 2021 12:31
GitHub dependents
#!/usr/bin/env node
const cliProgress = require('cli-progress');
const gh = require('github-url-to-object');
const meow = require('meow');
const puppeteer = require('puppeteer');
const usage = `Usage
$ github-dependents <repository>
npm init vue@3
if [ $? -eq 0 ]; then
LAST_FOLDER=$(ls -td ./* | head -1)
cd $LAST_FOLDER
yarn
code .
else
echo "Project creation unsuccessful 😔"
fi
@pcgeek86
pcgeek86 / paas_list.md
Last active March 8, 2025 04:34
Heroku Platform as a Service (PaaS) Alternatives with Docker Container Hosting

Open Source

  • Porter - Kubernetes powered PaaS that runs in your own cloud
  • Open Function - cloud-native open-source FaaS (Function as a Service) platform. website
  • CapRover - easy to use app/database deployment & web server manager
  • Tsuru - Open source and extensible Platform as a Service (PaaS) website
  • Kubero - free and self-hosted Heroku PaaS alternative for Kubernetes that implements GitOps
  • Dokku - docker-powered PaaS that helps you build and manage the lifecycle of applications
  • Piku - tiniest PaaS you've ever seen. Allows you to do git push deployments to your own servers.
@KristofferEriksson
KristofferEriksson / useLocation.ts
Created February 11, 2024 16:44
A React Typescript hook that provides real-time geolocation data, complete with heading and speed metrics
import { useEffect, useState } from "react";
interface LocationOptions {
enableHighAccuracy?: boolean;
timeout?: number;
maximumAge?: number;
}
interface LocationState {
coords: {
@danhollick
danhollick / tailwind-css-v4.mdc
Last active April 21, 2025 07:51
Cursor rules file for Tailwind CSS v4.0
// Update globs depending on your framework
---
name: tailwind_v4
description: Guide for using Tailwind CSS v4 instead of v3.x
globs: ["**/*.{js,ts,jsx,tsx,mdx,css}"]
tags:
- tailwind
- css
---
@fayazara
fayazara / aliases.sh
Last active March 12, 2025 08:47
My bash aliases - Not sure if these work on Linux/Windows
# Node.js project shortcuts (requires 'ni' package manager - https://github.com/antfu-collective/ni)
alias d="nr dev" # npm/pnpm/yarn run dev
alias s="nr start" # npm/pnpm/yarn run start
alias i="ni" # Install dependencies
alias u="nun" # Uninstall a a package
alias up="nlx taze" # Update dependencies to latest versions
# Open Cursor app
alias c="open $1 -a \"Cursor\""