Skip to content

Instantly share code, notes, and snippets.

View vinaysshenoy's full-sized avatar

Vinay Shenoy vinaysshenoy

View GitHub Profile

Create zip on macos without the hidden directories (for elasticbeanstalk)

zip -rX v0.49.4.zip . -x '**/.DS_Store' -x '.DS_Store'
unzip -v v0.49.4.zip
@vinaysshenoy
vinaysshenoy / Git commands.md
Last active March 27, 2024 03:32
Useful git commands
  1. Delete all local git branches except current
git branch --list | grep -v "^* $(git branch --show-current)$" | xargs git branch -D 
  1. Clean up GIT repository
git reflog expire --expire=now
git prune
git lfs prune
@vinaysshenoy
vinaysshenoy / gamebar.ps1
Created February 17, 2024 05:09
Disable gamebar completel;y
Get-AppxPackage Microsoft.XboxGamingOverlay | Remove-AppxPackage
reg add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR /f /t REG_DWORD /v "AppCaptureEnabled" /d 0
reg add HKEY_CURRENT_USER\System\GameConfigStore /f /t REG_DWORD /v "GameDVR_Enabled"
@vinaysshenoy
vinaysshenoy / resettablePostgreSQLContainer.ts
Last active December 24, 2023 08:21
PostgreSQL Testcontainer that allows restting the database without dropping the schema in between test runs
import { PostgreSqlContainer, StartedPostgreSqlContainer } from "@testcontainers/postgresql"
class ResettablePostgreSqlContainer extends PostgreSqlContainer {
private dumpSaveDirectory: string = ""
override async start(): Promise<StartedResettablePostgreSqlContainer> {
const container = await super.start()
return new StartedResettablePostgreSqlContainer(this.dumpSaveDirectory, container)
}
@vinaysshenoy
vinaysshenoy / gist:4c78c82471fbde536b4bf6e2cea0c879
Last active December 21, 2023 03:31
Useful macos shell commands
# Find files matching a pattern and then copy to directory
find . -maxdepth 1 -type f -iname "*s.bmp" | xargs -I _ cp _ ./S
# Check if repository exists (0: exists)
git -C ./qweebi-unity rev-parse 2>/dev/null; echo $?
kill -9 $(lsof -ti:8080)
@vinaysshenoy
vinaysshenoy / bootstrap.sh
Last active November 1, 2023 07:03
Bootstrap file to setup a new account on macOS (10.15+)
#!/bin/zsh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install jenv
brew install nvm
mkdir ~/.nvm
brew cask install gpg-suite
brew tap AdoptOpenJDK/openjdk
@vinaysshenoy
vinaysshenoy / serve.sh
Created October 10, 2023 07:13
Python server
python3 -m http.server 8080
@vinaysshenoy
vinaysshenoy / rule.txt
Last active September 9, 2023 01:12
Remove reddit mobile web popup
! https://www.reddit.com/r/uBlockOrigin/comments/yrtr3r/comment/j0v3gac/
! Reddit app ad
www.reddit.com##.XPromoPopupRpl
www.reddit.com##xpromo-new-app-selector
www.reddit.com##.bottom-bar, .XPromoBottomBar
www.reddit.com##.useApp,.TopNav__promoButton
www.reddit.com##body:style(pointer-events:auto!important;)
@vinaysshenoy
vinaysshenoy / build.gradle.kts
Created June 2, 2023 06:34
Enable test logging for Kotlin projects
tasks.test {
useJUnitPlatform()
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events("skipped", "failed", "passed")
}
}