Skip to content

Instantly share code, notes, and snippets.

View johnmcl's full-sized avatar

John McLaughlin johnmcl

View GitHub Profile
@henrik242
henrik242 / airtag-to-gpx-sync.sh
Last active April 19, 2025 20:26
Read AirTag data from the FindMy.app cache and convert to GPX
#!/usr/bin/env bash
#
# Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file
#
# Rsyncs the data to a web accessible folder that can be displayed with e.g.
# https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4
#
# This should typically be run as a cron job
#
@panpap
panpap / paywalled_sites.log
Created January 23, 2020 19:32
Keeping out the Masses: Understanding the Popularity andImplications of Internet Paywalls (WWW'20) - Oracle's list of paywalled websites
site
nytimes.com
telegraph.co.uk
wsj.com
forbes.com
washingtonpost.com
latimes.com
usatoday.com
businessinsider.com
independent.co.uk
@maguay
maguay / phone_extract.txt
Last active January 22, 2024 10:40
Regex to find phone phone numbers in all standard and international formats
(?:(?:\+?([1-9]|[0-9][0-9]|[0-9][0-9][0-9])\s*(?:[.-]\s*)?)?(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([0-9][1-9]|[0-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:#|x\.?|ext\.?|extension)\s*(\d+))?
/a tweaked version of the second regex in the question here to allow for all country codes and leading zeros in area codes: https://stackoverflow.com/questions/3868753/find-phone-numbers-in-python-script
@rambabusaravanan
rambabusaravanan / lambda-email.py
Last active November 7, 2023 03:35
AWS Lambda Function to send SMTP Email
import smtplib
import os
def send_email(host, port, username, password, subject, body, mail_to, mail_from = None, reply_to = None):
if mail_from is None: mail_from = username
if reply_to is None: reply_to = mail_to
message = """From: %s\nTo: %s\nReply-To: %s\nSubject: %s\n\n%s""" % (mail_from, mail_to, reply_to, subject, body)
print (message)
try:
@hrbrmstr
hrbrmstr / f1000.csv
Created March 23, 2016 16:02
2015 Fortune 1000 List with industry & website
name industry sector website rank
Walmart General Merchandisers Retailing http://www.walmart.com 1
Exxon Mobil Petroleum Refining Energy http://www.exxonmobil.com 2
Chevron Petroleum Refining Energy http://www.chevron.com 3
Berkshire Hathaway Insurance: Property and Casualty (Stock) Financials http://www.berkshirehathaway.com 4
Apple Computers, Office Equipment Technology http://www.apple.com 5
General Motors Motor Vehicles and Parts Motor Vehicles & Parts http://www.gm.com 6
Phillips 66 Petroleum Refining Energy http://www.phillips66.com 7
General Electric Diversified Financials Financials http://www.ge.com 8
Ford Motor Motor Vehicles and Parts Motor Vehicles & Parts http://www.ford.com 9
@tbrianjones
tbrianjones / free_email_provider_domains.txt
Last active April 5, 2025 02:20
A list of free email provider domains. Some of these are probably not around anymore. I've combined a dozen lists from around the web. Current "major providers" should all be in here as of the date this is created.
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
126.com
150ml.com
15meg4free.com
@sukeerthiadiga
sukeerthiadiga / gist:3772311
Created September 23, 2012 17:05
Mysql2::Error: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
locate my.cnf
change character set and collation
[mysqld]
character_set_server = utf8
collation_server = utf8_general_ci
in console if your database is not huge.