Skip to content

Instantly share code, notes, and snippets.

View drewgates's full-sized avatar

Drew Gates drewgates

View GitHub Profile
@drewgates
drewgates / PHP Password Protect Website
Last active August 1, 2018 21:04 — forked from jayde/PHP Password Protect Website
PHP Simple Page Authentication / Password Protect
<?
header("Content-type: text/html; charset=utf-8");
if(empty($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm=""');
header('HTTP/1.0 401 Unauthorized');
echo 'Password Required';
exit;
} else {
$password = "password";
if(
@drewgates
drewgates / blinkLed.py
Last active March 18, 2018 20:42 — forked from elktros/blinkLed.py
How to Blink an LED with Raspberry Pi
#!/usr/bin/env python
import RPi.GPIO as GPIO # RPi.GPIO can be referred as GPIO from now
import time
ledPin = 17 # pin17
def setup():
GPIO.setmode(GPIO.BCM) # Use BCM Pin Numbering to match T-Cobbler Numbering
GPIO.setup(ledPin, GPIO.OUT) # Set ledPin as output
GPIO.output(ledPin, GPIO.LOW) # Set ledPin to LOW to turn Off the LED