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 / 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) {
@tigawanna
tigawanna / readme_o_website.md
Last active January 15, 2024 05:49
How to display your README in your project , how to load markdown string with codeblocks and theme it properly without tailwind overiding the styles

Adding a github readme markdown to website

Add the dependancies

 npm i showdown highlight.js
npm i -D @types/showdown
@tigawanna
tigawanna / marmot-pocketbase.md
Last active October 17, 2025 04:37
setting up marmot and pocketbase on linux with nats-server

Getting started with marmot and pocketbase

This will work with any sqlite db since the only pocketbase specifics are the pb_data/data.db sqlite file in pocketbase

installation


the most reliable source for the latest + other versions would is repo/releases

@tigawanna
tigawanna / pocketbase-nginx.md
Last active September 1, 2024 16:29
How to host pocketbase on linux with ngnix as a reverse proxy

Tips on linux vm hosting of pocketbase

- copy installer to machine

helper script

#!/usr/bin/env bash
# Transfers a file from local to remote
PATH_TO_FILE=$1
IP=$2
USERNAME=$3
@tigawanna
tigawanna / profile.json
Last active September 13, 2022 14:53
working windows terminal settings json with wsl2 ubuntu git and powershell custom profiles with custom wsl starting directories
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command": "paste",
"keys": "ctrl+v"
},
{

how to completely remove MySql from linux

i had to do it after i forgot root password and the reset methods wouldn't work

run sudo su first then run

#!/usr/bin/env bash

service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
@tigawanna
tigawanna / vite_env_vars.md
Created September 5, 2022 15:50
adding vite enviromet variables : firebase api cnofig
  • create a .env file in the root directory
  VITE_apiKey=zahtddfrsfSyCHJYZaDa9s47oP4L7Cc
  VITE_authDomain=firebaseapp.firebaseapp.com
  VITE_databaseURL=https://firebaseapp.firebaseio.com
  VITE_projectId=firebaseapp
  VITE_storageBucket=firebaseapp.appspot.com
  VITE_messagingSenderId=200000020053535353535353535353
 VITE_appId=1:50000000080792:web:6676767676d766d7676sw6
@tigawanna
tigawanna / followUser.md
Created September 3, 2022 10:47
how to follow a user in github graphql with react query

Graphql mutations

using the github graphql api with react-query

we'll use follow and unfollow user mutations it takes in parmeter

input:FollowUserInput|UnfollowUserInput

which has the fields

@tigawanna
tigawanna / github-graphql-api.md
Created September 3, 2022 08:46
working with Github's Graphql api

working with Github's Graphql api

After working with the github rest api and experiencing some of it's limitations it's time to pick things up a bit and dive into their Graphql api

as Usual first things first we set up a tesing enviroment and github provides their own explorer which will setup the authentication headers for you under the hood , but if you prefer to use another gql explorer , just set it up like below Replace ghp_LBgN6pCeWsHcxeoJpR4ZTwUj with your personal access token

Image description

I have another article i made about react-query tips an tricks which might help explain that part . becau