Skip to content

Instantly share code, notes, and snippets.

View wpg4665's full-sized avatar

Will Gordon wpg4665

  • Masline Electronics
  • Rochester, NY
View GitHub Profile
@rainyear
rainyear / handy.py
Created July 3, 2015 10:09
Hand posture detection with OpenCV.
#!/usr/bin/env python
import cv2
import numpy as np
def main():
cap = cv2.VideoCapture(0)
while(cap.isOpened()):
ret, img = cap.read()
skinMask = HSVBin(img)
@Frick
Frick / fixssh.sh
Last active April 9, 2019 14:48
Quick way of fixing host SSH changes without flat out disabling StrictHostKeyChecking
function fixssh {
local hostname=""
local ip=""
for arg in $@; do
local hostout=$(host "$arg" 2>/dev/null)
if [ $? -eq 0 ]; then
local out=$(echo "$hostout" | grep -o "has address .*$" | grep -Eo "[0-9.]{7,15}")
if [ $? -eq 0 ]; then
local hostname="$arg"
local ip="$out"
@Frick
Frick / listening.sh
Last active May 29, 2022 14:11
A function I keep in my .bashrc for quickly determining what processes are listening on what ports, protocols and interfaces - sorted by port number.
function listening {
if [ "${1}" = "-h" ]; then
echo "Usage: listening [t|tcp|u|udp] [ps regex]"
return
fi
DISP="both"
NSOPTS="tu"
if [ "${1}" = "t" -o "${1}" = "tcp" ]; then
DISP="tcp"
NSOPTS="t"
@Frick
Frick / openfiles.sh
Last active July 29, 2020 06:28
A function I keep in my .bashrc for quickly finding what files a process has open.
function openfiles {
if [ "${1}" = "-h" ]; then
echo -e "Usage: openfiles [r|w|m|R|W] regex\n -r opened for reading or read/write\n -w opened for writing or read/write\n -m accessed from memory (includes running command)\n -R opened for reading only\n -W opened for writing only"
return
fi
if [ "$#" = "0" ]; then
echo "Process signature/regex required."
return
fi
MODE="(w|u)"
@webstandardcss
webstandardcss / pedantically_commented_playbook.yml
Last active April 23, 2019 06:03 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options.
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@rodricios
rodricios / summarize.py
Last active November 18, 2020 17:21
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@senko
senko / maybe.py
Last active May 2, 2024 18:35
A Pythonic implementation of the Maybe monad
# maybe.py - a Pythonic implementation of the Maybe monad
# Copyright (C) 2014. Senko Rasic <senko.rasic@goodcode.io>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@timothyandrew
timothyandrew / README.md
Last active December 16, 2023 17:05
Set up a seedbox (on DigitalOcean – Ubuntu) really quick

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………