Skip to content

Instantly share code, notes, and snippets.

View cartermp's full-sized avatar
🦫
reject modernity, become a beaver

Phillip Carter cartermp

🦫
reject modernity, become a beaver
View GitHub Profile
@cartermp
cartermp / sqlclient-netcore.md
Last active November 23, 2015 16:41
Changes to SqlClient for the RC1 release

Cross-Platform SqlClient

System.Data.SqlClient is cross-platform! This means you can now take advantage of its APIs to interact with a SQL Server database across OS X, Linux, and Windows.

Windows 7 and Windows Server 2008 R2 Users

To use the library, you will need to first download and install the Visual C++ Redistributable for Visual Studio 2012 Update 4 found here.

OSX and Linux Users

Maxpath and .NET

Changes to .NET Core now allow for longer paths for directories. Here's a sample showcasing that.

Note: this sample is running on .NET Core. The easiest way to get going with that is to get the bits, create these files in a directory, and open that directory with Visual Studio Code.

To build and run:

$ dnu restore
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="fsharp-daily" value="https://www.myget.org/F/fsharp-daily/api/v3/index.json" />
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nugetbuild" value="https://www.myget.org/F/nugetbuild" />
<!-- Location of dotnet-compile-fsc tool -->
type BST<`T> =
| Empty // handle empty case
| Node of `T * BST<`T> * BST<`T> // Node with a value and two subtrees
let foo tree =
match tree with
| Empty -> // do something with empty case
| Node(value, left, right) -> // 'value' is the value, 'left' and 'right' are the subtrees
using System;
namespace Fuckaroo
{
class Program
{
void Test()
{
if (this == null)
Console.WriteLine("this is null");
; Licensed to the Apache Software Foundation (ASF) under one or more
; contributor license agreements. See the NOTICE file distributed with
; this work for additional information regarding copyright ownership.
; The ASF licenses this file to You under the Apache License, Version 2.0
; (the "License"); you may not use this file except in compliance with
; the License. You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software

Welcome, family, friends and loved ones. We are gathered here today to celebrate the wedding of Na Hyung and Phillip. You have come here from all over the country - Georgia, California, Washington - to share in this commitment they now make to one another, to offer your love and support to their union, and to allow Na Hyung and Phillip to start their married life together surrounded by people dear and important to them.

Na Hyung and Phillip thank you for your presence here today. They ask for your blessing, encouragement, and lifelong support for their decision to be married. They also remember other loved ones who cannot be here to share this moment with them today. Those people too, they hold dear in their hearts.

Na Hyung and Phillip, marriage is the promise between two people who love each other, who trust that love, who honor one another as individuals in that togetherness, and who wish to spend the rest of their lives together. It enables you to share your desires, longings, dreams, memories, joys and

private static void WriteWatermark(string watermarkContent, Stream originalImage, Stream newImage)
{
originalImage.Position = 0;
using (Image inputImage = Image.FromStream(originalImage, true))
using (Graphics graphic = Graphics.FromImage(inputImage))
{
Font font = new Font("Georgia", 12, FontStyle.Bold);
SizeF textSize = graphic.MeasureString(watermarkContent, font);
open FSharp.Data.UnitSystems.SI.UnitSymbols
type float<[<Measure>] 'm> with
member a.Bind(f,x) = f x * a
member a.Return(x) = a * sqrt x
member a.Yield(x) = a / x
member a.Combine(b:float<'m1>, c:float<'m2>) = a * b * c
member a.Quote(x) = System.Runtime.Hosting.ApplicationActivator()
member a.Delay(f) = f() * a
member a.Run(f) = Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation f
@cartermp
cartermp / CodeReviewChecklist.md
Last active October 19, 2018 15:11
CASS Code Review Checklist

General Non-Code

  • Does the application compile?
  • Does the application, with changes, run without crashing?
  • Can a database, if applicable, be deployed without error?
  • If a new feature is under review, does the new feature act as expected (if this is easy to test)?
  • Does the commit message indicate the scope of the change set?
  • Does the commit message call out any future work that remains to be done?
  • Does the scope of the change set appear to fulfill the given task, and only that task?
  • Is the change set associated with its appropriate work item?