Skip to content

Instantly share code, notes, and snippets.

View timothypage's full-sized avatar

Tim Zwolak timothypage

  • Denver, Colorado
View GitHub Profile
# pip install fastapi "uvicorn[standard]" numpy matplotlib cairocffi
# run with uvicorn index:app (--reload)
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import io
from io import BytesIO

Intro To React

$ npm install -g create-react-app
$ create-react-app counter

delete everything except for index.js, registerServiceWorker.js

create components/ folder

create App.js

@timothypage
timothypage / socket.rb
Created August 2, 2016 23:07
Shitty Redis
require 'socket'
server = TCPServer.new 2000
data = {}
loop do
client = server.accept
client.puts "Welcome to the key-value server"
@timothypage
timothypage / pi.rb
Created August 2, 2016 21:14
Gauss–Legendre algorithm
require 'pry'
# implements https://en.wikipedia.org/wiki/Gauss%E2%80%93Legendre_algorithm
def calculate_pi(iterations)
a = 1.0
b = 1 / Math::sqrt(2)
t = 1.0 / 4
p = 1.0
while iterations > 0

Keybase proof

I hereby claim:

  • I am timothypage on github.
  • I am timothypage (https://keybase.io/timothypage) on keybase.
  • I have a public key whose fingerprint is 20AE E446 0884 9A97 231E 898D C425 3969 56BA 7B85

To claim this, I am signing this object:

@timothypage
timothypage / docker-compose.yml
Created April 13, 2016 17:30
Docker Compose for Asset Analyzer
asset_analyzer_redis:
image: redis:3.0.7
container_name: asset_analyzer_redis
net: yggdrasil
ports:
- 6379
restart: "unless-stopped"
asset_analyzer:
image: tutum.co/timothypage/asset-analyzer:0.0.9
@timothypage
timothypage / create_tasks.rb
Last active April 12, 2016 20:31
scheduler.rb
Sequel.migration do
change do
create_table(:tasks) do
primary_key :id
String :task_name
String :class_name
DateTime :last_ran
String :frequency # ie 4.hours
end
end
@timothypage
timothypage / Gemfile
Last active December 25, 2021 10:36
Quick hack to passthrough sinatra to webpack-dev-server for awesome client hot reloading plus live api endpoints
source "https://rubygems.org"
gem "rack-proxy"
gem "sidekiq"
gem "sinatra"
gem "sinatra-contrib"
gem "py"