Skip to content

Instantly share code, notes, and snippets.

@simlei
simlei / bt_conn_up.expect
Last active October 22, 2022 07:22
Reconnect bluetooth on raspbian, using PulseAudio pactl and expect
#!/usr/bin/expect -f
# from: https://gist.github.com/RamonGilabert/046727b302b4d9fb0055
set prompt "#"
set address [lindex $argv 0]
set timeout 20
spawn sudo bluetoothctl
# expect -re $prompt
send "connect $address\r"
@tonysneed
tonysneed / Mac OS X: Open in Visual Studio Code
Last active June 14, 2024 04:16
Add a command to Finder services in Mac OSX to open a folder in VS Code
- Open Automator
- File -> New -> Service
- Change "Service Receives" to "files or folders" in "Finder"
- Add a "Run Shell Script" action
- Change "Pass input" to "as arguments"
- Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*"
- Save it as something like "Open in Visual Studio Code"