Skip to content

Instantly share code, notes, and snippets.

Lukas Bestle lukasbestle

Block or report user

Report or block lukasbestle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lukasbestle
lukasbestle / kirbytag.php
Last active Jan 6, 2016
Dynamic image Kirbytag
View kirbytag.php
<?php
// Please note: Use http://getkirby.com/docs/cheatsheet/helpers/kirbytag for tags that don't require access to the files of the page
$field = new Field($page, null, '(image: example.jpg)');
echo $field->kirbytext();
@lukasbestle
lukasbestle / search.php
Created Nov 5, 2015
Kirby $pages->search() that searches for full matches only
View search.php
<?php
/**
* Fork of the native $pages->search() method
* Only searches for full matches
*/
function search($collection, $query, $params = array()) {
if(is_string($params)) {
$params = array('fields' => str::split($params, '|'));
@lukasbestle
lukasbestle / fizzbuzz.php
Created Aug 31, 2014
Fizz Buzz Test in PHP
View fizzbuzz.php
<?php
for($i = 1; $i <= 100; $i++) {
$found = false;
// Divisible by 3
if($i % 3 == 0) {
echo 'Fizz';
$found = true;
}
View keybase.md

Keybase proof

I hereby claim:

  • I am lukasbestle on github.
  • I am lukasbestle (https://keybase.io/lukasbestle) on keybase.
  • I have a public key whose fingerprint is 3A6F 39F5 BB6A A8D7 EF8D 0DC7 2B97 B9B6 1C7E A7B7

To claim this, I am signing this object:

@lukasbestle
lukasbestle / kirbytext.extended.php
Created Jun 30, 2014
Kirbytag for HTML5 video (Kirby 1)
View kirbytext.extended.php
<?php
class kirbytextExtended extends kirbytext {
function __construct($text, $markdown=true) {
parent::__construct($text, $markdown);
$this->addTags('video');
// define custom attributes
$this->addAttributes('poster');
@lukasbestle
lukasbestle / update.sh
Last active Aug 29, 2015
Shell script to update every Git repository in direct subdirectories of the script directory
View update.sh
#!/usr/bin/env bash
# Updates every Git repository in direct subdirectories of the script directory
# Usage: ./update
# Copyright: Lukas Bestle <lukas@lu-x.me>, 2014
# Check if git is installed
hash git &> /dev/null || {
echo -e "\033[31mYou don't have git installed.\033[0m"
exit 1
@lukasbestle
lukasbestle / install_kirby2.sh
Created Jan 3, 2014
A simple shell script to install Kirby CMS v2 from GitHub and init a new Git repo for your site
View install_kirby2.sh
# Get the default theme and switch to the folder
git clone https://github.com/getkirby-themes/default kirbyproject
cd kirbyproject
# Re-create the Git repo (this is a new site)
rm -Rf .git
git init
# Get the Kirby core as submodule
rmdir kirby
@lukasbestle
lukasbestle / smoothscroll.js
Created Sep 6, 2013
Vanilla JS smooth scrolling
View smoothscroll.js
/**
* Vanilla JS smooth scrolling
*
* @version 0.1b1
* @author Lukas Bestle <lukas@lu-x.me>
* @copyright Lukas Bestle
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
// Configuration
View gist:6142633
// Check iOS Version and change the META
window.onload = function() {
var iOSVersion;
if (/iP(hone|od|ad)/.test(navigator.platform)) {
// supports iOS 2.0 and later
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
iOSVersion = [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
iOSVersion = parseInt(iOSVersion[0]);
}
@lukasbestle
lukasbestle / howto.sh
Last active Dec 16, 2015
Spendenbytrag mass donator
View howto.sh
curl https://gist.githubusercontent.com/lukasbestle/5477654/raw/9dd750f33d4dbb917308b998b3775f1c7125c76a/spendenbytrag.sh | bash
You can’t perform that action at this time.