Skip to content

Instantly share code, notes, and snippets.

View hanssens's full-sized avatar

Juliën Hanssens hanssens

View GitHub Profile
@hanssens
hanssens / Inventorize.cs
Created March 21, 2011 07:48
Inventorize System Software (by Registry)
protected void Inventorize()
{
// Generate a container:
DataTable dtResult = new DataTable();
dtResult.Columns.Add("DisplayName");
dtResult.Columns.Add("DisplayVersion");
dtResult.Columns.Add("Publisher");
#region -- RxOps --
string keyUninstall = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
RegistryKey rk = Registry.LocalMachine.OpenSubKey(keyUninstall, false);
@hanssens
hanssens / Web.config.release
Created March 21, 2011 07:50
Web.config Transformations
/* Original */
<appSettings>
<add key="MyUsername" value="hello-user"/>
<add key="MyPassword" value="yadayadayada"/>
</appSettings>
/* Overload */
<appSettings>
<add key="MyPassword" value="xxx......" xdt:Transform="Replace" xdt:Locator="Match(key)" />
</appSettings>
@hanssens
hanssens / InvokeWorkFlowSample.cs
Created March 21, 2011 09:56
WF4.0 Sample (Invoke + Arguments in/out)
[TestMethod]
public void HelloWorldTest()
{
var writer = new StringWriter();
Console.SetOut(writer);
var target = new HelloWorld();
WorkflowInvoker.Invoke(target);
// [??] Waarom werkt dit verdomme nog niet??
@hanssens
hanssens / Coolite.RowDblClick.aspx
Created March 21, 2011 09:57
Coolite - RowDblClick
<Listeners>
<%-- This works!
<RowDblClick Handler="alert(#{myGridPanel}.getSelectionModel().getSelected().data.CustomerId);" />
--%>
<RowDblClick Handler="MyApplication.addTab({ title: 'Details', url: '/Customer/Customer/Detail/' + #{myGridPanel}.getSelectionModel().getSelected().data.CustomerId});" />
</Listeners>
@hanssens
hanssens / jquery.IsIframe.js
Created May 16, 2011 12:23
jQuery - IsIFrame()
var IsIFrame = (window.location != window.parent.location) ? true : false;
@hanssens
hanssens / AdresValidator.cs
Created May 31, 2011 06:47
AdresValidator - WinForms Component voor Cendris adres validatie
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Windows.Forms;
using Securancy.Common;
namespace WindowsApplication1
{
@hanssens
hanssens / MultiColumnRepeaterExtension.cs
Created October 28, 2011 11:10
[MVC3/RAZOR] MultiColumnRepeaterExtension
public static void MultiColumnRepeater<T>(this HtmlHelper helper, IEnumerable<T> model, int columnCount, Action rowHeader, Action<T> itemTemplate, Action rowFooter)
{
int currentColumn = 0;
foreach (T item in model)
{
if (currentColumn == 0)
rowHeader();
itemTemplate(item);
@hanssens
hanssens / jquery.ModalDialog.js
Created November 29, 2011 09:50
jQuery - Simple Modal Dialog
$(function () {
$("#dialog-modal").dialog({
closeOnEscape: true,
//closeText: 'Sluiten',
draggable: false,
resizable: false,
width: 550,
height: 500,
modal: true,
overlay: {
@hanssens
hanssens / HappyfunBallMetadata.cs
Created November 29, 2011 10:19
[C#] Adding annotations/metadata with partial classes
[MetadataType(typeof(HappyFunBallMetadata))]
public partial class HappyFunBall
{
public int Id { get; set; }
public string Name { get; set; }
public Color Colour { get; set; }
public int Weight { get; set; }
}
@hanssens
hanssens / Empty.html
Last active November 23, 2018 10:17
Empty HTML5 Page - includes jQuery and Bootstrap by default.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="Juliën Hanssens">
<title>Empty HTML5 Page</title>
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head>