Skip to content

Instantly share code, notes, and snippets.

View shandou's full-sized avatar

Shan Dou shandou

  • Vancouver, Canada
View GitHub Profile
@KoderDojo
KoderDojo / bisection-method.py
Created June 22, 2016 22:32
Bisection Method of Calculating Square Roots Using Python
number = abs(float(raw_input("Calculate square root of? ")))
lowerBound = abs(float(raw_input("Lower bound value? ")))
upperBound = abs(float(raw_input("Upper bound value? ")))
epsilon = 0.001
while True:
guess = (lowerBound + upperBound) / 2
difference = guess**2 - number
if abs(difference) <= epsilon:
@tomysmile
tomysmile / mac-setup-redis.md
Last active July 10, 2025 21:05
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@mutsune
mutsune / custom.css
Created February 22, 2017 14:45
Fira Code with Ligature for Jupyter Notebook
@font-face {
font-family: 'Fira Code';
src: url("https://cdn.rawgit.com/dunovank/jupyter-themes/1e851888/jupyterthemes/fonts/monospace/firacode/firacode.otf") format("opentype");
}
.CodeMirror {
font-family: 'Fira Code';
font-variant-ligatures: initial;
}
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2025 16:38
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@gene1wood
gene1wood / 01-explanation-of-python-logging-and-the-root-logger.md
Last active May 16, 2025 07:16
Explanation of the relationship between python logging root logger and other loggers

Explanation of the relationship between python logging root logger and other loggers