Skip to content

Instantly share code, notes, and snippets.

View matthewarkin's full-sized avatar

Matthew Arkin matthewarkin

View GitHub Profile
@matthewarkin
matthewarkin / argsoutput.js
Last active August 29, 2015 14:05
Output of Stripe Args
{
billing_address_apt: "",
billing_address_city: "San Francisco",
billing_address_country: "United States",
billing_address_country_code: "US",
billing_address_line1: "1231 Market St",
billing_address_state: "CA",
billing_address_zip: "94103",
billing_name: "Matthew Arkin",
shipping_address_apt: "",
traceroute: Warning: google.com has multiple addresses; using 74.125.239.41
traceroute to google.com (74.125.239.41), 64 hops max, 52 byte packets
1 172.16.0.1 (172.16.0.1) 1.431 ms 1.022 ms 2.126 ms
2 10.0.1.1 (10.0.1.1) 31.048 ms 35.342 ms 14.772 ms
3 10.0.0.41 (10.0.0.41) 84.013 ms 4.747 ms 3.885 ms
4 173.247.205.38 (173.247.205.38) 5.355 ms 14.197 ms 13.442 ms
5 eqixsj-google-gige.google.com (206.223.116.21) 6.502 ms 7.510 ms 10.480 ms
6 216.239.49.168 (216.239.49.168) 94.553 ms 7.316 ms 6.532 ms
7 72.14.232.35 (72.14.232.35) 6.586 ms 6.148 ms 7.652 ms
8 nuq04s19-in-f9.1e100.net (74.125.239.41) 7.865 ms 10.317 ms 10.480 ms
@matthewarkin
matthewarkin / deeppop.js
Last active August 29, 2015 14:05
attempting deep population
var query = Model.findOne(pk);
query = actionUtil.populateEach(query, req);
query.exec(function found(err, matchingRecord) {
//get list of all category id
var categoryModel = req._sails.models['category'];
var categoryIds = _.flatten(matchingRecord.categories,"id");
var categoryQuery = categoryModel.find({
id:categoryIds
});
categoryQuery = actionUtil.populateEach(categoryQuery, {param: req.param, options: {associations: [categoryModel.associations[1]], populate:true}});
@matthewarkin
matthewarkin / gist:8043e9a7f5d3ccf18f7f
Created September 3, 2014 19:11
Stripe transfer customers
Read through the Stripe Connect Getting Started Guide.
https://stripe.com/docs/connect/getting-started
Create a Stripe Connect App in your dashboard.
Get a Stripe connect code from for the account you want to transfer customers to
Then get an access token using that account (instructions in the getting-started guide).
Sweet, now we can make API calls on the account we are transfering customers to.
@matthewarkin
matthewarkin / test.js
Last active August 29, 2015 14:06
toObject sails
Model
.findOne(parentPk) //type app
.populate(relation, { //populate categories
where: where
})
.exec(function found(err, matchingRecord) {
//get list of all category id
var categoryModel = req._sails.models['category'];
var categoryIds = _.flatten(matchingRecord.categories,"id");
var categoryQuery = categoryModel.find({
@matthewarkin
matthewarkin / prettyStripe.html
Last active August 14, 2017 20:46
Stripe Checkout Custom Button CSS
<link rel="stylesheet" href="https://checkout.stripe.com/v3/checkout/button.css"></link>
<script src="https://checkout.stripe.com/checkout.js"></script>
<button id="customButton" class="stripe-button-el">
<span style="display: block; min-height: 30px;">Pay with Card</span>
</button>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Stripe Getting Started Form</title>
<!-- The required Stripe lib -->
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
<!-- jQuery is used only for this example; it isn't required to use Stripe -->
PhaseScriptExecution Build\ Framework\ Script /Users/matthewarkin/Library/Developer/Xcode/DerivedData/FPPicker-abpzfdbasbwogbabgzhnbfarbpvc/Build/Intermediates/FPPicker.build/Release-iphoneos/MultiArch\ Framework.build/Script-023D83351843CB2C00D74A82.sh
cd /Users/matthewarkin/Developer/checkout/ios-picker
export ACTION=build
export AD_HOC_CODE_SIGNING_ALLOWED=NO
export ALTERNATE_GROUP=staff
export ALTERNATE_MODE=u+w,go-w,a+rX
export ALTERNATE_OWNER=matthewarkin
export ALWAYS_SEARCH_USER_PATHS=NO
export ALWAYS_USE_SEPARATE_HEADERMAPS=YES
export APPLE_INTERNAL_DEVELOPER_DIR=/AppleInternal/Developer
@matthewarkin
matthewarkin / gist:c0b945e9a07d8bc4a8de
Created November 5, 2014 19:28
Stripe Automatic Transfer
{
"id": "tr_4xcA4dIkJ30RpX",
"object": "transfer",
"created": 1413337842,
"date": 1413417600,
"livemode": true,
"amount": 200000,
"currency": "usd",
"status": "paid",
"type": "bank_account",
@matthewarkin
matthewarkin / gist:24cca2d345473041cf9c
Created November 24, 2014 21:41
Parse issue .net timestamp
Message "String was not recognized as a valid DateTime."
StackTrace " at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
at Parse.ParseClient.ParseDate(String input)
at Parse.ParseObject.MergeMagicFields(IDictionary`2 data)
at Parse.ParseObject.MergeFromServer(IDictionary`2 data)
at Parse.ParseObject.MergeAfterSave(IDictionary`2 result)
at Parse.ParseObject.<>c__DisplayClass1f.<SaveAsync>b__1b(Task`1 t)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()