Skip to content

Instantly share code, notes, and snippets.

View philnelson's full-sized avatar

Phil Nelson philnelson

View GitHub Profile
# import the necessary packages
from imutils.video import VideoStream
from imutils.video import FPS
import argparse
import imutils
import time
import cv2
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
@philnelson
philnelson / gist:bdaf746711a6b56c292b44c18cdfbe63
Last active December 15, 2016 21:06
How to completely block politico.com from your computer (Mac OS X or Linux)
sudo sh -c 'echo "0.0.0.0 politico.com" >> /etc/hosts'
sudo sh -c 'echo "0.0.0.0 www.politico.com" >> /etc/hosts'
sudo sh -c 'echo "" >> /etc/hosts'
dscacheutil -flushcache
# Works with any browser or app and won't interfere with any other content blockers.
# Your /etc/hosts file is kind of a big deal, though, so... be careful.
_//)_//)
/ /)=/ /)
((O)=(O))
\||/
________====____[o]_
)/)|___._== ==_.___|(\(
(( \ || '-.________.-' || / ))
\=/ || ..''.. || \=/
\\_// / [||] \ \\_//
\V/ / ...... \ \V/
@philnelson
philnelson / gist:1628764
Created January 17, 2012 20:44
check if time is between 8am and 7pm PST
var a = new Date;
var hours = a.getHours();
var hourOffset = a.getTimezoneOffset()/60;
var timeNow = hours + hourOffset;
if (18 == a.getDate() && 0 == a.getMonth() && 2012 == a.getFullYear() && timeNow >= 13 && timeNow <= 24) {
window.location = "http://sopastrike.com/strike";
}
<table>
<tr><td>State</td><td>Name</td><td>Public Events</td><td>Scheduled Meetings</td><td>Position</td></tr>
<tr><td>AK</td><td>Begich</td><td></td><td></td><td>unknown</td></tr>
<tr><td>AK</td><td>Murkowski</td><td></td><td></td><td>unknown</td></tr>
<tr><td>AL</td><td>Sessions</td><td></td><td></td><td>unknown</td></tr>
<tr><td>AL</td><td>Shelby</td><td></td><td></td><td>unknown</td></tr>
<tr><td>AR</td><td>Boozman</td><td></td><td></td><td>YES (co-sponsor)</td></tr>
<tr><td>AR</td><td>Pryor</td><td></td><td></td><td>unknown</td></tr>
<tr><td>AZ</td><td>Kyl</td><td></td><td></td><td>unknown</td></tr>
<tr><td>AZ</td><td>McCain</td><td></td><td></td><td>YES (co-sponsor)</td></tr>
<table>
<tr><th>Name</th><th>State</th></tr>
<tr><td>Daniel Akaka</td><td>HI</td></tr>
<tr><td>Lamar Alexander</td><td>TN</td></tr>
<tr><td>Kelly Ayotte</td><td>NH</td></tr>
<tr><td>John Barrasso</td><td>WY</td></tr>
<tr><td>Max Baucus</td><td>MT</td></tr>
<tr><td>Mark Begich</td><td>AK</td></tr>
<tr><td>Michael Bennet</td><td>CO</td></tr>
<tr><td>Jeff Bingaman</td><td>NM</td></tr>
@philnelson
philnelson / minetweet.php
Created August 3, 2011 18:12 — forked from gavinblair/minetweet.php
script that periodically checks the minecraft server log, and tweets when players log in/out
<?php
//run via cron every 2 minutes
$log_location = "/users/minecraft/minecraft/";
$web_viewable_location = "/var/www/gotham.extrafuture.com/public_html/";
$bot_email = "[email protected]";
$twittermail_account = "";
//Get the log file