Skip to content

Instantly share code, notes, and snippets.

{
"font_face": "Anonymous Pro",
"line_padding_top": 1,
"line_padding_bottom": 2,
}
@DerZyklop
DerZyklop / xmlsitemap.php
Created April 23, 2014 16:31
A xmlsitemap for Kirby CMS without listing the children of "kontakt"
<?php
$ignore = array('sitemap', 'error');
foreach ($pages->find('kontakt')->children() as $value) {
array_push($ignore, $value->uri());
}
// send the right header
header('Content-type: text/xml; charset="utf-8"');
@DerZyklop
DerZyklop / back-to-old-commit.sh
Created April 28, 2014 10:32
git: Set master to old commit
git checkout master~1 # Checkout previous commit on master
git checkout -b new_master # Create branch for new master
git branch -D master # Delete old master
git branch -mv new_master master # Make new_master master
# source: http://stackoverflow.com/questions/4359681/want-to-change-my-master-to-an-older-commit-how-can-i-do-this
@DerZyklop
DerZyklop / phone-link.php
Created May 21, 2014 09:23
How to hyperlink a phone number in PHP
@DerZyklop
DerZyklop / git-submodule-healer
Created May 22, 2014 09:21
I hate git submodules. This command helps at the most, when i have trouble with it.
git submodule update --init --recursive
@DerZyklop
DerZyklop / kirby-submission-honeypot.php
Created June 11, 2014 10:46 — forked from anonymous/gist:e2726b63dc5247ead60a
Kirby Submission Plugin with Honeypot Spam Detection. This is just @dweidner's template for using the Honeypot. See: https://github.com/bastianallgeier/kirbycms-extensions/pull/61#issuecomment-29104650
<?php
$form = new contactform(array(
'to' => 'Daniel Weidner <hallo@danielweidner.de>',
'from' => 'Contact Form <kontakt@danielweidner.de>',
'subject' => 'Neue Nachricht',
'goto' => null,
'honeypot' => 'email-repeat-142'
));
@DerZyklop
DerZyklop / facepalm.txt
Created June 17, 2014 09:16
Works in helvetica and arial. but not in monaco or courier.
............................................________
....................................,.-'"...................``~.,
.............................,.-"..................................."-.,
.........................,/...............................................":,
.....................,?......................................................,
.................../...........................................................,}
................./......................................................,:`^`..}
.............../...................................................,:"........./
..............?.....__.........................................:`.........../
............./__.(....."~-,_..............................,:`........../

Das Verhalten von if statements ist in CoffeeScript das selbe wie in Javascript. Ich habe dafür einen kleinen Test geschrieben.

Sollte man allerdings

if true == 1

schreiben, dann macht CoffeeScript daraus ein

if true === 1

@DerZyklop
DerZyklop / index.html
Created June 26, 2014 15:16
A Pen by DerZyklop.
<input maxlength="5" type="text" name="nix" placeholder="Schreib..." value="">
@DerZyklop
DerZyklop / last-array-item.coffee
Created July 1, 2014 14:39
How to get the last item of an javascript array
array = [
{
position: 'first'
mood: 'meh...'
}
{
position: 'second'
mood: 'Yuck!'
}
{