Skip to content

Instantly share code, notes, and snippets.

@gdb
gdb / Sample gist
Created April 27, 2016 00:50
Sample gist
This is a sample gist! Nothing too interesting to see here.
aoeuaoeuaoeuaoeu
#!/bin/sh
# Download the Google safe_format_and_mount script to the location
# Kubernetes expects it to be on disk (/usr/share/google/...). This is
# made tricky by the fact that CoreOS doesn't want anyone writing to
# /usr.
set -ex
# Imported from https://chromium.googlesource.com/chromiumos/platform/crosutils/+/ea621903e927acf77889bcda4fa71636f4af7158/common.sh#458
$ curl -u $STRIPE_API_KEY: https://api.stripe.com/v1/customers -d plan=monthly
{
"error": {
"type": "invalid_request_error",
"message": "This customer has no attached card"
}
}
$ curl -u $STRIPE_API_KEY: https://api.stripe.com/v1/customers -d plan=monthly -d trial_end=1421427622
{
"object": "customer",
@gdb
gdb / gist:70efc16fb432601acd33
Last active October 13, 2018 20:30
Notes from Stellar dev meetup
Please publicly post the following Gist, and name it keybase.md:
### Keybase proof
I hereby claim:
* I am gdb on github.
* I am gdb (https://keybase.io/gdb) on keybase.
* I have a public key whose fingerprint is CA8F 367F 55F0 F4F7 92E3 7AED 29AD 1AE9 45D0 92BC
@gdb
gdb / gist:853c333748bbe51f5bd4
Last active August 29, 2015 14:04
Issuing your own "currency" using Stellar's distributed exchange

One interesting thing you can do with Stellar is issue your own custom "currency". Here's a simple example of doing so. This route involves making an offer on the distributed exchange, and then waiting for someone to make an overlapping counteroffer.

I've created an offer giving out minutes of my help on a project of your choice (represented by the currency GDB), at a rate of 1,000 stellar per minute. You can see this offer in the graphical account viewer: https://www.stellar.org/viewer/#/gdb.

(This credit is redeemable for things like architecture advice, conversations about cryptocurrencies, debugging help, or the like. Once you hold the credit, you can redeem it by contacting me, and we'll arrange a Hangout or in-person meeting, depending on what makes sense.)

Did you just claim the currency GDB?!

Not quite. Stellar works a bit off the principle "Is the blue you see, the same blue I see?" If someone trusts a bunch of gateways for USD, if effectively means that they per

@gdb
gdb / gist:1255035
Created September 30, 2011 21:36
Stripe PHP simple example
<?php
require 'path-to-Stripe.php';
if ($_POST) {
Stripe::setApiKey("your-api-key");
Stripe_Charge::create(array("amount" => 1000,
"currency" => "usd",
"card" => $_POST['stripeToken']));
}