Skip to content

Instantly share code, notes, and snippets.

View shikhirsingh's full-sized avatar

Shikhir Singh shikhirsingh

View GitHub Profile
@shikhirsingh
shikhirsingh / API_Design_Best_Practices.md
Last active August 7, 2026 02:10
API Design Best Practices Guide - Inspired by Loopback & Supabase

API Design Best Practices Guide

v11.04 — 2026-08-06

Primary consumers: SPAs (for example React), mobile applications, and LLM/agent clients. The API contract should also convert cleanly into MCP/tool definitions without inventing a second API design.

Scope: API design first — goals, boundaries, routes, parameters, payloads, headers, status codes, errors, discovery, and machine-readable contracts. This is not general implementation, deployment, or authentication-infrastructure guidance. Narrow enforcement notes appear only when they are needed to preserve the prescribed wire contract consistently.


#!/usr/bin/env bash
# find-environment.sh (v6)
# Purpose: Gather system info so an LLM can recommend correct install commands.
# Works on macOS + Linux. Outputs key=value lines grouped by sections.
set -euo pipefail
section(){ echo; echo "===== $1 ====="; }
kv(){ printf "%s = %s\n" "$1" "${2:-}"; }
have(){ command -v "$1" >/dev/null 2>&1; }
one_line(){ tr '\n' ';' | sed 's/;*$//' ; }
#!/bin/bash
# Colors for messages to enhance readability
RED='\033[0;31m' # Red for errors
GREEN='\033[0;32m' # Green for success
YELLOW='\033[1;33m' # Yellow for warnings or usage hints
NC='\033[0m' # No color reset
# Function to check if Docker is running
# This ensures the script doesn't proceed if Docker isn't available
@shikhirsingh
shikhirsingh / Dockerfile
Last active September 7, 2020 00:38
Raspberry Pi Docker Starter
FROM arm64v8/ubuntu:bionic-20200807
RUN \
apt-get update && \
apt-get install -y --no-install-recommends apt-utils && \
apt-get -y install vim && \
apt-get install -y lynx && \
apt-get -y install default-jre && \
apt-get -y install expect
How To Block Websites on Your Mac Using Terminal
1. Open up Terminal
2. In the command line, type in "sudo nano /etc/hosts".
3. When asked, type your admin password.
4. In the screen that will appear, you’ll see the host database for your computer.
5. Using your down arrow, go to the bottom, right under where it says, "127.0.0.1 localhost".
6. Type in "127.0.0.1 hit ‘tab’, then enter facebook.com”.
7. On a new line, type in "127.0.0.1" hit ‘tab’, then enter www.facebook.com"; this is for extra measure.
@shikhirsingh
shikhirsingh / startup.sh
Last active September 5, 2019 02:42
PS1 - bash prompt
export PS1="\[\033[38;5;26m\][\[$(tput sgr0)\]\[\033[38;5;6m\]\w\[$(tput sgr0)\]\[\033[38;5;27m\]]\[$(tput sgr0)\]\[\033[38;5;9m\]\\$\[$(tput sgr0)\]\[\033[38;5;15m\] \[$(tput sgr0)\]"
@shikhirsingh
shikhirsingh / PhoneId-Number-Deact-Addon
Created April 10, 2018 21:25
PhoneId-Number-Deact-Addon
curl --request POST https://rest-ww.telesign.com/v1/phoneid/<complete-phone-number> \\
--header "Content-Type: application/json" \\
--data '{"addons":{"number_deactivation":{}}}' \\
--user "CUSTOMER_ID":"API_KEY"
@shikhirsingh
shikhirsingh / PhoneId-ContactMatch.sh
Last active April 10, 2018 21:21
PhoneId-ContactMatch_addon
curl --request POST https://rest-ww.telesign.com/v1/phoneid/<complete-phone-number> \\
--header "Content-Type: application/json" \\
--data '{"addons":{"contact_match":{"first_name": "User First Name", "last_name":"User Last Name", "address": "123 Main St", "city": "Marina Del Rey"}}}' \\
--user "CUSTOMER_ID":"API_KEY"
@shikhirsingh
shikhirsingh / PhoneId-ContactPlus_addon.sh
Last active April 10, 2018 21:19
PhoneId-ContactPlus_addon
curl --request POST https://rest-ww.telesign.com/v1/phoneid/<complete-number>  \\
--header "Content-Type: application/json" \\
--data '{"addons":{"contact":{"billing_postal_code": "90292"}}}' \\
--user "CUSTOMER_ID":"API_KEY"
curl --request POST https://rest-ww.telesign.com/v1/phoneid/<complete-number> \\
--header "Content-Type: application/json" \\
--data '{"addons":{"contact":{}}}' \\
--user "CUSTOMER_ID":"API_KEY"