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 / sibling.css
Created August 17, 2014 18:41
Select previous sibling CSS
.previous:has(+ .next) {}
@EdCharbeneau
EdCharbeneau / Buttons.helpers.cshtml
Last active August 29, 2015 14:05
How To Style Guide
// These are not real helpers, only examples to show some helper code.
@Html.Button("text") //Default
// Renders
<button type="button" class="btn btn-default">Default</button>
@Html.Button("text").Primary()
// Renders
<button type="button" class="btn btn-primary">Primary</button>
// Etc...
@EdCharbeneau
EdCharbeneau / properties-for-helper.js
Last active August 29, 2015 14:05
Get and display css properties at runtime.
(function () {
displayCssInfoFor();
})();
// A simple helper to display the CSS properties of an element at runtime.
// Use:
// By defualt, displays the color of the previous sibiling.
// <span data-properties-for></span>
// Specify element
// <span data-properties-for='{"element": "selector"}'></span>
@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 }
*@
@EdCharbeneau
EdCharbeneau / ie-10-lumia-viewport.html
Last active August 29, 2015 14:09
IE10 Mobile viewport fix
<!-- Windows Phone 8 and Internet Explorer 10
Internet Explorer 10 doesn't differentiate device width from viewport width,
and thus doesn't properly apply the media queries in Bootstrap's CSS.
To address this, you can optionally include the following CSS and JavaScript
to work around this problem until Microsoft issues a fix.
Attribution: overflow http://stackoverflow.com/questions/19659053/viewport-for-ie10-11-desktop-but-not-mobile
-->
<style>
@-webkit-viewport { width: device-width; }
@EdCharbeneau
EdCharbeneau / Schedule.cshtml
Created December 14, 2014 20:16
Umbraco with Telerik Scheduler
@using Kendo.Mvc.UI;
@using EventSchedule;
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = "_Layout.cshtml";
var scheduleDate = Model.Content.GetPropertyValue<DateTime>("displayDate");
var events = Model.Content.Children.Select(child => new MyEvent(child));
}
@EdCharbeneau
EdCharbeneau / design-languages.md
Last active August 29, 2015 14:16
Design Languages (or Guidelines)
@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 / mvc6-notes.txt
Created April 7, 2015 14:32
Here are my notes from the What’s New in MVC 6 video.
Here are my notes from the What’s New in MVC 6 video.
https://www.youtube.com/watch?v=CKvaZkC94Mc
38:55 Http context IIS not required
39:38 Async all the things
40:45 www root is the new static context folder
@EdCharbeneau
EdCharbeneau / _layout.cshtml
Last active November 5, 2019 09:12
Foundation 6 on ASP.NET Core
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewData["Title"] - F6Core</title>
<environment names="Development">
<link rel="stylesheet" href="~/css/app.css" />