Skip to content

Instantly share code, notes, and snippets.

@seahorsepip
seahorsepip / ToggleAmbientBasedOnDrawerState.kt
Last active February 1, 2018 11:24
Toggle ambient support in Android Wear 2.0 based on Drawer state (open or closed/peek)
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()
}
}
@seahorsepip
seahorsepip / README.md
Last active March 22, 2024 15:30
Reverse SSH tunnel NGINX config script

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

Requirements:

Example usage: