Skip to content

Instantly share code, notes, and snippets.

@javafun
javafun / target.xml
Created Feb 4, 2020 — forked from sliekens/target.xml
A list of all <Target /> tags that ship with MSBuild / Visual Studio
View target.xml
C:\Program Files (x86)\MSBuild\12.0\Bin\Microsoft.Common.CurrentVersion.targets
<Target Name="_CheckForInvalidConfigurationAndPlatform"></Target>
<Target Name="Build" Condition=" '$(_InvalidConfigurationWarning)' != 'true' " DependsOnTargets="$(BuildDependsOn)" Returns="$(TargetPath)" />
<Target Name="BeforeBuild" />
<Target Name="AfterBuild" />
<Target Name="CoreBuild" DependsOnTargets="$(CoreBuildDependsOn)"></Target>
<Target Name="Rebuild" Condition=" '$(_InvalidConfigurationWarning)' != 'true' " DependsOnTargets="$(RebuildDependsOn)" Returns="$(TargetPath)" />
<Target Name="BeforeRebuild" />
<Target Name="AfterRebuild" />
<Target Name="BuildGenerateSources" DependsOnTargets="BuildGenerateSourcesTraverse;$(BuildGenerateSourcesAction)" />
@javafun
javafun / MigrateContentToGetaCategoriesJob.cs
Created Oct 13, 2019 — forked from davidknipe/MigrateContentToGetaCategoriesJob.cs
Migrates content to use Geta Categories. Note will only migrate categories that exist in the Geta Categories structure.
View MigrateContentToGetaCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.Security;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
@javafun
javafun / CreateGetaCategoriesFromEpiserverCategoriesJob.cs Create Geta Categories based on existing Episerver category structure
View CreateGetaCategoriesFromEpiserverCategoriesJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using Foundation.Cms.Categories;
using Geta.EpiCategories;
using Geta.EpiCategories.Extensions;
@javafun
javafun / sqlpackage.md
Created Sep 24, 2019 — forked from anova/sqlpackage.md
Sqlpackage.exe samples
View sqlpackage.md

Export

Creates a .bacpac file from live database.

"C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin\SqlPackage.exe" /a:Export /scs:"Data Source=SERVER;Initial Catalog=db_name;Integrated Security=False;Persist Security Info=False;User ID=db_user;Password=db_password" /tf:"D:\backup\database_backup.bacpac"

Import

Import from .bacpac file to database.

@javafun
javafun / LoremIpsumBuilder.cs
Created Sep 9, 2019 — forked from dampee/LoremIpsumBuilder.cs
Lorem ipsum generator in c#
View LoremIpsumBuilder.cs
/// <summary>
/// Lorem Ipsum Generator
/// </summary>
/// <remarks>
/// Based on Javascript Version of Marcus Campbell - Version 2.0 (Copyright 2003 - 2005)
/// Open-source code under the GNU GPL: http://www.gnu.org/licenses/gpl.txt
/// </remarks>
/// <example>
/// LoremIpsumBuilder _lib = new LoremIpsumBuilder();
/// string test = _lib.GetLetters();
@javafun
javafun / DependencyResolverInitialization.cs
Created Jul 26, 2019 — forked from joseftw/DependencyResolverInitialization.cs
Support for "injecting" AllowedTypes in EPiServer when ContentTypes doesn't know about each other. Raw
View DependencyResolverInitialization.cs
using System.Web.Mvc;
using EPiServer.DataAbstraction.RuntimeModel;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using ModularAllowedTypes.Business.Rendering;
using EPiServer.Web.Mvc;
using EPiServer.Web.Mvc.Html;
using StructureMap;
View FindExtensions.cs
namespace EPiServer.SocialAlloy.Web.Business.FindHelpers
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using EPiServer.Core;
using EPiServer.Find;
View FindExceptionInterceptor.cs
public class FindExceptionInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
try
{
invocation.Proceed();
}
catch (ClientException)
{
View ImportScheduledJob.cs
using System.Collections.Generic;
using System.Linq;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Core;
using EPiServer.Find;
using EPiServer.Find.Cms;
using EPiServer.PlugIn;
using EPiServer.Scheduler;
using EPiServer.ServiceLocation;
@javafun
javafun / UmbracoMembershipAPI snippets.cs
Created Jun 16, 2019
A bunch of Umbraco Membership API snippets
View UmbracoMembershipAPI snippets.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Security.
using Umbraco.Core.Services;
using Umbraco.Web.Models;
using Umbraco.Web.PublishedCache;
/*
*