Skip to content

Instantly share code, notes, and snippets.

View inderpreet's full-sized avatar

Inderpreet Singh inderpreet

View GitHub Profile
@inderpreet
inderpreet / Drawer-menu.js
Created May 3, 2021 18:49 — forked from alexanmtz/Drawer-menu.js
A tab menu example using Material-UI for react
// styles
const styles = theme => ({
iconContainer: {
display: 'none',
[theme.breakpoints.down('sm')]: {
display: 'block'
}
}
})
@inderpreet
inderpreet / mqtt.py
Created March 16, 2021 12:20 — forked from stylpen/mqtt.py
python MQTT wrapper
import thread, mosquitto, random, time
# mosquitto reference and download can be found here: http://mosquitto.org/documentation/python/
class mqtt():
def __init__(self, broker = "127.0.0.1", port = 1883, clientID = None):
self.__broker = broker
self.__port = port
self._client = None
self.__subscriptionsList = []
self.__pendingSubscriptionsList = []
@inderpreet
inderpreet / statemachine.c
Created March 13, 2017 06:41 — forked from nmandery/statemachine.c
State machines are very simple in C if you use function pointers.
/*
http://stackoverflow.com/questions/1371460/state-machines-tutorials/1371654#1371654
State machines are very simple in C if you use function pointers.
Basically you need 2 arrays - one for state function pointers and one for state
transition rules. Every state function returns the code, you lookup state
transition table by state and return code to find the next state and then
just execute it.
*/