Skip to content

Instantly share code, notes, and snippets.

@seahorsepip
seahorsepip / README.md
Last active October 23, 2023 20:09
Reverse SSH tunnel NGINX config script
View README.md

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

Requirements:

Example usage:

@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)
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()
}
}