Skip to content

Instantly share code, notes, and snippets.

// 1. Variable mit Closure Syntax und Klasse "groovy.lang.Closure" erstellen oder Inhalt direkt in ein Textfeld einfügen z.B.: $V{testClosure}.
// Variable kann dann in einem Textfeld eingefügt und die Closure mit $V{testClosure}() aufgerufen werden.
{
def a = 3;
def b = 4;
def c = a + b;
return c;
}
// 2. Beispiel mit Parameter.
@Sulkar
Sulkar / createDomElement.js
Created February 8, 2022 20:10
Javascript: universal Create Element function
//universal Create Element function
function createElement(type, props, ...children) {
let dom = document.createElement(type);
if (props) Object.assign(dom, props);
for (let child of children) {
if (typeof child != "string" && typeof child != "number")
dom.appendChild(child);
else dom.appendChild(document.createTextNode(child));
}
return dom;
@Sulkar
Sulkar / Vektorgrafik Bäume und Berg.svg
Last active January 19, 2021 18:24
Beispiel SVG Code einer komplexen Vektorgrafik
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sulkar
Sulkar / KlassengruppeExtender.java
Last active December 9, 2020 16:12
Script Executor: Klasse die in einer Variable erstellt werden kann -> bsp.: Bericht: Klassenübersicht
new bayern.asv.reports.api.groovy.ScriptExecutor("",/
import bayern.asv.reports.api.st.austritt.AustrittEintrittHelper;
import bayern.asv.reports.api.kl.datasources.schuelerliste.SchuelerlisteDatasourceConverter;
import bayern.asv.reports.api.st.migration.Migration;
import bayern.asv.reports.api.tools.arraylistdatasource.ArrayListDataSource;
import de.isb.svp.domain.pojo.Klasse;
import de.isb.svp.domain.pojo.Klassengruppe;
import de.isb.svp.domain.pojo.SchuelerSchuljahr;
import de.isb.base.business.context.Context;
import java.util.Date;
@Sulkar
Sulkar / default.html.twig
Created March 31, 2020 18:35
aus: /user/themes/myTheme/templates/flex/news/collection/
<div class="entry-details">
{% if object.website %}
<a href="{{ object.website }}"><span class="newsTitle">{{ object.title }}</span></a>
{% else %}
<span class="name">{{ object.title }}</span>
{% endif %}
<div class="newsInfo">
{{ object.info }}
@Sulkar
Sulkar / default.html.twig
Created March 31, 2020 18:35
aus: /user/themes/myTheme/templates/flex/news/collection/
<div id="flex-objects">
<div class="text-center">
<input class="form-input search" type="text" placeholder="Durchsuche die News" />
<button class="button button-primary sort asc" data-sort="name">
Sort by Name
</button>
</div>
{% set data = flex_entries.getData().toArray()|sort_by_key(title) %}
title: News
description: News für die Startseite erstellen.
type: flex-objects
# Flex Configuration
config:
# Administration Configuration
admin:
# Admin router (optional)
router:
@Sulkar
Sulkar / test.irplus
Last active September 30, 2017 21:10
<irplus>
<device manufacturer="Manufacturer" model="Model" columns="3" format="PRONTO_HEX" >
<button label="POWER" labelColor="FF000000" labelSize="20.0" backgroundColor="FFFFFFFF">0000 006D 0010 0000 000C 0044 000C 001C 000C 001C 000C 001C 000C 001C 000C 001C 000C 0044 000C 0044 000C 001C 000C 0044 000C 001C 000C 001C 000C 001C 000C 0044 000C 001C 000C 12FF</button>
</device>
</irplus>
@Sulkar
Sulkar / 1. import xxx.py
Last active August 13, 2017 12:08
[python] testing "import xxx" and "from xxx import xxx"
# import random module
import random
tempRandom = random.randint(0, 9)
print(tempRandom)
# lists all functions of the random module
print(dir(random))
@Sulkar
Sulkar / non-blockingTkinter.py
Created August 12, 2017 20:15
[python] non-blocking Tkinter thats uses .update_idletasks()
#
# non blocking Tkinter code -> uses of .update_idletasks()
#
import time
from tkinter import *
# Function: with timeout
def mySleep():
text.insert(INSERT, "start sleep\n")