Skip to content

Instantly share code, notes, and snippets.

View nrrb's full-sized avatar
🤔

Nicholas Bennett nrrb

🤔
View GitHub Profile
@nrrb
nrrb / face_detect.py
Last active September 14, 2015 02:52 — forked from 46bit/face_detect.py
Face detection using OpenCV. Refactored from https://realpython.com/blog/python/face-recognition-with-python/.
import sys, cv2
# Refactored https://realpython.com/blog/python/face-recognition-with-python/
def cascade_detect(cascade, image):
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
return cascade.detectMultiScale(
gray_image,
scaleFactor = 1.15,
minNeighbors = 5,
#!/bin/sh
# copied from http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
mkdir /tmp/curl
cd /tmp/curl
sudo apt-get update
sudo apt-get install build-essential debhelper libssh2-1-dev
apt-get source curl
sudo apt-get build-dep curl
cd curl-*
dpkg-buildpackage
@nrrb
nrrb / Makefile
Last active November 28, 2018 21:36
Periodic Screenshots (every 10 seconds) on Mac OS X
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " screencap To start recording screencaps and clean up yesterday's captures."
@echo " cleanyesterday Just delete yesterday's captures."
@echo " captoday Just start recording screencaps for today."
screencap:
./remove_yesterday_recording.sh
./start_recording.sh
@nrrb
nrrb / -
Created April 13, 2015 22:32
# BEGIN W3TC Browser Cache
<IfModule mod_deflate.c>
<IfModule mod_headers.c>
Header append Vary User-Agent env=!dont-vary
</IfModule>
AddOutputFilterByType DEFLATE text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
<IfModule mod_mime.c>
# DEFLATE by extension
AddOutputFilter DEFLATE js css htm html xml
</IfModule>
@nrrb
nrrb / requirements.txt
Created March 13, 2015 20:57
Scrape all the URLs shared in the INN Nerd Newsletters http://nerds.inn.org/category/newsletter/
python-wordpress-xmlrpc==2.3
# http://www.reddit.com/r/beginnerprojects/comments/19kxre/project_99_bottles_of_beer_on_the_wall_lyrics/
# GOAL
# Create a program that prints out every line to the song "99 bottles of beer on the wall." This should be a pretty simple
# program, so to make it a bit harder, here are some rules to follow.
# RULES
# If you are going to use a list for all of the numbers, do not manually type them all in. Instead, use a built in function.
# Besides the phrase "take one down," you may not type in any numbers/names of numbers directly into your song lyrics.
# Remember, when you reach 1 bottle left, the word "bottles" becomes singular.
def amount_of_beer_in_words(bottles):
if bottles == 1:
[
{
"code": "AF",
"value": 53,
"name": "Afghanistan"
},
{
"code": "AL",
"value": 117,
@nrrb
nrrb / ChiPy Mentoring Roll Call.ipynb
Last active August 29, 2015 14:09
ChiPy Mentoring Roll Call
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nrrb
nrrb / gist:5b61332f8b477a4dcc2d
Created October 23, 2014 19:07
Inject jQuery and animate.css, then animate img elements
/*
Inject jQuery and animate.css into the current page and make the images bounce.
jQuery: http://jquery.com/
animate.css: https://daneden.github.io/animate.css/
Using https://cdnjs.com/ to source scripts.
*/
@nrrb
nrrb / Intro to Scraping - Centro Careers.ipynb
Created October 16, 2014 16:41
Intro to Scraping - Centro Careers
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.