Skip to content

Instantly share code, notes, and snippets.

/**
This code snippet shows how an Android activity can trigger a web based auth using webview and then use
the cookies from there to make subsequent calls to an API (since the api is checking the cookies to detect
sign in)
MyApplication: The root "controller" and the first activity in my app
OAuthLogin: A class that handles the web based login.
It montors the url change and if the user had been redirected to
a "success" page it sends out the cookie string to the root controller
Once the controller has the cookie, it sets those on the service that
@jpillora
jpillora / sshd.go
Last active December 17, 2023 16:27
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@tjluoma
tjluoma / km-timemachine-mount-run-unmount.sh
Last active June 26, 2024 10:36
a variation of 'timemachine-mount-run-unmount.sh' meant to be used with Keyboard Maestro
#!/usr/bin/env zsh -f
# Purpose: Once you set the DEVICE,
# this script will mount your Time Machine drive,
# run Time Machine,
# and then unmount the drive
#
# From: Timothy J. Luoma
# Mail: luomat at gmail dot com
# Date: 2020-04-20
@dannymota
dannymota / install.sh
Last active March 4, 2023 16:41 — forked from ziadoz/install.sh
Install Chrome, Pip, Venv, ChromeDriver and Selenium on Ubuntu 20.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`