This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Text.RegularExpressions; | |
using System.Web.Mvc; | |
using System.Web.Mvc.Html; | |
namespace System.Web.Mvc.Html | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ImportedFilePathResolver : IPathResolver | |
{ | |
private string currentFileDirectory; | |
private string currentFilePath; | |
/// <summary> | |
/// Initializes a new instance of the <see cref="ImportedFilePathResolver"/> class. | |
/// </summary> | |
/// <param name="currentFilePath">The path to the currently processed file.</param> | |
public ImportedFilePathResolver(string currentFilePath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Usage: | |
1. Download this file into your project folder, named it as "Less.targets" | |
2. Use notepad to open your project file (e.g. Example.csproj), and put following code to above of end element 'Project'. | |
<Import Project="Less.targets" /> | |
3. Change element type of *.less file in your project file to "LessCompile". | |
You need to do that manual first time. After that, you can change the file's "build action" to 'LessCompile' through PropertyGrid. | |
4. Close notepad and reload your project in VisualStudio. Then press F6 to build your project. | |
You will found the css file will be generated by build process automatically. | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Verifies the controller action, contains an attribute of the specified attributeType. | |
/// </summary> | |
/// <param name="controller">The controller.</param> | |
/// <param name="action">The action method.</param> | |
/// <param name="attributeType">Type of the attribute to look for.</param> | |
/// <returns>Returns true if the attribute was present on the action. Otherwise false.</returns> | |
public static bool VerifyControllerActionAttribute(this Controller controller, Func<ActionResult> action, Type attributeType) | |
{ | |
MethodInfo methodInfo = action.Method; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using EPiServer; | |
using EPiServer.Core; | |
using EPiServer.ServiceLocation; | |
namespace Core.Properties | |
{ | |
public static class PropertyFinder | |
{ | |
public static T FindProperty<T>(PageData currentPage, string propertyName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using EPiServer.Shell; | |
namespace Meridium.UIDescriptors | |
{ | |
[UIDescriptorRegistration] | |
public class PageDataUIDescriptor: UIDescriptor<PageData> | |
{ | |
public BasePageUIDescriptor() | |
{ | |
DefaultView = CmsViewNames.AllPropertiesView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2 -DgroupId=com.aem.community -DartifactId=echoproject -Dversion=1.0-SNAPSHOT -Dpackage=com.aem.community -DappsFolderName=myproject -DartifactName="My Project" -DcqVersion="5.6.1" -DpackageGroup="My Company" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd + shift + L //Show All Shortcuts | |
cmd + F // Find and replace | |
Shortcut Key Mac Shortcut Key Windows Description | |
Command + 3 Ctrl + 3 In Eclipse Juno, puts the focus into Quick Access search box, in older eclipse opens quick access dialog. | |
Command + S Ctrl + S Save current editor | |
Command + 1 Ctrl + 1 Quickfix for errors and warnings, depends on the cursor position | |
Control + Space Ctrl + Space Content assist and code completion | |
Command + Shift + F Ctrl + Shift + F Format source code | |
Control + Q Ctrl + Q Moves cursor to the last edited position |