Skip to content

Instantly share code, notes, and snippets.

View niklausgerber's full-sized avatar
🍪

Niklaus Gerber niklausgerber

🍪
View GitHub Profile
@niklausgerber
niklausgerber / carbon.html
Created January 7, 2016 09:25
Carbon Ads Code for my Website
<script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1696&serve=CVYD42T&placement=niklausgerbercom" id="_carbonads_js"></script>
@niklausgerber
niklausgerber / Rob-den-Toom.html
Created March 12, 2014 08:43
Answer for Rob den Toom
<!-- Original Code -->
<div class="Flexible-container"></div>
<!-- Edited Code -->
<p>
<div class="Flexible-container"></div>
</p>
@niklausgerber
niklausgerber / gist:5626584
Last active December 17, 2015 14:48
Problem with my footer
<?php $article = $pages->find('blog')->children()->last() ?>
<?php $second = $article->prev() ?>
<?php $third = $second->prev() ?>
<div class="footer">
<div class="container">
<div class="grid full">
<h3><?php echo html($article->title()) ?></h3>
<small><?php echo html($article->Published()) ?></small>
<p><?php echo excerpt($article->text(), 400) ?><a href="<?php echo html($article->url()) ?>"> Continue reading</a></p>
@niklausgerber
niklausgerber / social-sharing.php
Created December 12, 2012 14:14
Social Sharing on Kirby CMS
<a href="http://twitter.com/share?url=<?php echo html($page->url()) ?>&text=<?php echo html($page->title()) ?> via @USERNAME" target="_blank">Share on Twitter</a>
<a href="https://plus.google.com/share?url=<?php echo html($page->url()) ?>" target="_blank">Google+</a>
<a href="http://www.facebook.com/sharer.php?u=<?php echo html($page->url()) ?>" target="_blank">Post to Facebook</a>
@niklausgerber
niklausgerber / Search.php
Created September 27, 2012 16:50
Search Query
<?php snippet('header') ?>
<?php snippet('navigation') ?>
<section id="search">
<?php
$search = new search(array(
'searchfield' => 'q',
'ignore' => array('disclaimer', 'error', 'feed', 'home', 'imprint', 'sitemap', 'about'),
@niklausgerber
niklausgerber / test
Created September 27, 2012 10:07
Can this be done more cleverly - and it does not work
<section>
<h2 class="nav-element"><a href="<?php echo html($pages->find('blog')->children()->last()->url()) ?>"><?php echo html($pages->find('blog')->children()->last()->title()) ?></a></h2>
<p><?php echo html($pages->find('blog')->children()->last()->excerpt(text(), 300)) ?> <a href="<?php echo html($pages->find('blog')->children()->last()->url()) ?>">Read more</a></p>
</section>
@niklausgerber
niklausgerber / .htaccess
Created April 16, 2012 09:19
Speeding up the web
# Apache configuration file
# httpd.apache.org/docs/2.2/mod/quickreference.html
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible
# httpd.apache.org/docs/2.2/howto/htaccess.html
# Techniques in here adapted from all over, including:
# Kroc Camen: camendesign.com/.htaccess
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/
# Sample .htaccess file of CMS MODx: modxcms.com
@niklausgerber
niklausgerber / hack.sh
Created April 3, 2012 07:34 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@niklausgerber
niklausgerber / idea.txt
Created March 19, 2012 14:51
KirbyTXT SPAN, CLASSES and ID
In KirbyText I can do this:
##Text
and it will give me
<h2>Text</h2>
I can also do this (link: http://getkirby.com text: getkirby popup: yes) which will give me a link. Brilliant would be if I could generate span classes or even direct classes or IDs out of this. As an Idea:
<img src="<?php $image = $article->images()->find('thumb.gif') ?><?php echo $image->url() ?>"> //that works
<img src="<?php $image = $article->images()->find('thumb.gif') ?><?php echo thumb($img, array('width' => 200), false); ?>"> //and this does not