Skip to content

Instantly share code, notes, and snippets.

@jbruchanov
jbruchanov / appbackup.gradle
Created March 7, 2022 11:43
Very naive debug backup of android app
import java.text.SimpleDateFormat
/*
this is very !naive! implementation by making just a copy of defined files (probably doesn't handle spaces or special chars!)
1) define following `backupMap` and `removeBeforeRestore`
2) import it into the app build.gradle using `apply from: "$rootProject.projectDir/appbackup.gradle"`
3) and then just run:
#backup (see the BackupID e.g. 20220307-113423)
./gradlew app:appBackup
#restore
@jbruchanov
jbruchanov / commit-hooks-windows-guide.txt
Last active July 22, 2022 12:38
Windows git prepare-commit-msg hook starting python script
//be sure your hook folder is correct
//`git config core.hooksPath`
//or set it `git config core.hooksPath .git/hooks`
//be sure the sh.exe exists and it's correct
//file:prepare-commit-msg
#!C:/Program\ Files/Git/usr/bin/sh.exe
python ".git/hooks/prepare-commit-msg.py" "$1"
exit 0
@jbruchanov
jbruchanov / sheet_scipt.js
Last active November 13, 2022 19:09
GoogleNestInSheetHistory
/*
Create google sheet file with 'Data', 'Weather', 'Settings' sheets
Settings: //https://developers.google.com/nest/device-access/get-started
SDMUrl https://smartdevicemanagement.googleapis.com/v1
projectId ...
nestDeviceId ...
oauthClientId ...
oauthClientSecret ...
oauthRefreshToken ...
oauthAccessToken ...