Skip to content

Instantly share code, notes, and snippets.

Ed Charbeneau EdCharbeneau

Block or report user

Report or block EdCharbeneau

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
@EdCharbeneau
EdCharbeneau / Enable-Transformations.md
Last active Oct 16, 2019
How to enable transformations on build with Visual Studio
View Enable-Transformations.md

#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
@EdCharbeneau
EdCharbeneau / AsJson.cshtml
Last active Sep 4, 2019
Turn any Umbraco content into a JSON object by using a Razor template
View AsJson.cshtml
@*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 }
*@
@EdCharbeneau
EdCharbeneau / FetchData.razor
Created Aug 15, 2019
Working Grid with Template
View FetchData.razor
@page "/fetchdata"
@inject HttpClient Http
@using Telerik.Blazor.Components.Grid
<h1>Weather forecast</h1>
<p>This component demonstrates fetching data from the server.</p>
<TelerikGrid Data="@forecasts" Pageable="true" Sortable="true" Filterable="true">
<TelerikGridColumns>
@EdCharbeneau
EdCharbeneau / masonry.css
Created Jun 17, 2019
Simple Masonry CSS
View masonry.css
.masonry {
display: flex;
flex-flow: column wrap;
max-height: 800px;
margin-left: -8px; /* Adjustment for the gutter */
width: 100%;
}
.masonry > div {
margin: 0 8px 8px 0; /* Some gutter */
@EdCharbeneau
EdCharbeneau / Test.razor
Created May 21, 2019
Telerik UI for Blazor Drop Down Enum
View Test.razor
<TelerikDropDownList Data="@ModeList" TextField="Text" ValueField="Value" bind-Value="@selectedValue">
</TelerikDropDownList>
<span>Selected: @((Modes)selectedValue)</span>
@functions {
int selectedValue { get; set; } = 0;
public class ModeViewModel
@EdCharbeneau
EdCharbeneau / string.isNullOrWhiteSpace.js
Created Mar 14, 2014
Javascript test a string to see if it is Null or Whitespace. Equivelent to C# String.IsNullOrWhiteSpace
View string.isNullOrWhiteSpace.js
function isNullOrWhiteSpace(str) {
return (!str || str.length === 0 || /^\s*$/.test(str))
}
@EdCharbeneau
EdCharbeneau / Templates.cshtml
Last active Feb 25, 2019
Row Template Detail
View Templates.cshtml
@page "/grid/templates"
@using TelerikBlazor.App.Models
@inject NorthwindContext nwContext
<h4> Row Template </h4>
<KendoGrid Data=@GridData Height="@Height">
<RowTemplate Context="product">
@if (selectedId == product.ProductId)
@EdCharbeneau
EdCharbeneau / BuilderUsage.cshtml
Last active Feb 19, 2019
Css Builder Extensions
View BuilderUsage.cshtml
<li aria-selected=@IsActive role="tab" class="@ClassToRender">
...
</li>
@functions {
...
protected bool IsActive => ContainerTabSet.ActiveTab == this;
[Parameter] protected bool Disabled { get; set; }
[Parameter] protected string Class { get; set; }
@EdCharbeneau
EdCharbeneau / CamelCase.cs
Last active Feb 10, 2019
CamelCase to human readable
View CamelCase.cs
public static string SplitUpperCaseToString(this string source) {
return string.Join(" ", SplitUpperCase(source));
}
public static string[] SplitUpperCase(this string source) {
if (source == null) {
return new string[] {}; //Return empty array.
}
if (source.Length == 0) {
return new string[] {""};
View VS-info.txt
Microsoft Visual Studio Enterprise 2019 Preview
Version 16.0.0 Preview 2.2
VisualStudio.16.Preview/16.0.0-pre.2.2+28602.52
Microsoft .NET Framework
Version 4.7.03056
Installed Version: Enterprise
Application Insights Tools for Visual Studio Package 9.0.11128.2
Application Insights Tools for Visual Studio
You can’t perform that action at this time.