Skip to content

Instantly share code, notes, and snippets.

View sharunkumar's full-sized avatar
💻
Working on new projects

Sharun sharunkumar

💻
Working on new projects
  • Bay Area
  • 20:04 (UTC -07:00)
View GitHub Profile
@sharunkumar
sharunkumar / config.toml
Created June 9, 2024 00:55
Helix Config
theme = "ayu_dark"
[editor]
true-color = true
[editor.statusline]
separator = " "
mode.normal = "🧬"
mode.insert = "📝"
mode.select = "🖍️"
@sharunkumar
sharunkumar / Profile.ps1
Last active February 3, 2024 08:08
PowerShell Profile with Autocomplete and Starship
Set-PSReadLineOption -PredictionSource HistoryAndPlugin -PredictionViewStyle ListView
Set-PSReadlineKeyHandler -Key Tab -Function TabCompleteNext
# Install-Module -Name CompletionPredictor -Repository PSGallery
Import-Module -Name CompletionPredictor
Invoke-Expression (&starship init powershell)
@sharunkumar
sharunkumar / merge-release.sh
Created October 16, 2023 04:28
Merge the latest tag from upstream
merge-release() {
git pull --all
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
git merge $TAG -m "Merge Release $TAG"
}
@sharunkumar
sharunkumar / Prisma.code-snippets
Last active October 11, 2023 00:14
Prisma Snippets
{
"Integer ID": {
"scope": "prisma",
"prefix": "id",
"body": [
"$1_id Int @id @default(autoincrement())",
"$0"
],
"description": "Integer ID"
}
@sharunkumar
sharunkumar / BuggyMouse.ahk
Last active June 15, 2023 20:42
Buggy Mouse Autohotkey Script
; Source: https://superuser.com/questions/207731/configure-debounce-time-in-windows-for-mouse
/*
** Buggy-Mouse.ahk - Fix a buggy mouse. Stop it from double-clicking when you try to single-click.
**
** NOTE: Please use this URL when linking to Buggy Mouse: r.secsrv.net/AutoHotkey/Scripts/Buggy-Mouse
**
** Updated: Thu, Nov 1, 2012 --- 11/1/12, 10:19:19am EDT
** Location: r.secsrv.net/AutoHotkey/Scripts/Buggy-Mouse
**
@sharunkumar
sharunkumar / .bashrc
Last active July 18, 2023 21:31
configurations for my WSL setup
bind TAB:menu-complete
bind "\C-H":shell-backward-kill-word
bind "\e[3;5~":shell-kill-word
@sharunkumar
sharunkumar / Convert-PdfToGif.ps1
Created April 25, 2023 19:18
Convert PDF to GIF
function Convert-PdfToGif($pdfpath) {
$pdf = Get-Item $pdfpath
$name = $pdf.BaseName
pdftoppm -png "$($pdf.FullName)" $name
$pngs = Get-ChildItem "$name-*.png"
$num = [math]::Ceiling([math]::Log10($pngs.Length + 1))
@sharunkumar
sharunkumar / 01Matrix.java
Last active April 5, 2023 18:59
DFS and BFS
// BFS
class Node {
int row;
int col;
int step;
Node(int row, int col, int step) {
this.row = row;
this.col = col;
this.step = step;
class Solution {
public List<List<String>> groupAnagrams(String[] strs) {
if (strs.length == 0) return new ArrayList();
Map<String, List> ans = new HashMap<String, List>();
for (String s : strs) {
char[] ca = s.toCharArray();
Arrays.sort(ca);
String key = String.valueOf(ca);
if (!ans.containsKey(key)) ans.put(key, new ArrayList());
ans.get(key).add(s);
@sharunkumar
sharunkumar / product_except_self.py
Last active March 27, 2023 22:19
238. Product of Array Except Self
# https://leetcode.com/problems/product-of-array-except-self/description/
# Runtime 219 ms Beats 96.61% Memory 21.1 MB Beats 95.12%
class Solution:
def productExceptSelf(self, nums: List[int]) -> List[int]:
zeroes = set()
prod = 1
for i, x in enumerate(nums):