Skip to content

Instantly share code, notes, and snippets.

View inderpreet's full-sized avatar

Inderpreet Singh inderpreet

View GitHub Profile
@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 / 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 / etec224-button.py
Created November 24, 2021 01:07
etec224 button with 3 leds code
#!/usr/bin/python3
import RPi.GPIO as GPIO
from time import sleep
LED_G = 21
BUTTON = 17
PRESSED = 0
RELEASED = 1
#!/usr/bin/python3
import RPi.GPIO as GPIO
import time
LED_G = 16
LED_Y = 20
LED_R = 21
PBT1 = 17
@inderpreet
inderpreet / apache2.conf
Created November 24, 2021 01:19
apache config for the etec224 course
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
import RPi.GPIO as G
import time
G.setmode(G.BCM)
G.setwarnings(False)
G.setup(7, G.OUT)
G.setup(25, G.IN, pull_up_down=G.PUD_UP)
toggle = 1
data = 1
#include <iostream>
void banner();
void m7_t1();
void m7_t2();
void m7_t3();
void m8_t1();
void m8_t2();
void m8_t3();