Skip to content

Instantly share code, notes, and snippets.

View KevM's full-sized avatar

Kevin Miller KevM

View GitHub Profile
@KevM
KevM / pypowerwall.env
Last active April 8, 2024 11:22
PyPowerwall Debug
PW_TIMEZONE=America/Chicago
PW_STYLE=grafana-dark
TZ=America/Chicago
PW_DEBUG=yes
PW_CACHE_EXPIRE=30
PW_POOL_MAXSIZE=1
@KevM
KevM / main.go
Last active March 15, 2024 20:11
Integration of ARPC with Gin
package main
import (
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
func main() {
router := gin.New()
logger := zap.NewNoOp() //replace with your logger
@KevM
KevM / foo.go
Last active February 23, 2024 17:58
wee
package wee
func Yippie(s string) {
log.Printf("yippie! %s". s)
}
@KevM
KevM / a_readme.md
Created January 30, 2012 17:11
Example rake file for applying schema scripts and running sql

Dovetail Automation

Running the rake script below will

  1. Apply all schema scripts ending in .schemascript.xml found in the child schema directory.
  2. Execute all .sql scripts found in the child database directory.

Setup

  1. Edit the rakefile.rb to have your correct database configuration.
@KevM
KevM / log-examples.txt
Created October 5, 2012 14:35
Adding the current web request URL to your log4net logging context
2012-10-04 17:25:25,241 DEBUG [|24] Dovetail.SDK.Bootstrap.Clarify.CurrentSDKUser / Setting the current user to be annie
2012-10-04 17:25:25,246 DEBUG [annie|24] Dovetail.SDK.Bootstrap.Clarify.ClarifySessionCache / Get session for annie. Found valid session in cache.
2012-10-04 17:25:39,695 DEBUG [|28] Dovetail.SDK.Bootstrap.Clarify.ClarifySessionCache /api/history/case/148 Getting application session.
2012-10-04 17:25:39,695 DEBUG [|28] Dovetail.SDK.Bootstrap.Clarify.ClarifySessionCache /api/history/case/148 Get session for sa. Found valid session in cache.
2012-10-04 17:25:39,695 DEBUG [|28] Dovetail.SDK.Bootstrap.Clarify.ClarifySessionCache /api/history/case/148 Get session for annie. Found valid session in cache.
2012-10-04 17:25:39,696 DEBUG [|28] Dovetail.SDK.Bootstrap.Authentication.PrincipalFactory /api/history/case/148 Creating principal for user annie with 165 permissions.
2012-10-04 17:25:39,696 DEBUG [|28] Dovetail.SDK.Bootstrap.Clarify.CurrentSDKUser /api/history/case/148 Setting the curren
@KevM
KevM / docker-compose.yml
Last active February 2, 2021 20:14
Minecraft Docker Compose file for Azure
version: "3.7"
services:
mc:
image: itzg/minecraft-server
domainname: my-domain-name
ports:
- 25565:25565
environment:
EULA: "TRUE"
@KevM
KevM / task-experiment.cs
Created December 11, 2020 14:36
exception_in_one_task_should_not_affect_others
public class Experiment
{
private readonly ITestOutputHelper _outputHelper;
public Experiment(ITestOutputHelper outputHelper)
{
_outputHelper = outputHelper;
}
[Fact]
@KevM
KevM / tika-example.cs
Created July 12, 2013 20:14
Using TikaOnDotNet for text extraction
var textExtractor = new TextExtractor();
var result = textExtractor.Extract(@"c:\projects\tikaondotnet\src\TikaOnDotNet.Tests\files\Tika.doc");
// View the result on the console
Console.WriteLine("Content Type: " + result.ContentType);
Console.WriteLine("\n\n" + result.Text.Trim());
@KevM
KevM / MessagePublisher.cs
Created January 29, 2010 15:06
Generic Masstransit Message Publisher/Sender
using Dovetail.Commons;
using MassTransit;
namespace Dovetail.Carrier.Core
{
public interface IMessagePublisher
{
void Publish<MESSAGE>(MESSAGE message) where MESSAGE : class;
}
@KevM
KevM / observable_extensions.cs
Created July 5, 2018 20:05
Testing Observables
public static class ObservableExtensions
{
public static Func<bool> WasObserved<T>(this IObservable<T> observableUnderTest, T expected)
{
var wasExpectedObserved = false;
var result = observableUnderTest.Subscribe(s =>
{
wasExpectedObserved = s.Equals(expected);
});