Skip to content

Instantly share code, notes, and snippets.

View peterwallhead's full-sized avatar
👨‍💻
Currently focusing on ROS 2 & SLAM.

Peter Wallhead peterwallhead

👨‍💻
Currently focusing on ROS 2 & SLAM.
View GitHub Profile
@plumbum
plumbum / sector.scad
Created July 12, 2017 08:59
How to make cylinder sector in OpenSCAD
translate([0,0,0]) sector(30, 20, 10, 90);
translate([22,0,0]) sector(30, 20, 300, 30);
translate([0,22,0]) sector(30, 20, 30, 300);
translate([22,22,0]) sector(30, 20, 10, 190);
module sector(h, d, a1, a2) {
if (a2 - a1 > 180) {
difference() {
cylinder(h=h, d=d);
translate([0,0,-0.5]) sector(h+1, d+1, a2-360, a1);
@NonaSuomy
NonaSuomy / XMLHTTPparse.ino
Created May 2, 2017 23:30
IHeartRadio XML Parsing on Arduino ESP8266
//http://playerservices.streamtheworld.com/api/livestream?version=1.5&mount=CIMXFMAAC&lang=en
#include <ESP8266WiFi.h>
#include <TinyXML.h>
const char* ssid = "SSID";
const char* password = "PASSWORD";
const char* host = "playerservices.streamtheworld.com";
const char* apiVersion = "1.5";
const char* mountPoint = "CIMXFMAAC";
@mdonkers
mdonkers / server.py
Last active August 20, 2025 17:24
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@keithweaver
keithweaver / domain-to-aws-ec2-instance.md
Created March 20, 2017 23:49
Point Domain to Amazon Web Services (AWS) EC2 Instance

Point Domain to Amazon Web Services (AWS) EC2 Instance

  1. Open the Amazon Route 53 console at https://console.aws.amazon.com/route53/.
  2. If you are new to Amazon Route 53, you see a welcome page; choose Get Started Now for DNS Management. Otherwise, choose Hosted Zones in the navigation pane.
  3. Choose Create Hosted Zone.
  4. For Domain Name, type your domain name.
  5. Choose Create.
  6. Click the Hosted Zone, edit record set.
  7. In the value, add ec2-54-152-134-146.compute-1.amazonaws.com.
  8. Change your DNS file to point to the IPv4 address (This would be in something like GoDaddy).
@keithweaver
keithweaver / bluetooth-raspberry-pi-communication.py
Last active November 14, 2024 11:23
Sending information with bluetooth on Raspberry Pi (Python)
# Uses Bluez for Linux
#
# sudo apt-get install bluez python-bluez
#
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/x232.html
# Taken from: https://people.csail.mit.edu/albert/bluez-intro/c212.html
import bluetooth
def receiveMessages():
@randallreedjr
randallreedjr / heroku-remote.md
Last active May 29, 2025 19:19
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git
@dmsherazi
dmsherazi / sip_speaker.py
Created October 21, 2016 10:42 — forked from hu55a1n1/sip_speaker.py
PJSIP: Play incoming call on audio device in python
#!/usr/bin/python
#
#
# Copyright (C) 2003-2008 Benny Prijono <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@cmoulton
cmoulton / URLSession Calls in Swift 3.0.1
Last active November 4, 2022 00:29
URLSession Calls in Swift 3.0.1
func makeGetCall() {
// Set up the URL request
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")
return
}
let urlRequest = URLRequest(url: url)
// set up the session
@jyotiska
jyotiska / selenium_test_file.py
Created August 23, 2016 20:18
Selenium Blog Post Code
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get("http://jyotiska.github.io/")
time.sleep(1)
blog_link = driver.find_element_by_name("Blog")
blog_link.click()
@jpf
jpf / signed-jwt-in-python.md
Last active August 3, 2024 00:18
JWTs signed with RS256 in Python: A demonstration of org-babel

Introduction

This is a guide to using pyjwt to sign and validate a JWT using RS256.

The trickiest part of doing this is knowing what the proper OpenSSL commands are to generate the RSA keypair. I demonstrate that below.

Generating RSA keys