Skip to content

Instantly share code, notes, and snippets.

View kellypleahy's full-sized avatar

Kelly Leahy kellypleahy

View GitHub Profile
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.ApplicationInsights.DependencyCollector;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
sudo apt install p7zip-full
curl https://gslvhcd66k6digicalcapisa.blob.core.windows.net/bob/publish.7z -o publish.7z
sudo apt-get install libunwind8
sudo apt-get install libcurl3
# pkill -f gicalcsvc
sudo rm -rf /var/opt/gicalc
sudo 7za x -o/var/opt/gicalc publish.7z
sudo chmod +x /var/opt/gicalc/gicalc-console
sudo date > /var/opt/gicalc/deploy-date
@kellypleahy
kellypleahy / main.rs
Created September 23, 2016 22:56
RUST: Using traits to implement generic Point<T> and Line<T> with a len() function that computes as f64.
#![allow(dead_code)]
#![allow(unused_imports)]
use std::mem;
use std::ops;
use std::convert;
struct Point<T> {
x: T,
y: T
}
### this is preamble (framework code), the user wouldn't type this.
$bindings = @{
projects = @()
}
function project($projectFilename, $block) {
function output-type($type) {
#maybe validate or translate, etc...
$bindings.outputType = $type
@kellypleahy
kellypleahy / gist:988177
Created May 24, 2011 05:33
CECIL based unit tests.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using Milliman.MGAlfa.AplInterface;
using Mono.Cecil;
using Mono.Cecil.Cil;
using NUnit.Framework;
@kellypleahy
kellypleahy / ThreadPool.cs
Created May 6, 2011 22:19
thread pool implementation from the advanced threading class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace ThreadingApp
{
public interface ITask
{
void Execute();
@kellypleahy
kellypleahy / gist:959341
Created May 6, 2011 17:08
testing post message handler
public class PostStatusCodeMessageHandler: DelegatingChannel
{
public PostStatusCodeMessageHandler(HttpMessageChannel innerChannel)
: base(innerChannel)
{
}
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var task = base.SendAsync(request, cancellationToken);
@kellypleahy
kellypleahy / IQueueWatcher.cs
Created March 24, 2011 07:05
an attempt at a queue watcher that is more correct for our needs.
public interface IQueueWatcher
{
void Start();
}
public interface IQueueMessageProcessor
{
void ProcessMessage(byte[] messageBytes);
}
[merge]
keepBackup = false;
tool = p4merge
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
void Main()
{
var rootList = new List<Node>(new[]{ new Node() }); // only ever one root, I assume.
var childrenAtThisLevel = FillLevel(rootList);
while(childrenAtThisLevel.Count > 0)
childrenAtThisLevel = FillLevel(childrenAtThisLevel);
}
List<Node> FillLevel(List<Node> childrenAtThisLevel)
{