Skip to content

Instantly share code, notes, and snippets.

Thomas Schoffelen tschoffelen

Block or report user

Report or block tschoffelen

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
View human-time.js
function humanTimeToSeconds(timestr) {
if(timestr.indexOf(':') < 0){
return null;
var vals = timestr.split(':')
if(vals.length !== 2){
return null;
var hr = parseInt(vals[0]);
var mn = parseInt(vals[1]);
View timeago.js
const timeago = (ts) => {
const templates = {
prefix: '',
suffix: ' ',
secs: 'just now',
minute: 'a minute ago',
minutes: '%d minutes ago',
hour: 'an hour ago',
hours: '%d hours ago',
day: 'a day ago',
tschoffelen /
Last active Apr 9, 2018
Spec for dashboard files for the Dashbored app for Apple TV.

Dashbored file specification

Dashboard files for the Dashbored app for Apple TV and iPhone are JSON files with a certain structure.

A dashboard file should be a JSON object with at least the keys title and sections, and optionally the key theme.


The title key should always exist and contain a string value of the title you want displayed at the top of the dashboard.

tschoffelen / dashboard.json
Last active Apr 9, 2018
Example dashboard JSON for the Dashbored app for Apple TV.
View dashboard.json
"title": "Our chicken farm",
"theme": {
"dashboardBackgroundColor": "green",
"dashboardBackgroundImage": "",
"dashboardTitleColor": "#ffffff",
"headerColor": "#666",
"textColor": "#121212",
"backgroundColor": "#ffffff",
"borderRadius": 10,
View dribbble-shots.php
// Set username
$username = 'tschoffelen';
// Get page contents
$content = file_get_contents('' . $username . '?page=1&per_page=12');
// Parse page content into $shots array
$shots = [];
tschoffelen / webpack.config.js
Last active Sep 27, 2018
Tricking PHPStorm in supporting React Native path aliases.
View webpack.config.js
* Why is this here you ask? React Native doesn't use Webpack. True. This file is here to trick
* IDEA in recognizing module aliases (see the package.json files in some of the subdirs).
* Nice solution? No. Does it work? Sure.
* Tracker URL:
* - TS
const fs = require('fs')

API Specificatie



tschoffelen / install.php
Created Dec 22, 2013
A simple PHP script that automatically downloads and unzips the latest version of Wordpress in the current directory (./), so that I don't have to download it and upload it to my server through FTP manually.
View install.php
echo '<pre>';
echo '<span style="color:blue">DOWNLOADING...</span>'.PHP_EOL;
// Download file
file_put_contents('', file_get_contents(''));
$zip = new ZipArchive();
$res = $zip->open('');
if ($res === TRUE) {
View WSSoapClient.php
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
You can’t perform that action at this time.