Skip to content

Instantly share code, notes, and snippets.

View aheld's full-sized avatar

Aaron Held aheld

View GitHub Profile
@aheld
aheld / main.java
Created July 14, 2013 19:48
Connecting to Microsoft Exchange using Java to download email messages
import microsoft.exchange.webservices.data.*;
import java.net.URI;
public class Main {
public static void main(String [] args) throws Exception {
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
ExchangeCredentials credentials = new WebCredentials("[email protected]","PASSWORD");
service.setCredentials(credentials);
service.setUrl(new URI("https://EXCHANGE_SERVER_API_DOMAIN/ews/exchange.asmx"));
@aheld
aheld / Random Philly Addresses
Last active December 16, 2015 11:49
Random Philly addresses, python style You need to pip install names for this to work
import random
import names
streets = "Vine,Race,Cherry,Arch,John F Kennedy Boulevard,Market,Chestnut,Sansom,Walnut,Locust,Spruce,Pine,Lombard,South".split(',')
second = "suite,apartment,unit".split(',')
def gen2():
if random.randrange(100) <= 30:
return "%s #%s" % (random.choice(second), random.randrange(20))
else:
@aheld
aheld / APIProxyHandler.cs
Created November 15, 2012 20:22
.net http proxy hack to allow javascript in the browser to authenticate against IIS and have the server call out to antother server
/*
This allows a javascript app to hit a relative url such as
/Proxy/myapp.com/api/rest/2/issues
and then have the server make a call to
http://myapp.com/api/rest/2/issues
@aheld
aheld / jira_metrics.rb
Created June 12, 2012 19:01
JIRA API quick and dirty calculations
require 'pp'
require 'rubygems'
require 'open-uri'
require "uri"
require "net/http"
require 'openssl'
require 'json'
require 'digest/sha1'