This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import tweepy | |
# 1. Download your twitter archive | |
# 2. fix the first line of tweets.js to be proper json | |
# 3. Get twitter API creds | |
# 4. fix all the SETMEs in here | |
# 5. run this | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
# Prints a list of digits to stdout | |
def emit(digits: list[int], newline:bool = False) -> None: | |
for i in digits: | |
print(i, end='') | |
if newline: | |
print() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CPPFLAGS="-I$(brew --prefix zlib)/include -I$(brew --prefix bzip2)/include" && \ | |
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include" && \ | |
LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" && \ | |
pyenv install -v 3.8.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: america great again | |
SHELL := /bin/bash | |
america: | |
@touch . | |
great: | |
@touch . | |
again: | |
@echo "Nah." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Flask Blueprint sublcass that overrides `route`. | |
Automatically adds rules for endpoints with and without trailing slash. | |
""" | |
from flask import Blueprint, Flask | |
class BaseBlueprint(Blueprint): | |
"""The Flask Blueprint subclass.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
You have a bunch of plane tickets from a recent multi-stop trip you took. | |
You dropped the tickets and they all got shuffled up. | |
Write some Python that takes the list of shuffled tickets | |
Where each ticket is in the format of (source, destination) | |
and reconstruct your trip. Output each city you were in, in chronological order. | |
""" | |
ticket_list = [ ('lax', 'ewr'), ('ord', 'jfk'), ('mia', 'ord'), ('cvg', 'sfo'), ('jfk', 'lax'), ('ewr', 'atl'), ('sfo', 'mia')] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func mergeSort(numbers: Int[], left: Int, right: Int) { | |
if right > left { | |
let splitIndex = (left + right) / 2 | |
mergeSort(numbers, left, splitIndex) | |
mergeSort(numbers, splitIndex+1, right) | |
var result = Int[]() | |
var nextLeft = left | |
var nextRight = splitIndex + 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A=$(curl https://api.github.com/zen -s) && git commit -m "$A" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0..9).each { |h| (0..9).each { |i| (0..9).each { |j| (0..9).each { |k| print "#{h}#{i}#{j}#{k}\n"}}}} |