Skip to content

Instantly share code, notes, and snippets.

View tigawanna's full-sized avatar

Dennis kinuthia tigawanna

  • Nairobi Kenya
View GitHub Profile
@cyco130
cyco130 / dploy-nginx.sh
Created April 8, 2024 09:26
Simple deployment manager
# This script also runs on the VPS.
# It handles the bits that require
# root access.
set -e
if [ $(id -u) != 0 ]; then
echo "You're not root"
exit 1
fi
@Cheesetouched
Cheesetouched / useOptimisticUpdate.js
Created September 24, 2023 08:36
Simple hook to perform optimistic updates with react-query
import { useCallback } from "react";
import { useQueryClient } from "@tanstack/react-query";
export default function useOptimisticUpdate() {
const queryClient = useQueryClient();
return useCallback(
async (queryKey, updater) => {
await queryClient.cancelQueries({ queryKey });
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files