Skip to content

Instantly share code, notes, and snippets.

Nick nickkraakman

Block or report user

Report or block nickkraakman

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
@nickkraakman
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
<?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
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 https://headjack.io/wp-admin/admin-post.php?action=subscribe_to_mailpoet
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
nickkraakman / ffmpeg-cheatsheet.md
Last active Oct 15, 2019
FFmpeg cheat sheet for 360 video
View ffmpeg-cheatsheet.md

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
nickkraakman / iEDGAR
Created Nov 12, 2014
Get XML response of SEC EDGAR filing URLs using the iEDGAR API
View iEDGAR
<?php
function getURLs($ticker){
$content = file_get_content("https://www.valuespreadsheet.com/iedgar/results.php?stock=".$ticker."&output=xml");
$xml = simplexml_load_string($content);
echo "<pre>"; print_r($xml); echo "</pre>";
}
You can’t perform that action at this time.