Skip to content

Instantly share code, notes, and snippets.

View lennybacon's full-sized avatar
🏠
Working from home

Daniel Fisher lennybacon

🏠
Working from home
View GitHub Profile
@lennybacon
lennybacon / RunAsX86.cs
Last active March 7, 2016 22:15
RunAsX86
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
/***********************************************************************
* CoolSoft RunAsX86
***********************************************************************
* Based on code by CoolSoft:
@lennybacon
lennybacon / LicensedComponent.cs
Created November 19, 2014 13:03
.NET Component Licensing
namespace MyNamespace
{
[LicenseProvider(typeof(MyLicenseProvider))]
public class MyLicensedComponent : Component
{
}
public class MyLicenseProvider : LicenseProvider
{
@lennybacon
lennybacon / license.licx
Created November 19, 2014 13:18
.NET Componen License File
TXTextControl.ServerTextControl, TXTextControl.Server, Version=21.0.600.500, Culture=neutral, PublicKeyToken=6b83fe9a75cfb638
@lennybacon
lennybacon / Compile-License.cmd
Created November 19, 2014 13:26
License Compiler in action
"LC.exe" /target:Licensensing.dll /complist:.\licenses.licx /outdir:. /i:".\TXTextControl.Server.dll"
@lennybacon
lennybacon / Embed-License.cmd
Created November 19, 2014 13:29
Embed a license during compilation
"Csc.exe" /reference:"System.dll" /reference:"System.Core.dll" /reference:"TXTextControl.dll" /reference:"TXTextControl.Server.dll" /out:Licensensing.dll /resource:Licensensing.dll.licenses /target:library .\Class1.cs .\Properties\AssemblyInfo.cs
@lennybacon
lennybacon / RuntimeLicenseContext-snip.cs
Created November 19, 2014 13:55
Resolve license from embedded resource
//..
if (resourceAssembly == null)
{
resourceAssembly = Assembly.GetEntryAssembly();
}
if (resourceAssembly == null)
{
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
{
//...
@lennybacon
lennybacon / LicenseLoader.cs
Created November 19, 2014 14:10
Loading Licenses into the LicenseContext
public class LicenseLoader
{
public static void LoadLicensesFromCallingAssembly()
{
var assembly = Assembly.GetCallingAssembly();
foreach (var resourceName in
assembly.GetManifestResourceNames().
Where(resourceName => resourceName.EndsWith(".licenses")))
{
@lennybacon
lennybacon / FusionLog.ps1
Created November 27, 2014 14:07
Manage Fusion Log by Powershell
function Enable-FusionLog{
Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name EnableLog -Value 1 -Type DWord
}
function Disable-FusionLog{
Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name EnableLog
}
@lennybacon
lennybacon / userstyle_jsonview.css
Last active March 2, 2021 16:09
Dark Theme for Firefox/Chrome add-ons JSON View (http://jsonview.com/) and JSON Formatter (https://github.com/callumlocke/json-formatter) by using the add-on Stylish (https://userstyles.org/)
/* ==UserStyle==
@name JSONView Dark
@namespace https://gist.github.com/lennybacon
@version 1.0.1
@description Dark theme for JsonView Extension
@author lennybacon
@homepageURL https://gist.github.com/lennybacon/cb700cee27601e7473dd
@updateURL https://gist.githubusercontent.com/lennybacon/cb700cee27601e7473dd/raw/7cfb8b250a8067122a0f138e4f00ab463b9d59d4/userstyle_jsonview.css
@license CC-BY-SA-4.0
==/UserStyle== */
@lennybacon
lennybacon / userstyle_about-home.css
Created December 31, 2014 15:40
Dark Theme for Firefox about:home using the add-on Stylish (https://userstyles.org/)
/* AGENT_SHEET */
/** DeepDark "about:home" for Firefox
/* http://userstyles.org/styles/64099/
/* by sr21
/* update 2014-02
*/
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document url("about:home") {