Skip to content

Instantly share code, notes, and snippets.

@tmonjalo
tmonjalo / list-fftabs.py
Created September 13, 2018 10:42
List all Firefox tabs with title and URL
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""
@jaime-olivares
jaime-olivares / DicomUID.cs
Last active December 11, 2023 17:50
Dicom UUID-derived UID generator
// A port from javascript: https://hcintegrations.ca/2014/05/14/quick-and-dirty-javascript-dicomweb-uid-generator/
public static string NewUID_dirty()
{
var r = new System.Random();
var uid = System.Text.RegularExpressions.Regex.Replace("2.25.xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx", "x", m => (r.Next()%16).ToString() );
return System.Text.RegularExpressions.Regex.Replace(uid, "y", m => (r.Next()&3|8).ToString());
}
// Trying to strictly follow the Dicom spec: ftp://medical.nema.org/medical/dicom/2013/output/html/part05.html#sect_B.2
// More details at: ISO/IEC 9834-8 / ITU-T X.667, Section 6.3