Skip to content

Instantly share code, notes, and snippets.

View matthewarkin's full-sized avatar

Matthew Arkin matthewarkin

View GitHub Profile
@matthewarkin
matthewarkin / es.sh
Last active December 21, 2015 04:49
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.7.deb
sudo dpkg -i elasticsearch-0.90.7.deb
## CREATE THE INDEX WITH ANALYZERS AND MAPPINGS
curl -XPUT 'http://127.0.0.1:9200/eshtml/?pretty=1' -d '
{
"mappings" : {
"page" : {
"dynamic":false,
"properties" : {
"title" : {
"fields" : {
#Create a Card Token
curl https://api.stripe.com/v1/tokens \
-u [private key]: \
-d "card[number]=4242424242424242" \
-d "card[exp_month]=12" \
-d "card[exp_year]=2015" \
-d "card[cvc]=123"
curl https://api.stripe.com/v1/charges \
-u [private key]: \
@matthewarkin
matthewarkin / gist:bb310ee27323ffee7ab8
Last active August 6, 2017 17:24
stripe upgrade, prorate, and bill for proration instantly
//create subscription
// $20 a month
curl https://api.stripe.com/v1/customers/cus_18nj91X8lMXyju/subscriptions
-u private key:
-d plan=gold
//change subscription - upgrade plan
//$40 a month
curl https://api.stripe.com/v1/customers/cus_18nj91X8lMXyju/subscriptions/sub_4HWcxqoS8wG7T3 \
-u private key: \
@matthewarkin
matthewarkin / stripeAddSub.html
Created July 23, 2014 23:52
Stripe Add Subscription Modal
<div class="modal" style="opacity: 1; -webkit-transform: none; top: 130px; display: block;"><div class="subscription-add-or-edit-view standard modal-dialog-form-content-view"><div class="modal-inner">
<div class="modal-header">
<h2>Add subscription</h2>
</div>
<div class="modal-sheet-inner">
<div class="modal-content">
<span class="modal-error">
@matthewarkin
matthewarkin / gist:70d5a775175e6b915f55
Created July 28, 2014 17:57
stripe set customer default card
curl https://api.stripe.com/v1/customers/cus_id
-u YOUR_SECRET_KEY:
-d "default_card=card_id"
<?php
require_once(dirname(__FILE__) . '/config.php');
$token = $_POST['stripeToken'];
$customer = Stripe_Customer::create(array(
'email' => 'customer@example.com',
'card' => $token
'plan' => 'fancy_plan_id'
));
NSDictionary *achInfo = @{@"country":@"US", @"routing_number":rountingNumber, @"account_number":accountNumber};
NSDictionary *dataDictionary = @{@"bank_account[country]": @"US",
@"bank_account[routing_number]" : rountingNumber,
@"bank_account[account_number]" : accountNumber};
@matthewarkin
matthewarkin / postedResponse.txt
Last active August 29, 2015 14:05
Stripe Billing and Shipping Address
stripeToken: tok_14QSDT2BnSLXc1GoU6JR4ZoX
stripeTokenType: card
stripeEmail: example@example.com
stripeBillingName: Matthew Arkin
stripeBillingAddressLine1: 123 Main St
stripeBillingAddressApt:
stripeBillingAddressZip: 94105
stripeBillingAddressCity: San Francisco
stripeBillingAddressState: CA
stripeBillingAddressCountry: United States
@matthewarkin
matthewarkin / reponses
Last active August 29, 2015 14:05
Stripe Addresses Reponse
stripeToken: tok_14QSDT2BnSLXc1GoU6JR4ZoX
stripeTokenType: card
stripeEmail: example@example.com
stripeBillingName: Matthew Arkin
stripeBillingAddressLine1: 123 Main St
stripeBillingAddressApt:
stripeBillingAddressZip: 94105
stripeBillingAddressCity: San Francisco
stripeBillingAddressState: CA
stripeBillingAddressCountry: United States