Skip to content

Instantly share code, notes, and snippets.

View mlgill's full-sized avatar

Michelle Gill mlgill

View GitHub Profile
@mlgill
mlgill / uninstall_adobe_air.sh
Last active May 3, 2021 02:00
Uninstalling Adobe AIR on Mac OS X
#!/bin/sh
# Installing Adobe AIR creates an application called "Adobe AIR Uninstaller" in /Applications/Utilities.
# Unfortunately, running this application does not uninstall the application and instead, it seems to
# unhelpfully confirm that it's installed (http://twitter.com/modernscientist/status/495388916267384833/photo/1).
# The proper way to run this application as an uninstaller is to run the enclosed from the command line
# with the flag "-uninstall" as superuser:
sudo /Applications/Utilities/Adobe\ AIR\ Uninstaller.app/Contents/MacOS/Adobe\ AIR\ Installer -uninstall
@mlgill
mlgill / owncloudsetup.md
Last active October 4, 2017 01:53
OwnCloud setup on Ubuntu 14.04

OwnCloud 6 Setup on Ubuntu 14.04

Basic Setup (test prior to adding SSL)

Adapted from here but updated for Ubuntu 14.04 and its apache configuration file location. Most of the instructions in this link did not have to be followed as they were already the defaults and/or the apache files were in different locations

1. Install the appropriate packages: apt-get install owncloud apache2 mysql-server php5 php5-mysql. You will be asked to set a password for the root MySQL user.

2. Ensure apache and mysql are running: sudo /etc/init.d/mysql restart and sudo /etc/init.d/apache2 restart

@mlgill
mlgill / ipython_nb_shell.sh
Last active July 23, 2018 04:04
Bash/Zsh functions for viewing/grepping only the input code of an IPython notebook and for clearing output cells.
# Two very basic functions for searching just the input code of an IPython notebook
# Written because I often want to search notebooks for snippets but the giant output
# of embedded encoded images makes it difficult.
# Ipython's nbconvert can be used to extract just the input, but this requires
# writing to a separate file and can be quite slow when used with large notebooks.
# Additionally, find/xargs can be used with igrep when the name of the notebook isn't known.
# icat could be used to convert an IPython notebook to a standard python file if
# the notebook does not contain whole-cell magics.
# 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)
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):
@mlgill
mlgill / rmerge.py
Last active March 8, 2023 18:19
A modified version of pandas merge command that will replace overlapping columns not associated with the join rather than appending a suffix.
import pandas as pa
def rmerge(left,right,**kwargs):
"""Perform a merge using pandas with optional removal of overlapping
column names not associated with the join.
Though I suspect this does not adhere to the spirit of pandas merge
command, I find it useful because re-executing IPython notebook cells
containing a merge command does not result in the replacement of existing
columns if the name of the resulting DataFrame is the same as one of the
@mlgill
mlgill / btsync_control.scpt
Created January 23, 2014 00:18
AppleScript to control throttling of BitTorrent Sync on Mac, optionally using Keyboard Maestro
--Applescript to (un)throtle BitTorrent Sync
--Requires AppleScript Editor to have Accessibility permissions in Mavericks
--Michelle L. Gill, 2014/01/22
--limitBTsync is set to 1 to limit bandwidth or 0 for unlimited bandwidth
--this assumes the appropriate text boxes are already populated with
--the values for limited bandwidth
tell application "Keyboard Maestro Engine"
set limitBTsync to the value of (make variable with properties {name:"limitBTsync"})
end tell
# Source: https://gist.github.com/4145515
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.
@mlgill
mlgill / image_joiner.py
Last active January 2, 2016 13:39
image_joiner: iOS (Pythonista) and Mac OS X, joins two images horizontally or vertically
import sys, Image, math
# Join two images together, either horizontally or vertically,
# with resizing to match joined dimension. Works on Mac OS X or iOS.
# On Mac OS X, the Python Imaging Library is required
# On iOS, Pythonista is required
# Michelle L. Gill, 2014/01/20
# Padding and borders
padding = 10
@mlgill
mlgill / DropboxSync.py
Last active February 12, 2019 18:11 — forked from wrenoud/DropboxSync.py
DropboxSync: iOS (Pythonista), synchronizes all files to/from Dropbox directory
import os, sys, pickle, console, re
sys.path += ['lib']
import dropboxsetup
# dropbox_sync
# by Michelle L. Gill, [email protected]
# requires my dropboxsetup module (https://gist.github.com/8311046)
# Change log