Feed http://unlaengst.de Kirby
Warning: date() expects parameter 2 to be long, string given in /home/jakoubek/webapps/kirby_unlaengst/site/plugins/feed/template.php on line 8
The blog feed for Baseblog. Checkliste Sommerurlaub http://unlaengst.de/blog/checkliste-sommerurlaub blog/checkliste-sommerurlaub Sun, 09 Aug 2015 00:00:00 +0000 Work in progress

Alle Jahre wieder .... zieht es die Familie in den Norden (oder Süden) zum Sommerurlaub. Aus aktuellem Anlass habe ich für uns selbst einmal zusammengestellt, was alles mitgenommen werden soll bzw. vorbereitet werden muss. Da es uns an die Nordsee zieht, ist unsere Liste entsprechend nördlich ausgerichtet. Außerdem spiegelt sie eine Anfahrt per Auto sowie die Unterkunft in einer Ferienwohnung wider.

Vorbereitung

  • Tarif des Mobilfunkanbieters prüfen: muss eine EU-/Auslands-Daten- oder Telefonie-Option hinzugebucht werden?
  • Anschrift des Hotels/Ferienanlage auf Papier ausdrucken; ggf. zusammen mit Anfahrtsinformationen
  • Anschrift des Hotels/Ferienanlage in das Navigationssystem des Autos einprogrammieren
  • sicherheitshalber eine Papier-Straßenkarte/Landkarte bereitlegen (für den groben Blick auf die Geografie)
  • geht's ins Ausland? Benötigt man eine fremde Währung? (in unserem Fall - Dänemark - ja) Muss vor Reiseantritt Geld umgetauscht werden oder kann man das im Zielland mit der EC-Karte am Automaten machen?
  • Fahrtstrecke und mögliche alternative Teilstrecken vorplanen

Auto

  • Reifenluftdruck prüfen
  • Wischwasser auffüllen
  • Auto betanken
  • Windschutzscheibe von innen reinigen
  • Dachbox montieren
  • DVD-Anlage fürs Kind montieren und testen
  • Kühlbox mit 12V-Anschluss unterbringen

Für die Autofahrt

  • Proviant (belegte Brote, Obst, Süßes, Wasser)
  • kleine Mülltüte für Essensreste und Verpackungen
  • Taschentücher
  • Nackenhörnchen für die Beifahrerin
  • Kotztüten fürs Kind

Klamotten

  • Regenjacke
  • Windstopperjacke
  • Turn-/Sportschuhe
  • Gummistiefel
  • Badesachen

Für den Strand

  • Schaufeln und Eimer
  • Sonnencreme

Wohnen + Schlafen

  • Bettzeug
  • Waschpulver

Küche und Essen

  • Spülmaschinentabs
  • Kaffeepulver
  • Kaffeefilter Größe 4
  • Salz (Nudelwasser!)

Technik & Büro

Internet

(Wir haben eine Ferienwohnung mit Internet-Zugang per Netzwerkbuchse.)

  • längeres LAN-Kabel
  • WLAN-Hotspot (vorkonfiguriert auf das heimische WLAN, damit sich die mitgebrachten Endgeräte sofort verbinden können)
  • Mehrfachsteckdose
  • Verlängerungskabel

Tragbare Technik

  • Notebook
  • E-Book-Reader
  • Fotokamera/Digicam
  • Netzgeräte/Ladekabel für Handy, Notebook, E-Book-Reader, Fotokamera

"Büro"

  • Notizblock/Spiralblock
  • Stifte/Kugelschreiber
  • Tasche/Mappe o.ä. für Belege, lose Blätter, Prospekte, Erinnerungen etc.

Dies & das

  • für Traditionalisten: Anschriften der Empfänger von Postkarten aufschreiben
]]>
Visible and invisible pages in Kirby http://unlaengst.de/blog/kirby-about-visible-and-invisible-pages blog/kirby-about-visible-and-invisible-pages Wed, 29 Jul 2015 00:00:00 +0000 Kirby's docs explain visible and invisible pages quite nicely. However there is some confusion among Kirby users about the differences between those two types of pages and how to deal with them, especially with the invisible pages.

I'd like to explain the differences and give you a short overview how to deal with the pages using Kirby's API from your templates. You'll see that visible and invisible pages act pretty similarly.

Creating pages

Every page in a Kirby-powered site sits in its own folder. The name of the folder defines the URL slug to access the page.

For instance this blog post resides in a folder named:

content/01-blog/14-kirby-about-visible-and-invisible-pages

This page is a second-level page (there is the blog-level above). That means this page is a child of the blog page/level while the blog is this page's parent. Every other page on the same level is a sibling to this page (as the folder starts with 14 you can assume that there are at least 13 other pages below the blog folder).

Therefore the core concept of Kirby's page visibility involves an attribute named children(). This attribute returns an array of all pages that are children to the current page whether they are visible or invisible. If the current page doesn't have any children this attribute still exists but it returns an empty array.

In a typical Kirby template one can load all children of the current page using a simple API call:

<ul>
  <?php foreach($pages->children() as $item): ?>
    <li><?php echo $item->title() ?></li>
  <?php endforeach ?>
</ul>

There are two additional method calls in Kirby's API, visible() and invisible(). These two methods act like filters to the children attribute:

  • The visible() method filters out all invisible children.
  • The invisible() method filters out all visible children.

To only return visible child pages:

<ul>
  <?php foreach($pages->children()->visible() as $item): ?>
    <li><?php echo $item->title() ?></li>
  <?php endforeach ?>
</ul>

To only return invisible child pages:

<ul>
  <?php foreach($pages->children()->invisible() as $item): ?>
    <li><?php echo $item->title() ?></li>
  <?php endforeach ?>
</ul>

Define visibility

The simple rule is:

  • If the folder starts with a number the page is visible (/content/01-hello-word).
  • If the folder does not start with a number the page is invisible (/content/contact).

Sorting visible pages

All visible pages somewhere in the "page tree" have a natural sort order: they're sorted alphanumerically using the prepended number from the folder name.

If two or more folders on the same level have the same number prepended to the folder name then the remaining string part of the folder is taken into account.

content/1-about-me
content/2-customers
content/2-portfolio
content/3-contact

Sorting invisible pages

Sorting invisible pages is even simpler: there is not number prepended - just the pure name of the folder gets sorted alphabetically.

content/contact
content/download
content/products

Advanced sorting

While visible and invisible pages have their natural sort order built in you can easily sort a collection of pages per any other field.

For instance if your blog posts have a field Date you can sort them in descending chronological order with the newest posts first (for using fields in content text files see Docs > Adding content > Text files > Fields).

Example:

<ul>
  <?php foreach($pages->children()->visible()->sortBy('date', 'desc') as $item): ?>
    <li><?php echo $item->title() ?></li>
  <?php endforeach ?>
</ul>

Visibility != accessibility

After all what does visible or invisible mean? Does invisible mean visitors cannot access this page?

The simple answer is: No. Every Kirby page can be accessed, regardless of its visibility. A visitor to your site can even access an invisible page if the URL is known to her (sure, there are ways to do access control in Kirby but this is not bound to page visibility).

At a glance

If you compare visible and invisible pages you'll see that there isn't much difference.

what? visible invisible
sort order by number, then folder name by folder name
sort by other criteria yes yes
URL slug folder name without number folder name
can be freely accessed yes yes

When to use visible, when invisible pages?

The decision when to use visible or invisible pages depends strongly on your personal working style concerning your website.

For parts of your website that have a "logical order of appearance" use visible pages, for instance different main sections of your website:

  • 01-about
  • 02-products
  • 03-customers
  • 04-blog
  • 05-contact

This way you can easily sort and re-sort these sections just by renaming the folders.

PLUS: if you use a ready-made theme for Kirby the theme can automatically build the main menu for you with all your visible pages.

If you have pages in your website that don't need to appear in a (~ one) fixed order then invisible pages might help you. Any pre-built menu functionality will not include these pages but you can search, query, filter, sort, flip, etc. these pages at your own option.

Have a look at the field structure of Kirby's content text files and the corresponding API docs.

I hope this post gives an initial insight into Kirby's visible and invisible pages. If there are questions left just post an comment.

]]>
My Git essentials http://unlaengst.de/blog/my-git-essentials blog/my-git-essentials Wed, 22 Jul 2015 00:00:00 +0000 This post is work-in-progress!

These are my essential commands for Git because I always forget them:

Initialize a Git repository

Initialize an empty Git repository in a directory called directory-name under the current directory.

git init directory-name

Initialize an empty Git repository in the current directory.

git init

Initialize an empty and bare Git repository in the current directory. Bare means this repository will contain only Git data but no working tree.

git init --bare

Add files/directories from your worktree to your repository

Add all files (and files in directories) in and under your current directory to your repository.

git add .

Add a specific (new) file to the repository.

git add mynewfile.php

or

git add some/subdir/mynewfile.php

Check the state of your worktree

The status command returns a list of files that are changed, renamed, deleted or newly added to the worktree.

git status

Add changed files to the next commit

After changing one or several files you want to lay down the edits in an event called commit. Though you've edited several files you may only want to include some of them in your next commit.

git add file1.php
git add file2.php
git add subdir/another_file.php

After you've added all necessary files you can commit them:

git commit -m "My commit message"

This command commits all added files. To identify your commit a commit message with the conent "My commit message" is added to the commit.

If you want to include all changed files in your commit just use the -a switch:

git commit -a -m "Commit all changed files"
]]>
Getting started with SQLite http://unlaengst.de/blog/getting-started-with-sqlite blog/getting-started-with-sqlite Tue, 17 Feb 2015 00:00:00 +0000 This article will show you a short introduction to SQLite, the embedded SQL database library.

What is SQLite?

SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world.

sqlite_homepage

For beginners:

  • SQLite is a software program
  • that you can download for free
  • that works like a relational SQL database

Howto get SQLite

The SQLite project provides the software for any common operating system for free. Head over to SQLite's download website and download SQLite for you operating system.

If you work on Windows download the file behind the link sqlite-shell-win32-x86-....zip (under Precompiled Binaries for Windows).

Remember: SQLite is a database library - a program that gives you access to existing or newly created database files. SQLite does not need or provide a separate database server process.

Using SQLite for the first time

After downloading you'll get an ZIP file to extract. The content of the ZIP file is just a sqlite3.exe program (under Windows). Extract the ZIP file to a directory of your choice.

On Windows launch the command prompt, cd to that directory and execute

sqlite3.exe mydatabasename.sqlite
SQLite version 3.8.8.2 2015-01-30 14:30:45
Enter ".help" for usage hints.
sqlite>

In that directory a a file mydatabasename.sqlite gets created - this represents the SQLite database.

Now you can start to create database tables and insert records (rows) into those tables. For beginners this is a bit tedious, so you better use a graphical frontend for SQLite to access your new database.

Accessing your database with a graphical frontend

The command line might not be the best way for laymans to access a SQLite database for the first time. Let's head over to graphical interfaces.

SQLiteStudio

One of the best graphical SQLite frontends I can recommend is SQLiteStudio. This program can be downloaded for free and is open source. On it's website you'll find releases for Windows, OSX and Linux. The current version is 3.0.2 (as of February 2015).

sqlitestudio_homepage

SQLiteSpy

SQLiteSpy is another slim graphical SQLite frontends. It's not open source but available for free and only for Windows. It starts very fast. It's functions are not that extensive like SQLiteStudio, but it's ok for fast inspecting a SQLite database.

sqlitespy_homepage

Accessing SQLite programmatically

SQLite is one of the moste widely deployed database formats worldwide. Therefore there is SQLite support availabe for nearly every common programming language. Please refer to your preferred programming language's documentation for howto access SQLite from PHP, Python, Ruby, etc...

More information

]]>
Howto install PHP Composer on WebFaction http://unlaengst.de/blog/howto-install-php-composer-on-webfaction blog/howto-install-php-composer-on-webfaction Sun, 15 Feb 2015 00:00:00 +0000 What is Composer?
Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.

see Composer

SSH access

Access your WebFaction via SSH:

ssh yourservername.webfaction.com

You'll find your server name on the home page of your WebFaction control panel under the section Web Server:

You have to supply your WebFaction account name and your password to login to your SSH account.

Install Composer

The Composer executable should be placed in the ~/bin directory:

curl -sS https://getcomposer.org/installer | php55

Note: as PHP command-line executable you need to address the executable php55 for the newest PHP version WebFaction provides (PHP 5.5, as of February 2015).

In your ~/bin directory you'll find a composer.phar file. This is the PHP Archive that provides the Composer functionality on your server.

Using Composer

You can use the Composer archive to install a new PHP project from existing source code repositories:

php55 composer.phar create-project october/october html dev-master

(example for installing an instance of October CMS in subdirectory html)

]]>
Unlängst migrated to WebFaction http://unlaengst.de/blog/unlaengst-migrated-to-webfaction blog/unlaengst-migrated-to-webfaction Sat, 14 Feb 2015 00:00:00 +0000 I recently stumbled upon WebFaction -- a web hosting provider "for developers" -- and soon decided to give it a go. Here is what I experienced while setting up an account with WebFaction and migrating my first website to their servers.

homepage

Pricing

A WebFaction account (~ virtual private server) costs a flat fee of $9.50 per month and gives you an unlimited numbers of websites (there are certain limits, i.e. 100 GB disk space, 600 GB bandwith/month, 512 MB RAM).

Domains

You can host websites under the generic account hostname (username.webfactional.com) or let your domain's name server entries point to WebFactional servers.

Apps

WebFaction has one-click installers for several well-known web applications or frameworks (Wordpress, Ghost, Drupal, Trac, Django, Ruby on Rails, Zope, etc.). Beyond that you can manually install a web app.

Serving websites and applications

WebFaction uses Apache and Nginx though the webservers are transparent to the user. Except for creating some rewrite rules in a .htaccess file I didn't come in contact with neither Apache nor Nginx settings.

Databases

You can create unlimited databases in your account, choice of MySQL or PostgreSQL. The databases have their own memory: the above-mentioned application memory of 512 MB is only for serving the applications, not for the databases.

Access to your WebFaction account

Most settings can be edited through WebFaction's mighty control panel. Transferring files to your server can be done with (S)FTP + you get a full shell access with SSH.

control_panel

Performance

I can't judge WebFaction's performance over a longer period of time but I can say after a few days that it feels really swift.

Email

A WebFaction account comes with unlimited email addresses and mailboxes. You can access your mail with IMAP or POP3 and using a Webmail provided by Roundcube.

Incoming email can be filtered, forwarded to another email address or piped to a script stored on your server.

Customer support

WebFaction provides a detailled documentation website and a community-driven question and answer forum (see below, "More information"). There is a ticket system for direct user support but I didn't need it yet.

Trial

You can test-drive the WebFaction account for two days for free. But the free account lacks some features:

  • only static web pages can be served
  • not outgoing email
  • no delivery of incoming emails to a script

Upgrades

As mentionend above the account is limited to 512 MB application memory, 100 GB disk space und 600 GB bandwith. You can order some upgrades on your account:

  • extra disk space: +$5/month per 50GB
  • extra bandwith: +$5/month per 300GB
  • dedicated IP address: +$5/month

Moreover there are higher plans which come with more RAM, space and bandwith included.

Hosting a Ghost blog

I chose my blog Unlängst (this one here) to be the first of my websites to be migrated to WebFaction. Installing and running a Ghost instance takes no more than 5 seconds with WebFaction's one-click installer.

control_panel_apps_ghost

After installing the Ghost instance you can setup the new blog and import your Ghost settings from the backup JSON file.

More information

]]>
Prism support in Ghost http://unlaengst.de/blog/prism-support-in-ghost blog/prism-support-in-ghost Wed, 07 May 2014 00:00:00 +0000 The theme I currently use for my Ghost blog is called StayPuft. It's a fork of Casper, the default Ghost theme.

StayPuft has several new features. One is support for Prism, a syntax highlighter available for many programming languages.

This is a dummy example for highlighting a piece of SQL code:

SELECT *
FROM   table
ORDER BY lastname, firstname;
]]>
Fossil SCM http://unlaengst.de/blog/fossil blog/fossil Mon, 28 Oct 2013 00:00:00 +0000 Fossil is a lightweight tool for version control (the "SCM" stands for software configuration management). It is similar to Git but simpler and more powerful at once.

See the Fossil website

self-contained

Fossil is self-contained: there is only one binary (fossil.exe on Windows, fossil on Linux). Put it in your project dir or somewhere in the path and you're done. Even better: the repository is also self-contained. While a Git repo is a vast directory tree (under .git) a Fossil repo is just one file. Typically you name it something like yourproject.fossil.

SQLite-based

From a technical view this repository is a SQLite database. You can even open it with any SQLite frontend. Why SQLite? Because it's a rock solid file format. A Fossil is developed by D. Richard Hipp who is also the main author of SQLite.

main features

  • version control
  • bug tracking/ticketing
  • integrated wiki
  • integrated web server/web interface
  • self-contained (single binary)
]]>
Laravel: Howto include the Piwik snippet only in production mode http://unlaengst.de/blog/laravel-howto-include-piwik-snippet-only-in-production-mode blog/laravel-howto-include-piwik-snippet-only-in-production-mode Sun, 08 Sep 2013 00:00:00 +0000 What and why?

I am using Laravel to write the tiny engine for this blog. And I use Piwik, an open-source web analytics tool, for visitor statistics on this website.

For tracking visits with Piwik you have to include a JavaScript snippet into your web pages. While developing on my local notebook I don't want that Piwik JavaScript snippet to be loaded. So here is how to achieve that:

Laravel environments

Laravel knows the concept of runtime environments. This allows you to let your Laravel app behave different when running on your laptop or on the live server.

In bootstrap/start.php there is an paragraph titled Detect The Application Environment. Here you define the URL that tells Laravel when it's not the production environment but the local development environment. Because the local URL on my laptop for this app is http://blog.dev I put this in the array.

$env = $app->detectEnvironment(array(
    'local' => array('blog.dev'),
));

Configuration

I create a new configuration file in the app/config dir. This file stores my own configuration settings. In this example I name this file blog.php.

return array(
    'piwik'   => true
);

I call the specific setting for the Piwik snippet piwik and set it to true.

Because the environment configuration logic of Laravel always takes the default configuration values if there is none defined for the local environment you have to overwrite this setting.

  • create a directory app/config/local
  • copy your blog.php config file from app/config to app/config/local
  • set the value for piwik from true to false

    return array(
    'piwik' => false
    );

The Piwik snippet

I store views or sub-templates that are here to just be included into other templates in a directory called app/views/partials.

View / master template

In your master template – preferably somewhere near the bottom – you'll now want to include the Piwik snippet. You put the include statement inside an if-clause where you check the Piwik setting from your configuration files.

@if (Config::get('blog.piwik'))
@include('partials.piwik')
@endif

Conclusion

That's all: your Laravel app now loads the Piwik JavaScript snippet when running on your live server and it doesn't if run on your development machine.

]]>
Projekte November 2014 http://unlaengst.de/blog/projekte-november-2014 blog/projekte-november-2014 Auf meinem Schreibtisch befinden sich eine Anzahl von (Software-)Projekten in der Warteschlange. Es handelt sich dabei im hauptsächlich um webbasierte Software-Angebote. Der thematische Schwerpunkt liegt bei den meisten Anwendungen auf Funktionen für die Branche Direktverteilung.

Die folgende Liste gibt einen groben und unvollständigen Überblick über diese Anwendungen sowie den Entwicklungsstand.

Technische Basis

Es handelt sich um in PHP geschriebene Webanwendungen. Ich verwende das Framework Laravel. Als Datenbank kommt PostgreSQL zum Einsatz.

Projekte

Stand: 2014-11-26

Accounts

Alle Webanwendungen von mir, bei denen Nutzer sich registrieren können, sollen auf eine zentrale Nutzerdatenbank zugreifen. Die Nutzer können somit mit einer Registrierung mehrere (genauer: alle) Anwendungen nutzen und ihren Account zentral verwalten.

Diese Anwendung trägt den Arbeitstitel Accounts.

Aktueller Status: Konzeptphase

Mindestlohnrechner

Ab 2015 müssen Unternehmen ihren Mitarbeitern den gesetzlichen Mindestlohn bezahlen. Verteilunternehmen bezahlen ihre Zusteller meist nach einer Stückvergütung. Der Mindestlohnrechner hilft diesen Unternehmen, anhand der Lohndatensätze für ihre Zusteller mögliche Aufschläge zum Einhalten des Mindestlohnes zu errechnen.

Aktueller Status: Konzeptphase

Weitere Informationen gibt es auf der Projektseite.

Verteiljobs

Verteilunternehmen suchen ständig nach Zustellkräften, da diese meist nach einer gewissen Zeit wieder ausscheiden. Verteiljobs wird eine Online-Jobbörse für diese Jobangebote sein. Viele generische Jobbörsen (d.h. für alle möglichen Arten von Jobangeboten) stellen dem Inserenten hauptsächlich ein großes Textfeld für die Beschreibung des Arbeitsplatzes bereit. Verteiljobs hingegen wird dem Anbieter gezielte Attribute bereitstellen, mit denen diese ihre Jobangebote für Zusteller ganz konkret beschreiben können. Dazu zählen z.B. Wochentag, Ort, Größe des Bezirks, Art des Verteilguts, geschätzter Zeitaufwand, usw.

Aktueller Status: geplant

Vornamencheck

Vornamencheck wird ein API-Dienst sein. Dieser stellt eine Funktion zur Verfügung, um für Vornamen das Geschlecht zu ermitteln. Diese Funktion kann in betriebswirtschaftliche Anwendungen integriert werden. Die meisten dieser Anwendungen stellen den Benutzern keine Möglichkeit bereit, zu eingegebenen Adressdaten automatisch das Geschlecht (d.h. die Anrede) zu ermitteln.

Aktueller Status: geplant

Geburtstagsemail

Über diesen Dienst können Verteilunternehmen ihren oft mehreren Hundert oder Tausenden Zustellern unkompliziert per E-Mail zum Geburtstag gratulieren. Das ist zugegebenermaßen eine betriebswirtschaftlich irrelevante Funktion, wird meiner Erfahrung nach von den Zustellern aber positiv wahrgenommen.

Aktueller Status: geplant

Verteilerportal

Das Verteilerportal wird eine Portalanwendung sein, über die die Zusteller eines Verteilunternehmens ihre eigenen Stammdaten selbst pflegen und aktualisieren können (Employee Self Service).

Aktueller Status: geplant

Verteilplaner

Über den Verteilplaner können die Werbekunden von Verteilunternehmen ihre Direktverteilaufträge selbst erfassen und auch das Verteilgebiet auf einer Karte selbst festlegen. Über eine Schnittstelle kann das Verteilunternehmen diese Aufträge dann u.U. direkt in die eigene Verteilsoftware importieren.

Aktueller Status: geplant

]]>