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
using System;
namespace Fuckaroo
{
class Program
{
void Test()
{
if (this == null)
Console.WriteLine("this is null");
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
<?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 -->

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
@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

@cartermp
cartermp / stupid.cs
Last active November 18, 2015 16:31
public static string HeyThere(this IEnumerable<Point> pts) =>
$"{pts.Skip(1).Aggregate($"[{pts.First().X},{pts.First().Y},", (curr, p) => $"{curr},{p.X},{p.Y}")}]";
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YES
{
public abstract class ErrorReportingBase
{
@cartermp
cartermp / core.clj
Created April 12, 2015 00:26
Google Translate changes to core
(ns app.core
(:require
[app.cache :refer :all]
[clojure.string :as str]
[clojure.xml :as xml]
[clj-xpath.core :as xpath]
[ring.util.codec :as codec])
(:import (org.apache.tika.language.translate GoogleTranslator)))
(def langs {:en "english"
@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?
@cartermp
cartermp / pipe-forward.scm
Created December 25, 2014 00:13
F# pipe-forward operator implemented in Scheme with a quick test
(define (|> f g)
(g f))
(define (square x)
(* x x))
(|> '(1 2 3 4 5) (lambda (x) (map square x)))