Skip to content

Instantly share code, notes, and snippets.

View mlgill's full-sized avatar

Michelle Gill mlgill

View GitHub Profile
@mlgill
mlgill / New reminder from Launchbar
Last active May 18, 2021 13:19 — forked from Jayphen/New reminder from Launchbar
A script for quickly adding reminders to the Reminders app in Mountain Lion from Launchbar and Alfred. Save this as a .scpt and drop it in ~/Library/Application\ Support/LaunchBar/Actions
--Script for setting Reminders for LaunchBar and Alfred
--For Alfred, Applescript must NOT be set to run in Background otherwise date parsing does not work
--For LaunchBar, place the script in ~/Library/Scripts/LaunchBar
--by Michelle L. Gill, 10/07/2012
--Inspired by https://gist.github.com/3187630
--A related Alfred version 2 workflow can be found here: https://github.com/mlgill/alfred-workflow-create-reminder
--Changes
--02/01/2013 * Fixed an issue with setting the time when the hour is 12 and AM/PM (12-hour clock) is used
-- * Removed the ability to set seconds for the time since Reminders doesn't recognize them
@mlgill
mlgill / pipista.py
Last active July 30, 2020 23:16 — forked from pudquick/pipista.py
pipista: iOS (Pythonista), attempts to seamlessly download and unpack files from PyPi Changes from fork: (1) fixes xmlrpclib import if _auto_path is False; (2) automatically uncompresses and untars downloaded files.
import os, os.path, sys, urllib2, requests, gzip, tarfile
class PyPiError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def _chunk_report(bytes_so_far, chunk_size, total_size):
if (total_size != None):
@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, michelle@michellelynngill.com
# requires my dropboxsetup module (https://gist.github.com/8311046)
# Change log
# 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.
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):
# 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)
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@mlgill
mlgill / gsDL.py
Last active August 29, 2015 14:17 — forked from pudquick/gsDL.py
import re, hashlib, uuid, json, random, os, urllib2, os.path, time, sys, SimpleHTTPServer, SocketServer, string, console, webbrowser, shutil, zipfile
class SmarterHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
server_version = 'SimpleHTTP/0.6'
file_name = ''
def do_GET(self):
if self.path.startswith('/transfer'):
self.get_transfer()
else:
f = self.send_head()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import multiprocessing
import pandas as pd
import numpy as np
def _apply_df(args):
df, func, kwargs = args
return df.apply(func, **kwargs)
def apply_by_multiprocessing(df, func, **kwargs):
workers = kwargs.pop('workers')