Skip to content

Instantly share code, notes, and snippets.

View mapio's full-sized avatar
🎯
Focusing

Massimo Santini mapio

🎯
Focusing
View GitHub Profile
@willurd
willurd / web-servers.md
Last active April 26, 2024 18:00
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
{% extends 'admin/master.html' %}
{% import 'admin/lib.html' as lib with context %}
{% block body %}
{% call lib.form_tag() %}
{{ lib.render_form_fields(form) }}
<input type="submit" />
{% endcall %}
{% endblock %}
@christophermanning
christophermanning / 50_top_paid_chicago_lobbyists.json
Last active April 2, 2022 21:28
Chicago Lobbyists Force-Directed Graph Visualization
{"links":[{"target":1,"source":0},{"target":2,"source":0},{"target":3,"source":0},{"target":4,"source":0},{"target":5,"source":0},{"target":6,"source":0},{"target":7,"source":0},{"target":8,"source":0},{"target":9,"source":0},{"target":10,"source":0},{"target":11,"source":0},{"target":12,"source":0},{"target":13,"source":0},{"target":14,"source":0},{"target":15,"source":0},{"target":16,"source":0},{"target":17,"value":22,"source":0},{"target":18,"value":24,"source":0},{"target":19,"value":28,"source":0},{"target":20,"value":19,"source":0},{"target":21,"value":19,"source":0},{"target":22,"value":26,"source":0},{"target":23,"value":28,"source":0},{"target":25,"source":24},{"target":26,"source":24},{"target":27,"source":24},{"target":28,"source":24},{"target":29,"source":24},{"target":30,"source":24},{"target":31,"source":24},{"target":32,"source":24},{"target":33,"source":24},{"target":34,"source":24},{"target":35,"value":1,"source":24},{"target":36,"value":12,"source":24},{"target":23,"value":1,"source":24},{"
@endolith
endolith / frequency_estimator.py
Last active October 30, 2023 18:08
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