Skip to content

Instantly share code, notes, and snippets.

View Desttro's full-sized avatar

Desttro

  • Czech Republic
View GitHub Profile
@Desttro
Desttro / index.ts
Created February 1, 2025 21:12 — forked from w00kie/index.ts
Cloudflare Worker that bundles R2 objects in a Zip file
import { z } from 'zod';
import { ZipWriter, BlobReader, configure } from '@zip.js/zip.js';
// Without this, we get uncaught error due to Workers runtime bug
// See: https://github.com/gildas-lormeau/zip.js/discussions/514
configure({
useCompressionStream: false,
});
// Payload schema that lists the files to be bundled, their filenames and the archive filename
@Desttro
Desttro / .cursorrules
Created January 25, 2025 17:27 — forked from RobSchilderr/.cursorrules
Tamagui Takeout .cursorrules
# Takeout Cursor Rules
You are an expert in cross-platform development with React Native, Expo, TypeScript, React, PostgreSQL, Tamagui, Expo Router, tRPC, Solito, Supabase, and more. You possess deep knowledge of best practices and performance optimization techniques across these technologies. Our codebase is a shared Turborepo called "Takeout".
• Prompt Context:
1. If the question explicitly mentions any of the tools or technologies listed above or pertains to the Takeout codebase, ensure your answer incorporates best practices relevant to the mentioned technologies.
2. If the question is about frontend/backend without specific mentions, apply general best practices relevant to the context.
3. If the question involves general TypeScript or other unrelated tasks, stick to general best practices.
4. For follow-up questions unrelated to the technologies or content specified in these rules, the rules do not apply. Focus on answering the question without considering the specified best practices unless explicit
@Desttro
Desttro / TamaguiZeego.tsx
Created June 13, 2024 06:32 — forked from nderscore/TamaguiZeego.tsx
Example of how to wrap Zeego's components with Tamagui styles
import { FC } from 'react';
/**
* Utilities to make Typescript happy wrapping Zeego components with Tamagui's
* styled() components. These utils do nothing except assign Typescript types.
*
* Makes the following props optional and of `unknown` type:
* - children
* - key
*
@Desttro
Desttro / gpg_ecc-25519_keygen
Created September 28, 2023 15:24 — forked from SomajitDey/gpg_ecc-25519_keygen
Create ECC (elliptic curve crypto) keys using curve 25519 with/for GPG
#!/usr/bin/env -S gpg --batch --expert --gen-key
# Brief: Generate ECC PGP keys for signing (primary key) & encryption (subkey)
# Run as: chmod +x gpg_ecc-25519_keygen; ./gpg_ecc-25519_keygen
# Ref: https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html
%echo "Generating ECC keys (sign & encr) with no-expiry"
%no-protection
Key-Type: EDDSA
Key-Curve: ed25519
Subkey-Type: ECDH
@Desttro
Desttro / gist:9756906dbb4867c2b1048a0744f6efb3
Created September 28, 2023 12:54 — forked from rtrouton/gist:8016797
createmyguest.sh script, original by nbalonso (https://gist.github.com/nbalonso/5696340)
#!/bin/bash
# Original script by Noel B. Alonso: https://gist.github.com/nbalonso/5696340
#variables
DSCL="/usr/bin/dscl"
SECURITY="/usr/bin/security"
LOGGER="/usr/bin/logger"
# Determine OS version
@Desttro
Desttro / ci-pnpm-install.md
Created July 16, 2023 02:11 — forked from belgattitude/ci-pnpm-install.md
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

@Desttro
Desttro / README.md
Created October 5, 2022 15:12 — forked from babldev/README.md
NextJS Background Task

NextJS Background Task Example

An example of how to add a background task (e.g. a queue consumer) to an existing NextJS project.

Setup

  • Add your background task file
  • Add a new worker-tsconfig.json, specifically specifying "module": "commonjs" and targeting only the worker source files.
  • Add convenience functions for building & running to package.json

Then to build once:

@Desttro
Desttro / iterm2-solarized.md
Created August 7, 2022 11:13 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

import { codes } from './database';
const app = document.querySelector('.app') as HTMLDivElement;
const videoEl = app.querySelector('video');
const canvasEl = app.querySelector('canvas');
const labelsEl = app.querySelector('.labels') as HTMLDivElement;
const ctx = canvasEl.getContext('2d');
interface Window {
BarcodeDetector: any;
@Desttro
Desttro / README.md
Created April 5, 2022 19:23 — forked from 0x77dev/README.md
mercurius-js/mercurius #370