Skip to content

Instantly share code, notes, and snippets.

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

Jeffallan

🏠
Working from home
View GitHub Profile
@Jeffallan
Jeffallan / age.py
Created March 21, 2018 17:05
Birthday calculator
from datetime import date
class Birthday(object):
def __init__(self, year, month, day):
self.dob = date(year, month, day)
@property
@Jeffallan
Jeffallan / PythonFlower.py
Last active November 16, 2017 17:32
Give a flower, and the gift of Python, to that special someone in your life.
import turtle
def draw_square(some_turtle):
for i in range(1,5):
some_turtle.forward(100)
some_turtle.right(90)
def draw_art():
window=turtle.Screen()
@Jeffallan
Jeffallan / mautic-styling.css
Created November 16, 2017 15:57
Basic Styling For Mautic Contact Form
.mauticform_wrapper {
max-width: 600px;
margin: 10px auto;
}
.mauticform-innerform {}
.mauticform-post-success {}
.mauticform-name {
// original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
// original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6
function doGet(e){
return handleResponse(e);
}
// Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
@rickdaalhuizen90
rickdaalhuizen90 / .bashrc
Created February 12, 2017 17:20
Parrot Os bash theme for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@Jeffallan
Jeffallan / gist:78843f0eed5caab5b069a48f24f18193
Last active January 5, 2017 20:05
The starting point for automated email verification
https://nathanleclaire.com/blog/2013/11/23/how-i-automated-finding-almost-anyones-email-address/
https://www.scottbrady91.com/Email-Verification/Python-Email-Verification-Script
http://life-longlearner.com/find-email-addresses/
@Jeffallan
Jeffallan / gist:6d12c20687b8110a741970ea37ac432f
Created January 4, 2017 19:04
Find Old Versions of Websites
https://archive.org/web/
http://webcache.googleusercontent.com/search?q=cache:http://example.com/
@gbaman
gbaman / HowToOTGFast.md
Last active July 19, 2024 23:49
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)

More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. If using a recent release of Jessie (Dec 2016 onwards), then create a new file simply called ssh in the SD card as well. By default SSH i

@gbaman
gbaman / HowToOTG.md
Last active July 19, 2024 11:47
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int