Skip to content

Instantly share code, notes, and snippets.

View 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:2230606
Created Mar 28, 2012
PHP SDK - Litle Auth Reversal transaction
View gist:2230606
<?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:2230664
Created Mar 28, 2012
PHP SDK - Litle Force Capture transaction
View gist:2230664
<?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:2230571
Created Mar 28, 2012
PHP SDK - Litle AVS Only Transaction
View gist:2230571
<?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 Mar 28, 2012
PHP SDK - Litle Capture Given Auth transaction
View gist:2230641
<?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 Jun 6, 2012
PHP Script to test connectivity to Litle's certification environment
View curl_test.php
<?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 Oct 13, 2015
Git submodule
View modules.md

#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 Dec 10, 2012
oops git reverse commit back out
View how_to_back_out_a_commit.md

#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

View bash.md
  • 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
View 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