Skip to content

Instantly share code, notes, and snippets.

View L-U-C-K-Y's full-sized avatar

Lucky L-U-C-K-Y

  • JobDone
  • Zürich, Switzerland
View GitHub Profile
@belgattitude
belgattitude / ci-pnpm-install.md
Last active November 1, 2024 19:25
Composite github action to improve CI time with pnpm

Why

Although @setup/node as a built-in cache option, it lacks an opportunity regarding cache persistence. Depending on usage, the action below might give you faster installs and potentially reduce carbon emissions (♻️🌳❤️).

Requirements

pnpm v7 or v8 (not using pnpm ? see the corresponding yarn action gist)

Bench

@belgattitude
belgattitude / ci-yarn-install.md
Last active November 5, 2024 08:32
Composite github action to improve CI time with yarn 3+ / node-modules linker.
@evalphobia
evalphobia / README.md
Last active December 19, 2022 04:15
Golang Benchmark: uuid(v4) vs cuid vs nanoid

Golang Benchmark: uuid(v4) vs cuid vs nanoid

Comparing these libraries

  • github.com/google/uuid
  • github.com/lucsky/cuid
  • github.com/matoous/go-nanoid

result

@tumainimosha
tumainimosha / page-info.ts
Last active September 18, 2024 08:18
NestJS Graphql Cursor Based pagination
import { ObjectType, Field } from "@nestjs/graphql";
@ObjectType()
export class PageInfo {
@Field({ nullable: true })
startCursor: string;
@Field({ nullable: true })
endCursor: string;
@SamuelDavis
SamuelDavis / wordpress-traefik-compose.yml
Last active December 6, 2021 11:51
WordPress With HTTPS Example
version: '3'
networks:
reverse-proxy: {}
wp-test: {}
volumes:
wp-test-db: {}
services:
@XieJiSS
XieJiSS / emoji-strip-browser.js
Last active February 27, 2023 21:40
To strip all emoji(s) from texts.
// generated with emoji-strip-node.js
// ref https://unicode.org/Public/emoji/12.1/emoji-data.txt
const emojiRegex = /©|®|‼|⁉|™|ℹ|[↔-↙]|↩|↪|⌚|⌛|⌨|⏏|[⏩-⏳]|[⏸-⏺]|Ⓜ|▪|▫|▶|◀|[◻-◾]|[☀-☄]|☎|☑|☔|☕|☘|☝|☠|☢|☣|☦|☪|☮|☯|[☸-☺]|♀|♂|[♈-♓]|♟|♠|♣|♥|♦|♨|♻|♾|♿|[⚒-⚔]|⚕|⚖|⚗|⚙|⚛|⚜|⚠|⚡|⚪|⚫|⚰|⚱|⚽|⚾|⛄|⛅|⛈|⛎|⛏|⛑|⛓|⛔|⛩|⛪|[⛰-⛵]|[⛷-⛺]|⛽|✂|✅|[✈-✍]|✏|✒|✔|✖|✝|✡|✨|✳|✴|❄|❇|❌|❎|[❓-❕]|❗|❣|❤|[➕-➗]|➡|➰|➿|⤴|⤵|[⬅-⬇]|⬛|⬜|⭐|⭕|〰|〽|㊗|㊙|\u{1F004}|\u{1F0CF}|\u{1F170}|\u{1F171}|\u{1F17E}|\u{1F17F}|\u{1F18E}|[\u{1F191}-\u{1F19A}]|[\u{1F1E6}-\u{1F1FF}]|\u{1F201}|\u{1F202}|\u{1F21A}|\u{1F22F}|[\u{1F232}-\u{1F23A}]|\u{1F250}|\u{1F251}|[\u{1F300}-\u{1F321}]|[\u{1F324}-\u{1F393}]|\u{1F396}|\u{1F397}|[\u{1F399}-\u{1F39B}]|[\u{1F39E}-\u{1F3F0}]|[\u{1F3F3}-\u{1F3F5}]|[\u{1F3F7}-\u{1F4FD}]|[\u{1F4FF}-\u{1F53D}]|[\u{1F549}-\u{1F54E}]|[\u{1F550}-\u{1F567}]|\u{1F56F}|\u{1F570}|[\u{1F573}-\u{1F579}]|\u{1F57A}|\u{1F587}|[\u{1F58A}-\u{1F58D}]|\u{1F590}|\u{1F595}|\u{1F596}|\u{1F5A4}|\u{1F5A5}|\u{1F5A8}|\u{1F5B1}|\u{1F5B2}|\u{1F5BC}|[\u{1F5C2}-\u{1F5C4}]|[\u{1F5D1}-\u{1F5D
@webdeb
webdeb / Hasura Keycloak.md
Last active October 29, 2022 19:03
Basic Keycloak Script Mapper to provide Hasura claims

Steps to provide Hasura Claims in Keycloak generated JWT

  1. Create your realm / client
  2. Inside client configuration go to "Mappers"
  3. Click on "Create"
  4. Name it "hasura"
  5. Choose Mapper Type "Script Mapper"
  6. Add following script to demonstrate how it works
@notakaos
notakaos / create_function_plv8_cuid.sql
Last active August 16, 2024 10:10
cuid for PostgreSQL with PL/v8
-- original code: https://github.com/ericelliott/cuid
-- Add the "plv8" extension
create extension if not exists "plv8";
-- Add the "pgcrypto" extension
create extension if not exists "pgcrypto";
\dx
-- Connect a database
@alexanderkjeldaas
alexanderkjeldaas / setup-k3s-on-hetzner.sh
Last active January 10, 2024 19:07
Setup k3s on Hetzner with CSI drivers
#!/bin/bash
LOCATION=${HCLOUD_LOCATION:-nbg1-dc3}
if [ -z "$HCLOUD_TOKEN" ]; then
echo "You need to set HCLOUD_TOKEN to an Hetzner API token!";
exit 1
fi
if [ -z "$SSH_KEY" ]; then
@donaldpipowitch
donaldpipowitch / README.md
Last active September 30, 2024 19:39
Use GitLab Pages to deploy a Storybook per branch

It's quite straightforward to use GitLab Pages to deploy a Storybook instance per branch (and remove it whenever the branch will be removed). And yeah, it's irony to document this in a GitHub Gist 😅

You just need a .gitlab-ci.yml like this one:

stages:
  - setup
  - build-and-test
  - deployment
  - pages