Skip to content

Instantly share code, notes, and snippets.

View peterwallhead's full-sized avatar
👨‍💻
coding all the things

Peter Wallhead peterwallhead

👨‍💻
coding all the things
View GitHub Profile
@peterwallhead
peterwallhead / compassbearing.py
Created January 24, 2024 09:39 — forked from jeromer/compassbearing.py
compass bearing between two points in Python
# LICENSE: public domain
def calculate_initial_compass_bearing(pointA, pointB):
"""
Calculates the bearing between two points.
The formulae used is the following:
θ = atan2(sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong))
@peterwallhead
peterwallhead / noodles.js
Created June 10, 2023 09:27 — forked from kellyvaughn/noodles.js
Accept LinkedIn Requests
const btns = document.querySelectorAll('button[aria-label*="Accept"]')
for(const btn of btns){
setTimeout(() => { btn.click() }, 300)
}
@peterwallhead
peterwallhead / compre.py
Created July 12, 2018 20:29 — forked from soruly/compre.py
Compare two images using OpenCV and SIFT in python
import cv2
import sys
import os.path
import numpy as np
def drawMatches(img1, kp1, img2, kp2, matches):
rows1 = img1.shape[0]
cols1 = img1.shape[1]
rows2 = img2.shape[0]
@peterwallhead
peterwallhead / 0_reuse_code.js
Created October 1, 2015 23:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var json = {
data: ['a','bunch','of','things']
};
var otherData = {
things: [],
madness: {}
};
json.data.forEach(function(data,index,array){
@peterwallhead
peterwallhead / UUID.php
Last active December 23, 2015 04:09 — forked from dahnielson/UUID.php
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4211 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.