Skip to content

Instantly share code, notes, and snippets.

@DanSmith
DanSmith / DDI4Beta.markdown
Last active December 21, 2023 22:34
Draft DDI Lifecycle 4.0 beta announcement

Hello DDI Community,

The Technical Committee is happy to announce the availability of a beta version of DDI Lifecycle 4.0.

DDI Lifecycle 4.0 is managed using a Model First development approach. Content additions and changes are added to the model and the serialization formats are automatically generated. The metadata content of DDI 3.3 has been converted into the new 4.0 model.

The ddi-lifecycle-4.0-beta.1.zip package includes:

  • schema.xsd - XML Schema
  • jsonSchema.json - JSON Schema
  • ddi4.xmi - OMG's UML XMI 2.5
@DanSmith
DanSmith / snippet.cs
Created June 16, 2022 20:52
Attach a variable scheme to an instrument using a custom field, and register only the instrument in a transaction
var client = new RestRepositoryClient(info);
VersionableBase.DefaultAgencyId = "int.example";
MultilingualString.CurrentCulture = "en";
var instrument = new Instrument();
var varset = new VariableScheme();
var customField = new CustomField();
customField.RelatedItemIdValue = new TypedIdTriple(varset.CompositeId, DdiItemType.VariableScheme);
customField.ValueType = CustomFieldType.Relationship;
@DanSmith
DanSmith / populateset.cs
Last active April 6, 2022 21:36
Populate a variable set and all children using two REST calls to the Colectica Respotiroy
// First, start with an instance of the variable scheme
var variableScheme = client.GetItem(variableSchemeId, ChildReferenceProcessing.Instantiate);
// The SetPopulator uses only two Repository calls to populate the entire item graph.
// The populator will call the Repository GetSet to find all identifiers, then the GetItems to retrieve all DDI for all items
// It will recurse all the children, children of children, etc within this graph of items, and populate them
SetPopulator setPopulator = new SetPopulator(client);
variableScheme.Accept(setPopulator);
@DanSmith
DanSmith / MahApps-migration-regex.markdown
Created November 9, 2021 20:22
Regex for visual studio to find MahApps Resource Keys that have been changed for MahApps 2

VS Regex for finding old MahApps resource keys when upgrading to MahApps 2 See https://mahapps.com/docs/guides/migration-to-v2.0 for more information

Renamed and new Colors

AccentBaseColor|AccentColor|AccentColor2|AccentColor3|AccentColor4|BlackColor|FlyoutColor|Gray1|Gray10|Gray2|Gray3|Gray4|Gray5|Gray6|Gray7|Gray8|Gray9|GrayHover|GrayNormal|HighlightColor|IdealForegroundColor|MenuShadowColor|ProgressIndeterminateColor1|ProgressIndeterminateColor2|ProgressIndeterminateColor3|ProgressIndeterminateColor4|WhiteColor

Renamed and new Brushes

AccentBaseColorBrush|AccentColorBrush|AccentColorBrush2|AccentColorBrush3|AccentColorBrush4|AccentSelectedColorBrush|BlackBrush|ButtonMouseOverBorderBrush|CheckBoxBrush|CheckBoxMouseOverBrush|CheckmarkFill|CleanWindowCloseButtonBackgroundBrush|CleanWindowCloseButtonPressedBackgroundBrush|ComboBoxMouseOverBorderBrush|ComboBoxPopupBorderBrush|ContextMenuBackgroundBrush|ContextMenuBorderBrush|ControlBackgroundBrush|ControlBorderBrush|ControlsDisabledBrush|ControlsValidatio

@DanSmith
DanSmith / ColecticaCLA.markdown
Last active June 12, 2017 22:43
Colectica Open Source CLA

###Colectica Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by Colectica or its affiliates (“Colectica”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Colectica in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact opensource@colectica.com.

@DanSmith
DanSmith / keybase.md
Created October 27, 2014 23:54
keybase.md

Keybase proof

I hereby claim:

  • I am dansmith on github.
  • I am smithdan (https://keybase.io/smithdan) on keybase.
  • I have a public key whose fingerprint is 40A8 469D 93BD CCD7 D930 E171 A989 912D 955D 2DD1

To claim this, I am signing this object:

@DanSmith
DanSmith / RegisterEventLog.ps1
Created September 7, 2012 19:25
Powershell script to register a windows event log source
# https://github.com/dansmith
#
$source = "My Application Name"
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent()
$prp=new-object System.Security.Principal.WindowsPrincipal($wid)
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator
$IsAdmin=$prp.IsInRole($adm)