Skip to content

Instantly share code, notes, and snippets.

Sipke Schoorstra sfmskywalker

Block or report user

Report or block sfmskywalker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View generate-theme.cmd
dotnet new octheme -n "MadeWithLoveTheme"
@sfmskywalker
sfmskywalker / InstallCodeGenerationTemplates.cmd
Created Jul 29, 2018
Installs the Orchard Core Code Generation Templates
View InstallCodeGenerationTemplates.cmd
dotnet new -i OrchardCore.Cms.Templates::1.0.0-beta2-*
@sfmskywalker
sfmskywalker / npm-install.cmd
Last active Jul 29, 2018
Executes the NPM Install command
View npm-install.cmd
cd ClientApp
npm install
ng build
@sfmskywalker
sfmskywalker / DownloadAngularElementSample.ps1
Last active Jul 29, 2018
Downloads and extracts a sample Angular Custom Element from GitHub
View DownloadAngularElementSample.ps1
Add-Type -AssemblyName System.IO.Compression.FileSystem
Invoke-WebRequest -Uri https://github.com/nitayneeman/made-with-love/archive/release/v1.1.0.zip -OutFile ./ClientApp.zip
[System.IO.Compression.ZipFile]::ExtractToDirectory("c:\Code\Orchard Core and Angular\AngularWidgetsDemo\ClientApp.zip", "c:\Code\Orchard Core and Angular\AngularWidgetsDemo")
Rename-Item made-with-love-master ClientApp
@sfmskywalker
sfmskywalker / IncludeElements.cmd
Last active Jul 29, 2018
Add Angular Elements & Polyfill
View IncludeElements.cmd
cd ClientApp
ng add @angular/elements
@sfmskywalker
sfmskywalker / NewProject.cmd
Last active Jul 29, 2018
Create new ASP.NET Core Orchard Core Project
View NewProject.cmd
dotnet new web --name "AngularWidgetsDemo"
cd "AngularWidgetsDemo"
dotnet add package "OrchardCore.Application.Cms.Targets" --version 1.0.0-beta2-*
View Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace AngularWidgetsDemo
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
View AuthenticatingHandler.cs
public class AuthenticatingHandler<T> : DelegatingHandler where T : ISecurityTokenAccessor
{
private readonly Policy<HttpResponseMessage> _policy;
private readonly T _securityTokenAccessor;
private IAccessToken _accessToken;
private AuthenticationHeaderValue _authenticationHeader;
public AuthenticatingHandler(T securityTokenAccessor)
{
_securityTokenAccessor = securityTokenAccessor;
View Startup.cs
app.UseOrchardCore(a => a.Run(async context =>
{
// ShellSettings provide the tenant's configuration.
var shellSettings = context.RequestServices.GetRequiredService<ShellSettings>();
// Read the tenant-specific custom setting.
var customSetting = shellSettings.Configuration["CustomSetting"];
// Resolve all registered IMessageProvider services.
var messageProviders = context.RequestServices.GetServices<IMessageProvider>();
You can’t perform that action at this time.