Skip to content

Instantly share code, notes, and snippets.

View vinaysshenoy's full-sized avatar

Vinay Shenoy vinaysshenoy

  • https://www.qweebi.com
  • Bangalore, India
View GitHub Profile
@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")
}
}
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Vinay Shenoy",
"label": "Engineering Lead at Qweebi",
"email": "[email protected]",
"url": "",
"summary": "Software Engineer with 10+ years of experience, specializing in developer experience and consistent engineering delivery.",
"location": {
"countryCode": "SG",
@vinaysshenoy
vinaysshenoy / provider.kt
Last active November 29, 2022 16:31
Onion layers
interface Provider<T, U> {
fun provide(params: U?): T
}
class DatabaseProvider: Provider<User, string> {
override fun provide(id: string?): User {
// Query DB here
}
}
@vinaysshenoy
vinaysshenoy / fix.sh
Created September 28, 2022 05:15
Git LFS BS (Encountered files)
git rm .gitattributes
git reset .
git checkout .
@vinaysshenoy
vinaysshenoy / files sorted by size.sh
Last active February 2, 2022 03:29
macOS list files by size
find . -type f -print0 | xargs -0 ls -l | sort -k5,5rn > ~/files.txt
find -E . -regex '.*\.(jpg|png)' -print0 | xargs -0 ls -l | sort -k5,5rn
find -E . -regex '.*\.(jpg|jpeg|png|hdr|exr)' -print0 | xargs -0 stat -f "%N,%z" > ./files.csv
@vinaysshenoy
vinaysshenoy / .profile
Created May 27, 2021 05:21
Delete gradle log files older than 7 days on login
export GRADLE_USER_HOME="$HOME/Dev/.gradle"
# Delete all gradle log files older than 7 days
find $GRADLE_USER_HOME/daemon -type f -mtime +7 -iregex '.*\.\(dmp\|log\)$' -delete
@vinaysshenoy
vinaysshenoy / FirstFragment.kt
Created September 30, 2020 07:49
Render a view to a Bitmap of a specific size
package `in`.obvious.android.bitmaptest
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.RectF
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.LayoutInflater