Skip to content

Instantly share code, notes, and snippets.

View hexatridecimal's full-sized avatar
🤩
Making something beautiful

Janet Jeffus hexatridecimal

🤩
Making something beautiful
View GitHub Profile
#!/usr/bin/env perl
use DBI;
use Data::Dumper qw/Dumper/;
my $query = shift(@ARGV);
my $dbh = DBI->connect('dbi:mysql:database=', 'root', 'YoPassword');
my $sth = $dbh->prepare("SHOW PROCESSLIST");
while (1) {
$sth->execute();
function geocode(lat,lon) {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(lat,lon);
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
var address = "", city = "", state = "", zip = "", country = "", formattedAddress = "";
var lat;
var lng;
@hexatridecimal
hexatridecimal / git install wxmac.txt
Created July 27, 2011 20:34
Installation output
==> Downloading http://downloads.sourceforge.net/project/wxwindows/2.8.11/wxMac-2.8.11.tar.bz2
File already downloaded in /Users/jjeffus/Library/Caches/Homebrew
/usr/bin/tar xf /Users/jjeffus/Library/Caches/Homebrew/wxmac-2.8.11.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/wxmac/2.8.11 --enable-unicode
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/wxmac/2.8.11 --enable-unicode
checking build system type... i686-apple-darwin11.0.0
checking host system type... i686-apple-darwin11.0.0
checking target system type... i686-apple-darwin11.0.0
loading argument cache configarg.cache
checking for --enable-gui... yes
@hexatridecimal
hexatridecimal / git install wxmac.txt
Created July 27, 2011 20:34
Installation output
==> Downloading http://downloads.sourceforge.net/project/wxwindows/2.8.11/wxMac-2.8.11.tar.bz2
File already downloaded in /Users/jjeffus/Library/Caches/Homebrew
/usr/bin/tar xf /Users/jjeffus/Library/Caches/Homebrew/wxmac-2.8.11.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/wxmac/2.8.11 --enable-unicode
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/wxmac/2.8.11 --enable-unicode
checking build system type... i686-apple-darwin11.0.0
checking host system type... i686-apple-darwin11.0.0
checking target system type... i686-apple-darwin11.0.0
loading argument cache configarg.cache
checking for --enable-gui... yes
@hexatridecimal
hexatridecimal / git install wxmac.txt
Created July 27, 2011 20:34
Installation output
==> Downloading http://downloads.sourceforge.net/project/wxwindows/2.8.11/wxMac-2.8.11.tar.bz2
File already downloaded in /Users/jjeffus/Library/Caches/Homebrew
/usr/bin/tar xf /Users/jjeffus/Library/Caches/Homebrew/wxmac-2.8.11.tar.bz2
==> ./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/wxmac/2.8.11 --enable-unicode
./configure --disable-debug --disable-dependency-tracking --prefix=/usr/local/Cellar/wxmac/2.8.11 --enable-unicode
checking build system type... i686-apple-darwin11.0.0
checking host system type... i686-apple-darwin11.0.0
checking target system type... i686-apple-darwin11.0.0
loading argument cache configarg.cache
checking for --enable-gui... yes
@hexatridecimal
hexatridecimal / OpenVPN Build Issue
Created July 30, 2011 19:17
OpenVPN build issue on Lion/XCode 4.1
==> Downloading http://build.openvpn.net/downloads/releases/openvpn-2.2.0.tar.gz
File already downloaded in /Users/jjeffus/Library/Caches/Homebrew
/usr/bin/tar xf /Users/jjeffus/Library/Caches/Homebrew/openvpn-2.2.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/openvpn/2.2.0 --disable-debug --disable-dependency-tracking
./configure --prefix=/usr/local/Cellar/openvpn/2.2.0 --disable-debug --disable-dependency-tracking
checking build system type... x86_64-apple-darwin11.0.0
checking host system type... x86_64-apple-darwin11.0.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
@hexatridecimal
hexatridecimal / add_watermark.pl
Created September 8, 2011 21:10
Adding a box to a PDF file
#!/usr/bin/perl
use strict;
use PDF::API2::Simple;
my ($input_pdf, $pdf, $api, $page, $width, $height);
my ($box_width, $box_height);
$input_pdf = shift @ARGV;
@hexatridecimal
hexatridecimal / sample.rb
Created September 9, 2011 20:51
Sample creation code.
require 'open-uri'
def get_file_path()
name = ActiveSupport::SecureRandom.hex(16)
Rails.root.join('processing',
name[0],
name[1],
name[2 .. name.length]).to_s + '.pdf'
end
@hexatridecimal
hexatridecimal / internet_secure.rb
Created October 12, 2011 17:11
Internet Secure gateway code for active_merchant
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class InternetSecureGateway < AuthorizeNetGateway
self.live_url = self.test_url = 'https://anet.internetsecure.com/process.cgi'
self.homepage_url = 'http://www.internetsecure.com/'
self.display_name = 'InternetSecure'
def test?
Base.gateway_mode == :test
# Adds information about the customer
def add_arb_customer(xml, options)
customer = options[:customer]
return unless customer
xml.tag!('customer') do
xml.tag! 'type' ,customer[:type] if customer[:type]
xml.tag! 'id' ,customer[:id] if customer[:id]
xml.tag! 'email' ,customer[:email] if customer[:email]
xml.tag! 'phoneNumber' ,customer[:phone_number] if customer[:phone_number]
xml.tag! 'faxNumber' ,customer[:fax_number] if customer[:fax_number]