Skip to content

Instantly share code, notes, and snippets.

@alirobe
alirobe / html5.master.part
Created February 1, 2012 06:03
On-demand IE9 rendering for SharePoint 2010 Master Pages.
<asp:ContentPlaceHolder runat="server" id="html5">
<-- In your .aspx page, use a override this ContentPlaceHolder using "IE=9" to enable HTML5 features - on pages where it's required... -->
<meta http-equiv="X-UA-Compatible" content="IE=8"/>
</asp:ContentPlaceHolder>
@alirobe
alirobe / masterfile-snippet.html
Last active August 19, 2022 21:50
Enable Chrome 'quick-search' for SharePoint Intranets
<!--
add inside the 'head' element of master page.
replace title="Intranet" with the name of your intranet (if branded)
-->
<link rel="search" title="Intranet" type="application/opensearchdescription+xml" href="/Style%20Library/opensearch.xml" />
@alirobe
alirobe / umbraco-filebrowser.cshtml
Last active August 19, 2022 21:49
A simple recursive media folder/file viewer macro for directory browsing in #Umbraco 7+, using Bootstrap 3 for display. Not suitable for >100 files (use a surfacecontroller)
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{ var mediaId = Model.MacroParameters["mediaId"]; }
@helper DisplayFolder(dynamic folder, bool collapsed) {
var items = folder.Children().OrderBy("DocumentTypeAlias Desc,Name");
if (items.Any()) {
<a class="list-group-item" role="button" aria-expanded="false" data-toggle="collapse" href="#macro-mediaList-folder-@folder.Id">
<i class="glyphicon glyphicon-folder-open"></i> &nbsp; @folder.Name
</a>
<div class="list-group @(collapsed?"collapse":"collapse in") well well-sm" id="macro-mediaList-folder-@folder.Id">
@foreach(var item in items) {
/********************
GLOBAL
*********************/
body,
textarea,
input,
keygen,
select,
button {
font-family: 'segoe ui semilight', 'segoe ui', myriad, sans-serif;
@alirobe
alirobe / MyContentFinder.cs
Created April 5, 2017 05:18
Umbraco "Legacy URL" IContentFinder
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web;
using Umbraco.Web.Routing;
using umbraco;
using System.Linq;
namespace MyUmbraco
{
@alirobe
alirobe / export-umbraco-redirects-for-seochecker.sql
Last active May 19, 2022 21:10
How to Migrate Umbraco Redirects into SEOChecker
SELECT replace(umbracoRedirectUrl.url, '1075/', '') as url
,umbracoNode.id
,umbracoRedirectUrl.contentKey
FROM umbracoRedirectUrl
INNER JOIN umbracoNode on umbracoRedirectUrl.contentKey = umbracoNode.uniqueID
# Run in SSMS, right click results and export to CSV. Import CSV to SEOChecker.
# NB replace 1075 with your root node ID
@alirobe
alirobe / reduceCrmv9Spacing.js
Last active February 25, 2020 09:18
Reduce Dynamics 365 v9 Field Spacing
if(!window.parent.document.querySelector('style#v9removepadding')) {
var style = window.parent.document.createElement('style');
style.id = "v9removepadding";
style.innerText = ".acwallEmailView .emailexpandedaccordion { margin:0; width:100% } TABLE.ms-crm-FormSection td { padding: 4px 1px 1px 16px !important; min-height: 26px; }";
window.parent.document.body.appendChild(style);
}
@alirobe
alirobe / Load-CSOMProperties.psm1
Created July 22, 2016 05:24 — forked from glapointe/Load-CSOMProperties.ps1
Utility PowerShell function that facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
<#
.Synopsis
Facilitates the loading of specific properties of a Microsoft.SharePoint.Client.ClientObject object or Microsoft.SharePoint.Client.ClientObjectCollection object.
.DESCRIPTION
Replicates what you would do with a lambda expression in C#.
For example, "ctx.Load(list, l => list.Title, l => list.Id)" becomes
"Load-CSOMProperties -object $list -propertyNames @('Title', 'Id')".
.EXAMPLE
Load-CSOMProperties -parentObject $web -collectionObject $web.Fields -propertyNames @("InternalName", "Id") -parentPropertyName "Fields" -executeQuery
$web.Fields | select InternalName, Id
@alirobe
alirobe / SP2013-video-cewp-ios-restrictions.txt.html
Last active June 21, 2018 01:21
This is an iOS compatible method of embedding a video from SharePoint, if blob storage is not enabled.
<!--
via: https://www.linkedin.com/pulse/play-video-file-from-sharepoint-document-library-mobile-hai-nguyen
alt: https://threewill.com/sharepoint-videos-in-ios-safari-iphone-ipad-unforgiving/
-->
<video controls="true" style="min-height:360px;width:100%;">
<source src="/PublishingImages/your-video.mp4">
Sorry, your browser does not support playback of this video.
</video>
<script>
if (/iPhone|iPad|iPod/i.test(navigator.userAgent) || document.location.search.indexOf('video-ios-test') != -1) {
@alirobe
alirobe / dotVscodeDir-extensions.json
Created May 17, 2018 05:57
Productive React & TypeScript Settings
{
"recommendations": [
"eg2.tslint",
"rbbit.typescript-hero",
"pmneo.tsimporter",
"esbenp.prettier-vscode",
"christian-kohler.path-intellisense",
"CoenraadS.bracket-pair-colorizer",
"eamodio.gitlens",
"ryu1kn.partial-diff",