Skip to content

Instantly share code, notes, and snippets.

View mjarrett's full-sized avatar

Mike Jarrett mjarrett

View GitHub Profile
@mjarrett
mjarrett / nfsn_update_ip.py
Last active January 8, 2021 20:30
Quick script for using the Nearlyfreespeach.net API to update a resource record with your current IP. NfsnAuth class taken from https://github.com/ktdreyer/python-nfsn. I would suggest using the python-nfsn package, but it is broken for python>=3.6 because of a dependency on BeanBag. This script removes all 3rd party dependencies.
#!/usr/bin/env python3
import hashlib
import logging
import random
import requests
import string
import time
import json
import re
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Travel Trends from Mobi Data\n",
"\n",
"This analysis follows Jake VanerPlas's blog post: http://jakevdp.github.io/blog/2015/07/23/learning-seattles-work-habits-from-bicycle-counts/"
]
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<title>Machine+Learning+Mobi+Data</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<style type="text/css">
/*!
*
* Twitter Bootstrap
@mjarrett
mjarrett / pandas_dt_index.ipynb
Created May 26, 2017 21:40
Pandas datetime index with bar and line plots
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mjarrett
mjarrett / gist:24aaf6acf26cb0fa6d2bc633c2832ae0
Created May 26, 2017 21:36
Pandas datetime index with bar and line plots
<div class="cell border-box-sizing code_cell rendered">
<div class="input">
<div class="prompt input_prompt">In&nbsp;[1]:</div>
<div class="inner_cell">
<div class="input_area">
<div class=" highlight hl-ipython3"><pre><span></span><span class="o">%</span><span class="k">matplotlib</span> notebook
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="k">import</span> <span class="n">pyplot</span> <span class="k">as</span> <span class="n">plt</span>
<span class="n">df</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="n">pd</span><span class="o">.</span><span class="n">date_range</span><span class="p">(</span><span class="n">start</span><span class="o">=</span><span class="s1">&#39;2017-05-01&#39;</span><span class="p">,<