Skip to content

Instantly share code, notes, and snippets.

View pfrenssen's full-sized avatar

Pieter Frenssen pfrenssen

  • Sofia, Bulgaria
View GitHub Profile
@pfrenssen
pfrenssen / whichproject
Last active September 27, 2018 07:45
Work on Joinup or OpenEuropa?
#!/usr/bin/env php
<?php
const JOINUP_RATIO = 0.667;
$times = [];
foreach (['Joinup', 'NextEuropa', 'OpenEuropa'] as $project) {
do {
$time = readline("Time spent on $project: ");
} while (!is_numeric($time));
@pfrenssen
pfrenssen / extract-subtitles
Created December 23, 2017 10:21
Extract SRT subtitles from MKV files
#!/usr/bin/env php
<?php
declare(strict_types = 1);
if (count($argv) !== 2) help();
$dirname = $argv[1];
if (!is_dir($dirname)) help();
$directory_path = realpath($dirname);
@pfrenssen
pfrenssen / gist:7a6c624383fb3ea5c11df7025fc854dd
Created August 23, 2017 18:20
Convert reveal.js to yeoman
#!/usr/bin/env php
<?php
require 'vendor/autoload.php';
use Symfony\Component\DomCrawler\Crawler;
$crawler = new Crawler(file_get_contents('/home/pieter/v/d8-training/index.html'));
$crawler = $crawler->filter('div.slides section');
@pfrenssen
pfrenssen / gherkinify.sh
Last active February 16, 2016 17:07 — forked from sandervd/behatify.sh
#!/bin/sh
cat $1 | sed 's/$/,/g' | column -s ',' -t -o ' | ' | sed 's/^/| /g'
@pfrenssen
pfrenssen / gist:7347b8a930593747e759
Created January 6, 2016 09:57
Greasemonkey script for Jira Agile keyboard accessibility
// ==UserScript==
// @name Jira Agile keyboard accessibility
// @namespace https://gist.github.com/pfrenssen
// @version 1.0
// @description Improve keyboard accessibility for Jira Agile boards
// @author Pieter Frenssen
// @include https://*/secure/RapidBoard.jspa*
// @include https://*/**/secure/RapidBoard.jspa*
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant none
@pfrenssen
pfrenssen / gist:1b55da3cabcc877d2182
Created November 9, 2015 14:57
Deezer keyboard accessibility user style for Stylish
/* Allow to scroll the page with the keyboard. */
body {
overflow: scroll !important;
}
#page_content {
overflow-x: visible !important;
overflow-y: visible !important;
}
@pfrenssen
pfrenssen / README.md
Last active May 10, 2022 14:00
Git hook to check coding standards using PHP CodeSniffer before pushing

About

This is a git pre-push hook intended to help developers keep their PHP code base clean by performing a scan with PHP CodeSniffer whenever new code is pushed to the repository. When any coding standards violations are present the push is rejected, allowing the developer to fix the code before making it public.

To increase performance only the changed files are checked when new code is

#!/bin/bash -e
#
# Syncs a local Drupal dev site with the production server:
# - pulls latest code from the git repo on the server
# - downloads database from production and restores it locally
# - syncs the sites/default/files folder
#
# Required software packages: git, mysql, openssh, rsync, sudo
# Drush has to be installed on the server.
<?php
/**
* A Phing task to run Behat commands.
*/
require_once 'phing/Task.php';
/**
* A Behat task. Runs behavior-driven development tests against a codebase.
*
@pfrenssen
pfrenssen / removecommits.sh
Last active August 29, 2015 14:22
Script to remove a range of commits from all branches in a given remote
#!/bin/bash
#
# Removes a range of commits in all remote branches.
#
# Disclaimer: this will remove data on your remote repository. Use at your own
# risk.
# The commit that precedes the oldest commit that needs to be removed.
PRECEDING_COMMIT=ab6ce03927e46ba4fc71a0ccb7ed5d9854242c64