Skip to content

Instantly share code, notes, and snippets.

Rob Heaton robert

Block or report user

Report or block robert

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robert
robert / game_of_life.py
Last active May 30, 2019
Programming projects for Advanced Beginners #2: Game of Life
View game_of_life.py
import random
import time
DEAD = 0
LIVE = 1
def dead_state(width, height):
"""Constuct an empty state with all cells set to DEAD.
Parameters
View gini.py
import numpy as np
import random
import plotly
import plotly.graph_objs as go
N_QUINTILES = 5
def gini(array):
View ascii_art.py
# Programming projects for Advanced Beginners: ASCII art
# (https://robertheaton.com/2018/06/12/programming-projects-for-advanced-beginners-ascii-art/)
from PIL import Image
import subprocess
from colorama import Fore, Style
ASCII_CHARS = "`^\",:;Il!i~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$"
MAX_PIXEL_VALUE = 255
View gist:6052207
require "net/http"
require "uri"
secret_token = "stolen-from-github-or-somewhere"
# Construct your evil hash
my_evil_session_hash = {
"ive_made_a_huge_mistake" => true
}
You can’t perform that action at this time.