Skip to content

Instantly share code, notes, and snippets.

View kjellski's full-sized avatar
🤓
learning every day...

Kjellski kjellski

🤓
learning every day...
View GitHub Profile
@kjellski
kjellski / TextBoxLogger.cs
Created November 20, 2013 09:21
Create a commons logging adapter for WPF TextBox
using System;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using Common.Logging;
using Common.Logging.Simple;
namespace YourNamespace.Logging
{
/// <summary>
@kjellski
kjellski / gist:7526476
Created November 18, 2013 11:42
useless stacktrace
The type initializer for 'VMwareWrapper.RLVMwareController' threw an exception.
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
@kjellski
kjellski / CreepCell.cs
Created November 3, 2013 18:55
Creeping With Unity
using System;
using UnityEngine;
[ExecuteInEditMode]
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
[RequireComponent(typeof(MeshCollider))]
public class CreepCell : MonoBehaviour, IFillable
private readonly Vector3[] _vertices = new Vector3[_verticesCount];
private readonly Vector3[] _normals = new Vector3[_verticesCount];
<Project DefaultTargets="CopyOutputs;DeployService" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!-- These settings control what the service's name, description etc appear in services.msc task panel. -->
<PropertyGroup Label="ServiceMetaData">
<ServiceName>ShinyNewService</ServiceName>
<ServiceDisplayName>Shiny New Service</ServiceDisplayName>
<ServiceDescription>A shiny new service, that changes the world for the greater good.</ServiceDescription>
</PropertyGroup>
<Choose>
@kjellski
kjellski / sublime_open_as.reg
Created September 18, 2013 16:59
Open folder in Sublime Text 2 by "right clickt context menu"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Open folder as Sublime Text 2 Project]@="Open folder as Sublime Text 2 Project"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Open folder as Sublime Text 2 Project\command]@="C:\\Program Files\\Sublime Text 2\\sublime_text.exe" %1
@kjellski
kjellski / LambdaComparer.cs
Created September 5, 2013 14:15
LambdaComparer, not mine though, but I can't remember where on SO I found it...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Utils
{
/// <summary>
/// Creates an Comparer for a type
/// </summary>
@kjellski
kjellski / RLUtils.Logging.config
Created September 2, 2013 13:01
web.config referencing Logging config
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<loggingConfiguration name="" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
source="Enterprise Library Logging" formatter="Complete Text Formatter"
@kjellski
kjellski / empty.lua
Created August 28, 2013 13:15
Put this into /etc/xdg/awesome/rc.lua and /usr/share/awesome/themes/default/empty.lua for a maximized window completely without menues and decorators. :)
---------------------------
-- Default awesome theme --
---------------------------
theme = {}
theme.font = "sans 8"
theme.bg_normal = "#222222"
theme.bg_focus = "#535d6c"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RLUtils
{
/// <summary>
/// Creates an Comparer for a type
/// </summary>
[~]$ docker
Segmentation Fault or Critical Error encountered. Dumping core and aborting.
Aborted
[~]$