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 ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Play Store API Test</title>
<style>
body { font-family: sans-serif; max-width: 700px; margin: 40px auto; padding: 0 20px; }
label { display: block; margin-top: 16px; font-weight: bold; }
textarea { width: 100%; height: 150px; font-family: monospace; font-size: 12px; }
input[type=text] { width: 100%; padding: 6px; font-size: 14px; }