This file contains hidden or 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
// Imports | |
const fs = require('fs'), spawn = require('child_process').spawn; | |
// Filter for projects to not build with this | |
const filter = ['e2e']; | |
// Amount of projects to build async. | |
const batch = 3; |
This file contains hidden or 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
// Put main in companion object of said class | |
/* | |
class App { | |
companion object { | |
@JvmStatic | |
fun main(args: Array<String>) { | |
System.out.println("Hello") | |
} | |
} | |
} |
This file contains hidden or 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 static List<Method> getMethodsAnnotatedWith(final Class<?> type, final Class<? extends Annotation> annotation) { | |
final List<Method> methods = new ArrayList<>(); | |
Class<?> klass = type; | |
while (klass != Object.class) { | |
final List<Method> allMethods = new ArrayList<>(Arrays.asList(klass.getDeclaredMethods())); | |
allMethods.stream() | |
.filter(method -> method.isAnnotationPresent(annotation)) | |
.forEach(methods::add); | |
klass = klass.getSuperclass(); | |
} |
This file contains hidden or 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
// Backup from https://lukewickstead.wordpress.com/2013/01/18/ninject-cheat-sheet/ | |
// **** DETERMINING WHICH CONSTRUCTOR TO USE **** | |
// The main DI pattern is Constructor Injection | |
// A known constructor parameter is one which has been explicitly bound | |
// An unknown constructor parameter is one which has not been explicitly bound even if it has a resolvable constructor the following order defines which constructor is used | |
// 1. User defined costructor marked with [Inject] attribute | |
// 2. The constructor with the most known bound parameters. | |
// 3. The default parameterless constructor | |
// **** PROPERTY / METHOD INJECTION |
This file contains hidden or 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
@inherits PartialViewMacroPage | |
@using Umbraco.Cms.Web | |
@using Umbraco.Cms.Web.Macros | |
@using Umbraco.Framework | |
@using System.Text.RegularExpressions | |
@functions { | |
String HtmlRemover(string html) | |
{ | |
//Source: http://stackoverflow.com/questions/307013/how-do-i-filter-all-html-tags-except-a-certain-whitelist |