Skip to content

Instantly share code, notes, and snippets.

View mlgill's full-sized avatar

Michelle Gill mlgill

View GitHub Profile
@jiffyclub
jiffyclub / tserv
Last active September 3, 2020 09:14
Start a Tornado static file server in a given directory. To start the server in the current directory: `tserv .`. Then go to `http://localhost:8000` to browse the directory.
#!/usr/bin/env python
"""
Starts a Tornado static file server in a given directory.
To start the server in the current directory:
tserv .
Then go to http://localhost:8000 to browse the directory.
Use the --prefix option to add a prefix to the served URL,
{"display_name":"Julia","argv":["/usr/bin/julia","-i","-F","/home/jupyter/.julia/v0.3/IJulia/src/kernel.jl","{connection_file}"],"language":"julia","codemirror_mode":"julia"}
@jbarratt
jbarratt / nblist
Last active August 29, 2015 14:04
nblist
#!/usr/bin/env python
""" A cross-platform (POSIX, at least) tool to list running IPython Notebooks
and their working directories.
This code will be incredibly simpler to write as of IPython 3.0, so
contains numerous workarounds to make it work on 2.x.
Thanks to @takluyver for the suggestions for improvement.
@jbarratt
jbarratt / nbgrep
Last active July 31, 2025 23:11
'nbgrep', search the code of all your ipython notebooks
#!/bin/bash
# usage: nbgrep 'pattern'
SEARCHPATH=~/work/
# 'jq' technique lifted with gratitude
# from https://gist.github.com/mlgill/5c55253a3bc84a96addf
# Break on newlines instead of any whitespace
@omz
omz / Dropbox File Picker.py
Last active February 20, 2025 09:40
Dropbox File Picker.py
# IMPORTANT SETUP INSTRUCTIONS:
#
# 1. Go to http://www.dropbox.com/developers/apps (log in if necessary)
# 2. Select "Create App"
# 3. Select the following settings:
# * "Dropbox API app"
# * "Files and datastores"
# * "(No) My app needs access to files already on Dropbox"
# * "All file types"
# * (Choose any app name)
@ChrisBeaumont
ChrisBeaumont / cat_qglue.py
Created May 15, 2014 15:55
Using qglue with categorical data
from glue import qglue
from glue.core.data_factories import panda_process
import pandas as pd
df = pd.read_csv(...)
data = panda_process(df) # convert to Glue data, detect categorical components
qglue(data=data) #start ui
#alternatively, from the GUI, choose file->open data set, and choose file type=Pandas table
@sburns
sburns / 00_nbimport.py
Created May 9, 2014 18:50
A startup file for IPython that provides a hook into python's import infrastructure so we can import notebooks as python modules. This helps code sharing/re-use between notebooks.
import io
import os
import sys
import types
from IPython.nbformat import current
from IPython.core.interactiveshell import InteractiveShell
def find_notebook(fullname, path=None):
@hiilppp
hiilppp / DrafTerm.scpt
Last active October 15, 2019 12:13
As a text file is added to a directory to which this AppleScript is associated as Folder Action, the content of the received file is executed as shell script and the generated output sent to an iOS device.
-- Replace "[Pushover_user_key]" on line #42 with your Pushover accout's user
-- key. (You can find it here: <https://pushover.net/dashboard>)
-- You should probably also replace the app token provided on line #41 with one
-- of your own. (They can be generated here: <https://pushover.net/apps/build>)
on URL_encode(a)
set safe_characters to "abcdefghijklmnopqrstuvwxyz0123456789~-_."
set hex to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"}
set a_encoded to ""
@audy
audy / uncertain pandas.ipynb
Created April 9, 2014 12:04
error propagation using Pandas and Uncertainties
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ramnathv
ramnathv / Makefile
Last active September 2, 2022 14:31
Rmd to IPython Notebook and HTML
all: example.ipynb example.html
example.md: example.Rmd
./knit
example.ipynb: example.md
notedown example.md | sed '/%%r/d' > example.ipynb
example.html: example.Rmd
R -e "knitr::knit2html('example.Rmd')"