Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
coding up a storm!

seankearon

💭
coding up a storm!
View GitHub Profile
@seankearon
seankearon / AzureStorageConnectionStringParser.cs
Last active Jun 3, 2021
Simple Azure Storage Connection String Parser
View AzureStorageConnectionStringParser.cs
using System;
using System.Collections.Generic;
/// <summary> Based on Patric Macvey's answer here https://stackoverflow.com/a/60998564/2608 </summary>
public class AzureStorageConnectionStringParser
{
readonly Dictionary<string, string> _values = new Dictionary<string, string>();
readonly string _connectionString;
public AzureStorageConnectionStringParser(string connectionString)
View set-sql-azure-pi-rule.ps1
# --------------------------------------------------------------------------------
# Registers an IP rule to allow access to a SQL Azure DB from the current machine's IP.
# --------------------------------------------------------------------------------
# SETUP
# --------------------------------------------------------------------------------
# This assumes you are running PowerShell 7 or greater.
#
# Install the Azure and Azure SQL modules.
#
# Install-Module -Name Az -AllowClobber -Scope CurrentUser
@seankearon
seankearon / Program.fs
Last active Apr 6, 2020
Using EF Core with CosmosDB in F#
View Program.fs
open System
open Microsoft.EntityFrameworkCore
type [<CLIMutable>] LegacyForm = {
id: string // The form's UID.
Client: string
CompanyId: int
Number: string
InstallationAddress: string
@seankearon
seankearon / ModusTollens.cs
Last active Jan 12, 2020
Curry-Howard Exercise
View ModusTollens.cs
// (A => B and not B) => not A
Not<A> ModusTollens<A, B>(
Func<A, B> A_implies_B,
Not<B> not_B)
{
Absurd A_to_Absurd(A a)
{
return not_B.Apply(A_implies_B(a));
}
return new Not<A>(A_to_Absurd);
@seankearon
seankearon / do it.bat
Created Nov 11, 2019
Set Git to use Beyond Compare
View do it.bat
git config --global diff.tool bc3
git config --global difftool.bc3.path "C:\Program Files\Beyond Compare 4\bcomp.exe"
git config --global merge.tool bc3
git config --global mergetool.b3c.path "C:\Program Files\Beyond Compare 4\bcomp.exe"
git config --global difftool.prompt false
View SB Choco
# PLUS: npm install --global --production windows-build-tools
choco install spotify -y
choco install visualstudiocode -y
choco install microsoftazurestorageexplorer -y
choco install sourcetree --version 1.9.10.0 -y
choco install webstorm -y
choco install jetbrainstoolbox -y
# not updated choco install jetbrains-rider -y
choco install balsamiqmockups3 -y
@seankearon
seankearon / gist:de261ac578de1a735b26f23b0ce78155
Created Aug 31, 2017 — forked from robertpi/gist:2964793
F# record implementing an interface
View gist:de261ac578de1a735b26f23b0ce78155
namespace MyNamespace
type IMyInterface =
abstract GetValue: unit -> string
type MyRecord =
{ MyField1: int
MyField2: string }
interface IMyInterface with
member x.GetValue() = x.MyField2
View CreateAndQuery.cs
using System;
using System.Collections.Generic;
using System.Linq;
using Marten;
using Xunit;
namespace marten_test
{
public class CreateAndQuery
{
View invoke-environment.ps1
function Invoke-Environment {
# Source: http://stackoverflow.com/a/4385011/2608
# and https://github.com/nightroman/PowerShelf/blob/master/Invoke-Environment.ps1
param
(
[Parameter(Mandatory=1)][string]$Command,
[switch]$Output,
[switch]$Force
)
$stream = if ($Output) { ($temp = [IO.Path]::GetTempFileName()) } else { 'nul' }
@seankearon
seankearon / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console