Skip to content

Instantly share code, notes, and snippets.

View mlgill's full-sized avatar

Michelle Gill mlgill

View GitHub Profile

Auto Synchronized Backups with Bittorrent sync & a vps

1. Cloud syncing on the cheap

Two awsome things were released yesterday :

Compare this to the pricing of : dropbox pro

@pudquick
pudquick / gsDL.py
Last active December 17, 2015 11:59
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()
@mblondel
mblondel / sparse_multiclass_numba.py
Last active January 27, 2020 14:58
Sparse Multiclass Classification in Numba!
"""
(C) August 2013, Mathieu Blondel
# License: BSD 3 clause
This is a Numba-based reimplementation of the block coordinate descent solver
(without line search) described in the paper:
Block Coordinate Descent Algorithms for Large-scale Sparse Multiclass
Classification. Mathieu Blondel, Kazuhiro Seki, and Kuniaki Uehara.
Machine Learning, May 2013.
@waltonjones
waltonjones / Stylable Pandas Groupby Boxplots
Last active March 1, 2016 16:38
This gist includes a function called stylable_groupby_boxplot() that receives a pandas dataframe object and the column you want to groupby and returns a dictionary that includes all the boxplot's parts just like the standard matplotlib boxplot function does.
from numpy.random import rand
import matplotlib.pyplot as plt
import pandas as pd
# 2 columns produces an array of 2 matplotlib.axes.AxesSubplot objects
df2 = pd.DataFrame(rand(10,2), columns=['Col1', 'Col2'] )
df2['X'] = pd.Series(['A','B','A','B','A','B','A','B','A','B'])
#1 column produces a single matplotlib.axes.AxesSubplot object
df1 = pd.DataFrame(rand(10), columns=['Col1'] )
@yong27
yong27 / apply_df_by_multiprocessing.py
Last active April 12, 2023 04:35
pandas DataFrame apply multiprocessing
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')
@nealtz
nealtz / TNG_Redirect_Example.py
Last active August 29, 2015 13:57
Redirect Telefonnumbers via TNG.de
# -*- coding: utf-8 -*-
# Check and change redirection status of a telefon number via the
# website of my telephone network service provider TNG.de
# Python Script for iOS Pythonista App (Vers. 1.4)
from bs4 import BeautifulSoup
import requests, console, re, sys, time, exceptions
try:
@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')"
@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.
@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 ""
@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):