Skip to content

Instantly share code, notes, and snippets.

@chrisrichards
chrisrichards / project.json
Created April 22, 2016 14:47
.Net Core project.json to produce OSX native executable
{
"version": "1.0.0-*",
"compilationOptions": {
"emitEntryPoint": true,
"debugType": "portable"
},
"runtimes": {
"osx.10.11-x64" : {}
},
"dependencies": {
@chrisrichards
chrisrichards / nuget.config
Created April 22, 2016 14:46
.Net Core RC2 nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
@chrisrichards
chrisrichards / LogEntriesLogger.h
Last active August 2, 2017 08:33
Custom CocoaLumberjack logger for LogEntries.
//
// LogEntriesLogger.h
// lcinventories
//
// Created by Chris Richards on 17/11/2014.
// Copyright (c) 2014 Yellow Feather Ltd. All rights reserved.
//
#import "DDLog.h"
@chrisrichards
chrisrichards / ObjectModelQuery.cs
Created October 19, 2011 13:05
Create an object model from a single LINQ query
var results = Session.Query<Answer>()
.Select(answer => new
{
QuestionId = answer.Question.Id,
QuestionText = answer.Question.Text,
QuestionDate = answer.Question.Date,
AnswerId = answer.Id,
AnswerText = answer.Text,
AnswerDate = answer.Date,
})
using System.IO;
using Lucene.Net.Analysis;
namespace LuceneTest
{
public class PartNumberAnalyzer : Analyzer
{
private const string SkipCharacters = " -/\\";
#region Overrides of Analyzer