Skip to content

Instantly share code, notes, and snippets.

View jeremypage's full-sized avatar

Jeremy Page jeremypage

  • Trafford Council
  • UK
View GitHub Profile
@jdthorpe
jdthorpe / FetchXML.md
Last active April 26, 2024 12:39
Notes on FetchXML

Learn to Love Tolerate FetchXML

Overview

FetchXML seems to be a quirky subset of the SQL implemented in XML and optimized for UI tasks, including:

  • the ability select specific fields (foo, b.bar) or all fields (*) from an entity
  • perform LEFT OUTER and INNER joins
  • assign aliases to attributes (select a.b as foo) and (joined) entities (left join foo as BAR)
@jeremypage
jeremypage / sticky-footer-flexbox.html
Last active April 10, 2024 09:10
HTML / CSS: Sticky footer using Flexbox and Grid
@mhagrelius
mhagrelius / steps.md
Created October 4, 2019 13:04
Steps to encrypt web.config

For Single Box

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef connectionStrings "C:\Folder\Project"

To Share Across Environments

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pc "SiteRSAEncryptionKeys" -exp C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pa "SiteRSAEncryptionKeys" "COMPUTER\UserName"

Setup ConfigProtectedData section of web.config

C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef connectionStrings "C:\Folder\Project" -prov "SiteRSAEncryptionProvider"

@chriskempson
chriskempson / vs-code-strip-attributes-from-html-tags.txt
Last active October 25, 2023 00:27
VS Code - Strip Attributes from HTML Tags
# Couldn't figure out how to do /s or get VS Code to search over newlines so came up with this convoluted mess '[\S\s]*?\n?' that matches all characters plus newlines
Search for: <(table|tr|td|p|div|span)[\S\s]*?\n?>
Replace with: <$1>
@jeremypage
jeremypage / jQuery-noConflicy.md
Last active December 28, 2020 07:37
jQuery: Using noConflict() to use multiple versions of jQuery on the same page

How to use multiple versions of jQuery on the same page

First, reference 'legacy' jQuery version:

<script src="jquery.1.10.2.js"></script>

Do any necessary legacy jQuery stuff, and anything that is not version-dependent:

@jeremypage
jeremypage / git-cheatsheet.md
Last active December 1, 2023 00:24
Git cheatsheet

Git cheatsheet

Find all instances of text in all commits

git grep "text to look for" $(git rev-list --all)

List commit messages since given commit

@ps-team
ps-team / Local view menu
Last active December 15, 2022 08:28
Recreating the Contensis Local View Menu in Razor
@using Contensis.Framework.Web
@using Contensis.Framework.Web.Search
<ul class="sys_menu">
@{
// Loading jQuery through the Contensis API
AppContext.Current.Page.Scripts.RegisterJQuery();
if(CurrentNode != null) {
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web.Http;
using Contensis.Framework.Web.Controllers;
namespace Zengenti
{
[RoutePrefix("api/MyApiController")]
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Web.Http;
using Contensis.Framework.Web.Controllers;
namespace Zengenti
{
[RoutePrefix("api/MyApiController")]
public class MyController : ContensisApiController
@using Contensis.Framework.Web
@{
AppContext.Current.Page.Scripts.Add("/siteelements/scripts/jqueryvalidate/jquery.validate.js");
AppContext.Current.Page.Scripts.Add("/siteelements/scripts/jqueryvalidate/jquery.validate.unobtrusive.js");
// define some validation rules against fields within the Form
Validation.Add("Username",
Validator.Required("You must provide a username"),
Validator.StringLength(10, 0, "No more than 10 letters")