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 / 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 / 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 / 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 / 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 / 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 / InputText.vue
Created May 8, 2020 10:40
Vue transparent wrapper template
<template>
<div>
<label>{{ label }}</label>
<input
v-on="listeners"
v-bind="$attrs"
/>
</div>
</template>
{"LION":{"latency":183.540149,"download":18.95268006495637,"upload":13.125318661571571,"timestamp":"2023-08-11T12:09:08.312074035+04:00"},"MARS":{"latency":0,"download":0,"upload":0,"timestamp":"2023-08-11T12:09:08.495608854+04:00"},"METISS":{"latency":0,"download":0,"upload":0,"timestamp":"2023-08-11T12:09:08.541537373+04:00"},"SAFE1":{"latency":0,"download":0,"upload":0,"timestamp":"2023-08-11T12:09:08.358202271+04:00"},"SAFE2":{"latency":0,"download":0,"upload":0,"timestamp":"2023-08-11T12:09:08.404005203+04:00"},"SAFE3":{"latency":0,"download":0,"upload":0,"timestamp":"2023-08-11T12:09:08.449744506+04:00"}}
@MrSunshyne
MrSunshyne / affected-countries.js
Last active March 12, 2020 12:21
Array of affected countries from CDC website
// Open the developer toosl console and execute the folowing command to get an array of countries listed on the page.
// Right click and copy object for convenience.
// For use on this page: https://www.cdc.gov/coronavirus/2019-ncov/locations-confirmed-cases.html
let nodes = document.querySelectorAll(".syndicate li");
let list = [].slice.call(nodes);
let innertext = list.map(function(e) { return e.innerText; });
console.log(innertext);
@MrSunshyne
MrSunshyne / countries.js
Created March 12, 2020 08:30
Countries
const countries = [
"Afghanistan",
"Austria",
"Azerbaijan",
"Bahamas",
"Bahrain",
"Bangladesh",
"Barbados",
"Belarus",
"Belgium",
Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
CPU Family: 0x6