Skip to content

Instantly share code, notes, and snippets.

👨‍👩‍👦‍👦 💻 🎸

Mark van Duijker mvanduijker

👨‍👩‍👦‍👦 💻 🎸
  • The Netherlands
View GitHub Profile
View gist:9bc56a9b13a07aa7f8c5
wget -E -H -k -K -p -e robots=off
mvanduijker / gist:4bd7b3a8d7956f01c8c0
Created Nov 6, 2015
Doctrine2 repository as a symfony2 service
View gist:4bd7b3a8d7956f01c8c0
class: Doctrine\ORM\EntityRepository
factory_service: doctrine.orm.default_entity_manager
factory_method: getRepository
- Acme\Entity\YourEntity
mvanduijker /
Created Jan 12, 2013
Simple script to export iTunes library to mp3. (use it for my car radio usb stick) You need faad and lame Tested on mac brew install faad2 lame
itunes_folder="/Users/MacBookPro/Music/iTunes/iTunes Media/Music"
if [ ! -d "$output_folder" ]; then
mkdir -p "$output_folder"
find "$itunes_folder" -type f | while read FILENAME;
file=$(basename "$FILENAME")
nativefier --name "WhatsApp" --width 700px --height 800px -o --counter --icon whatsapp.png ''
mvanduijker / HtmlMiniRenderer.rb
Created May 29, 2017
CommonMark Html Mini Renderer only renders subset of commonmark. Should be good for stuff like user comments where minimal markup is required / desired
View HtmlMiniRenderer.rb
# Proof of concept to use CommonMarker to only render a subset of CommanMark language
# Good if you only want links, em, strong, etc where minimal markup is desired.
# Example:"# Test"))
class HtmlMiniRenderer < CommonMarker::HtmlRenderer
mvanduijker / gist:d12383eaac6e1532f5844103c344407b
Created Aug 23, 2017
Create clip from video without re-encoding (fast!)
View gist:d12383eaac6e1532f5844103c344407b
ffmpeg -i in.mp4 -ss 00:10:00 -to 00:20:00 -c copy out.m4v
mvanduijker / gist:138ee8958f0e3c9627d93004731a7475
Created Aug 29, 2017
google page speed jpeg optimisation
View gist:138ee8958f0e3c9627d93004731a7475
# First stage: strip all comments, this will ALWAYS reduce size
jpegoptim --max=85 --strip-all --strip-com --strip-exif --strip-iptc --strip-icc $1
# Second stage: do an progressive scan apart which may produce bigger images in some scenarios
jpegoptim --all-progressive $1
mvanduijker / pagination.php
Created Dec 11, 2013
Standard pagination.php to create a override in your template for joomla 2.5 websites
View pagination.php
* Pagination template override
* Functions to override joomla standard behaviour
* From JPagination::_list_render
* @param $list
mvanduijker /
Last active Apr 30, 2021
Dollar averaging buy 10 bitcoin in euro with kraken api and it's cli
set -e
# Install kraken cli ( and put this script in same path
# Make sure the following tools are installed: bc, jq
# To make a daily trade add this script in your cron
# Use offical pair, check them with ./ AssetPairs | jq
mvanduijker /
Created Jan 10, 2022
bash script to buy crypto on bitvavo you can use for dca
#!/usr/bin/env bash
# Script to buy crypto through at market price, so you can automate for DCA (Dollar Cost Averaging)
# Request API KEY and API Secret in your bivavo account with trade permissions
# Pass in api key and secret as environment variables to the script
# Argument 1 is for quote amount (default: 10)
# Argument 2 is for market (default: BTC-EUR)
# Examples: