Skip to content

Instantly share code, notes, and snippets.

Robin Herbots RobinHerbots

View GitHub Profile
@RobinHerbots
RobinHerbots / ProxyBase.cs
Last active Sep 27, 2015
WCF ProxyBase with channel reuse
View ProxyBase.cs
using System;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Diagnostics;
using System.ServiceModel;
using System.Threading;
using System.Reflection;
namespace ServiceProxies
{
@RobinHerbots
RobinHerbots / ProxyBase.cs
Created Oct 24, 2011
Simple WCF Proxybase with a static ChannelFactory
View ProxyBase.cs
using System;
using System.ServiceModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
namespace ServiceProxies
{
public class ProxyBase<TChannel> : IDisposable where TChannel : class
@RobinHerbots
RobinHerbots / exampleUsage.js
Created Oct 25, 2011
jquery konami code plugin
View exampleUsage.js
(function($) {
$(document).ready(function() {
$(document).konami(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
document.body.appendChild(s);
s.src = 'http://erkie.github.com/asteroids.min.js';
});
$(document).konami(function() {
var u = navigator.userAgent.toLowerCase(), v = (u.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1];
@RobinHerbots
RobinHerbots / hash.js
Created Dec 14, 2011
hashtable in javascript
View hash.js
/*
http://www.mojavelinux.com/articles/javascript_hashes.html
added keys array to more easily retrieve the data elements - RH
*/
function Hash() {
@RobinHerbots
RobinHerbots / Proxy.tt
Created Apr 26, 2012
Proxy generation template
View Proxy.tt
/*
== DO NOT EDIT THIS GENERATED FILE ==
Generated on <#=DateTime.Now.ToShortDateString()#> at <#=DateTime.Now.ToShortTimeString()#>
*/
<#@ template hostspecific="True" #>
<#@ assembly name="System.ServiceModel.dll" #>
<#@ assembly name="System.Xml" #>
<#@ assembly name="EnvDTE" #>
<#@ assembly name="Microsoft.VisualStudio.OLE.Interop" #>
@RobinHerbots
RobinHerbots / Global.asax
Last active Dec 14, 2015
MVC DataAnnotations - Validate submodel in model with separate result in ModelState
View Global.asax
public class MvcApplication : HttpApplication
{
protected void Application_Start()
{
ModelValidatorProviders.Providers.Add(new RecursiveModelValidatorProvider());
....
View Multiple Download example
this.downloadUpload = function (rowid) {
var rowids = rowid ? [rowid] : res.Control.uploadOverview.jqGrid('getGridParam', 'selarrrow');
$.each(rowids, function (ndx, rwd) {
var downloadFrame = $("<iframe></iframe>");
downloadFrame.attr("src", '@Url.Action("DownloadFile", "Upload")?uploadId=' + rwd);
downloadFrame.on("onload", function() {
$(this).remove();
});
$("body").append(downloadFrame);
});
@RobinHerbots
RobinHerbots / index.ejs
Created Feb 23, 2017 — forked from ksrb/index.ejs
jquery.inputmask webpack configuration and package.json
View index.ejs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<input id="float"/>
</body>
</html>
@RobinHerbots
RobinHerbots / index.ejs
Created Feb 23, 2017 — forked from ksrb/index.ejs
jquery.inputmask webpack configuration and package.json
View index.ejs
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<input id="float"/>
</body>
</html>
@RobinHerbots
RobinHerbots / 52-nvidia-coolbits.conf
Last active Jan 22, 2018
nvidia coolbits config for Ubuntu 17.10 (cp /usr/share/X11/xorg.conf.d/)
View 52-nvidia-coolbits.conf
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Coolbits" "12"
SubSection "Display"
Depth 24
EndSubSection
EndSection
You can’t perform that action at this time.