Skip to content

Instantly share code, notes, and snippets.

View rippo's full-sized avatar

Richard Wilde rippo

View GitHub Profile
@rippo
rippo / GitVersionIncrement.ps1
Last active August 9, 2021 15:31 — forked from nbarnwell/GitVersionIncrement.ps1
Simple PowerShell script to create the appropriate next tag on a git repo
function New-Tag {
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string] $Tag)
process {
if ($PSCmdlet.ShouldProcess("git tag $Tag")) {
Write-Verbose "git tag $Tag"
git tag $Tag
}
@rippo
rippo / Connection.cs
Created January 22, 2018 15:22 — forked from lancscoder/Connection.cs
Dapper Getting Started
public class ConnectionFactory {
public static DbConnection GetOpenConnection() {
var connection = new SqlConnection("MyConnectionString");
connection.Open();
return connection;
}
}
[HtmlTargetElement("div")]
public class VisibilityTagHelper : TagHelper
{
public bool IsVisible { get; set; } = true;
public override void Process(TagHelperContext context, TagHelperOutput output)
{
if (!IsVisible)
output.SuppressOutput();
@rippo
rippo / GarberIrish.js
Created May 25, 2016 10:27 — forked from danielgreen/GarberIrish.js
Garber-Irish JavaScript implementation. Provides a way to execute script, on page load, based on the MVC controller and action that produced the page. This is a DOM-routing approach. It can help pages to avoid explicitly referencing numerous JS files. See http://viget.com/inspire/extending-paul-irishs-comprehensive-dom-ready-execution
/* Contains general scripts that may be used in any page.
* If this file starts to get large it can be split into page-specific files. */
/* The following code is the Garber-Irish implementation, a way to run relevant JavaScript on page-load
* based on the MVC action that produced the page. It's an unobtrusive approach, which means that the
* code to call the relevant JavaScript functions is all here instead of being hardcoded into the HTML.
* All this code needs from the page is data-controller and data-action attributes on the body tag.
* Since JavaScript is case-sensitive, the controller and action names we use here must be an exact match.
* http://viget.com/inspire/extending-paul-irishs-comprehensive-dom-ready-execution */