Skip to content

Instantly share code, notes, and snippets.

View IanYates's full-sized avatar

Ian Yates IanYates

View GitHub Profile
@mdubey82
mdubey82 / BitmapToDicom.cs
Created November 7, 2012 08:48
Create dicom dataset from secondary capture image
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Text;
using Dicom.Imaging;
using Dicom.IO.Buffer;
namespace Dicom
{
using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Text;
using Dicom.Imaging;
using Dicom.IO.Buffer;
namespace Dicom
{
@zaus
zaus / DelayedRenderExtensions.cs
Created September 27, 2013 18:06
RenderSections in PartialViews -- delayed rendering of any HTML content. See SO answer: http://stackoverflow.com/a/18790222/1037948
public static class HtmlRenderExtensions {
/// <summary>
/// Delegate script/resource/etc injection until the end of the page
/// <para>@via http://stackoverflow.com/a/14127332/1037948 and http://jadnb.wordpress.com/2011/02/16/rendering-scripts-from-partial-views-at-the-end-in-mvc/ </para>
/// </summary>
private class DelayedInjectionBlock : IDisposable {
/// <summary>
/// Unique internal storage key
/// </summary>
@cryo-warden
cryo-warden / knockout-projection-inversion.js
Created March 1, 2016 10:15
Adds two-way array-binding methods to Knockout v3.0.0beta. Updates may be needed to use this with more modern versions of Knockout.
var log = function () {
if (false && window.DEVMODE) {
return console.log.apply(console, arguments);
}
};
var mapArrayChanges =
ko.utils.mapArrayChanges = function (sourceObs, targetObs, fn, handlerState) {
return sourceObs.subscribe(function (events) {
if (handlerState.busy) { return; }
@alirobe
alirobe / reclaimWindows10.ps1
Last active May 22, 2024 20:58
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@42degrees
42degrees / sso_login_freshdesk.cs
Last active December 27, 2018 21:59 — forked from darkpssngr/sso_login_freshdesk.cs
SSO Login for Freshdesk support portal - ASP.Net C# Sample Code
/// <summary>
/// Handles the display of having successfully logged out of Freshdesk. There
/// are no other side-effects.
/// </summary>
public ActionResult FreshdeskLogout()
{
return View();
}
/// <summary>
@odinserj
odinserj / MutexAttribute.cs
Last active January 15, 2022 12:56
MutexAttribute.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Hangfire.Common;
using Hangfire.States;
using Hangfire.Storage;
namespace Hangfire.Pro
{
/// <summary>
@adufilie
adufilie / memoize.ts
Last active January 9, 2018 06:35
Decorator for creating memoized versions of functions in TypeScript
/**
* @author adufilie http://github.com/adufilie
*/
let UNDEFINED = {} as any;
type AnyFunction = (...args:any[])=>any;
function isPrimitive(value:any):boolean
{
@anthonyeden
anthonyeden / ExchangeInstallLE.bat
Created December 23, 2017 03:03
Let's Encrypt & Microsoft Exchange - Installation Script
"C:\Program Files\Lets Encrypt\letsencrypt.exe" --renew --baseuri "https://acme-v01.api.letsencrypt.org/"
powershell -File "C:\Program Files\Lets Encrypt\ExchangeLetsEncrypt.ps1" -CertificateImport "C:\ProgramData\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\mail.example.com-all.pfx" -ServerName exchange.example.com
@ayende
ayende / LetsEncryptClient.cs
Created January 11, 2018 22:26
ACME v2 client for Let's Encrypt
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;