Skip to content

Instantly share code, notes, and snippets.

@hartez
hartez / attachments3.py
Created October 4, 2015 19:21
Plotting email attachment data using pandas
import pandas as pd
import numpy as np
import humanfriendly
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import os.path
# Read in our email data file
df = pd.read_csv('../attachments2.csv', header = 0)
@hartez
hartez / emailwordcounts.py
Created October 25, 2015 20:44
Python script for counting words in emails
from bs4 import BeautifulSoup as bsoup
import pandas as pd
import numpy as np
import humanfriendly
# Read in email data file
df = pd.read_csv('../bodytext.csv', header = 0)
# Filter out sent mail
emails = df.query('FromEmail != "[my email address]"').copy()
@hartez
hartez / bodytext.ps1
Last active February 9, 2017 18:10
PowerShell script to pull email body text out of GMVault
$emails = @()
$gmvaultdb = "[path to your gmvault data]"
$total = (Get-ChildItem $gmvaultdb -Recurse -Filter *.eml | measure).Count
Add-Type -Path "MimeKit.1.2.10.0\lib\net45\MimeKit.dll"
$formats = @{
[MimeKit.Text.TextFormat]::Text = 0;

Keybase proof

I hereby claim:

  • I am hartez on github.
  • I am hartez (https://keybase.io/hartez) on keybase.
  • I have a public key ASDHDfsQ0rypUYqHl9WtalmOx-BzQgjxRscWRqnmdtVdpAo

To claim this, I am signing this object:

@hartez
hartez / TranslatePage.cs
Created October 3, 2017 22:07
Add gesture to off-screen view, animate it onto the screen, gesture still works
public class TranslatePage : ContentPage
{
public TranslatePage()
{
var layout = new RelativeLayout();
var tapGesture = new TapGestureRecognizer
{
Command = new Command(() => DisplayAlert("Box Tapped", "The box was tapped", "Cool, thanks."))
};
@hartez
hartez / TranslatePage.cs
Last active October 4, 2017 20:24
View accepts input after translation
public class TranslatePage : ContentPage
{
public TranslatePage()
{
var layout = new RelativeLayout();
double viewSize = 100;
var box = new Entry
{