Skip to content

Instantly share code, notes, and snippets.

View mitchellvitez's full-sized avatar

Mitchell Vitez mitchellvitez

View GitHub Profile
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.State
import Data.Word
import Foreign.C.Types
import Graphics.UI.GLUT as GL hiding (Window, createWindow, bitmap, get, renderer)
import SDL hiding (get)
import requests
from bs4 import BeautifulSoup
def soupify(url):
page = requests.get(url)
return BeautifulSoup(page.text, 'html.parser')
parks = soupify('https://www.nps.gov/planyourvisit/fee-free-parks-state.htm').find_all('a')
for park in parks:
@mitchellvitez
mitchellvitez / Relativity.elm
Created January 22, 2019 21:16
A relativity calculator for finding the Lorentz factor at various velocities
module Relativity exposing (main)
import Html exposing (..)
import Html.Attributes exposing (style, src, min, max, type_, value)
import Html.Events exposing (onClick, onInput, onMouseEnter, onMouseDown, onMouseUp)
type Msg
= SetMacro String
| SetMedium String
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
module Main where
import Control.Applicative
import Data.Aeson
import Data.Char
import GHC.Generics
import Numeric
-- Tree drawings
-- Left click and drag to pan the drawing
-- Right click and drag to zoom
-- install this by running `cabal install gloss`
-- You may need to install/update opengl
import Graphics.Gloss
-- Config variables for n-ary tree with k levels of depth