Skip to content

Instantly share code, notes, and snippets.

View gsherman's full-sized avatar

Gary Sherman gsherman

View GitHub Profile
. .\CreateClarifyApplicationAndLogin.ps1
$rmaNumber = "000045-1";
$path = "C:\temp\$rmaNumber.doc"
If (Test-Path $path){ remove-item $path -Force; }
$smtpServer="emailServer"
$To="someone@company.com"
$From="someone_else@company.com"
$Subject="Details for RMA $rmaNumber"
var employee_objid = 268435457;
var boReportsEmp = FCSession.CreateGeneric('employee');
var boReportsUser = FCSession.CreateGeneric('user');
boReportsEmp.AppendFilter("emp_supvr2employee", "=", employee_objid);
boReportsUser.TraverseFromParent(boReportsEmp, "employee2user");
boReportsUser.AppendFilter("status","=",1); // This appears to be ignored.
boReportsEmp.Query();
WScript.Echo('Total count of users:' + boReportsUser.TotalCount());
Dim listEmployees As List
Sub Form_Load()
Dim br As New Bulkretrieve
Dim employeeList As List
Dim nameList As New List
Dim i As Integer
Dim recEmplUser As Record
Declare Function GetStartingDateOfLastMonth() as Date
Declare Function GetStartingDateOfThisMonth() as Date
Declare Sub FindCasesCreatedLastMonth()
Sub main()
Call FindCasesCreatedLastMonth
End Sub
Sub FindCasesCreatedLastMonth()
@gsherman
gsherman / Get HGBST list
Created October 27, 2010 17:20
Get an HGBST List (in this case, the CR_DESC list)
SELECT l1.title,
s1.title,e1.title,e1.rank,
s2.title,e2.title,e2.rank,
s3.title,e3.title,e3.rank
FROM
table_hgbst_lst l1,
table_hgbst_show s1,
table_hgbst_show s2,
table_hgbst_show s3,
table_hgbst_elm e1,
@gsherman
gsherman / send_email_about_obj.dat
Created November 17, 2010 22:45
a customized log email template and rule properties that includes dynamic case data by using rule properties. (in this case, the case title)
OBJECT TYPE="com_tmplte", NAME="com_tmplte_268435465"
UNIQUE_FIELDS = "title"
FIELDS
title = "send_email_about_obj";
flags = 144;
action = "
TO: <FOCUS.recipient>, <FOCUS.cc_list>
FR: <FOCUS.sender>
RE: About Case <ADDITIONAL_INFO> : [Case Title] [Subcase Title]
@gsherman
gsherman / CheckExpiringLicenseKeys.js
Created December 6, 2010 18:21
Check for any license keys that are about to expire
/////////////////////////////////////////////////////////////////////////////////////////////
// Check for any license keys that are about to expire
// If found, send an email
// once a reminder is sent - update the license key table so its not sent again in the future
/////////////////////////////////////////////////////////////////////////////////////////////
function rw(foo){WScript.Echo(foo);}
//How far in the future to look for expiring Keys
var numDays = 30;
@gsherman
gsherman / IIS7: rewrite cookies to be httponly
Created January 20, 2011 22:40
a rewriting rule that adds "HttpOnly" to any out going "Set-Cookie" headers
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!--
Rewrite any outgoing "Set-Cookie" headers to be "HttpOnly"
Requires the IIS7 URL Rewrite Module, available from: http://www.iis.net/download/urlrewrite
-->
<rewrite>
<outboundRules>
<rule name="Add HttpOnly" preCondition="No HttpOnly">
@gsherman
gsherman / web.config
Created January 24, 2011 18:35
example of a web config that uses the URL rewrite module to block potentially dangerous querystring. works on IIS7 and classic asp.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!--
Block potentially dangerous querystrings.
Requires the IIS7 URL Rewrite Module, available from: http://www.iis.net/download/urlrewrite
-->
<rewrite>
<rules>
@gsherman
gsherman / PrevalidationSanitizer.cs
Created January 24, 2011 18:57
an example of an HttpModule that html encodes form data
using System;
using System.Collections.Specialized;
using System.Reflection;
using System.Web;
public class PrevalidationSanitizer : System.Web.IHttpModule
{
private HttpApplication httpApp;
public void Init(HttpApplication httpApp)