Skip to content

Instantly share code, notes, and snippets.

View timdetering's full-sized avatar

Tim Detering timdetering

  • Seattle, WA
View GitHub Profile
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
#! /usr/bin/python
import pip
import sys
from subprocess import call
def pip_upgrade():
if sys.version_info > (3, 0):
# Python 3 code in this block
@timdetering
timdetering / Random_Dungeon_Design.md
Last active February 24, 2023 03:59
The Secret Workings of Jamis Buck's Dungeon Generator

Random Dungeon Design

The Secret Workings of Jamis Buck's Dungeon Generator

So you've tried my Dungeon Generator http://www.aarg.net/~minam/dungeon.cgi once or twice, and it's got you thinking. Perhaps you're a programmer and would like to incorporate similar features in a program of your own. Or maybe you're not a programmer, but would be interested in an overview of how this program works.

Either way, I've been asked how this random dungeon generator works many, many times, and I finally decided that, to save myself time, I'd just put up the description on a web page.

If you find this explanation useful, please let me know. Likewise, if you feel that I was too technical, or not technical enough, or too ambiguous, let me know that, too, and I can try and improve it.

//
// The VersionInfo.cs file contains default assembly attributes that describe the common assembly attributes.
// Assembly specific attributes and values should be defined in the AssemblyInfo.cs file of the individual assemblies.
// These attributes are placed into the metadata for the assembly that is read by Windows and install programs.
//
// Based on blog post:
// http://blog.xoc.net/2012/11/using-assembly-attributes-in-net.html
//
// To update run:
// curl -L https://gist.github.com/timdetering/e8cd043606beb2e4d2f8230898e81d37/raw/ > ./VersionInfo.cs
@timdetering
timdetering / DisposableClass.cs
Last active May 1, 2017 16:59
IDisposable, Done Right
using System;
namespace DisposableExample
{
//-------------------------------------------------------------------
/// <summary>
/// Provides the base implementation for the <see cref="T:System.IDisposable"/> interface.
/// </summary>
/// <seealso cref="https://gist.github.com/timdetering/b99bc162443d95ed6f9e5e62e03bbefc"/>
/// <seealso cref="https://gist.github.com/thinktainer/5633464"/>
@timdetering
timdetering / DeleteToRecycleBin.cs
Created November 1, 2019 03:26
DeleteToRecycleBin
public class DeleteToRecycleBin
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto, Pack = 1)]
public struct SHFILEOPSTRUCT
{
public IntPtr hwnd;
[MarshalAs(UnmanagedType.U4)]
public int wFunc;
public string pFrom;
public string pTo;