Skip to content

Instantly share code, notes, and snippets.

View criskell's full-sized avatar

criskell

View GitHub Profile
@torvalds
torvalds / gist:6faadce34c56d53b2d5352da0c3cd093
Last active July 9, 2025 06:32
Not involved with any fishy crypto fishy business
I'm told that there are people claiming to "tokenize" my git repositories with my approval.
I just want to clarify that that is not the case. I do not believe in monetizing my repositories.
If you believe crypto-currencies are anything but a scam, I have a bridge to sell you.
But I'm not selling source code.
@sibelius
sibelius / fintech-problems-roadmap.md
Last active May 24, 2025 18:25
roadmap of problems to solve in a Fintech

Here is a short list of problems to solve in "any" Fintech

  • KYC
  • Ledger
  • Scaling
  • Reliability
  • Latency
  • Security
  • Data Consistency
  • Integration with many external systems
@jgcmarins
jgcmarins / hybridRouter.tsx
Created August 26, 2024 13:56
router abstraction to work on both Next.js Apps and React Apps with react-router-dom
/* eslint-disable react-hooks/rules-of-hooks */
// 24:33 error React Hook "useNextRouter" is called conditionally. React Hooks must be called in the exact same order in every component render react-hooks/rules-of-hooks
// 25:43 error React Hook "useReactRouterNavigate" is called conditionally. React Hooks must be called in the exact same order in every component render react-hooks/rules-of-hooks
// 43:35 error React Hook "useNextPathname" is called conditionally. React Hooks must be called in the exact same order in every component render react-hooks/rules-of-hooks
// 44:37 error React Hook "useReactRouterLocation" is called conditionally. React Hooks must be called in the exact same order in every component render react-hooks/rules-of-hooks
'use client';
import { usePathname as useNextPathname, useRouter as useNextRouter } from 'next/navigation';
import {
@sibelius
sibelius / agile-questions.md
Last active May 19, 2025 19:11
agile-questions
  • do you use feature flags? expand
  • do you use git flow?
  • have you decoupled deploy from release? https://www.honeycomb.io/blog/deploys-wrong-way-change-user-experience
  • do you use sprints?
  • do you have automated tests?
  • do you do refactoring?
  • do you use types (typescript)?
  • how do you manage the project?
  • do you have daily meetings? expand
  • do you have written documentation?

The Problem

Adding inner margins and padding to one component should be avoided. In one screen it may make sense to do this, but as soon as other screen doesn't require that margin, the component becomes incorrect. Do not create new components with inner margins. There are a few ways to undo this. Let's first create an incorrect example:

❌ Wrong

type ProfileCardItemProps = {
  label: string
  value: string
}
@adamgundry
adamgundry / DetectScopedTypeVariables.hs
Created January 26, 2024 18:22
Haskell program to test whether ScopedTypeVariables is enabled
{-# LANGUAGE GHC2021, NoScopedTypeVariables, RequiredTypeArguments, AllowAmbiguousTypes #-}
import Data.Proxy
hasScopedTypeVariables :: Bool
hasScopedTypeVariables = f Char
f :: forall a -> C a => Bool
f a = g @Int
where
@jaygaha
jaygaha / laravel-sanctum-csrf-token.md
Created January 12, 2024 02:57
How to make Laravel Sanctum's XSRF-TOKEN cookie available for each environment [Laravel Sanctum]

While I was working on one of my projects using Laravel Sanctum using SPA Authentication. This project has multiple sub-domains for different environments, like DEV, STG, UAT and is hosted in the same domain, like dev.domain.tld, stg.domain.tld. In the .env file, the SESSION_DOMAIN variable should include a leading dot (.) before the subdomain. This ensures that the session cookie is available to all subdomains. For example:

SESSION_DOMAIN=.domain.tld

Basic authentication flow

  1. Access GET sanctum/csrf-cookie to initialize CSRF protection; it will set the session for the request and XSRF-TOKEN as a cookie in the browser. With this session, it will persist.
  2. After issuing the token, the user can now login to the system.
@Grubba27
Grubba27 / generic-proxy.ts
Created January 3, 2024 19:56
create your own tRPC-like api with JavaScript proxy and a little bit of ts magic
const setProxySettings = (
{
call,
filter,
}: {
call: ({ path, args }: { path: unknown; args: unknown[] }) => any;
filter: (path: string[]) => unknown;
} = {
call: ({ path, args }) => {
return {
@noghartt
noghartt / cc.md
Last active June 9, 2025 18:37
Resources to learn more about Computer Science and related stuffs