Skip to content

Instantly share code, notes, and snippets.

@javafun
javafun / TinyMCE.cs
Created Jul 8, 2021 — forked from adnanzameer/TinyMCE.cs
Allow valid HTML elements to TinyMCE 2.+ in Episerver 11
View TinyMCE.cs
using System.Collections.Generic;
using EPiServer.Cms.TinyMce.Core;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
namespace MySite.Business.Initialization
{
[ModuleDependency(typeof(TinyMceInitialization))]
public class ExtendedTinyMceInitialization : IConfigurableModule
View webpack.config.babel.js
/* global process :true, __dirname :true, module :true */
import path from 'path'
import webpack from 'webpack'
import minimist from 'minimist'
import TerserPlugin from 'terser-webpack-plugin'
import ManifestPlugin from 'webpack-manifest-plugin'
import PnpWebpackPlugin from 'pnp-webpack-plugin'
import safePostCssParser from 'postcss-safe-parser'
import HtmlWebpackPlugin from 'html-webpack-plugin'
View BuyBundleGetItemDiscount.cs
namespace EPiServer.Reference.Commerce.Site.Features.Promotions
{
using System.ComponentModel.DataAnnotations;
using EPiServer.Commerce.Catalog.ContentTypes;
using EPiServer.Commerce.Marketing;
using EPiServer.Commerce.Marketing.DataAnnotations;
using EPiServer.Core;
using EPiServer.DataAnnotations;
@javafun
javafun / build.yml
Created Jun 18, 2020 — forked from jraps20/build.yml
Cache NuGet Packages with Cache Task in Azure DevOps YAML
View build.yml
- powershell: | # generates a hash of all packages.config and saves each on a single line on 'hash.txt'
Get-FileHash -Algorithm MD5 -Path (Get-ChildItem packages.config -Recurse) >> hash.txt
Write-Host "Hash File saved to $pwd\hash.txt"
workingDirectory: src
displayName: 'Calculate and save packages.config hash'
- task: CacheBeta@0 # speed up builds by caching packages folder
inputs:
key: nuget|1|$(Agent.OS)|$(Build.SourcesDirectory)\src\hash.txt # hash map generated in previous step
path: $(Build.SourcesDirectory)\src\packages
@javafun
javafun / profile.ps1
Created May 21, 2020 — forked from sixeyed/profile.ps1
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
View profile.ps1
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
@javafun
javafun / profile.ps1
Created May 21, 2020 — forked from sixeyed/profile.ps1
PowerShell profile with a Linux-style prompt and aliases for common Docker commands
View profile.ps1
function Prompt(){
$W = Split-Path -leaf -path (Get-Location)
$prompt = Write-Prompt "$($env:UserName)@$($env:ComputerName):" -ForegroundColor Green
$prompt += Write-Prompt $W -ForegroundColor DarkCyan
$prompt += Write-Prompt '>'
return ' '
}
function Remove-StoppedContainers {
docker container rm $(docker container ls -q)
@javafun
javafun / target.xml
Created Feb 4, 2020 — forked from StevenLiekens/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.