Skip to content

Instantly share code, notes, and snippets.

@boxabirds
boxabirds / .cursorrules
Last active October 29, 2025 23:48
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@bnlokash
bnlokash / biometrics-provider.tsx
Last active June 26, 2024 11:22
React Native Biometrics Hook
import React, { createContext, useState, useEffect, FC, useContext } from 'react'
import Keychain from 'react-native-keychain'
import AsyncStorage from '@react-native-async-storage/async-storage'
interface IBiometricsContext {
isBiometricsSupported: boolean
isBiometricsEnabled: boolean
isBiometricsLoading: boolean
biometricsType: Keychain.BIOMETRY_TYPE | null
enableBiometrics: (username: string; password: string) => Promise<void>
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active October 15, 2025 21:47
Xcode KeyBindings as VSCode
@JamieCurnow
JamieCurnow / firestore.ts
Last active September 30, 2025 14:14
Using Firestore with Typescript
/**
* This Gist is part of a medium article - read here:
* https://jamiecurnow.medium.com/using-firestore-with-typescript-65bd2a602945
*/
// import firstore (obviously)
import { firestore } from "firebase-admin"
// Import or define your types
// import { YourType } from '~/@types'
@dinvlad
dinvlad / retries.ts
Last active February 2, 2024 16:18
Retries with exponential backoff and jitter for idempotent background Google Cloud Functions
// one can also use Google Cloud Firestore library,
// with a slight change in semantics
import { firestore } from 'firebase-admin';
import { EventContext, runWith } from 'firebase-functions';
import { promisify } from 'util';
const eventCollection = 'function-events';
enum EventStatus {
RUNNING = 'running',