Skip to content

Instantly share code, notes, and snippets.

View kayhadrin's full-sized avatar

David kayhadrin

  • AU-US in betweener
View GitHub Profile
@kayhadrin
kayhadrin / extract-angular-1.x-DI.coffee
Created August 10, 2016 19:52
How to extract angular 1.x full dependency list
# # How to use?
# Put a breakpoint in angular.module() and when in there,
# Save the `modules` variable on the window object like `window.modules = modules`
# Then load the script below
# Then invoke: `angular.toJson(analyseModules(modules), true)`
analyseModule = (module) ->
module.map (provider) ->
[providerType, type, definition] = provider
diff --git a/babel.config.js b/babel.config.js
index 56ee9e1..694d1fc 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -7,7 +7,13 @@ module.exports = function(api) {
'module:metro-react-native-babel-preset',
],
plugins: [
- 'babel-plugin-fbt', 'babel-plugin-fbt-runtime',
+ [
@kayhadrin
kayhadrin / changes.diff
Last active June 5, 2020 01:44
Babel types: flow libdef changes (related to https://github.com/babel/babel/pull/11671)
1,2c1,6
< // NOTE: This file is autogenerated. Do not modify.
< // See packages/babel-types/scripts/generators/flow.js for script used.
---
> /**
> * NOTE: This file is autogenerated. Do not modify.
> * See packages/babel-types/scripts/generators/flow.js for script used.
> *
> * @flow strict
> */
@kayhadrin
kayhadrin / yes-im-listening-youtube-music.js
Last active November 26, 2020 08:41
Automatically click "Yes" to Youtube Music's "Are you still listening prompts". Use your browser's debugging console (https://www.w3schools.com/js/js_debugging.asp) to execute this code.
// Automatically click "Yes" to Youtube Music's "Are you still listening prompts"
// Use your browser's debugging console (https://www.w3schools.com/js/js_debugging.asp) to execute this code.
setInterval(function() {
var button = document.querySelector('.ytmusic-you-there-renderer #button');
button && button.click();
}, 500)
@kayhadrin
kayhadrin / README-syncthing-restore-version.md
Last active January 12, 2023 04:38
Syncthing: bash script to move the latest version of all files from a given folder to a target folder

Syncthing: script to MOVE the latest version of all files from a given folder to a target folder

This is useful in case you've mistakenly deleted a very large folder and it takes forever to restore the files via "file copy". In this case, we're literally MOVING the old version files to the target location! So be careful, this cannot be reverted!

Usage:

./syncthing-restore-version.sh srcFolder dstFolder
@kayhadrin
kayhadrin / syncthing__versions_du.sh
Last active April 5, 2025 19:10
Analyse a given Syncthing versions folder and display the disk space used by files grouped by dates.
#!/bin/bash
echo Analyse a given Syncthing versions folder and display the disk space used by files grouped by dates.
targetDir=$( realpath "$1" )
echo Target directory: "'"$targetDir"'"
echo Start time: $(date)
if ! [[ -d "$targetDir" ]]; then
echo "Unable to access target folder: '$targetDir'"
exit 1
fi