Skip to content

Instantly share code, notes, and snippets.

View williamgilpin's full-sized avatar

William Gilpin williamgilpin

View GitHub Profile
# This is code written by Nathaniel Virgo, for the sake of replying to a Twitter thread.
#
# The code is in the public domain and you can do what you want with it.
#
# It simulates N masses moving in 2D with Newtonian gravity, with symmetric initial
# conditions, and outputs an animated gif.
#
# This code makes no attempt to be accurate, because the whole point was to show
# the system breaking down as a result of numerical inaccuracies. In particular, it
# doesn't use a conservative ODE solver, so even before it breaks down a little bit of
@vhoulbreque
vhoulbreque / nteract-tricks.md
Last active March 30, 2021 14:44
Make conda environments visible in nteract

Nteract tricks

To add a conda environment to the list of environments:

$ source activate thisenv
(thisenv) $ pip install ipykernel
(thisenv) $ python -m ipykernel install --user --name thisenv
@johnpolacek
johnpolacek / .gitconfig
Last active May 8, 2024 04:05
My current .gitconfig aliases
[alias]
co = checkout
cob = checkout -b
coo = !git fetch && git checkout
br = branch
brd = branch -d
brD = branch -D
merged = branch --merged
st = status
aa = add -A .
@Chaser324
Chaser324 / GitHub-Forking.md
Last active May 13, 2024 11:18
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@sloria
sloria / bobp-python.md
Last active May 12, 2024 06:54
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@nrubin
nrubin / matlab.sublime-build
Last active August 17, 2017 14:21
Build System for Sublime Text 2 for MATLAB files on Windows
{
"cmd": ["C:\\Program Files\\MATLAB\\R2012b\\bin\\matlab", "-nosplash", "-nodesktop", "-r", "run('$file_name')"],
"selector": "source.m"
}
@endolith
endolith / frequency_estimator.py
Last active May 8, 2024 17:59
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread