Skip to content

Instantly share code, notes, and snippets.

View tigawanna's full-sized avatar

Dennis kinuthia tigawanna

  • Nairobi Kenya
View GitHub Profile
@tigawanna
tigawanna / typesafe_meta_and_keys.md
Created July 17, 2025 08:13
Tanstack query client setup with typed keys and meta options , The meta : {invalidates} is setup to invalidate all queries with that key prefix
import { MutationCache, QueryClient } from "@tanstack/react-query";


export const queryKeyPrefixes = {
  viewer: "viewer",
  auth: "auth",
} as const
@tigawanna
tigawanna / android_studio_for_react_native.md
Created July 15, 2025 12:33
Setting Up Android Studio on Linux for React Native (Expo) Development

Setting Up Android Studio on Linux for React Native (Expo) Development

This comprehensive guide will walk you through installing and configuring Android Studio on Linux specifically for React Native and Expo development. By the end of this guide, you'll have a fully functional development environment optimized for mobile app development.

Table of Contents

  1. Prerequisites
  2. Installing Android Studio
  3. Initial Android Studio Configuration
  4. React Native/Expo Specific Setup
  5. Environment Variables Configuration
@tigawanna
tigawanna / drizzle_query_logger.md
Last active December 24, 2024 17:45
custom drizzle logger with pretty printing for queries
export function formatSqlQuery(query: string): string {
  const keywords = [
    "SELECT",
    "FROM",
    "WHERE",
    "LEFT JOIN",
    "RIGHT JOIN",
    "INNER JOIN",
    "OUTER JOIN",
@tigawanna
tigawanna / Recursive_typescript_types.md
Last active October 21, 2024 13:46
Recursive typescript types

Recursive type helpers

inspired by the typed pocketbase library

type Join<K, P> = K extends string | number
  ? P extends string | number
    ? `${K}${"" extends P ? "" : "."}${P}`
@tigawanna
tigawanna / windows_powershell_aliases.md
Created May 29, 2024 14:54
How to add aliases in windows powershell

In this example we'll alias pp to pnpm

  • check powerchell profile location
 echo $profile

Note

powershell <7 is usually on : C:\Users\denni\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 powershell 7+ is usually on : C:\Users\denni\OneDrive\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

@tigawanna
tigawanna / simple_vlsx.md
Created January 15, 2024 05:16
simple vlsx (airbnb) visualisation
"use client";
import { SiSolid } from "react-icons/si";
import { FaReact } from "react-icons/fa";
import { SiSvelte } from "react-icons/si";
import { FaVuejs } from "react-icons/fa";
import { SiDeno } from "react-icons/si";
import { SiRemix } from "react-icons/si";
import { TbBrandNextjs } from "react-icons/tb";
import { SiNuxtdotjs } from "react-icons/si";
@tigawanna
tigawanna / vlsx_visulize.md
Created January 15, 2024 03:25
Visualizing react list items with vlsx from airbnb

Visualize most Used Libraries

i had a list of top libraries i use and listing them in a ul didn't look appealing enought , luckily i hda seen the tanstack website and their sponsors section wher they had this coool visualization of circles that vary in sizebased on how big a contributor they are..

We'll be using vlsx by the people at Airbnb

npm i @visx/hierarchy @visx/responsive 
@tigawanna
tigawanna / contact_me_form_server_actions.md
Created January 14, 2024 15:20
contact me form server actions in nextjs with nodemailer

Adding a contact me form using server actions and nodemailer

Now that we've shown the viewre all about us , lets give them a way to reach us

Since we're using NextJs lets use some server actions to send them an email when someone submits that form

Lets create the server action

"use server";
@tigawanna
tigawanna / github_javascript_stack.md
Created January 14, 2024 14:25
Aggregate a repos package json to determine their javascript stack
// deno-lint-ignore-file no-explicit-any ban-ts-comment

import { logError } from "../helpers.ts";
import { getViewerRepos, LanguageEdge } from "./getViewerRepos.ts";

export function pkgTypeCondition(pkg: RequiredDecodedPackageJson): {
  pkg_type: TPkgType;
  condition: boolean;
} {
@tigawanna
tigawanna / fetch_all_viewer_repos.md
Created January 14, 2024 14:21
Recursively fetch all github repositories and it's langauges

code to fetch the viewer's repos

export async function getViewerRepos(
  viewer_token: string,
  cursor: string | null = null,
): Promise<{ data: ViewerRepos | null; error: BadDataGitHubError | null }> {

  const query = `
    query($first: Int!,$after: String) {