adduser <user>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This file can be used as an auto installer or you can mannually execute the steps yourself. | |
| # If you use it as an installer, you must run it as root. | |
| # Check if the script is run with sudo | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root or with sudo" | |
| exit | |
| else | |
| echo "Installing Mosquitto..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This file can be used as an auto installer or you can mannually execute the steps yourself. | |
| # If you use it as an installer, you must run it as root. | |
| # Check if the script is run with sudo | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root or with sudo" | |
| exit | |
| else | |
| echo "Installing Erlang and Elixir..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import gi | |
| gi.require_version('Gtk', '3.0') | |
| from gi.repository import Gtk, Gdk | |
| import sys | |
| class MyWindow(Gtk.ApplicationWindow): | |
| def __init__(self, app): | |
| Gtk.Window.__init__(self, title="Gtk get screen workarea", application=app) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class EventDispatcher: | |
| def __init__(self): | |
| self.__eventhandlers = {} | |
| def add_event(self, event, handler): | |
| self.__eventhandlers[event] = handler | |
| def remove_event(self, event): | |
| del self.__eventhandlers[event] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class AutoFitGrid : RecyclerView { | |
| private var manager: GridLayoutManager? = null | |
| private var columnWidth = -1 | |
| constructor(context: Context) : super(context) { | |
| initialization(context, null) | |
| } | |
| constructor(context: Context, attrs: AttributeSet) : super(context, attrs) { | |
| initialization(context, attrs) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NotifyingGridLayoutManager(context: Context?) : GridLayoutManager(context, 1) { | |
| var onLayoutCompleteCallback: OnLayoutCompleteCallback? = null | |
| override fun onLayoutCompleted(state: RecyclerView.State?) { | |
| super.onLayoutCompleted(state) | |
| onLayoutCompleteCallback?.onLayoutComplete() | |
| } | |
| fun isLastItemCompletelyVisible() = findLastCompletelyVisibleItemPosition() == itemCount - 1 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NotifyingLinearLayoutManager(context: Context?) : LinearLayoutManager(context, VERTICAL, false) { | |
| var onLayoutCompleteCallback: OnLayoutCompleteCallback? = null | |
| override fun onLayoutCompleted(state: RecyclerView.State?) { | |
| super.onLayoutCompleted(state) | |
| onLayoutCompleteCallback?.onLayoutComplete() | |
| } | |
| fun isLastItemCompletelyVisible() = findLastCompletelyVisibleItemPosition() == itemCount - 1 | |
| } |
NewerOlder