Minimal Pure CSS Expand/Collapse Widget

The gist here is leveraging a hidden checkbox to maintain expand/collapse state and css :before {content: "xyz" } to add the expand/collapse widget which keeps the additional markup minimal.

Markdown compatible :)

<p></p><input type="checkbox" class="expander">
#### Expandified Heading
* bullet 
* bullet
* <input type="checkbox" class="expander"><i>another expander</i>
  * nested content that will be expanded

ASP.Net Controller API nuggets

Write Directly to Response Stream Stack-o basically covers this already but kinda danced around how minimal the code can really be for the basic scenario… 123456789101112131415161718192021222324252627 //e.g. $.ajax(url, { procName: "", parms: {deliveryDate:"3/2/2016"}, returnParmName: "" }, ...) public class GenericProcArgs { public string procName { get; set; } //from: //super convenient way to receive JS object with arbitrary properties to be fed straight to proc parms public dynamic parms { get; set; } /// <summary> /// whether to titleCase the JSON property names (handy for feeding auto built datagrids) /// </summary> public bool titleCase { get; set; } = false; public string returnParmName { get; set; } } //here's the beef.

Kendo UI Nuggets

Grid doesn’t like spaces in dataSource field names (I happen to be subscribing to KnockoutJS observable here to receive data feed but that naturally depends on your framework of choice.) Typical Kendo JS error: invalid template Particularly note the way the columns property is generated. 1234567891011121314151617181920212223242526272829303132333435363738 sigCapVm.packingSlips.subscribe(function (newval) { var gridPackingSlips = $("#gridPackingSlips"); var kgrid ="kendoGrid"); if (kgrid && kgrid.columns.length); else { if (kgrid) kgrid.destroy(); gridPackingSlips.kendoGrid({ //workaround for autogenerating columns with spaces //from: http://www.

Nuget Cheatsheet

tip command line uninstall all packages matching pattern `get-package speaking of Humanzier, just install Humanizer.Core to get English only ↩

JavaScript (ES7) async wrappers perfect for Chrome.Bookmarks API

Background: I tasked myself with a little project to sync my Chrome Bookmarks Bar with my Diigo links. Chrome’s Bookmarks API is very straightforward but it is a traditional async callback style call… so it became a good opportunity for me to cozy up to EcmaScript v7’s (ES7) async/await support… since this is done in a Chrome Extension, it lends itself to this hard dependency on ES7 syntax… async/await is supported as of Chrome v55 in Dec.

Automatic Header Links

I envied this little eye candy on some other blogs and it was easy to throw together.   If you’re on WordPress, a plugin like Simple Custom CSS and JS comes in handy for stuff like this. CSS a.headerLink:hover { color: inherit; opacity: 1; } a.headerLink { position: relative; transition: opacity 0.5s ease-in-out; cursor: pointer; opacity: .2; } a.headerLink i.fa { position: absolute; left: -1.5em; } a.headerLink:focus { color: inherit !

Exposing Azure Function web API to native & web clients through Azure AD authentication

Problem Azure AD writeups are prevalent but I was really struggling to find examples of calling the same Azure Function API, secured by Azure AD Authentication, by both Native as well as Web clients (since we can only select one app type in the Azure AD App registration, not both). TL;DR The kicker solution for me was having both a web and native App registration (i.e. two Client Id’s) and providing the WEB App registration’s Application Id as the “RESOURCE” parameter to the AuthenticationContext.

GreaseMonkey hacking Gmail

motivation i wanted to see if i could get category bundling working in gmail ala outlook… it’s always been a nice mental flow for me to carve out pending events from littering my “inbox zero” but still see them right there in front so i don’t forget to check up on them vs a click away hidden under a “folder” update – don’t miss the google “labs” functionality for doing exactly this kind of category bundling