Skip to content

Instantly share code, notes, and snippets.

@evert
evert / eslint.yml
Created October 2, 2023 19:01
ESLint
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: ESLint
on:
push:
branches: [ main, 'version/**' ]
pull_request:
branches: [ main, 'version/**' ]
{
"basics": {
"name": "Evert Pot",
"label": "Technical Leadership / API specialist",
"email": "[email protected]",
"url": "https://evertpot.com/",
"summary": "I’m 20 year software engineering veteran and co-founded several businesses.\n\nI’m currently on the look-out for new opportunities. I’m especially interested in CTO and Director or part-time advisor positions.",
"location": {
"city": "Toronto",
"countryCode": "CA",
async () => {
const response = await fetch('large.bin');
const buffer = await response.arrayBuffer();
};
const Ketting = require('ketting').default;
const k = new Ketting('https://hal-browser.evertpot.com/games');
const main = async () => {
const games = k.go();
console.log(await games.get());
<?php declare(strict_types=1);
class Player {
private $name;
function __construct(string $name) {
$this->name = $name;
@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: *
@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 / 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 / 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 = [];
<?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();