Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@todgru
todgru / rake.sh
Last active August 29, 2015 14:06 — forked from felixhummel/rake.sh
# bash completion for rake
#
# some code from on Jonathan Palardy's http://technotales.wordpress.com/2009/09/18/rake-completion-cache/
# and http://pastie.org/217324 found http://ragonrails.com/post/38905212/rake-bash-completion-ftw
#
# For details and discussion
# http://turadg.aleahmad.net/2011/02/bash-completion-for-rake-tasks/
#
# INSTALL
#
@VantivSDK
VantivSDK / gist:2230664
Created March 28, 2012 21:19
PHP SDK - Litle Force Capture transaction
<?php
require_once realpath(dirname(__FILE__)) . '/../lib/LitleOnline.php';
#Force Capture
$capture_info = array(
'id'=> '456',
'merchantId' => '101',
'version'=>'8.8',
'reportGroup'=>'Planets',
'litleTxnId'=>'123456',
@VantivSDK
VantivSDK / gist:2230606
Created March 28, 2012 21:13
PHP SDK - Litle Auth Reversal transaction
<?php
require_once realpath(dirname(__FILE__)) . '/../lib/LitleOnline.php';
#Auth Reversal
#litleTxnId contains the Litle Transaction Id returned on the authorization
$authRev_info = array(
'litleTxnId'=>'350000000000000001',
'id'=> '456'
);
@VantivSDK
VantivSDK / gist:2230571
Created March 28, 2012 21:10
PHP SDK - Litle AVS Only Transaction
<?php
require_once realpath(dirname(__FILE__)) . '/../lib/LitleOnline.php';
#AVS Only
$auth_info = array(
'orderId' => '1',
'id'=> '456',
'amount' => '10010',
'orderSource'=>'ecommerce',
'billToAddress'=>array(
@VantivSDK
VantivSDK / gist:2230641
Created March 28, 2012 21:16
PHP SDK - Litle Capture Given Auth transaction
<?php
require_once realpath(dirname(__FILE__)) . '/../lib/LitleOnline.php';
#Capture Given Auth
$capture_info = array(
'id'=> '456',
'orderId'=>'12344',
'amount'=>'106',
'authInformation' => array(
@VantivSDK
VantivSDK / curl_test.php
Created June 6, 2012 12:25
PHP Script to test connectivity to Litle's certification environment
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, NULL);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: text/xml'));
curl_setopt($ch, CURLOPT_URL, 'https://cert.litle.com/vap/communicator/online');
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
curl_setopt($ch,CURLOPT_TIMEOUT,'5');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,2);
@todgru
todgru / modules.md
Last active October 13, 2015 01:08
Git submodule

#Submodules

Here is how we do it at Our Office


When you clone your working repos (api, app, www), you'll have an empty Modules directory. The working repo will contain a pointer to the hash of the last Modules repo committed. All that needs to be done from your working repo directory is:

$ git subumodule init
@todgru
todgru / how_to_back_out_a_commit.md
Created December 10, 2012 18:58
oops git reverse commit back out

#Oops, I merged untested changes to master!

You've made changes to master, commited and push up to your repo. Git is flexible enough that you can dig yourself out rather easily. Here are two of many options to get back to a safe place.

  • Option 1, Branch out and keep your changes.
  • Option 2, Reset the branch and lose changes.

The final step in both of these options is $ git push --force origin master.

##Option 1: Branch Out

@todgru
todgru / bash.md
Last active December 11, 2015 12:39
bash
  • du -sh {directory} list display size of directory in human readable format.
  • du -sh * show size of each directory in the current path
  • df disk space usage
$ du -sh *
 11M  Applications
1.9G	Desktop
 14G	Documents
8.0K	Downloads
@todgru
todgru / base58.rb
Created December 6, 2013 19:12 — forked from jou/base58.rb
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
# 14 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE