Skip to content

Instantly share code, notes, and snippets.

View christopherphan's full-sized avatar

Christopher Phan christopherphan

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@christopherphan
christopherphan / best_wordle_words_remaining.ipynb
Last active March 6, 2022 18:38
The best initial word to play in Wordle, based on how many words are expected to be ruled out
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@christopherphan
christopherphan / best_wordle_letter_frequency.ipynb
Last active January 20, 2022 04:51
The best initial word to play in Wordle, based on letter frequencies
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@christopherphan
christopherphan / aholedecorator.py
Last active March 23, 2022 19:32
A silly Python decorator that I made as a **BAD** joke
#!/usr/bin/env python3
########################################################################################
# Terrible joke Python decorator
#
# By Christopher Phan, cphan@chrisphan.com
# github: christopherphan
#
# MIT License
#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@christopherphan
christopherphan / Senate_representation_by_impeachment_trial_vote.md
Last active March 19, 2021 23:42
A breakdown of how many people are represented by senators voting for or against conviction in the Feb. 2021 presidential impeachment trial

Population represented in the U.S. Senate by by Feb. 2021 impeachment trial vote

In February 2021, the U.S. Senate acquitted a former president after an impeachment trial. To convict would have required 2/3 of senators (67 of the full Senate) to vote guilty; the final vote was 57 votes for guilty and 43 votes for not guilty. This chart illustrates how many U.S. residents are represented by senators who voted for and against impeachment.

Population figures are from 2019.

Copyright and license info

@christopherphan
christopherphan / Senate_representation_by_party.md
Last active March 18, 2021 04:25
A breakdown of how many people are represented by each party in the U.S. Senate

Population represented in the U.S. Senate by party

As of March 2021, there are 100 U.S. Senators (as there has been since the admission of Hawaii in 1959), 50 of whom are Democrats (or independents who caucus with the Democrats), and 50 of whom are Republicans. (Democratic Vice-president Kamala Harris can cast a tie-breaking vote, which gives control of the chamber to the Democrats.) However, the states represented by Democrats are altogether larger in population than those represented by Republicans. This graphic illustrates how.

Population figures are from 2019.

Copyright and license info

#!/usr/bin/env python3
# leg_sizes.py
# Christopher Phan
# cphan@chrisphan.com
# https://chrisphan.com/
#
# Takes data from the Wikipedia article "List of legislatures by number of
# members", and peforms a linear regression on n = kP^alpha
# where n is the number of members of the lower house of a nation's legislature

Keybase proof

I hereby claim:

  • I am christopherphan on github.
  • I am christopherphan (https://keybase.io/christopherphan) on keybase.
  • I have a public key ASBX9sPz1e1QSSvW93F6712vQ6wi1GJ5JSjmf3htX-RfSAo

To claim this, I am signing this object: