Skip to content

Instantly share code, notes, and snippets.

View thrbr84's full-sized avatar
🏠
Working from home

Thiago Bruno thrbr84

🏠
Working from home
View GitHub Profile
@thrbr84
thrbr84 / update.php
Created March 22, 2018 13:11 — forked from GianpaMX/update.php
Automatically updating a hosts file for dynamic dns
<?php
if(!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == ""){
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location: $redirect");
}
class Host {
private $ip;
private $hosts;
@thrbr84
thrbr84 / webcam-cv2.py
Created February 20, 2018 23:40 — forked from tedmiston/webcam-cv2.py
Display the webcam in Python using OpenCV (cv2)
'''
Simply display the contents of the webcam with optional mirroring using OpenCV
via the new Pythonic cv2 interface. Press <esc> to quit.
'''
import cv2
def show_webcam(mirror=False):
cam = cv2.VideoCapture(0)
while True: