Skip to content

Instantly share code, notes, and snippets.

View AndreasBackx's full-sized avatar
🥔

Andreas Backx AndreasBackx

🥔
View GitHub Profile
@AndreasBackx
AndreasBackx / ADB Wi-Fi Autoconnect
Last active February 3, 2017 09:42
Connect to your Android device over your LAN. Asks to plug in so it can enable tcpip mode on adb. Requires adb to be in PATH.
connectAndroid() {
port=5555
host=192.168.1.99
wifiConnected=$(adb devices | grep "$host:$port\tdevice")
if [ -n "$wifiConnected" ]; then
echo "Your device is already connected via port $port."
else
wifiStartConnectionCommand="adb connect $host | grep 'connected to $host:$port'"
wifiStartConnection=$(eval $wifiStartConnectionCommand)
if [ -n "$wifiStartConnection" ]; then
@AndreasBackx
AndreasBackx / gist:76a42e4f65699435acd3
Last active August 29, 2015 14:23
Auto upload Android screenshot to imgur and copy link to OSX clipboard.
imgur() {
for i in "$@"; do
curl -$# -F "image"=@"$i" -F "key"="4907fcd89e761c6b07eeb8292d5a9b2a" imgur.com/api/upload.xml | xmllint --xpath '/rsp/original_image/text()' - | pbcopy
echo "Successfully copied image to clipboard."
done
}
androidScreenshot() {
fileName=android-screenshot.png
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > $fileName

Keybase proof

I hereby claim:

  • I am andreasbackx on github.
  • I am andreasbackx (https://keybase.io/andreasbackx) on keybase.
  • I have a public key ASCsftMprp_gRQvyvz5StWVX1ZWAUpyj9f-61wg4y5dq1wo

To claim this, I am signing this object:

@AndreasBackx
AndreasBackx / template.js
Created April 30, 2018 20:10
VS Code Theme Color Reference JSON Template
{
"type": "dark",
"colors": {
//
// Contrast Colors
//
// An extra border around active elements to separate them from others for greater contrast.
"contrastActiveBorder": "#ff0000",
// An extra border around elements to separate them from others for greater contrast.
"contrastBorder": "#ff0000",