Skip to content

Instantly share code, notes, and snippets.

View interview.py
from typing import Iterable, Optional, Tuple
import unittest
def longest_substring_with_two_characters(s: str) -> Optional[Tuple[int]]:
"""Finds the longest substring in s that contains up to 2 distinct characters."""
substring_start = 0
current_index = 0
other_char = None
continuous_substring_start = 0
@billyeh
billyeh / outline_formatter.gs
Last active Dec 30, 2021
Format text outlines in Google Docs (from PDF conversions)
View outline_formatter.gs
/**
* Convenient script for formatting Google Docs converted from outline PDF files.
* Simply copy/paste the outline text, and the script cleans up the whitespace
* and correctly formats the document according to the Roman numerals found
* in the text.
/**
* Calculates all the next Roman numeral strings we expect.
* @return {Array} List of outline point strings to search the
* document for. For example, [' I. ', ' C. ', ' 1. '].
View Prayer Partner Generator.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@billyeh
billyeh / flatbible.ipynb
Last active Jul 11, 2017
Parse the Recovery Version to create a flat Bible
View flatbible.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@billyeh
billyeh / photosend.py
Last active May 8, 2017
Simple way to deliver photos by email using facebook image recognition
View photosend.py
import requests
import json
import fnmatch
import os
import ast
import httplib2
import mimetypes
import base64
import logging
@billyeh
billyeh / clock.html
Last active Jan 9, 2017
Clock with seconds and carousel of background images
View clock.html
<html>
<body onload="main()" style="margin:0; background-color:black; font-family:sans-serif;">
<div id="body" style="width:100%; height:100%; background-image:url(image1.jpg); background-size:cover">
<div style="position:absolute; top:50%; color:white; margin-left:3%">
<div>
<span id="time"></span>
<span id="secs"></span>
</div>
<div id="date"></div>
</div>
@billyeh
billyeh / pptToPdf README
Last active Aug 29, 2015
README for Powerpoint to PDF Converter
View pptToPdf README
PDF Print
=========
##Installation
Install easily on a Windows machine:
1. Download and install a compatible version of [Python](https://www.python.org/downloads/).
(Make sure the Python.exe file is added to the PATH variable. This is one of the
installation options.)
2. Find the release of [Python for Windows Extensions](http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/)
@billyeh
billyeh / pptToPdf
Last active Aug 29, 2015
Powerpoint to PDF Converter
View pptToPdf
import sys
import argparse
import os
import fnmatch
import win32com
from Tkinter import *
from tkFileDialog import *
from win32com.client import Dispatch