Skip to content

Instantly share code, notes, and snippets.

View jimmcslim's full-sized avatar

James Webster jimmcslim

  • Brisbane, Australia
View GitHub Profile
@jimmcslim
jimmcslim / something.ign
Created March 11, 2024 14:22
this is a test
blah blah blah
@jimmcslim
jimmcslim / install-tmux-config.sh
Created September 29, 2022 01:56
Install tmux config
#!/bin/bash
# Installs https://github.com/gpakosz/.tmux
cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
@jimmcslim
jimmcslim / TestStack.Dossier.Parent.Child.cs
Created October 7, 2019 21:16
Demonstrating constructing parent/child relationships via TestStack Dossier.
using System;
using System.Collections.Generic;
using System.Linq;
using Shouldly;
using TestStack.Dossier;
using TestStack.Dossier.Lists;
using Xunit;
namespace Dossier
{

Keybase proof

I hereby claim:

  • I am jimmcslim on github.
  • I am jimmcslim (https://keybase.io/jimmcslim) on keybase.
  • I have a public key ASBT50ipVd_wUBR-tbIoW1n3GlKj380Bn7vqONIjGzACDgo

To claim this, I am signing this object:

@jimmcslim
jimmcslim / gist:58d82277eaf82a3b8ec4
Created January 25, 2016 03:30
Quick demo of creating a spreadsheet
using System.IO;
using System.Linq;
using OfficeOpenXml; // comes from EPPlus
namespace SpreadsheetGenerationSample
{
class Program
{
static void Main(string[] args)
{
using System;
using System.Security;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Runtime.CompilerServices;
namespace net.visibleblue.util
{
public static class SecureStringExtensions
{
@jimmcslim
jimmcslim / Grok.cs
Created October 28, 2015 07:11
Bare-bones Grok implementation in C#, translated from http://stackoverflow.com/a/23078970/28381
var Types = new Dictionary<string, string>
{
{"WORD", @"\w+"},
{"NUMBER", @"\d+"},
};
var grok = new Regex(@"%{(\w+):(\w+)}");
MatchEvaluator e = match => string.Format("(?<{0}>{1})", match.Groups[2].Value, Types[match.Groups[1].Value]);
var regex = new Regex(grok.Replace("%{WORD:method} %{NUMBER:bytes} %{NUMBER:duration}", e));
@jimmcslim
jimmcslim / RoyalTS-Helpers.ps1
Created September 22, 2015 06:30
A collection of Powershell functions that make the RoyalTS Powershell module a little more sane to work with.
function Load-RoyalDocument
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)] [string] $Path
)
$cred = Get-Credential
$store = New-RoyalStore -UserName $cred.UserName
$document = Open-RoyalDocument -Store $store -FileName $path -Password $cred.Password
(defn my-test [x]
(.log js/console "I have run for " x)
(+ x 10)
)
(defn my-memoize [x]
(fn [a]
(let [my-memoize-atom (atom {})]
(let [my-atom @!my-memoize-atom]
(if (contains? my-atom a)
@jimmcslim
jimmcslim / consul.debug.log
Created February 18, 2015 04:23
Log of Consul Template
2015/02/18 14:08:52 [INFO] (runner) creating new runner (dry: false, once: false)
2015/02/18 14:08:52 [INFO] (runner) creating consul/api client
2015/02/18 14:08:52 [DEBUG] (runner) setting address to nas01:8500
2015/02/18 14:08:52 [INFO] (runner) creating Watcher
2015/02/18 14:08:52 [INFO] (runner) starting
2015/02/18 14:08:52 [DEBUG] (runner) running initial templates
2015/02/18 14:08:52 [INFO] (runner) running
2015/02/18 14:08:52 [DEBUG] (runner) checking template services.html.tmpl
2015/02/18 14:08:52 [INFO] (brain) getting data for catalog services
2015/02/18 14:08:52 [INFO] (runner) was not watching 1 dependencies