Skip to content

Instantly share code, notes, and snippets.

View mlgill's full-sized avatar

Michelle Gill mlgill

View GitHub Profile
@mlgill
mlgill / tserv
Created December 29, 2015 20:27 — forked from jiffyclub/tserv
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,
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')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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()
#!/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 / tmuxp.sh
Last active June 22, 2022 09:43
Execute parallel processes in arbitrary number of tmux panes
#!/bin/bash
# The "tmuxifier"
# Execute parallel processes in an arbitrary number of tmux panes
# This script requires the path to an existing script to
# execute in parallel. Optionally, the number of threads to
# and the name of the tmux session can be input. If threads
# and session name are not entered, threads are determined
# automatically and session names is set to a default.
@mlgill
mlgill / proc.sh
Last active October 17, 2022 18:41
Bash script to display sorted list of processes using most memory or cpu with colorized output
#!/bin/bash
# Michelle L. Gill
# 2014/10/25
# For use with Today Scripts
# http://www.reddit.com/r/osx/comments/2k24ps/today_scripts_widget_update_colorized_output
# Inspired by: https://gist.github.com/anonymous/470bb40b05173fdb6348
# Set this to "cpu" or "mem"
procname="cpu"
@mlgill
mlgill / adblock_plus
Last active August 29, 2015 14:07
Useful custom Adblock Plus Filters
(The start of) A personal list of useful Adblock Plus filters.
Add these to the "Add your own filters" section of Adblock Plus.
* Remove Google Plus posts from Google News:
news.google.com##.gpost-bubble
@mlgill
mlgill / gslfft_test.c
Last active August 29, 2015 14:05
Issue with passing wavetable array for use with FFT from GNU Scientific Library
#include <gsl/gsl_fft_complex.h>
#include <stdio.h>
void fft_test(int *dims, gsl_fft_complex_wavetable *wt, gsl_fft_complex_wavetable *wt_x, gsl_fft_complex_wavetable *wt_y, gsl_fft_complex_wavetable *wt_z) {
printf("\nFFT Test\n");
printf("%d, %d, %d\n", dims[0], dims[1], dims[2]); // This is OK
printf("%d, %d, %d\n", wt_x, wt_y, wt_z); // These are equal to values from main function--OK