Skip to content

Instantly share code, notes, and snippets.

View john-science's full-sized avatar

John Stilley john-science

View GitHub Profile
@john-science
john-science / .bashrc
Last active April 9, 2024 15:27
A handy .bashrc file.
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# aliases I love
alias l='ls -thal'
alias lh='ls -thal'
@john-science
john-science / monty_hall.py
Created April 3, 2024 23:05
Let's solve the Monty Hall problem using Monte Carlo!
"""
Modeling the Monty Hall Problem
https://en.wikipedia.org/wiki/Monty_Hall_problem
Suppose you're on a game show, and you're
given the choice of three doors: Behind one
door is a car; behind the others, goats. You
pick a door, say No. 1, and the host, who
knows what's behind the doors, opens another
@john-science
john-science / plot_my_weight.py
Last active February 14, 2024 15:07
Python script for plotting my weight over time
""" plot_my_weight.py
This is a simple scatter-and-line plot of my body weight at various times. The challenge is that
the data is very irregular. This program reads in a CSV of this form:
datetime,weight(lbs),Steps,Meals,Calories,Run (km),anything,else...
2010-02-18,165
2010-02-25,156.6
2010-03-11,154.4
2022-06-22,159.1,10000,2,1500,5,...
@john-science
john-science / snake.sh
Created August 7, 2017 22:53
The classic Snake game, written in Bash.
#!/bin/bash
#
# Centipede game
#
# v2.0
#
# Author: sol@subnetzero.org
#
# Functions
@john-science
john-science / chess_training.md
Last active December 7, 2023 09:11
Training for Chess

Chess Training

My current goals:

  1. Go through my checklist before EVERY move.
  2. Stop playing hope chess: if you can find a single weakness in an idea, abandon it and find a new idea.

The Checklist

@john-science
john-science / chess_games.md
Last active May 1, 2023 22:03
Interesting Chess Games

Just various chess games I found interesting. Ideally, I find a PGN and paste it into the lichess analysis board.

YEAR_MM_DD Light Player Dark Player Result Link Thoughts
1834 McDonnell De La Bourdonnais 0-1 W YT An amazing push of three pawns all the way to the 8th rank.
1847 Paul Morphy Alonzo Morphy 1-0 YT L An 8-year-old Paul Morphy beats his father in a very solid game.
1850-05 Paul Morphy Johann Lowenthal 1-0 YT Morphy, 13, wins his first game against a master.
1850-05 Paul Morphy Johann Lowenthal 1-0
@john-science
john-science / freemont_diner_buttermilk_biscuits.md
Last active March 2, 2023 15:01
Fremont Diner Buttermilk Biscuits Recipe

Buttermilk Biscuits

Makes 12 2 ½” biscuits

This is a recipe for fluffy biscuits, not flakey. They are best straight out of the oven with butter or jam. Always make extra, they are great split, buttered, and griddled for breakfast sandwiches. We use a food processor to mix the butter and flour. You can use your hands or a fork but using the food processor helps to keep the butter cold which will help make tender biscuits (and it is much faster & more uniform).

Equipment

  • food processor
  • 2 ½” round biscuit cutter
@john-science
john-science / build_your_own_lisp.md
Last active December 9, 2021 05:27
Build Your Own LISP

Build Your Own LISP

I had fun building my own LISP (Slow Loris). The project was extremely easy to get off the ground, because there a ton of resources to do just this. I thought it might be handy to have a little links round-up, based on my research.

In Python

There are already several good projects out there on writing your own LISP in Python.

Peter Norvig's LisPy

@john-science
john-science / vimrc
Last active October 22, 2021 00:54
Customizing your VI/VIM experience.
" NERDTree for file viewing:
" https://github.com/preservim/nerdtree
" Taglist for Python-awareness
" https://github.com/yegappan/taglist
" https://sourceforge.net/projects/vim-taglist/
" apt-get install ctags
set linebreak
set textwidth=200
set showmatch
set hlsearch