Skip to content

Instantly share code, notes, and snippets.

View santoshtechwiz's full-sized avatar

santosh kumar singh santoshtechwiz

View GitHub Profile
@santoshtechwiz
santoshtechwiz / e-commerce.md
Created May 23, 2016 07:22 — forked from hjr3/e-commerce.md
Examples of RESTful API calls for E-commerce platforms

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

@santoshtechwiz
santoshtechwiz / PowerShell_ODAC.ps1
Created May 11, 2016 10:41 — forked from mnzk/PowerShell_ODAC.ps1
Example Of PowerShell (V3) & Oracle Data Access Components & ADO.net DbProviderFactory
#
# PowerShell (v3.0) + ODAC (and ADO.net)
#
function Load-DbProviderFactory([ScriptBlock[]]$loaders){
$fa = $loaders | foreach {
try{
(& $_)| ? {$_ -is [System.Data.Common.DbProviderFactory]}
}catch{}
} | Select -First 1
@santoshtechwiz
santoshtechwiz / Expr.g4
Created February 8, 2016 12:18 — forked from mattmcd/Expr.g4
ANTLR4 simple expression grammar. Note that left recursion is now allowed and operator precedence is just order of definition.
grammar Expr;
// Need to call recursive rule expr from non-recursive rule
r : expr+ ;
// ANTLR4 : Left recursion!
// Operator precedence matches order of definition
expr : '-' expr // Unary minus
| expr ('*' | '/' ) expr
| expr ('+' | '-' ) expr
@santoshtechwiz
santoshtechwiz / AntiForgeryTokenValidator.asp
Created February 5, 2016 06:56 — forked from lorddev/AntiForgeryTokenValidator.asp
Classic ASP version of ASP.NET MVC AntiForgeryToken validator
<%
' Use with a very short session (basically the page lifecycle, GET then POST)
Class AntiForgeryValidator
Private m_securityToken
Sub SetCookie()
m_securityToken = CreateWindowsGuid()
Response.Cookies("RequestVerificationToken") = m_securityToken
@santoshtechwiz
santoshtechwiz / stripStringHTML.asp
Created January 27, 2016 17:53 — forked from gwobcke/stripStringHTML.asp
Classic ASP Strip HTML Function
<%
FUNCTION stripHTML(strHTML)
Dim objRegExp, strOutput, tempStr
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "<(.|n)+?>"
'Replace all HTML tag matches with the empty string
strOutput = objRegExp.Replace(strHTML, "")
'Replace all < and > with &lt; and &gt;