Skip to content

Instantly share code, notes, and snippets.

View ghotz's full-sized avatar

Gianluca Hotz ghotz

View GitHub Profile
@jdaigle
jdaigle / gist:2781349
Created May 24, 2012 12:39
SQL Server Service Broker: Short Script to clear empty a named queue
DECLARE @handle UNIQUEIDENTIFIER;
WHILE (SELECT COUNT(*) FROM NameOfQueue) > 0
BEGIN
RECEIVE TOP (1) @handle = conversation_handle FROM NameOfQueue;
END CONVERSATION @handle WITH CLEANUP
END
@lidopaglia
lidopaglia / ConvertFrom-Markdown.ps1
Created September 17, 2012 20:04
PowerShell function to convert Markdown to HTML via Github API
<#
.SYNOPSIS
Converts Markdown formatted text to HTML.
.DESCRIPTION
Converts Markdown formatted text to HTML using the Github API. Output is "flavored" depending on
the chosen mode. The default output flavor is 'Markdown' and includes Syntax highlighting and
Github stylesheets.
Based on the Ruby version by Brett Terpstra:
http://brettterpstra.com/easy-command-line-github-flavored-markdown/
@pohatu
pohatu / md2html.ps1
Created July 1, 2013 19:38
Use the GitHub markdown service to convert md to html via powershell.
[CmdletBinding()] Param (
[Parameter(Position = 0, Mandatory = $True, ValueFromPipelineByPropertyName = $True)]
[ValidateNotNullOrEmpty()]
[Alias('FullName')]
[String]
$filePath
)
function ConvertFrom-md($mdText){
$response = Invoke-WebRequest -Uri 'https://api.github.com/markdown/raw' -Method Post -body "$mdText" -ContentType "text/plain"