Skip to content

Instantly share code, notes, and snippets.

I hereby claim:

  • I am evert on github.
  • I am evert (https://keybase.io/evert) on keybase.
  • I have a public key whose fingerprint is 107B AA3F EC16 5B36 2AA3 B1A0 7140 EC0B 6D75 CC9B

To claim this, I am signing this object:

{
{
"email": "[email protected]",
"basicAuth": {
"userName": "6aJLC9SCpNpjXsWWQu69aRkQW9A2XA1ZH5d4dQsU7Phh.2vNSupMEg",
"password": "1U8VAfh0mkI8SoRegXqj50gTE9VTpleCDn4LiD564hy7TXuyNC6RFg",
"expires": 1395806514
},
"links": {
"addressbook-home-set": "\/~evert\/fruux\/fruux-ent\/public\/server.php\/addressbooks\/users\/4\/",
"current-user-principal": "\/~evert\/fruux\/fruux-ent\/public\/server.php\/principals\/users\/4\/"
@evert
evert / copyright_update
Last active December 31, 2015 16:44
Update sabre/dav copyrights with sed
@evert
evert / 00-email-to-google.md
Last active October 21, 2018 13:05
Email to google about carddav issues.

Context: This is the email I sent google, listing issues I came across when working with their carddav server. More information in this blogpost. I reformatted and redacted the email to protect people's privacy.

Hello redacted,

You may have figured it from the other emails, but we are currently working on providing a syncronization tool with Google's new CardDAV server. We've run into a number of issues that are definitely bugs, and looking for some advise in a different area.

I would much appreciate it if you could take a look at these, but I'd also completely understand if you're busy. Regardless, I feel that this information may be helpful for you, because I feel I will not the last to mention them

<?php
function generatePayload($username, array $permissions) {
$xml = [
'{http://myns.org/}/user' => $username,
'{http://myns.org/}/permissions' => new Sabre\Xml\Element\Elements($permissions)
];
$service = new Sabre\Xml\Service();
@evert
evert / markov.php
Last active January 2, 2016 06:41
A PHP script to generate a random blogpost.
<?php
// Where to find the blog posts
$sources = '_posts/2015/**.md';
$files = glob($sources);
$startWords = [];
$allWords = [];
@evert
evert / disqus-to-json.php
Created July 15, 2018 04:16
Convert Disqus export to a JSON file
<?php
$xml = simplexml_load_file('php://stdin');
$threads = [];
$posts = [];
$userMap = [
'evertp' => [
'url' => 'https://evertpot.com',
@evert
evert / _includes-comment-single.html
Last active July 15, 2018 04:47
Embedding comments from _data/comments.json with Jekyll / GH Pages
<li>
{% if include.comment.url %}<a href="{{ include.comment.url }}">{% endif %}
{% if include.comment.avatar %}<img src="{{ include.comment.avatar }}" alt="{{ include.comment.name }}" />{% end
{% if include.comment.url %}</a>{% endif %}
{% if include.comment.url %}<a href="{{ include.comment.url }}">{% endif %}
<span class="author">{{ include.comment.name }}</span>
{% if include.comment.url %}</a>{% endif %}
• <time>{{ include.comment.created | date: "%b %d, %Y" }}</time>
@evert
evert / prefer-push.md
Created November 15, 2018 14:47
Prefer-Push
Prefer-Push: item, icon

Client asks the server to push all resources that are linked via the item and icon relations of the context resource.

Prefer-Push: *
<?php declare(strict_types=1);
class Player {
private $name;
function __construct(string $name) {
$this->name = $name;