Skip to content

Instantly share code, notes, and snippets.

View pfefferle's full-sized avatar
😴
zzZZzzzZzzZZzZZZ

Matthias Pfefferle pfefferle

😴
zzZZzzzZzzZZzZZZ
View GitHub Profile
#!/usr/bin/env bash
#==========================================================================================
# Original Script from Clemens Lang, neverpanic.de
# https://neverpanic.de/blog/2014/03/19/downloading-google-web-fonts-for-local-hosting/
# Modified by Chris Jung, campino2k.de
# * Rename Files to be compatible with Windows File System (remove spaces and colon)
# * Add "local()" to src like Google does to skip downloading if System has font installed
# Modified by Robert
# * Fix Mac execution
(function () {
if (window.parent !== window) {
window.parent.postMessage(JSON.stringify({
// The config of your endpoint
reply: 'http://voxpelli.com/reply?u={url}'
}), '*');
}
// Pick a way to invoke the registerProtocolHandler, through a submit handler in admin or something
document.getElementById('confForm').addEventListener('submit', function (e) {
@voxpelli
voxpelli / indieconfig-loader.html
Last active August 29, 2015 14:06
Promise based loading of indie-config, wrapped in an example page using that promise. More info @ http://indiewebcamp.com/indie-config
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Indie Configuration</title>
<link rel="stylesheet" href="/css/style.css" />
</head>
<body>
<div class="page" id="page-wrapper">
<header>
<?php
function twitter_metadata($metadata) {
$metadata['twitter:card'] = 'summary';
$metadata['twitter:creator'] = '@willnorris';
foreach (array('url', 'title', 'description', 'image') as $attr) {
if (array_key_exists("og:$attr", $metadata)) {
$metadata["twitter:$attr"] = $metadata["og:$attr"];
}
@jkphl
jkphl / Micrometa Bookmarklet
Last active June 20, 2016 17:10
Bookmarklet for submitting the current page to http://micrometa.jkphl.is and analyzing the embedded Microformats2 and schema.org markup. Create a new bookmark in your browser and paste this code as the bookmark target.
javascript:var f=document.createElement("form");f.action="https://micrometa.jkphl.is",f.method="post",f.target="_blank";var u=document.createElement("input");u.type="hidden",u.name="url",u.value=document.location,f.appendChild(u);var s=document.createElement("input");s.type="hidden",s.name="microdata",s.value=1,f.appendChild(s),document.body.appendChild(f),f.submit();
<?php
function is_valid_mf2_json($input) {
// Input to this function must be an array
if(!is_array($input))
return false;
// Keys type and properties are required at a minimum and must be arrays
if(!isset($input['type']) || !is_array($input['type']))
return false;
@getsource
getsource / junit.xml
Created March 31, 2020 09:38
Test WordPress phpunit `junit.xml` file with failures from PDF disable in `policy.xml`.
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="" tests="10279" assertions="51407" failures="3" errors="1" time="169.605525">
<testsuite name="default" tests="10254" assertions="51160" failures="3" errors="1" time="169.142043">
<testsuite name="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" tests="25" assertions="98" failures="0" errors="0" time="0.102243">
<testcase name="test_simple_action" class="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" line="10" assertions="3" time="0.003842"/>
<testcase name="test_remove_action" class="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" line="27" assertions="4" time="0.003248"/>
<testcase name="test_has_action" class="Tests_Actions" file="/tmp/wp-current-test/tests/phpunit/tests/actions.php" line="46" assertions="6" time="0.002852"/>
<testcase name="test_multiple_actions" class="Tests_Actions" file="/tmp/wp-current-test/tes
@fabioyamate
fabioyamate / nokogiri
Created June 18, 2010 02:56
nokogiri installation from libxml2 and libxslt macosx
# using rvm with ruby-1.8.7-p249
# latest version 2.7.7 2010-06-17
brew install libxml2
# installing libxslt from source code
wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
./configure --prefix=/usr/local/Cellar/libxslt/1.1.26 --with-libxml-prefix=/usr/local/Cellar/libxml2/2.7.7
make
sudo make install
@prologic
prologic / post.go
Created December 18, 2019 12:56
A quick 'n dirty MIcroPub Go (Golang) client for Micro.blog (https://micro.blog)
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<!-- OPML generated by Fever -->
<head><title>Fever // Project26</title></head>
<body>
<outline type="rss" text="Torsten Landsiedel" title="Torsten Landsiedel" xmlUrl="https://torstenlandsiedel.de/tag/projekt26/feed" htmlUrl="https://torstenlandsiedel.de"/>
<outline type="rss" text="Marc Nilius" title="Marc Nilius" xmlUrl="https://www.wp-wartung24.de/tag/projekt26/feed/" htmlUrl="https://www.wp-wartung24.de"/>
<outline type="rss" text="Stefan Kremer" title="Stefan Kremer" xmlUrl="https://nairobi-notes.de/tag/projekt26/" htmlUrl=""/>
<outline type="rss" text="Ralf Wiechers" title="Ralf Wiechers" xmlUrl="https://blog.drivingralle.de/stichwort/projekt26/feed" htmlUrl="https://blog.drivingralle.de"/>
<outline type="rss" text="Thomas Brühl" title="Thomas Brühl" xmlUrl="https://her.ein.de/tag/projekt26/feed" htmlUrl="https://her.ein.de"/>