Skip to content

Instantly share code, notes, and snippets.

View sawyer's full-sized avatar

Sawyer Bateman sawyer

  • EasyPost
  • San Francisco, CA
View GitHub Profile
# This program will take swag.csv and create a batch of USPS
# shipping labels in one PDF file for easy printing using
# the EasyPost simple shipping API.
#
# If you have any questions about EasyPost or want help
# modifying this script for other carriers or a non-US
# source address please email us anytime at contact@easypost.com
#
# Usage:
# easypost_batch_from_csv.rb
@sawyer
sawyer / ThreadTest.java
Created May 15, 2015 19:28
EasyPost Java Threading Example
package com.easypost;
import com.easypost.model.*;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Rule;
import org.junit.rules.ExpectedException;
import java.text.ParseException;
import java.util.HashMap;
@sawyer
sawyer / all_shipments.php
Last active August 29, 2015 14:24
Paging through all EasyPost Shipments in PHP
<?php
require_once("../lib/easypost.php");
\EasyPost\EasyPost::setApiKey('cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi');
$base_params = array(
"start_datetime" => "2015-07-01",
"end_datetime" => "2015-08-01",
"purchased" => false, // actually means only_purchased?
"page_size" => 10
@sawyer
sawyer / easypost_stripe_relay.rb
Last active September 3, 2017 11:17
Sample integration of EasyPost with Stripe Relay.
require 'stripe'
require 'easypost'
Stripe.api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
EasyPost.api_key = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
SHIPPING_ORIGIN_ADDRESS = {
company: "EasyPost",
street1: "417 Montgomery St",
street2: "5 FL",