Skip to content

Instantly share code, notes, and snippets.

View flox1an's full-sized avatar

Florian flox1an

View GitHub Profile
// Delete thumbnails if exists. To be used in Alfresco javascript console. Starts from selected space
recurse(space, function(node) {
var doclib = node.getThumbnail('doclib');
var webpreview = node.getThumbnail('webpreview');
var webpreview2 = node.getThumbnail('web-preview');
var imgpreview = node.getThumbnail('imgpreview');
var pdf = node.getThumbnail('pdf');
if(doclib){
doclib.remove();
@JJediny
JJediny / 12factorapp_checklist.md
Last active September 26, 2018 00:18
DRAFT checklist for developing or benchmarking an application against 12factor.net

The twelve-factor app Checklist

Also factors in the four principles of modern Release Engineering

  • Identifiability Being able to identify all of the source, tools, environment, and other components that make up a particular release.
  • Reproducibility The ability to integrate source, third party components, data, and deployment externals of a software system in order to guarantee operational stability.
  • Consistency The mission to provide a stable framework for development, deployment, audit, and accountability for software components.
  • Agility The ongoing research into what are the repercussions of modern software engineering practices on the productivity in the software cycle, i.e. continuous integration.
@jremmen
jremmen / mm.js
Last active May 7, 2024 01:39
js: matrix multiplication using dot product and transposition
mmultiply = function(a,b) {
return a.map(function(x,i) {
return transpose(b).map(function(y,k) {
return dotproduct(x, y)
});
});
}
dotproduct = function(a,b) {
return a.map(function(x,i) {
@darklow
darklow / elasticsearch.custom.sort.py
Last active May 31, 2022 05:25
ElasticSearch custom sort, based on provided ids array order. Original code from here: http://damienalexandre.fr/post/elasticsearch-ids-query-order Rewritten to new "function_score" syntax Note: You need to remove \n new lines from "script" field in order to get it work.
q = {
"query": {
"function_score": {
"boost_mode": "replace",
"query": {
"ids": {
"values": [
50,
80,
44,
@jgoldhammer
jgoldhammer / alfresco jmxClient rootobject example.js
Last active December 25, 2015 07:48
the jmxClient provides access to the system/alfresco global properties by listing them and get a specific system/alfresco global property Only executable in the javascript console because of the print statement.
print(jmxClient.listSystemProperties());
print('Java version:'+jmxClient.getSystemProperty('java.version'));
print(jmx.listAlfProperties());
print('Activiti enabled?'+jmx.getAlfProperty('system.workflow.engine.activiti.enabled'));
@jgoldhammer
jgoldhammer / alfresco policies root object example.js
Last active July 4, 2018 06:55
shows how to temporarly disable and enable the policy behaviours of a node
var node = search.findNode(<nodeRefOfADocumentOrFolder>);
var modified = node.properties.modified;
policies.disableForNode(node);
node.setName("C10");
node.save();
node.reset();
policies.enableForNode(node);
var modifiedAfter = node.properties.modified;
@jgoldhammer
jgoldhammer / alfresco simple batch processing example.js
Last active December 25, 2015 07:39
A first example to show the possibilities with the simple batch processing extension for alfresco javascript execution. It has the only limitation that the processorfunction must have the name process
var batchName ='MyProcessor';
var numberOfThreads = 4;
var numberOfProcessedItems = 10;
var runAsSystem = true;
var processorFunction = function process(node){
if(node.hasAspect('cm:titled')){
logger.error(node);
}
};
@gabrielhpugliese
gabrielhpugliese / meteor-windows-vagrant-tutorial.md
Last active April 19, 2022 14:37
Tutorial for running Meteor in Windows using Vagrant

Tutorial: Meteor in Windows using Vagrant

BEFORE YOU CONTINUE:

  • Now, Meteor runs in any Windows without any line of this tutorial. Just download the Meteor binary! Yay!!
  • mrt is no longer used with Meteor 1.0

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on

@loftux
loftux / AlfrescoMysql2Postgresql.txt
Created February 27, 2013 14:44
Alfresco Mysql to Postgresql migration. This is a simple outline on how to migrate Alfresco from mysql to postgresql.
Prerequisite
One instance of Alfresco on mysql, one postgresl of exactly the same version (schema version).
Step 1. Dump database
mysqldump --port 3306 -u alfresco --password=alfloftux -h 127.0.0.1 --databases alfresco --skip-comments --skip-extended-insert --no-create-db --hex-blob --default-character-set=utf8 --skip-triggers --compact --no-create-info --skip-quote-names > mydump.sql
Step 2. Dump local Postgres schema
You can install a clean version of Alfresco to use as for schema dump
(need to insert command for dump here)
@schacon
schacon / gist:1
Created July 15, 2008 18:17
the meaning of gist
This is gist.
There are many like it, but this one is mine.
It is my life.
I must master it as I must master my life.
Without me gist is useless.
Without gist, I am useless.