Skip to content

Instantly share code, notes, and snippets.

@troyfontaine
troyfontaine / PythonAndPowerShell.md
Last active March 4, 2024 14:20
Setting up Aliases for Python on Windows PowerShell

Getting Your Python (Development) On!

Python for Windows is really easy to install-but what if you had started in the world of MacOS/*nix OSes and miss that single command to call Python or Pip? What if you don't have access to modify your environment PATH?

Windows PowerShell has a feature called "Profiles" which allows you to configure your PowerShell in a similar fashion as you could with Bash, Zsh, etc.

Pretty cool huh?

Create a Profile

@rolandostar
rolandostar / AndroidClipboard.kt
Last active October 24, 2024 02:39
Get clipboard content when entering activity
/*
According to the Android lifecycle, clipboard contents cannot be accesed in either onCreate, onResume and neither onRestart.
As such, they can only be accessed when the activity's layout is fully formed
*/
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
val textToPaste: String = clipboard?.primaryClip?.getItemAt(0)?.text.toString().trim()
Log.d(TAG, textToPaste)