Skip to content

Instantly share code, notes, and snippets.

View PatrickTulskie's full-sized avatar

Patrick Tulskie PatrickTulskie

View GitHub Profile
@VantivSDK
VantivSDK / fullPaypageLifecycle.rb
Last active August 30, 2016 22:18
Litle Ruby SDK - Paypage, Authorization, Capture, Refund, Reverse lifecycle
require 'LitleOnline'
include LitleOnline
hash = {
'orderId'=>'1234',
'amount'=>'106',
'orderSource'=>'ecommerce',
'paypage'=>{
'type'=>'VI',
'paypageRegistrationId' =>'QU1pTFZnV2NGQWZrZzRKeTNVR0lzejB1K2Q5VDdWMTVqb2J5WFJ2Snh4U0U4eTBxaFg2cEVWaDBWSlhtMVZTTw==',
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mikeygee
mikeygee / 01-before.html
Created May 7, 2012 07:45
truncate blog posts in jekyll
<!-- using the truncate filter -->
{% for post in site.posts limit:10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span>
{% if post.content.size > 2000 %}
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node -->
<a href="{{ post.url }}">read more</a>
{% else %}
{{ post.content }}
{% endif %}
@VantivSDK
VantivSDK / gist:1941298
Created February 29, 2012 14:47
Ruby SDK - Litle Authorization transaction
require 'LitleOnline'
include LitleOnline
#Authorization
auth_info = {
'orderId' => '1',
'amount' => '10010',
'orderSource'=>'ecommerce',
'billToAddress'=>{
'name' => 'John Smith',
@VantivSDK
VantivSDK / gist:1941291
Created February 29, 2012 14:46
Ruby SDK - Litle Payment full lifecycle example
require 'LitleOnline'
include LitleOnline
#Authorization
#Puts a hold on the funds
auth_hash = {
'orderId' => '1',
'amount' => '10010',
'orderSource'=>'ecommerce',
'billToAddress'=>{
@stepahn
stepahn / gist:1099278
Created July 22, 2011 11:27
growl iChat
-- growl notifications for ichat, based on
-- http://scriptingosx.com/2010/11/ichat-notification-with-growl/
property growlAppName : "Growl iChat"
property notificationNames : {"Buddy Became Available", ¬
"Buddy Became Unavailable", ¬
"Message Received", ¬
"Completed File Transfer"}
property defaultNotificationNames : {"Buddy Became Available", ¬
@shaiguitar
shaiguitar / gist:1032229
Created June 17, 2011 20:20
check processes with kill -0
usage()
{
echo "./$0 [--verbose]"
}
VERBOSE=0
if [ "$1" == "--verbose" ]; then
VERBOSE=1
fi
@karmi
karmi / .gitignore
Created May 15, 2011 11:15
Import your Gmail messages into ElasticSearch and search them with a simple web application.
.DS_Store
*.log
Gemfile.lock
@protocool
protocool / caveatPatchor.js
Created February 11, 2011 01:00
Sample Propane caveatPatchor.js file
/**
Sample Propane caveatPatchor.js file based on tmm1's avatar hack.
You'll need at least version 1.1.1 to experiment with this:
http://propaneapp.com/appcast/Propane.1.1.1.zip
Once I'm sure exposing this hack-injection point doesn't cause problems
I'll do an official auto-updating version.
As of version 1.1.1, Propane will load and execute the contents of
@ahoward
ahoward / net-http-debug.rb
Created December 10, 2010 20:06
a simple way to debug tons of libs that use ruby's net/http
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)