Skip to content

Instantly share code, notes, and snippets.

Avatar

Ali Robertson alirobe

View GitHub Profile
@alirobe
alirobe / reclaimWindows10.ps1
Last active May 4, 2021
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
View reclaimWindows10.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@alirobe
alirobe / PostToUrlAsJson.cs
Last active Oct 13, 2020
Umbraco Forms Workflow - POST to URL as JSON (with optional Bearer Access Token). Just place this file anywhere in your Umbraco+Forms project, and the dependency injection will pick it up. This will allow you to connect to Microsoft Flow or Zapier or any integration web service, from which you can send to Salesforce/Dynamics/etc.
View PostToUrlAsJson.cs
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Dynamic;
using System.Net;
using System.Text.RegularExpressions;
using Umbraco.Core.Logging;
using Umbraco.Forms.Core;
using Umbraco.Forms.Core.Attributes;
@alirobe
alirobe / setupWindowsServer2016.ps1
Created Sep 15, 2017
setupWindowsServer2016.ps1
View setupWindowsServer2016.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.6.1, 2017-08-02
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, 'smart' features, and 3rd party bloat ...
View metrotheme.css
/********************
GLOBAL
*********************/
body,
textarea,
input,
keygen,
select,
button {
font-family: 'segoe ui semilight', 'segoe ui', myriad, sans-serif;
@alirobe
alirobe / export-umbraco-redirects-for-seochecker.sql
Last active Apr 4, 2020
How to Migrate Umbraco Redirects into SEOChecker
View export-umbraco-redirects-for-seochecker.sql
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 Feb 25, 2020
Reduce Dynamics 365 v9 Field Spacing
View reduceCrmv9Spacing.js
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 / umbraco-filebrowser.cshtml
Last active Nov 20, 2019
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)
View umbraco-filebrowser.cshtml
@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) {
@alirobe
alirobe / Load-CSOMProperties.psm1
Created Jul 22, 2016 — 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.
View Load-CSOMProperties.psm1
<#
.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 Jun 21, 2018
This is an iOS compatible method of embedding a video from SharePoint, if blob storage is not enabled.
View SP2013-video-cewp-ios-restrictions.txt.html
<!--
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
Productive React & TypeScript Settings
View dotVscodeDir-extensions.json
{
"recommendations": [
"eg2.tslint",
"rbbit.typescript-hero",
"pmneo.tsimporter",
"esbenp.prettier-vscode",
"christian-kohler.path-intellisense",
"CoenraadS.bracket-pair-colorizer",
"eamodio.gitlens",
"ryu1kn.partial-diff",