Skip to content

Instantly share code, notes, and snippets.

@ekager
ekager / bad_place_notify.py
Last active October 28, 2022 08:18
Searches for specified search terms and sends emails if found
"""
This script will search 4chan (need to specify a board unfortunately) and then
search all comments on Reddit for specific keywords. If found, it will then send
an email with the links to any matching posts.
Because 4chan posts are archived after ~48 hours I would recommend setting this up
to run on that cadence as well.
Sender email will need "Allow less secure apps" to ON or similar setting.
I followed these instructions for setting that up:

Keybase proof

I hereby claim:

  • I am ekager on github.
  • I am ekager (https://keybase.io/ekager) on keybase.
  • I have a public key ASCDU4zmFxUnmQlOIZu2snSx3NjB122AGFm_SybP0IvpnAo

To claim this, I am signing this object:

@ekager
ekager / PerfectsAndPrimes.py
Created March 7, 2017 21:52
Perfect Numbers and Prime Number methods in Python
import timeit
from math import sqrt
import sys
#sum of factors excluding itself equals n
def perfect(n):
sum = 0
x = 1
while (x < n):
@ekager
ekager / DataTypes.py
Created March 7, 2017 21:48
Implementing new classes for Fraction and Mixed Number data types in Python
import math
class Fraction:
def __init__(self, numerator, denominator=1):
self.numerator = numerator
self.denominator = denominator
def __str__(self):
return "%d/%d" % (self.numerator, self.denominator)
@ekager
ekager / ChurchNumerals.py
Created March 7, 2017 21:46
Implementing Church Numerals in Python
def zero(f):
return lambda x: x
def one(f):
return lambda x: f(x)
def two(f):
return lambda x: f(f(x))