Skip to content

Instantly share code, notes, and snippets.

View bastianallgeier's full-sized avatar
🎯
Focusing

Bastian Allgeier bastianallgeier

🎯
Focusing
View GitHub Profile
<?php $n=0; foreach($page->children()->visible()->flip() as $article): $n++; ?>
<?php if($n==1): ?>
<!-- html for your first article -->
<?php else: ?>
<!-- html for all the other articles -->
<?php endif ?>
<?php endforeach ?>
@bastianallgeier
bastianallgeier / inuit-widths.css
Created February 11, 2014 15:08
I always forget the available widths selectors for the inuit grid
/**
* Whole
*/
.one-whole
/**
* Halves
*/
.one-half
<?php
if(param('template') == 'sometemplate') {
require('sometemplate.php');
} else {
require('othertemplate.php');
}
?>

free plan:

25 random layouts
price: free forever until facebook will buy us

bronze plan:

50 random layouts
price: $50 / month

@bastianallgeier
bastianallgeier / config.apc.php
Last active August 29, 2015 14:02
Cache setup for Kirby
<?php
// apc driver setup
// requires the php apc extension
c::set('cache', true);
c::set('cache.driver', 'apc');
@bastianallgeier
bastianallgeier / links.md
Created June 3, 2014 13:22
Kirby now has beautiful URLs for anything inside your content folder.

Why we can't have nice things…

Missing open-source vat rules

Selling stuff on the web is not that hard anymore. Services like Stripe or Paymill make it very easy to integrate credit card payments and even getting started with Paypal is only half-horrible. But the real pain in the ass is collecting VAT correctly — at least when you are a company located in Germany (and probably most other European countries) There are simply too many rules to be considered when you send a client an invoice. For a small business with a couple invoices per year it's not a big deal. You just ask your tax advisor for any invoice that is not 100% clear. But if you want to sell software worldwide for example you simply have to find someone who does the hard VAT work for you. I went for Fastspring to handle sales for me for Kirby just because they also handle VAT collection.

The solution would be an open-source collection of VAT rules th

<?php
// search the entire site
$results = $site->search('my awesome search');
// search all children, children of children, etc. of the current page
$results = $page->search('my awesome search');
// filter the search results
$results = $page->search('my awesome search')->visible()->filterBy('template', 'article');
## Kirby Starterkit Cleanup
**/content**
all folders except home and error
**/assets**
all files
<?php
$results = new Pages();
$children = $pages->find('webfonts-in-action')->children();
foreach($page->fontnames()->split(',') as $fontname) {
$results->add($children->filterBy('fontnames', $fontname, ','));
}
foreach($results->shuffle()->limit(3) as $result): ?>