This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# Old CGI script from 1996 | |
# https://web.archive.org/web/20000829140422id_/http://www.joecode.com/news/news_cgi.txt | |
# Usage | |
# /news.cgi?url=http://fullcoverage.yahoo.com/fc/Business/Internet_Taxes_and_Regulation/&subject=internet_tax&title=Internet%20Tax%20News: | |
if ($ENV{'REQUEST_METHOD'} eq 'GET') { | |
@pairs = split(/&/, $ENV{'QUERY_STRING'}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parse attributedBody blob values into ASCII text. | |
# Grab HEX(attributedBody) from chat.db and unfark it | |
def unfark_imessage_attributed_body(hex_string) | |
wtf_string = [hex_string].pack("H*").encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: ' ') | |
wtf_string.gsub!(/\s+/, ' ') | |
if wtf_string.include? 'NSNumber' | |
wtf_string = wtf_string.split('NSNumber')[0] | |
if wtf_string.include? 'NSString' | |
wtf_string = wtf_string.split('NSString')[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
source /home/username/.bashrc | |
# Shell | |
SHELL=/bin/bash | |
MAILTO=foo@bar.com | |
# WordPress Command Line Interface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Usage: [hubspot_form form_id="1234-5678-90123-45676"] | |
// Inspiration: https://rschu.me/an-easy-way-to-embed-hubspot-forms-in-wordpress/ | |
// API Documentation: http://developers.hubspot.com/docs/methods/forms/advanced_form_options | |
add_shortcode('hubspot_form', function($atts) { | |
extract(shortcode_atts(array( | |
'form_id' => null, | |
'redirect_url' => null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Custom text filters | |
module TextFilter | |
# USD Currency | |
def currency(input) | |
return sprintf('$%0.2f',input).gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,") | |
end | |
end | |
# Globally register custom text filters | |
Liquid::Template.register_filter(TextFilter) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ruby btwb-to-jekyll.rb | |
# (execute from Jekyll blog root) | |
puts 'BTWB To Jekyll' | |
require 'yaml' | |
require 'httparty' | |
require 'nokogiri' | |
# Beyond The White Board Credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var soap = require('soap'), | |
Cookie = require('soap-cookie'), | |
util = require('util'), | |
wsdl = 'bdti.wsdl'; | |
soap.createClient(wsdl, function(err, client) { | |
client.Login({User: "USERNAME", Client: "CLIENTID", Password: "PASSWORD"}, function(err, result) { | |
// Cookie based security | |
client.setSecurity(new Cookie(client.lastResponseHeaders)); | |
// GetCalcServers (This action requires login.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://www.barraone.com | |
#http://savonrb.com | |
require 'savon' | |
def barra_xml_to_hash (dirty_xml) | |
# Clean up the response, not sure why the payload from BarraOne is so dirty | |
xml = dirty_xml.gsub(/--.*<\?/m,'<?') | |
xml = xml.gsub(/--.*--/,'') |