Skip to content

Instantly share code, notes, and snippets.

@fyndor
fyndor / TypedId.cs
Created November 29, 2024 05:21
Type-safe ID fields
using MongoDB.Bson;
public struct TypedId<T> : IEquatable<TypedId<T>>
{
public TypedId()
{
}
public TypedId(ObjectId value)
{
public class Adder
{
public int Add(int a, int b)
{
return a + b;
}
}
public class UnitTest1
{
@fyndor
fyndor / Safe8087CWUtils.pas
Created June 23, 2017 20:32
Thread-safe way to set and get the 8087 FPU control word settings in Delphi
unit Safe8087CWUtils;
interface
procedure SafeSet8087CW(ANewCW: Word); stdcall; export;
procedure SafeSet8087CWEx(ANewCW: Word); register;
function SafeGet8087CW :Word; stdcall; export;
function SafeGet8087CWEx :Word; register;
implementation
@fyndor
fyndor / Engine.cs
Created July 20, 2015 08:06
Microsoft.Tools.WindowsInstallerXml.Bootstrapper.Engine
#region Assembly BootstrapperCore.dll, v3.0.0.0
// C:\Program Files (x86)\WiX Toolset v3.10\SDK\BootstrapperCore.dll
#endregion
using System;
using System.Reflection;
namespace Microsoft.Tools.WindowsInstallerXml.Bootstrapper
{
// Summary:
@fyndor
fyndor / BootstrapperApplication.cs
Created July 20, 2015 08:04
Microsoft.Tools.WindowsInstallerXml.Bootstrapper.BootstrapperApplication
#region Assembly BootstrapperCore.dll, v3.0.0.0
// C:\Program Files (x86)\WiX Toolset v3.10\SDK\BootstrapperCore.dll
#endregion
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Tools.WindowsInstallerXml.Bootstrapper
{
// Summary:
@fyndor
fyndor / BootstrapperApplication
Created July 20, 2015 07:53
Microsoft.Tools.WindowsInstallerXml.Bootstrapper
#region Assembly BootstrapperCore.dll, v3.0.0.0
// C:\Program Files (x86)\WiX Toolset v3.10\SDK\BootstrapperCore.dll
#endregion
using System;
using System.Runtime.InteropServices;
namespace Microsoft.Tools.WindowsInstallerXml.Bootstrapper
{
// Summary:
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-pages/core-pages.html">
<link rel="import" href="../paper-button/paper-button.html">
<polymer-element name="my-element">
<template>
<style>
@fyndor
fyndor / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-item/core-item.html">
@fyndor
fyndor / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<polymer-element name="my-element">