Skip to content

Instantly share code, notes, and snippets.

Rob Heaton robert

View GitHub Profile
@robert
robert / game_of_life.py
Last active Dec 18, 2018
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.