Skip to content

Instantly share code, notes, and snippets.

View vinaysshenoy's full-sized avatar

Vinay Shenoy vinaysshenoy

View GitHub Profile
ARG NODE_VERSION
# Typescript build
FROM node:$NODE_VERSION as builder
# Server build
WORKDIR /src
COPY ./src ./src
COPY index.ts ./
COPY tracing.ts ./

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 / 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)
}
kill -9 $(lsof -ti:8080)
@vinaysshenoy
vinaysshenoy / serve.sh
Created October 10, 2023 07:13
Python server
python3 -m http.server 8080
@vinaysshenoy
vinaysshenoy / gist:4c78c82471fbde536b4bf6e2cea0c879
Last active May 2, 2024 06:08
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
# Find files of extension and delete
find . -type f -iname "*.blend" -exec rm {} \;
# Check if repository exists (0: exists)
git -C ./qweebi-unity rev-parse 2>/dev/null; echo $?
@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 / 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 / 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")
}
}