Skip to content

Instantly share code, notes, and snippets.

View shrink0r's full-sized avatar

Thorsten Schmitt-Rink shrink0r

View GitHub Profile
@shrink0r
shrink0r / regex_test.php
Created July 25, 2012 22:17
Readable regex playing around with named groups.
<?php
$pattern = <<<EOT
/
(?(DEFINE)
(?<T_NUM> [0-9] )
)
^(?&T_NUM)$
/x
EOT;
@shrink0r
shrink0r / gist:3983337
Created October 30, 2012 21:59
Shows how I ran into some trouble while trying to generate api doc for some project classes that extend phing.
<?php
/*
Here is the error I get when removing the @ error-supressor in ClassNode line 333:
Storing structure.xml in "/home/vagrant/projects/honeybee/etc/integration/docs/serverside/structure.xml" .. OK
Initializing transformer .. OK
Processing behaviours ..
Warning: require_once(phing/ProjectComponent.php): failed to open stream: No such file or directory in /home/vagrant/projects/honeybee/vendor/phing/phing/classes/phing/Task.php on line 22
{
"identifier": "layer-dbfb6787-2753-4af5-b529-4bc7312328bb-de_DE-1",
"title": "this is a text title",
"description": "this is a fulltext descirption",
"keywords": ["keyword one", "keyword two"],
"categories": ["category one", "category two"]
}

Honeybee und Pulq Workshop

Arbeitsumgebung einrichten

Hier werden alle Schritte notiert, die dazu führen, dass Projektumgebungen automatisiert hochgefahren und eingerichtet werden können.

Vorraussetzungen

<?xml version="1.0" encoding="UTF-8"?>
<ae:configurations
xmlns="http://berlinonline.de/schemas/honeybee/exports/1.0"
xmlns:env="http://berlinonline.de/schemas/honeybee/config/envelope/definition/1.0"
xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0">
<ae:configuration>
<exports>
<!-- Export config example: -->
<export name="pulq-fe" class="PulqNavigationExport">
<description>
<?xml version="1.0" encoding="UTF-8"?>
<ae:configurations
xmlns="http://agavi.org/agavi/config/parts/databases/1.0"
xmlns:ae="http://agavi.org/agavi/config/global/envelope/1.0">
<ae:configuration>
<databases default="Pulq.Fe">
<database name="Pulq.Fe" class="Honeybee\Agavi\Database\CouchDb\Database">
<ae:parameter name="url">http://localhost:5984/</ae:parameter>
<ae:parameter name="database">%core.project_prefix%_%core.clean_environment%_pulq_fe</ae:parameter>
function(doc)
{
if (doc.type === 'asset')
{
emit(doc.sourceDoc, doc._id);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<setting name="input_template">
<ae:parameter name="tabs">
<ae:parameter name="content">
<ae:parameter name="rows">
<ae:parameter>
<ae:parameter name="type">custom</ae:parameter>
<ae:parameter name="template">
%core.modules_dir%/Layer/impl/Edit/GoogleMapsDrawWidget.twig

Keybase proof

I hereby claim:

  • I am shrink0r on github.
  • I am shrink0r (https://keybase.io/shrink0r) on keybase.
  • I have a public key whose fingerprint is 9505 31E3 B1ED 966C F56A 3728 E798 8695 6C1E B389

To claim this, I am signing this object:

create index

curl -XPUT localhost:9200/localnews/ -d @localnews.index.json

create mapping

curl -XPUT localhost:9200/localnews/news_item/_mapping -d @localnews.mapping.json