Skip to content

Instantly share code, notes, and snippets.

nickkraakman / exponential-backoff.php
Last active May 13, 2019
API call with max number of retries and exponential backoff in PHP
View exponential-backoff.php
$retries = 0; // Init the retries variable
$maxRetries = 5; // Means we try max 6 times
$retry = false; // Should we retry or not?
$initialWait = 1.0; // Initial wait time in seconds
try {
do {
// If it is not the first try, calculate exponential backoff and wait
nickkraakman / functions.php
Last active May 3, 2018
Subscribe to- or remove users from MailPoet lists using the MailPoet API
View functions.php
// Subscribe to or remove from MailPoet
// Add this at the bottom of your WordPress theme's functions.php file
// POST to
function subscribe_to_mailpoet() {
$api_key = "XXXXXXXXXX"; // Basic API key authentication, send over SSL
if ( !empty($_POST['key']) && $_POST['key'] == $api_key ) {
$subscriber_data = array(
nickkraakman /
Last active Mar 8, 2021
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
nickkraakman / iEDGAR
Created Nov 12, 2014
Get XML response of SEC EDGAR filing URLs using the iEDGAR API
function getURLs($ticker){
$content = file_get_content("".$ticker."&output=xml");
$xml = simplexml_load_string($content);
echo "<pre>"; print_r($xml); echo "</pre>";