Skip to content

Instantly share code, notes, and snippets.

seahorsepip /
Last active Nov 4, 2022
Reverse SSH tunnel NGINX config script

To be used with /etc/ssh/sshd_config ForceCommand.


Example usage:

seahorsepip / ToggleAmbientBasedOnDrawerState.kt
Last active Feb 1, 2018
Toggle ambient support in Android Wear 2.0 based on Drawer state (open or closed/peek)
View ToggleAmbientBasedOnDrawerState.kt
private var mAmbientMode: AmbientMode? = null
private var mAmbientAttached = false
private val mDrawerStateCallback = object : WearableDrawerLayout.DrawerStateCallback() {
override fun onDrawerStateChanged(layout: WearableDrawerLayout?, newState: Int) {
super.onDrawerStateChanged(layout, newState)
if (newState == 0) {
if ((playback_drawer.isClosed || playback_drawer.isPeeking)) removeAmbientSupport()
else if (playback_drawer.isOpened) addAmbientSupport()