Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard V. Rokko11

  • Germany
View GitHub Profile
@Rokko11
Rokko11 / openligadb_ruby_rails_example_snippet
Created Aug 10, 2013
Getting Information of OpenLigaDb with Ruby in a Rails project
View openligadb_ruby_rails_example_snippet
# This snippet works with Ruby Gem "Savon"
client = Savon.client(wsdl: "http://www.OpenLigaDB.de/Webservices/Sportsdata.asmx?WSDL")
method = "get_matchdata_by_league_date_time"
message = {from_date_time: 5.hours.ago, to_date_time: Time.now, league_shortcut: 'bl1'}
result = client.call(:"#{method}", message: message)
data_array = result.body[:"#{method}_response"][:"#{method}_result"][:matchdata]
data_array.each do |data|
puts data[:match_id]
end
@Rokko11
Rokko11 / gist:6376918
Created Aug 29, 2013
How to add foreign key from bundle_option to cms_block
View gist:6376918
/** @var $installer Mage_Catalog_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$installer->getConnection()->addColumn($installer->getTable('bundle/option'), 'block_id',
array(
'nullable' => true,
'unsigned' => true,
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
@Rokko11
Rokko11 / design_adminhmtl_default_default_template_cmsforbundle_product_edit_bundle_option.phtml
Created Aug 30, 2013
Problem: Werte von Bundle/Option werden nicht im option.phtml vorselektiert
View design_adminhmtl_default_default_template_cmsforbundle_product_edit_bundle_option.phtml
<script type="text/javascript">
optionTemplate = '<div id="<?php echo $this->getFieldId() ?>_{{index}}" class="option-box"> ' +
'<div class="option-title"> ' +
'<label for="<?php echo $this->getFieldName() ?>[{{index}}][title]"><?php echo Mage::helper('bundle')->__('Default Title') ?> <span class="required">*</span></label>' +
<?php if ($this->isDefaultStore()): ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_title" value="{{title}}">' +
<?php else: ?>
'<input class="input-text required-entry" type="text" name="<?php echo $this->getFieldName() ?>[{{index}}][default_title]" id="id_<?php echo $this->getFieldName() ?>_{{index}}_default_title" value="{{default_title}}">' +
<?php endif; ?>
'<?php echo $this->jsQuoteEscape($this->getOptionDeleteButtonHtml()) ?>' +
@Rokko11
Rokko11 / EventContainer.java
Created Nov 5, 2015
Documentation, how to use a composite component together with JavaEE-events.
View EventContainer.java
import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.inject.Named;
/**
* Klasse, die das zu feuernde Event beinhaltet.
* Diese wird benoetigt, da bei JSF < 2.2 keine DI in Komponenten moeglich ist.
*/
@Named
public class EventContainer {
@Rokko11
Rokko11 / child.xhtml
Created Dec 10, 2015
Not typesafe ui:param
View child.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<ui:define name="columns">
<!-- At this like, the IDE does not know the type of "key". So autocompletion and refactorings of "property" will fail. -->
<h:outputText value="#{key.property}"/>
</ui:define>
</ui:composition>
View regex-pattern
<div id="stack-trace">other.package.MyTry.exec(MyTry.java:19)</div>
Now I need a jQuery/JS-Method which parses this Element by the Regex "\(\w*\.java:\d*\)" and modifies the content of this div to following:
<div id="stack-trace">other.package.MyTry.exec(<a href="MyTry.java:19">MyTry.java:19</a>)</div>
@Rokko11
Rokko11 / docker-compose.yml
Last active Aug 20, 2019
Beispiel-Code für die Transformation eines docker-compose.yml in ein Markdown-File. Dieses wird mit dem pandoc-plantuml-Filter in ein Diagramm überführt.
View docker-compose.yml
version: '3'
services:
proxy:
image: nginx:1.15-alpine
labels:
description: "nginx SSL Proxy"
depends_on:
- webapp
- docs
@Rokko11
Rokko11 / SampleIT.java
Last active Sep 10, 2019
Generierung Benutzerhandbuch aus Selenium-Test
View SampleIT.java
public class SampleIT extends SeleniumTestCase {
@Test
@Login
@ImportFile(name = "brief/Datenbasis.xls")
public void testErfolgreicherVersand() throws Exception {
new VertragPage()
.setLogStrategy(new MarkdownStrategy())
.title("handbuch.briefversand.title")
.describe("handbuch.briefversand.description")
View MarkdownUsageFormatter.java
import com.beust.jcommander.*;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
public class MarkdownUsageFormatter implements IUsageFormatter {
private final JCommander commander;
@Rokko11
Rokko11 / ReleaseNotes.md
Last active Aug 19, 2019
Erzeugung von ReleaseNotes mit dem maven-changes-plugin. Nach dem Auslesen aus Jira werden sie per Apache Velocity in Markdown exportiert. Die Issues werden anschließend mit einem Lua-Filter verlinkt.
View ReleaseNotes.md

Version 1.2.3

Stories:

  • MYPROJECT-1: Kurzbeschreibung Story 1
  • MYPROJECT-2: Kurzbeschreibung Story 2

Fixed Bugs:

  • MYPROJECT-12: Anzeigefehler auf Seite 1
You can’t perform that action at this time.