Skip to content

Instantly share code, notes, and snippets.

Pavel Vlasov pvlasov

Block or report user

Report or block pvlasov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pvlasov
pvlasov / generate-sirius-diagram-images-with-maps.md
Last active Jul 18, 2019
Headless generation of diagram images from Sirius representations (.aird) with image maps
View generate-sirius-diagram-images-with-maps.md
@pvlasov
pvlasov / constraint.ecore
Created Apr 23, 2019
Ecore constraint annotation for generation of validation methods
View constraint.ecore
<eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
<details key="constraints" value="nonNegativeBalance"/>
</eAnnotations>
@pvlasov
pvlasov / clear-targets.bat
Created Jan 8, 2019
Recursively remove target directories in multiple Maven projects
View clear-targets.bat
for /f %i in ('dir /a:d /s /b target') do rd /s /q %i
@pvlasov
pvlasov / YamlResource.java
Created Jan 7, 2019
Demonstrates how to create an EMF resource loading/storing (configuration) model from/to YAML files. It can be used for creating configuration editors for Spring applications, e.g. microservices.
View YamlResource.java
// --- Resource ---
public class YamlResourceImpl extends ResourceImpl {
private Map<String, Object> data;
public YamlResourceImpl(URI uri) {
super(uri);
}
@SuppressWarnings("unchecked")
@pvlasov
pvlasov / CollectConcreteSubclasses.java
Created Jan 6, 2019
Collecting and instantiating concrete subclasses of a specified base class. Can be used to collect children for a reference in emf-based editor
View CollectConcreteSubclasses.java
/**
* Iterates over registered ecore packages. Collects and instantiates concrete subclasses.
* @return
*/
public static List<MyType> collectMyTypes() {
List<MyType> ret = new ArrayList<>();
IExtensionRegistry registry = RegistryFactory.getRegistry();
if (registry != null) {
IConfigurationElement[] configElems = registry.getConfigurationElementsFor("org.eclipse.emf.ecore.generated_package");
for (IConfigurationElement elem : configElems) {
@pvlasov
pvlasov / mirror-oxygen.bat
Created Jan 26, 2018
Mirroring of Eclipse repos
View mirror-oxygen.bat
eclipsec.exe -application org.eclipse.equinox.p2.metadata.repository.mirrorApplication -source http://download.eclipse.org/releases/oxygen -destination C:\oxygen-repository
eclipsec.exe -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication -source http://download.eclipse.org/releases/oxygen -destination C:\oxygen-repository
@pvlasov
pvlasov / cdo-emf-model-annotations.md
Last active Oct 1, 2017
CDO EMF model annotations
View cdo-emf-model-annotations.md
View jsTree context menu on other page elements
$(function(){
$("<element selector>").contextmenu(function(e) {
var jsTree = $('<jstree selector>').jstree();
var obj = jsTree.get_node(<node id>);
jsTree.show_contextmenu(obj, e.pageX, e.pageY, e);
return false;
});
});
@pvlasov
pvlasov / JavaCallGraphToGexf.java
Created May 10, 2017
Call graph visualization with Gephi
View JavaCallGraphToGexf.java
/*
Dependencies:
- Java Call Graph - https://github.com/gousiosg/java-callgraph.
- Gexf4j - https://github.com/francesco-ficarola/gexf4j (download all dependencies with mvn dependency:copy-dependencies)
*/
import java.io.BufferedReader;
import java.io.File;
@pvlasov
pvlasov / mantisbt_ntlm.md
Last active Mar 2, 2018
Setting MantisBT behind Apache with NTML
View mantisbt_ntlm.md

This is a hack. Unfortunately I could not find a description of how to put MantisBT behind Apache with NTLM auth.

Set authentication to BASIC_AUTH in config/config_inc.php:

$g_login_method           = BASIC_AUTH;

core/authentication_api.php - comment out lines 289-291 to disable password check:

You can’t perform that action at this time.