Skip to content

Instantly share code, notes, and snippets.

Avatar

Michelle Gill mlgill

View GitHub Profile
@mlgill
mlgill / jupyter_collapse_headings_html
Created Aug 30, 2018 — forked from tarokiritani/jupyter_collapse_headings_html
small script to collapse headings in jupyter notebook after converted to html
View jupyter_collapse_headings_html
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
var all_cells = $("div.cell");
$.each(all_cells, function( index, value ) {
if ($(value).find("h1").length == 0){
$(value).hide()
} else{
var bare_h1 = $(value).find("h1").text()
View docker_hygiene.sh
# Remove all exited containers
docker rm `docker ps -a -q --filter status=exited` 2>/dev/null
# Remove any orphaned containers related to "INSERT_CONTAINER_NAME_HERE"
docker rm `docker ps -a -q --filter ancestor=INSERT_CONTAINER_NAME_HERE` 2>/dev/null
# Remove any orphaned images from aborted/old builds
docker rmi `docker images -q -f "dangling=true"` 2>/dev/null
# Clean up whatever disk-hogging stuff Docker leaves lying aroung
@mlgill
mlgill / amsgrad.py
Created Feb 2, 2018 — forked from kashif/amsgrad.py
Keras implementation of AMSGrad optimizer from "On the Convergence of Adam and Beyond" paper
View amsgrad.py
class AMSgrad(Optimizer):
"""AMSGrad optimizer.
Default parameters follow those provided in the Adam paper.
# Arguments
lr: float >= 0. Learning rate.
beta_1: float, 0 < beta < 1. Generally close to 1.
beta_2: float, 0 < beta < 1. Generally close to 1.
epsilon: float >= 0. Fuzz factor.
@mlgill
mlgill / setup_aws_gpu.sh
Last active Apr 3, 2019
Setup AWS GPU instance
View setup_aws_gpu.sh
#!/bin/bash
####################################################################################
## AWS GPU Instance Setup Script ##
## Michelle L. Gill ##
## michelle@michellelynngill.com ##
## Gist location: https://gist.github.com/mlgill/63114af65d9dd3e1c386b03a02c199b7 ##
## Date updated: 2017/05/27 ##
####################################################################################
@mlgill
mlgill / Gaussian_elimination.py
Created Apr 11, 2017 — forked from mikofski/Gaussian_elimination.py
numpy scipy gaussian elimination using LU decomposition with pivoting
View Gaussian_elimination.py
#! /usr/bin/env python
"""
Solve linear system using LU decomposition and Gaussian elimination
"""
import numpy as np
from scipy.linalg import lu, inv
def gausselim(A,B):
@mlgill
mlgill / README.md
Last active Nov 23, 2022
Sets up a data science focused conda environment use a specified python version and path.
View README.md

Automated Conda Setup

Michelle L. Gill
Updated: 2017/05/20

Regularly updated Gist located here.

This bash script will download and setup a Conda environment on Mac OS X or Linux using a specified Python version (2.7, 3.6) and packages. The Conda installation path and environment name can also be specified. All settings are input at the beginning of the script (see below).

If the Conda directory exists and can be determined to be a Conda installation, a new environment will be created. If the directory does exist but does not appear to be a Conda installation, the script will quit to avoid accidentally overwriting a file.

@mlgill
mlgill / scrape_tweets.js
Created Apr 7, 2016
Scrape Tweets with CasperJS
View scrape_tweets.js
var utils = require('utils'),
fs = require('fs'), tweet_account_name,
nbLinks, outputfilename,
header = "Tweet,Timestamp",
stream, css, count = 0, images,
casper = require('casper').create({
viewportSize: {
width: 480,
height: 360
},
@mlgill
mlgill / instant_jupyter_notebook.zsh
Last active Mar 23, 2016
Downloads the conda install script, creates an environment with basic scientific packages, and launches a jupyter notebook. Ideally want the environment to be cleaned up at the end.
View instant_jupyter_notebook.zsh
#!/usr/bin/env zsh
# set Linux/Darwin url
if [[ `uname` == "Darwin" ]]; then
echo "Detected Mac OS X..."
url="http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh"
else
echo "Detected Linux..."
url="http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh"
fi
View simple-https-server.py
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@mlgill
mlgill / keybase.md
Created Jan 21, 2016
Keybase.io Identity Verification
View keybase.md

Keybase proof

I hereby claim:

  • I am mlgill on github.
  • I am mlgill (https://keybase.io/mlgill) on keybase.
  • I have a public key whose fingerprint is 64D5 7A40 E2C2 1E49 EF96 F194 E45F 4767 96F8 74BB

To claim this, I am signing this object: