Skip to content

Instantly share code, notes, and snippets.

View sholsinger's full-sized avatar

Steve Holsinger sholsinger

View GitHub Profile
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>CreateResponse</wsa:Action>
<wsa:MessageID>urn:uuid:fcb12801-6f5c-4e13-aed4-3b2c444dea4c</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:f41fef8d-63fc-482b-b4f3-8a41680c587b</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-f8c1e842-f068-4281-87e8-82ac5b994f50">
<wsu:Created>2014-06-02T17:15:32Z</wsu:Created>
<wsu:Expires>2014-06-02T17:20:32Z</wsu:Expires>
@sholsinger
sholsinger / SQL Parser Error (Text AND Category)
Created October 18, 2010 15:47
Parser tells me: Incorrect syntax near the keyword 'ORDER' -- which one?
DECLARE @str VARCHAR(255);
SELECT @str = LOWER(?);
SELECT * (
SELECT TOP 8 * FROM [oca_search_model]
WHERE [osm_isactive] = 1
AND LOWER([osm_category]) = LOWER(?)
AND (
LOWER([osm_keywords]) LIKE '%'+@str+'%'
OR LOWER([osm_description]) LIKE '%'+@str+'%'
OR LOWER([osm_name]) LIKE @str+'%'
@sholsinger
sholsinger / Array.indexOf.js
Created February 9, 2011 22:59
Detect existence of Mozilla's indexOf Array extension and implement if not available.
if(Array.prototype.indexOf === undefined)
{
Array.prototype.indexOf = function(val)
{
for (var i = 0; i < this.length; i++)
{
if(this[i] == val)
return i;
}
return -1;
@sholsinger
sholsinger / JSON.stringify.js
Created February 15, 2011 22:10
Apparently the standard is stringify() // Who decided that?!
if(JSON.hasOwnProperty('encode') && !JSON.hasOwnProperty('stringify')){
JSON.stringify = JSON.encode;
}
@sholsinger
sholsinger / proj_request_report.js
Created February 17, 2011 16:11
A quick and dirty report of the unique input names on my page.
var report = {
run: function ()
{
return $("form :input[name!='']").filter(this.isUniqueField);
},
isUniqueField: function (index)
{
if(report.elementNameCache.indexOf(this.name) < 0) {
@sholsinger
sholsinger / GetTableDefinitionADO.asp
Created March 9, 2011 16:54
Some functions to aid in "describing" a SQL table that you don't have direct SQL access to via COM ADO library.
<%
Function GetTableDefinition( table_name, conn, id, idfield )
dim rs, fld, rec
dim where: where = ""
If IsNumeric(id) And id > 0 and idfield <> "" Then
where = " WHERE " & idfield & " = " & id
End If
@sholsinger
sholsinger / gist:901874
Created April 4, 2011 16:00
VBScript Tools for measuring the length of an array and appending values to a Dynamic array
' appends the second argument to the first if the first is an array.
' MUST be a dynamic array! Returns new array.
' Usage:
' Dim myArray()
' myArray = ArrayAppend(myArray, "foo")
Function ArrayAppend( a, o )
On Error Resume Next
Err.Clear()
dim tn, i
i = 0
@sholsinger
sholsinger / addBusinessDays.js
Created April 18, 2011 21:58
A JavaScript module to extend the Date prototype to provide an easy method for adding to or subtracting from a Date instance in business days.
if(Number.prototype.mod === undefined)
{
Number.prototype.mod = function(n) {
return ((this%n)+n)%n;
}
}
if(Date.prototype.addBusinessDays === undefined)
{
Date.prototype.addBusinessDays = function(dd) {
var weeks = (dd >= 0) ? Math.floor(dd/5): Math.ceil(dd/5);
@sholsinger
sholsinger / toKey.js
Created May 2, 2011 16:18
JavaScript method to convert a string into a reasonable "key" string.
if(String.prototype.toKey === undefined)
{
String.prototype.toKey = function(){
var s = this.toLowerCase();
s = s.replace(/^[0-9_-]+|[^a-z0-9_\s-]|(\s.\s){1,}|[\s]{2,}|[_\s-]+$/ig, '');
s = s.replace(/[\-\s_]+/ig,"_");
return s;
}
}
@sholsinger
sholsinger / logparse.php
Created October 12, 2011 06:15
A quick 'n' dirrrty PHP script to parse IIS log files and insert them into a relational database table. (ala MySQL)
<?
define("DEBUG", FALSE);
function get_log_file($file_path)
{
if(file_exists($file_path))
{
return file_get_contents($file_path);
}
return false;