Skip to content

Instantly share code, notes, and snippets.

@Thesaurus
Thesaurus / SynchronizationContext.cs
Last active November 29, 2016 16:20
Provides a .NET ConcurrentQueue based SynchronizationContext that uses event based notification to inform subscribers that the queue needs processed.
using System;
using System.Threading;
using System.Diagnostics;
using System.ComponentModel;
using System.Collections.Concurrent;
namespace Mono.Embedding
{
// REF http://codereview.stackexchange.com/questions/31820/basic-single-threaded-implementation-of-synchronizationcontext
@Thesaurus
Thesaurus / post-archive-build-action.sh
Last active January 28, 2016 13:49
An xcode post archive action that checks for Gatekeeper compatibility using spctl. For a given Xcode scheme put something like this into the scheme archive post-actions script.
if [ "${CONFIGURATION}" == "Release" ]; then
# xcode post build action for build/archive cannot directly return or log error conditions but we can:
# 1. put up a dialog
# 2. post a notification
# 3. say someting
# 4. write to the syslog
# 5. write to a file and open the file
# Execute a project folder script.
@Thesaurus
Thesaurus / TSGridView.h
Created December 4, 2015 13:19
Using NSTableView as a grid control.
//
// TSGridView.h
//
// Created by Jonathan Mitchell on 06/07/2015.
// Copyright (c) 2015 Thesaurus Software Limited. All rights reserved.
//
#import <Cocoa/Cocoa.h>
extern NSString *TSGridColumns;
@Thesaurus
Thesaurus / make-mono64-bundle.bash
Created October 7, 2015 12:16
A script to build a Mono 64 framework bundle on OS X. Note that this script is designed to be used within the context of a Dubrovnik repository.
#!/bin/sh
# make-mono64-bundle.sh
# https://github.com/ThesaurusSoftware/Dubrovnik/blob/master/Scripts/make-mono64-bundle.sh
#
# Created by Jonathan Mitchell on 02/10/2015.
#
# See the main project README for usage.
#
# This script can be used build the Mono 64 bit framework bundle
# used by Dubrovnik.
@Thesaurus
Thesaurus / BPCheckBoxButton.m
Created September 16, 2015 12:13
NSButton checkbox with wrapping title (despite what IB says a check box title does not wrap)
#import <Cocoa/Cocoa.h>
@interface BPCheckBoxButton : NSButton
@end
@implementation BPCheckBoxButton
- (void)setTitle:(NSString *)aString
{