Skip to content

Instantly share code, notes, and snippets.

View javafun's full-sized avatar

Vincent javafun

View GitHub Profile
using EPiServer.Shell;
namespace Meridium.UIDescriptors
{
[UIDescriptorRegistration]
public class PageDataUIDescriptor: UIDescriptor<PageData>
{
public BasePageUIDescriptor()
{
DefaultView = CmsViewNames.AllPropertiesView;
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
@javafun
javafun / Bootstrap.cshtml
Last active August 29, 2015 14:25 — forked from bjorn-ali-goransson/Bootstrap.cshtml
Bootstrap rendering of blocks in EPiServer, with AJAX support on On Page Editing. Bootstrap.cshtml should be put in /Views/Shared/DisplayTemplates/ and don't forget to use Tag = "Bootstrap" in the page template.
@model EPiServer.Core.ContentArea
@{
new BootstrapContentAreaRenderer().Render(Html, Model);
}

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@javafun
javafun / gist:e922fb94423a0049cd83
Created November 23, 2015 03:48 — forked from lontivero/gist:593fc51f1208555112e0
Generates Markdown from VS XML documentation file
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace GithubWikiDoc
{
using System.Collections.Generic;
using EPiServer.Core;
using EPiServer.Validation;
using EPiServer;
using AlloyDemoMVC.Models.Media;
namespace AlloyDemoMVC.Business
{
public class ImagePropertyValidator : IValidate<ContentData>
{

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@javafun
javafun / express.bat
Created February 3, 2016 11:43 — forked from cuth/express.bat
Batch file to run IIS Express on the current directory. Optionally set the first parameter to set the port number.
SET EX="C:\Program Files\IIS Express\iisexpress.exe"
if not "%1" == "" (
CALL %EX% /path:%CD% /port:%1
) else (
CALL %EX% /path:%CD%
)
@javafun
javafun / BundleConfig.cs
Created April 13, 2016 03:30 — forked from ismaelhamed/BundleConfig.cs
Bundling AngularJS Templates with ASP.NET MVC
using System.Web.Optimization;
namespace NgTemplateBundling
{
using NgTemplateBundling.Bundling;
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
@javafun
javafun / EFExtensions.cs
Created June 13, 2016 13:20 — forked from ondravondra/EFExtensions.cs
C# extension for executing upsert (MERGE SQL command) in EF with MSSQL
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
namespace EFExtensions