Skip to content

Instantly share code, notes, and snippets.

View MrSunshyne's full-sized avatar
🇲🇺
productivity mode engaged

Sandeep Ramgolam MrSunshyne

🇲🇺
productivity mode engaged
View GitHub Profile
@MrSunshyne
MrSunshyne / Makefile
Created May 28, 2020 15:38
Directus Operations
#!make
include .env
export $(shell sed 's/=.*//' .env)
build:
@echo "hi ${SOURCE_DATABASE_NAME}"
export:
@(docker exec -i ${SOURCE_CONTAINER_ID} mysqldump -u ${SOURCE_DATABASE_USERNAME} -p${SOURCE_DATABASE_PASSWORD} ${SOURCE_DATABASE_NAME}) > ../directusdb/dump.sql
@MrSunshyne
MrSunshyne / Default (Linux).sublime-keymap
Created January 14, 2021 06:39
Sublime Text 3 User keymaps to have VS Code Keybindings
[
{ "keys": ["ctrl+shift+l"], "command": "find_all_under" },
{ "keys": ["ctrl+f2"], "command": "find_all_under" },
{ "keys": ["alt+shift+i"], "command": "split_selection_into_lines" },
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+shift+b"], "command": "build" },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+shift+up"], "command": "select_lines", "args": {"forward": false} },
{ "keys": ["ctrl+shift+down"], "command": "select_lines", "args": {"forward": true} },
@MrSunshyne
MrSunshyne / useGoogleSheet.ts
Last active December 26, 2021 09:57
A Vue3 Composable to get Google Sheet Data.
/*
//INPUT
API_KEY
SHEET_ID
SHEET_NAME(optional)
// Returns
headers
items(formatter as { header: value }
@MrSunshyne
MrSunshyne / Global Pre Commit
Created October 2, 2023 07:37
Use a global pre-commit to prevent committing tracked files
mkdir ~/global-git-hooks
code ~/global-git-hooks/pre-commit
chmod +x ~/global-git-hooks/pre-commit
git config --global core.hooksPath ~/global-git-hooks
@MrSunshyne
MrSunshyne / keymap.json
Created March 5, 2024 12:28
Zed keymap for missing VSCode key bindings
[
{
"context": "Editor",
"bindings": {
"alt-up": "editor::MoveLineUp",
"alt-down": "editor::MoveLineDown",
"alt-shift-down": "editor::DuplicateLine",
"alt-shift-up": ["workspace::SendKeystrokes", "alt-shift-down up"],
"cmd-shift-k": "editor::DeleteLine"
}
@MrSunshyne
MrSunshyne / pre-commit
Created September 11, 2024 07:27
Pre-commit hook that prevents you from accidentally git comitting as a different user
#!/bin/bash
# Setup
# touch ~/.git/hooks/pre-commit
# chmod +x ~/.git/hooks/pre-commit
# git config --global core.hooksPath ~/.git/hooks
# Get the current user email
user_email=$(git config --global user.email)
user_email=$(git config --global user.email)
@MrSunshyne
MrSunshyne / worktree-helper.sh
Created February 28, 2025 11:05
A helper for using worktrees in any repo
# Make sure the repo is cloned with --bare
# Guide: https://nicknisi.com/posts/git-worktrees/
# Paste the following in your .zshrc
alias newtree='new-worktree'
new-worktree() {
local branch_name="$1"
local repo_dir="PATH TO YOUR REPO"
local worktree_dir="$repo_dir/$branch_name"