Skip to content

Instantly share code, notes, and snippets.

View alirobe's full-sized avatar

Ali Robertson alirobe

View GitHub Profile
@alirobe
alirobe / SecureMediaController.cs
Last active November 23, 2023 02:36
Secure Media Controller for Umbraco v9 Cloud
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Services;
using MimeKit;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.IO;
namespace UmbracoProject.Controllers
{
public class SecureMediaController : Controller
{
@alirobe
alirobe / pnp-list-copy.ps1
Last active May 22, 2024 20:59
Copy list contents between lists in SharePoint using PnP
# authored @alirobe for @sopewebtech 2022-06-17
# pnp-list-copy.ps1 : https://gist.githubusercontent.com/alirobe/4187b0f073dc2eba5207f312a01ddab6/
# this copies list values from source to target
# before using this script, create a new list 'from existing list' in the same site
# then, plug values in below and run. should work for most field types. any issues let me know.
# todo: add batching, add field types
# licensed under GPL V2
$Site = "https://notproduction.sharepoint.com/sites/not-sproket-4/"
@hetfirma
hetfirma / PostToUrlAsJson.cs
Last active October 21, 2024 09:58 — forked from alirobe/PostToUrlAsJson.cs
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.
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Dynamic;
using System.Net;
using System.Net.Http.Headers;
using System.Runtime.CompilerServices;
using System.Text;
using Umbraco.Cms.Core.Models.PublishedContent;