Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@soemarko
soemarko / theme.html
Created November 26, 2011 16:18
embed github gist to tumblr
<!-- Add the following lines to theme's html code right before </head> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script src="http://static.tumblr.com/fpifyru/AKFlv9zdu/embedgist.js"></script>
<!--
Usage: just add <div class="gist">[gist URL]</div>
Example: <div class="gist">https://gist.github.com/1395926</div>
-->
@acdha
acdha / curl-ttfb.sh
Created November 28, 2011 23:03
Use curl to measure and report HTTP response times (pre-, start- and total transfer)
#!/bin/bash
#
# Report time to first byte for the provided URL using a cache buster to ensure
# that we're measuring full cold-cache performance
while (($#)); do
echo $1
curl -so /dev/null -H "Pragma: no-cache" -H "Cache-Control: no-cache" \
-w "%{http_code}\tPre-Transfer: %{time_pretransfer}\tStart Transfer: %{time_starttransfer}\tTotal: %{time_total}\tSize: %{size_download}\n" \
"$1?`date +%s`"
@kreeger
kreeger / mw2md.rb
Created March 5, 2012 22:43
Ruby: Convert MediaWiki to Markdown
#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
require 'maruku'
require 'wikicloth'
require 'tidy_ffi'
require 'pandoc-ruby'
opts = {}
OptionParser.new do |o|
@VantivSDK
VantivSDK / gist:2120291
Last active November 7, 2017 16:09
Curl example
$curl --header "Content-Type: text/xml" -d@<File with XML content> https://www.testvantivcnp.com/sandbox/communicator/online
@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: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: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 / 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',