Skip to content

Instantly share code, notes, and snippets.

@TheXenocide
TheXenocide / TestClrMD.cs
Created March 6, 2014 23:46
In-progress abstraction around accessing heap data using ClrMD
// TODO: encapsulate runtime session, store heap, common general purpose types, stats, etc.
static ClrRuntime _runtime;
void Main()
{
DataTarget _target = DataTarget.LoadCrashDump("C:\\Temp\\MEM.DMP");
_target.SetSymbolPath(Environment.GetEnvironmentVariable("_NT_SYMBOL_PATH"));
var clrVer = _target.ClrVersions[0];
string dac = clrVer.TryGetDacLocation();
delegate void SignalHandler(object, SignalEventArgs);
delegate void SignalErrorHandler(object, SignalErrorEventArgs);
interface ISignalRecipient {
void ProcessSignal(object sender, SignalEventArgs e);
void ProcessError(object sender, SignalErrorEventArgs e);
}
interface ISignalSource {
event SignalHandler SignalOccurred;
@TheXenocide
TheXenocide / sidebar.js
Created October 2, 2012 21:59
Float my tumblr sidebar
(function($) {
$(function() {
var $sidebar = $('#sidebar');
var $win = $(window);
var origOffset = $sidebar.offset().top;
$win.scroll(function() {
var top = $win.scrollTop();
var offset = $win.scrollTop() - $sidebar.offset().top;
var overlap = $sidebar.height() - $win.height();