Skip to content

Instantly share code, notes, and snippets.

View alexdlaird's full-sized avatar

Alex Laird alexdlaird

View GitHub Profile
@alexdlaird
alexdlaird / pyngrok_HttpServerExample_server.py
Last active June 5, 2025 16:21
Simple HTTP server integration example for pyngrok, full documentation found at https://pyngrok.readthedocs.io/en/latest/integrations.html
import os
from http.server import HTTPServer, BaseHTTPRequestHandler
from pyngrok import ngrok
port = os.environ.get("PORT", "80")
server_address = ("", port)
httpd = HTTPServer(server_address, BaseHTTPRequestHandler)
@alexdlaird
alexdlaird / 1_pyngrok_TCPExample_server.py
Last active June 5, 2025 16:21
Simple TCP server/client integration example for pyngrok, full documentation found at https://pyngrok.readthedocs.io/en/latest/integrations.html
# HOST="1.tcp.ngrok.io" PORT=12345 python server.py
import os
import socket
from pyngrok import ngrok
host = os.environ.get("HOST")
port = int(os.environ.get("PORT"))
@alexdlaird
alexdlaird / 1_AirNowTextingService.md
Last active June 5, 2025 16:21
Texting service to receive current air quality conditions and maps, powered by AirNow, Twilio, and AWS
@alexdlaird
alexdlaird / 1_ServerlessSMSRaffle.md
Last active September 11, 2020 00:47
Serverless SMS raffle powered by Twilio and AWS

Serverless SMS Raffle

Create a new Role from a Policy with the following permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
 "Effect": "Allow",
@alexdlaird
alexdlaird / daemon.cpp
Last active June 5, 2025 16:19
Useful as a starting point for a C++ based Linux daemon application.
#include <dirent.h>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <sys/stat.h>
#include <syslog.h>