Skip to content

Instantly share code, notes, and snippets.

🤗
free hugs

todgru

🤗
free hugs
View GitHub Profile
@simme
simme / Install_tmux
Created Oct 19, 2011
Install and configure tmux on Mac OS X
View Install_tmux
# 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 Oct 31, 2011
Testing storage of millions of keys in Redis
View gist:1329319
#! /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 Nov 26, 2011
embed github gist to tumblr
View theme.html
<!-- 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 Nov 28, 2011
Use curl to measure and report HTTP response times (pre-, start- and total transfer)
View curl-ttfb.sh
#!/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 Mar 5, 2012
Ruby: Convert MediaWiki to Markdown
View mw2md.rb
#!/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 Nov 7, 2017
Curl example
View gist:2120291
$curl --header "Content-Type: text/xml" -d@<File with XML content> https://www.testvantivcnp.com/sandbox/communicator/online
@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: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: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 / 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',
You can’t perform that action at this time.