Skip to content

Instantly share code, notes, and snippets.

David De Sloovere DavidDeSloovere

Block or report user

Report or block DavidDeSloovere

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@blowdart
blowdart / UpdateIISExpressSSLForChome.ps1
Last active Sep 21, 2019
IIS Express certs (for now) don't contain SAN strings. This makes Chrome unhappy. Make Chrome happy again with a new organic, artisanal, gluten free HTTPS certificate.
View UpdateIISExpressSSLForChome.ps1
# Create a new self signed HTTPS Certificate for IIS Express
# Crafted with all organic, GMO, gluten free ingreditations
# with an artisinal SAN to make Chrome 58 onwards happy.
#
# See https://bugs.chromium.org/p/chromium/issues/detail?id=308330
#
# Run this at an administrative PowerShell prompt.
#
# You will be prompted to trust a new certificate via a windows dialog.
# Click yes otherwise Visual Studio will not be able to determine your
@pohatu
pohatu / md2html.ps1
Created Jul 1, 2013
Use the GitHub markdown service to convert md to html via powershell.
View md2html.ps1
[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"
@jbtule
jbtule / AESGCM.cs
Last active Sep 10, 2019
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
View AESGCM.cs
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
@xavierdecoster
xavierdecoster / register a myget feed.markdown
Last active Aug 30, 2018
Store MyGet credentials in your roaming user profile NuGet.config
View register a myget feed.markdown

Execute the following script using your MyGet [feedUrl] and MyGet [username] , [password] and [apikey]. Run this from a commandline where you have access to nuget.exe (or set the path to your nuget.exe in a system environment variable).

Store credentials in machine-level nuget.config (non-transferable)

nuget setapikey [apikey] -source [feedUrl]
nuget sources add|update -Name [name] -source [feedUrl] -User [username] -pass [password]
@DanTup
DanTup / VS References Yuml.ps1
Last active Oct 4, 2015
Output Visual Studio project references for yuml.me
View VS References Yuml.ps1
function Get-ProjectReferences
{
param(
[Parameter(Mandatory)]
[string]$rootFolder,
[string[]]$excludeProjectsContaining
)
dir $rootFolder -Filter *.csproj -Recurse |
@rdingwall
rdingwall / Global.asax.cs
Created Mar 10, 2012
camelCase + indented JSON formatter for ASP.NET Web API
View Global.asax.cs
...
var config = GlobalConfiguration.Configuration;
// Replace the default JsonFormatter with our custom one
var index = config.Formatters.IndexOf(config.Formatters.JsonFormatter);
config.Formatters[index] = new JsonCamelCaseFormatter();
...
@DavidDeSloovere
DavidDeSloovere / gist:1893621
Created Feb 23, 2012
Sample CacheAttribute for ASP.NET Web Api - i'm not saying this is the best way
View gist:1893621
namespace ProjectName.WebApi.Infrastructure
{
using System;
using System.Net;
using System.Net.Http.Headers;
using System.Web.Http.Filters;
public class CacheAttribute : ActionFilterAttribute
{
public CacheAttribute()
@joshuaflanagan
joshuaflanagan / nuget_tool.bat
Created Jun 24, 2011
Example batch file to execute a tool from a Nuget package
View nuget_tool.bat
@ECHO OFF
SETLOCAL
REM This can be used for any .exe installed by a nuget package
REM Example usage: nuget_tool.bat nunit-console.exe myproject.tests.dll
SET TOOL=%1
FOR /R %~dp0\source\packages %%G IN (%TOOL%) DO (
IF EXIST %%G (
SET TOOLPATH=%%G
GOTO FOUND
)
@joelnet
joelnet / example.html
Created Jun 3, 2011
Unobtrusive Knockout support library for jQuery
View example.html
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
You can’t perform that action at this time.