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
import com.pi4j.system.SystemInfo | |
import java.io.BufferedReader | |
import java.io.IOException | |
import java.io.InputStreamReader | |
import java.net.InetAddress | |
import java.net.ServerSocket | |
import java.net.Socket | |
import java.text.ParseException |
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
/* | |
* i2c_port_address_scanner | |
* Scans ports D0 to D7 on an ESP8266 and searches for I2C device. based on the original code | |
* available on Arduino.cc and later improved by user Krodal and Nick Gammon (www.gammon.com.au/forum/?id=10896) | |
* D8 throws exceptions thus it has been left out | |
* | |
*/ | |
#include <Wire.h> |
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 player(): | |
def __init__(self): | |
self.is_initiated = False | |
self.SEEK_TIME = 20 | |
self.MAX_VOL = 512 | |
self.MIN_VOL = 0 | |
self.DEFAULT_VOL = 256 | |
self.VOL_STEP = 13 | |
self.current_vol = self.DEFAULT_VOL |
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
fun addBordertoImage(source: BufferedImage, color: Color=Color.WHITE, borderLeft: Int =10, borderTop: Int =10): BufferedImage { | |
val borderedImageWidth: Int = source.width + borderLeft * 2 | |
val borderedImageHeight: Int = source.height + borderTop * 2 | |
val img = BufferedImage(borderedImageWidth, borderedImageHeight, BufferedImage.TYPE_3BYTE_BGR) | |
img.createGraphics() | |
val g = img.graphics as Graphics2D | |
g.color = color | |
g.fillRect(0, 0, borderedImageWidth, borderedImageHeight) | |
g.drawImage( |
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
import sqlite3 | |
import base64 | |
class SqlideApi(): | |
def __init__(self, dbname, tablename): | |
self.tablename = tablename | |
self.dbname = dbname | |
self.con = None | |
try: |
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
import socket | |
import threading | |
from time import sleep | |
class ThreadedServer(object): | |
def __init__(self, host, port): | |
self.host = host | |
self.port = port | |
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
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
#include <ESP8266WiFi.h> //https://github.com/esp8266/Arduino | |
#include <DNSServer.h> | |
#include <ESP8266WebServer.h> | |
#include <WiFiManager.h> //https://github.com/tzapu/WiFiManager | |
#include <ArduinoOTA.h> | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("Booting"); | |
WiFiManager wifiManager; |
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/bash | |
if [ $# -ne 1 ] | |
then | |
echo "Invalid arguments" | |
exit | |
fi | |
re='^[0-9]+$' |
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
import pyaudio | |
import socket | |
from threading import Thread | |
frames = [] | |
def udpStream(): | |
udp = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
while True: |
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/bash | |
POSITIONAL=() | |
while [[ $# -gt 0 ]] | |
do | |
key="$1" | |
case $key in | |
-t|--time) | |
TIME="$2" |