This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function detach(element) { | |
| return element.parentElement.removeChild(element); | |
| } | |
| function move(src, dest, isBefore) { | |
| dest.insertAdjacentElement(isBefore ? 'beforebegin' : 'afterend', detach(src)); | |
| } | |
| function children(element, selector) { | |
| return element.querySelectorAll(selector); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET ANSI_NULLS ON | |
| GO | |
| SET QUOTED_IDENTIFIER ON | |
| GO | |
| -- ============================================= | |
| -- Author: Chris Randle | |
| -- Create date: 17/02/2021 | |
| -- Description: Converts a SQL table into a basic CLR object (a "POCO" or "plain old CLR object") | |
| -- ============================================= | |
| ALTER PROCEDURE [dbo].[TableToPoco] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading.Tasks; | |
| using Microsoft.Extensions.Caching.Memory; | |
| using Microsoft.Extensions.Logging; | |
| using Paige.Caching.BaseCache; | |
| using Paige.ModelLayer.Enums; | |
| using Paige.ModelLayer.Interfaces.Cache; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // always (definitely!) centre | |
| .ex1 .parent { | |
| display: grid; | |
| place: centre; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Fix the title */ | |
| #article-form-title{ | |
| font-size:12px !important; | |
| } | |
| /* Fix the content body text */ | |
| #article_body_markdown{ | |
| font-size: 11px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [HttpGet] | |
| public FileStreamResult Download() | |
| { | |
| var stream = System.IO.File.OpenRead(AppSettings.PdfFileName); | |
| return new FileStreamResult(stream, AppSettings.MimeType); | |
| } | |
| [HttpGet("open-pdf")] | |
| public IActionResult Get() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System.IO.File.WriteAllText(filePath, "Hello World!", System.Text.Encoding.UTF8); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C:\Users\cshar\AppData\Local\Temp\tmp4550.tmp | |
| Path.GetTempFileName(); | |
| // C:\Users\cshar\AppData\Roaming\DateLinks.csv | |
| Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "DateLinks.csv"); | |
| // See https://www.mikesdotnetting.com/article/302/server-mappath-equivalent-in-asp-net-core for DotNetCore method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Web.Http.Filters; | |
| using Umbraco.Core.Models.ContentEditing; | |
| using Umbraco.Web.Editors; | |
| using Umbraco.Web.Models.ContentEditing; | |
| public class MyContentAppFactory | |
| { | |
| // Works in v7 | |
| public void Initialize() => | |
| // on startup bind to this event |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('span.u-truncate').each(function(index){ console.log($(this).text()); }) |