Skip to content

Instantly share code, notes, and snippets.

@iguigova
iguigova / gist:1182841
Created August 31, 2011 04:50
Invoking a Generic Method With Parameters using Reflection
private Dictionary<string, Type> typeCache = new Dictionary<string, Type>();
public bool TryFindType(string typeName, out Type t)
{
lock (typeCache)
{
if (!typeCache.TryGetValue(typeName, out t))
{
t = Type.GetType(typeName);
if (t == null)
@iguigova
iguigova / Ext.ux.form.HtmlTableEditor.js
Created September 6, 2011 17:30
ExtJS HtmlEditor extension to work with tables
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.ns('Ext.ux.form');
/**
* @class Ext.ux.form.HtmlTableEditor
@iguigova
iguigova / googlemap.html
Created September 14, 2011 05:46
Hello GoogleMap API
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
@iguigova
iguigova / gist:2563071
Created April 30, 2012 22:06
new Thread template
Thread thread = new Thread(() =>
{
try
{
<func_name>(<func_parms>);
}
catch (Exception ex) { <exception_handling> }
});
thread.Start();
@iguigova
iguigova / gist:2714340
Created May 16, 2012 22:04
Activator.CreateInstance example
public static ICommand GetCommand(HttpRequest httpRequest)
{
try
{
return ((ICommand)Activator.CreateInstance(Type.GetType(string.Format("{0}.Cmd{1}", MethodBase.GetCurrentMethod().DeclaringType.Namespace, httpRequest.Headers["Command"])))).Init(httpRequest);
}
catch (Exception ex)
{
return new Command(ex);
}
@iguigova
iguigova / gist:2989846
Created June 25, 2012 16:54
Process query example
// if (IsAsyncUploadAllowed(oAct, encAttachsToUpload) && BroadcastAsyncUploadAttachments(encAttachsToUpload))
// {
// COlUIHandler.OnAllAttachUploadedComplete(null, new AttachUploadedEventArgs(false, null));
// return;
// }
private static bool IsAsyncUploadAllowed(CActivation activation, CEncoding attachments)
{
if (activation.pen.penProfile.useAsyncUpload)
{
@iguigova
iguigova / gist:2991318
Created June 25, 2012 21:17
AutoStart
public static class CAutoStartUtils
{
public static string exePath
{
get
{
return (ApplicationDeployment.IsNetworkDeployed) ? Path.Combine(CDeploymentInfo.AppPath, exeName) : Assembly.GetExecutingAssembly().Location;
}
}
@iguigova
iguigova / gist:2996803
Created June 26, 2012 16:16
ContextMenu
public static class CContextMenu
{
public static string Name
{
get { return "Send File Securely"; }
}
public static string Command
{
get { return string.Format("{0}\"{1}\" \"%1\"", (ApplicationDeployment.IsNetworkDeployed) ? "cmd.exe /c " : string.Empty, exePath); }
@iguigova
iguigova / gist:5957630
Created July 9, 2013 14:07
Sequencer - an interview question - Given a short input string and a set of words, split the input string into a space separated sequence of words in the set
<html>
<body onload="Test()">
<script>
function Filter(dictionary, letter, pos){ // Return a subset of words containing letter @ pos
var result = [];
for(idx in dictionary){
var word = dictionary[idx];
if (word[pos] == letter){
result.push(word);
using System;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
namespace Logon.IdPx.Shopify
{
// https://shopify.dev/api/admin/rest/reference/plus/multipass
// https://bitbucket.org/logonlabs/breadbutter-shopify-poc/src/master/shopify/multipass.js
// https://stackoverflow.com/questions/44782910/aes128-decryption-in-c-sharp