Skip to content

Instantly share code, notes, and snippets.

View EdCharbeneau's full-sized avatar
🏠
Working from home

Ed Charbeneau EdCharbeneau

🏠
Working from home
View GitHub Profile
@EdCharbeneau
EdCharbeneau / Enable-Transformations.md
Last active May 6, 2024 11:44
How to enable transformations on build with Visual Studio

#Transform web.config on build

  1. Unload the project
  2. Edit .csproj
  3. Append figure 1 to the end of the file just before </Project>; v12.0 my change depending on your version of Visual Studio
  4. Save .csproj and reload
  5. Open configuration manager
  6. Add a new Configuration Name: Base. Copy settings from: Release
  7. Copy the contents of your web.config
  8. Right click Web.Config > Add Config Transformation
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.Entity;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text.RegularExpressions;
@EdCharbeneau
EdCharbeneau / app.css
Created February 17, 2023 16:54
REPL Example
.banner {
font-size: 32px;
background-color: red;
color: white;
}
@EdCharbeneau
EdCharbeneau / ConfigurationExtensions.cs
Created August 10, 2022 13:38
Adds a JSON configuration source to builder for MAUI using appsettings.json
public static class ConfigurationExtensions
{
/// <summary>
/// Adds a JSON configuration source to builder
/// </summary>
/// <param name="config"></param>
/// <param name="configResourceName"></param>
/// <returns>The IConfigurationBuilder</returns>
public static IConfigurationBuilder AddJsonResource(this IConfigurationBuilder config, string configResourceName)
{
@EdCharbeneau
EdCharbeneau / kendo-export.js
Created March 24, 2015 15:06
Export to image with Kendo UI
// Convert the DOM element to a drawing using kendo.drawing.drawDOM
kendo.drawing.drawDOM($(".qr-wrapper")) //#qrMail
.then(function(group) {
// Render the result as a PNG image
return kendo.drawing.exportImage(group);
})
.done(function(data) {
// Save the image file
kendo.saveAs({
dataURI: data,
@EdCharbeneau
EdCharbeneau / RemoteAuthenticatorView.razor
Created June 4, 2020 15:41
All the RemoteAuthenticatorView templates
<RemoteAuthenticatorView Action="@Action">
<LoggingIn>
<span>Logging you in...</span>
</LoggingIn>
<CompletingLoggingIn>
<span>Checking permissions...</span>
</CompletingLoggingIn>
<LogInFailed>
<span>Sorry, your login failed. Please try again or contact support.</span>
</LogInFailed>
@EdCharbeneau
EdCharbeneau / StringBuilderExtensions.cs
Created March 22, 2022 16:48
String Builder cleanup
public static class StringBuilderExtensions {
public static StringBuilder AppendWhen(this StringBuilder sb, string value, bool predicate) {
if(predicate) {
sb.Append(value);
}
return sb;
}
}
@EdCharbeneau
EdCharbeneau / all.scss
Last active February 3, 2022 21:23
Minimal Gulp for Telerik Themes
@import "~@progress/kendo-theme-bootstrap/dist/all";
@EdCharbeneau
EdCharbeneau / AsJson.cshtml
Last active November 8, 2021 17:37
Turn any Umbraco content into a JSON object by using a Razor template
@*Experimental, I'm still fairly new to Umbraco there could be an API avialbe for this already.
This was inspired by http://cultiv.nl/blog/razor-vs-base-to-output-json-in-umbraco/
If there is a better way please let me know via twitter @EdCharbeneau
Add this template to your Umbraco site and any content can be called via Ajax using
/mySite/contentPath/?alttemplate=AsJson
Return value will be { propertyAlias : value }
Ex: { "personAlias" : "John Doe", "id" : 1002 }
*@
/*highlight the small rows*/
.main-layout > div:nth-child(4n-1), .main-layout > div:nth-child(4n) {
background: #777
}
.main-layout > div {
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;