- Open Automator
- Create a new document
- Select Quick Action
- Set “Service receives selected” to
files or foldersinany application - Add a
Run Shell Scriptaction- your default shell should already be selected, otherwise use
/bin/zshfor macOS 10.15 (”Catalina”) or later - older versions of macOS use
/bin/bash
- your default shell should already be selected, otherwise use
- if you're using something else, you probably know what to do 😉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.gradle.api.tasks.testing.logging.TestExceptionFormat | |
| import org.gradle.api.tasks.testing.logging.TestLogEvent | |
| import groovy.time.TimeCategory | |
| import java.util.Date | |
| /** | |
| * based on the groovy code by lwasyl: | |
| * https://gist.github.com/lwasyl/f5b2b4ebe9e348ebbd8ee4cb995f8362 | |
| */ | |
| var testResults by extra(mutableListOf<TestOutcome>()) // Container for tests summaries |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Context context = view.getContext(); | |
| ContentResolver cr = context.getContentResolver(); | |
| ContentValues values; | |
| try { | |
| // create a file for test | |
| File file = new File(context.getFilesDir(), "1234568"); | |
| file.createNewFile(); | |
| try (OutputStream os = new FileOutputStream(file)) { | |
| os.write("test".getBytes()); |
- Login to Namecheap Account
- Get JSON from https://ap.www.namecheap.com/Domains/dns/GetAdvancedDnsInfo?fillTransferInfo=false&domainName=YOURDOMAINNAME.com
- Save it to file
python main.py data.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import androidx.lifecycle.LiveData | |
| import androidx.lifecycle.MediatorLiveData | |
| import kotlinx.coroutines.CoroutineScope | |
| import kotlinx.coroutines.Job | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.launch | |
| fun <T> LiveData<T>.debounce(duration: Long = 1000L, coroutineScope: CoroutineScope) = MediatorLiveData<T>().also { mld -> | |
| val source = this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
| # requires pycryptodome lib (pip install pycryptodome) | |
| import sys | |
| import base64 | |
| import os | |
| import json | |
| from Crypto.Cipher import AES |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| APP=TeamsFixer | |
| mkdir -vp ${APP}.app/Contents/MacOS ${APP}.app/Contents/Resources | |
| PATH="$PATH:/usr/libexec" | |
| printf '#!/usr/bin/env bash\nexec /Applications/Microsoft\ Teams.app/Contents/MacOS/Teams --disable-gpu' > ${APP}.app/Contents/MacOS/${APP} | |
| chmod +x ${APP}.app/Contents/MacOS/${APP} | |
| cp /Applications/Microsoft\ Teams.app/Contents/Resources/icon.icns ${APP}.app/Contents/Resources/icon.icns | |
| PlistBuddy ${APP}.app/Contents/Info.plist -c "add CFBundleDisplayName string ${APP}" | |
| PlistBuddy ${APP}.app/Contents/Info.plist -c "add CFBundleIconFile string icon.icns" | |
| PlistBuddy ${APP}.app/Contents/version.plist -c "add ProjectName string ${APP}" | |
| find ${APP}.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Details: | |
| # https://en.wikipedia.org/wiki/Steinhart%E2%80%93Hart_equation | |
| # https://de.wikipedia.org/wiki/Steinhart-Hart-Gleichung | |
| # Fitting of the four coefficient equation | |
| import csv | |
| import numpy | |
| from scipy.optimize import curve_fit | |
| import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.pem with the following command: | |
| # openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import http.server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| License: MIT License | |
| Copyright (c) 2023 Miel Donkers | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer |
NewerOlder