Skip to content

Instantly share code, notes, and snippets.

View davetransom's full-sized avatar

Dave Transom davetransom

View GitHub Profile
@ForeverZer0
ForeverZer0 / ExtractTarGz.cs
Last active June 28, 2024 08:01
Use pure C# to extract .tar and .tar.gz files
using System;
using System.IO;
using System.IO.Compression;
using System.Text;
namespace TarExample
{
public class Tar
{
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@mfcollins3
mfcollins3 / GenerateVersionInfo.xml
Created January 24, 2013 16:44
Classes for using semantic version numbers with .NET applications. For more information, see <http://www.michaelfcollins3.me/blog/2013/01/23/semantic_versioning_dotnet.html>.
<!--
The GenerateVersionInfo task will generate the VersionInfo.cs file with the
metadata for the current build.
-->
<UsingTask TaskName="GenerateVersionInfo"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
##################################################
#
##################################################
param(
[Parameter(Mandatory = $true)][String]$subscriptionId,
[Parameter(Mandatory = $true)][String]$storageAccountName,
[Parameter(Mandatory = $true)][String]$affinityGroupName,
[Parameter(Mandatory = $true)][String]$imageName = 'MSFT__Windows-Server-2012-Datacenter-201208.01-en.us-30GB.vhd',
[Parameter(Mandatory = $true)][String]$adminPassword,
@howarddierking
howarddierking / chainedBundleTransform.cs
Created March 8, 2012 03:20
example of a chained bundle transform using less
protected void Application_Start()
{
//...
Bundle cssBundle = new Bundle("~/Content/css", new LessTransform().Then(new CssMinify()));
cssBundle.AddFile("~/Content/site.css", throwIfNotExist: false);
cssBundle.AddDirectory("~/Content/", "jquery.mobile*", searchSubdirectories: false, throwIfNotExist: false);
BundleTable.Bundles.Add(cssBundle);
//...
@dieseltravis
dieseltravis / iisexpress.bat
Last active January 5, 2016 13:35
Add a shortcut to your Send To menu to launch a folder in IISExpress
@echo off
:: normalize folder
SET folder=%~1
IF %folder:~-1%==\ SET folder=%folder:~0,-1%
:: random number from 8000 to 9999
SET /a port=(%random%)*1999/32767+8000
:: start the web server for the random port starting at the passed-in directory