Skip to content

Instantly share code, notes, and snippets.

View jongalloway's full-sized avatar

Jon Galloway jongalloway

View GitHub Profile
@jongalloway
jongalloway / index.html
Created February 24, 2015 00:21
qEYPqw
<h2>Testing custom link renderer with Marked.js</h2>
<div class="container">
<div class="row">
<div class="col-md-6">
<textarea class="form-control" id=input rows="30">
Enter Markdown here. This should append /readme.htm to any relative link to a path (not a document).
* [Self anchor link](#do-not-change-me)
* [Another doc anchor](/chocolate/#change-me)
* [Another doc with path](/chocolate/cake.htm)
public class CurrentTimeGetter
{
private volatile Holder _holder;
const String rfc1123Pattern = "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
public string GetCurrentTimeAsString()
{
DateTime now = DateTime.UtcNow;
Holder currentHolder = _holder;
@jongalloway
jongalloway / links.md
Created January 27, 2016 07:49
Links from ASP.NET Community Standup - Jan 26, 2016
$find = '<a (name|id)="(\w*)" />'
$replace = '<a $1="$2"></a>'
$match = 'README.md'
gci -r -i $match | % {
(gc $_ ) | % { $_ -replace $find, $replace } | sc $_
}
Microsoft Windows [Version 10.0.14986]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Users\jonga\AppData\Local\hyper\app-1.0.1>node -v
v7.3.0
C:\Users\jonga\AppData\Local\hyper\app-1.0.1>npm -v
3.10.10
C:\Users\jonga\AppData\Local\hyper\app-1.0.1>hyper
@jongalloway
jongalloway / BlogImportController.cs
Created July 27, 2017 07:45
Cloudscribe RSS importer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Net.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Diagnostics;
using cloudscribe.SimpleContent.Models;
using System.Xml.Linq;
@jongalloway
jongalloway / frmKeyboard.cs
Created August 30, 2017 06:14
OnscreenKeyboard
/*
REFERENCES:
http://210.58.99.179/flyup2005/textview.php?file=0000001034&txtdate=2005/08/19 (main code)
http://www.vbaccelerator.com/home/NET/Code/Controls/Popup_Windows/Floating_Controls/article.asp (preventing a window from getting focus)
http://www.codeproject.com/dotnet/DesktopWidget.asp (hide title, unused)
*/
using System;
using System.Drawing;
using System.Windows.Forms;
@jongalloway
jongalloway / gist:f3bf135ac60b742caee73c22fdca0765
Last active September 23, 2017 08:03
Saving / Loading a Docker Image
D:\Users\Jon> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
microsoft/dotnet latest b10593e780a5 39 hours ago 1.64GB
D:\Users\Jon> docker save -o d:\dotnet-docker-image.tar microsoft/dotnet
D:\Users\Jon> docker rmi microsoft/dotnet
Error response from daemon: conflict: unable to remove repository reference "microsoft/dotnet" (must force) - container 40bf430d0282 is using its referenced image b10593e780a5
D:\Users\Jon> docker rmi microsoft/dotnet -f
Untagged: microsoft/dotnet:latest