Skip to content

Instantly share code, notes, and snippets.

View Spencer-Doak's full-sized avatar

Spencer Spencer-Doak

  • United States of America
View GitHub Profile
@troyhunt
troyhunt / rick-roll-content-scraper.js
Created August 19, 2020 07:41
A Cloudflare worker to redirect image requests from dickhead content scraper's site to a Rick Roll
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
async function fetchAndApply(request) {
let response = await fetch(request)
let referer = request.headers.get('Referer')
let contentType = response.headers.get('Content-Type') || ''
if (referer && contentType.startsWith('image/')) {
@jamescalam
jamescalam / meditations_text.py
Last active April 4, 2020 17:19
Code snippet for part of data cleansing process for Meditations data import.
import requests
import re
# import Meditations
response = requests.get('http://classics.mit.edu/Antoninus/meditations.mb.txt')
data = response.text
# clean the text
data = data.split("Translated by George Long")[1].replace("-", "").split("THE END")[0]
data = re.sub("BOOK [A-Z]+\n", "", data)
@jbjonesjr
jbjonesjr / getting-going-best-practices.md
Created May 2, 2018 19:57
Getting Going and Best Practices Guide

GitHub Onboarding and Introduction

A guide for getting started and best practices for teams new to, or improving their interactions with, GitHub

image GitHub's features and capabilities

This document is meant to help new teams to GitHub familiarize themselves with the features and platform, as well as start to explore some of the best practices. While not a complete exploration, it's meant as a introduction to the key tenets of using GitHub for your business. For teams and organizations that desire more one on one support, GitHub Professional Services has many different options available to customize tools, training, and process to best meet your needs. The GitHub offerings listed in the diagram above are just a sampling of the various capabilities and we'd love to create a customized offering to meet your specific organizational needs.

Overview and Intr

@reza
reza / aws-guardduty-lambda-security
Created January 23, 2018 12:49
I have used a lambda function to automatically deactivate any access key associated with a high severity GuardDuty alert.
#!/usr/bin/env python
#developed for blog post at http://www.cloudten.com.au/aws-guardduty-intelligent-threat-detection/
from __future__ import print_function
import boto3
import json
def lambda_handler(event, context):
print("Received event: " + json.dumps(event))
try:
@shortjared
shortjared / list.txt
Last active June 25, 2024 17:04
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com