Skip to content

Instantly share code, notes, and snippets.

View ericzou's full-sized avatar

ericzou

View GitHub Profile
POST /orders
Request
{
"foreign_order_id" : "1234",
"total_amount" : "23.223",
"custom_field" : "foobar",
"auth_token" : auth_token
}
@ericzou
ericzou / gist:1020300
Created June 11, 2011 05:48
payment notification
Post http://yourwebsite.com/payment_notification
Parameters
{
"Payment Notification" :
{
"foreign_order_id" : "A1234",
"amount" : "2.20",
"transaction_fee" : 0.0,
"bitcoin_address" : "1AFZ6Cv8q96rFaS9T8fR1y2j2CjNDcTIVD",
@ericzou
ericzou / gist:1020345
Created June 11, 2011 07:41
create a new token
POST /tokens
Request
{
"auth_token" : "Your primary access token"
"token" : { "bitcoin_address" : "Bitcoin address associated with this token" }
}
@ericzou
ericzou / gist:1024397
Created June 14, 2011 05:47
Example : Create an order
require "rubygems"
require "net/http"
@base_url = "https://www.bitcoinpayflow.com"
@access_token = "yourtoken"
# create an order:
uri = URI.parse("#{@base_url}/orders")
http = Net::HTTP.new(uri.host, uri.port)
@ericzou
ericzou / gist:1837862
Created February 15, 2012 18:11
gemfile tempalte
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
<?xml version="1.0"?>
<root>
<item>
<name>Change Page Down to Control Right</name>
<identifier>private.swap_space_and_tab</identifier>
<autogen>--KeyToKey-- KeyCode::PAGEDOWN, KeyCode::CONTROL_R</autogen>
</item>
</root>
@ericzou
ericzou / angular-js-bootstrap-0.1.0.js
Created November 12, 2012 01:02
angular-js-bootstrap-0.1.0
angular.module("ui.bootstrap", ["ui.bootstrap.accordion","ui.bootstrap.dropdownToggle","ui.bootstrap.modal","ui.bootstrap.tabs"]);
angular.module('ui.bootstrap.accordion', []);
angular.module('ui.bootstrap.accordion').controller('AccordionController', ['$scope', function ($scope) {
var groups = $scope.groups = [];
this.select = function(group) {
angular.forEach(groups, function (group) {
group.selected = false;
@ericzou
ericzou / bootstrap_angular_js_manually.js
Created December 29, 2012 17:51
Manually bootstrap Angular JS
window.onload = function() {
var $rootElement = angular.element(window.document);
var modules = ['ng', 'myApp', function($provide) {
$provide.value('$rootElement', $rootElement);
}];
var $injector = angular.injector(modules);
var $compile = $injector.get('$compile');
var compositeLinkFn = $compile($rootElement);
@ericzou
ericzou / ripper_scanner_events.rb
Created March 7, 2013 18:08
ripper scanner events table
{
:CHAR=>1,
:__end__=>1,
:backref=>1,
:backtick=>1,
:comma=>1,
:comment=>1,
:const=>1,
:cvar=>1,
:embdoc=>1,
@ericzou
ericzou / ripper_parse_event_table.rb
Created March 7, 2013 18:09
ripper parse event table
{
:BEGIN=>1,
:END=>1,
:alias=>2,
:alias_error=>1,
:aref=>2,
:aref_field=>2,
:arg_ambiguous=>0,
:arg_paren=>1,
:args_add=>2,