Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
👨‍👩‍👦‍👦 💻 🎸

Mark van Duijker mvanduijker

👀
👨‍👩‍👦‍👦 💻 🎸
  • The Netherlands
View GitHub Profile
@mvanduijker
mvanduijker / bitvavo_dca.sh
Created Jan 10, 2022
bash script to buy crypto on bitvavo you can use for dca
View bitvavo_dca.sh
#!/usr/bin/env bash
# Script to buy crypto through https://www.bitvavo.com 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:
#
@mvanduijker
mvanduijker / daily-trade.sh
Last active Apr 30, 2021
Dollar averaging buy 10 bitcoin in euro with kraken api and it's cli
View daily-trade.sh
#!/bin/bash
set -e
# Install kraken cli (https://support.kraken.com/hc/en-us/articles/360025180232-Kraken-REST-API-command-line-client) 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 ./krakenapi.py AssetPairs | jq
PAIR=XXBTZEUR
@mvanduijker
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
<?php
/**
* Pagination template override
* Functions to override joomla standard behaviour
*/
/**
* From JPagination::_list_render
*
* @param $list
@mvanduijker
mvanduijker / gist:138ee8958f0e3c9627d93004731a7475
Created Aug 29, 2017
google page speed jpeg optimisation
View gist:138ee8958f0e3c9627d93004731a7475
#!/bin/bash
# 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
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
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: HtmlMiniRenderer.new.render(CommonMarker.render_doc("# Test"))
class HtmlMiniRenderer < CommonMarker::HtmlRenderer
[
:header,
:list,
:list_item,
:blockquote,
:hrule,
View create_whatsapp_app.sh
#!/bin/sh
wget https://raw.githubusercontent.com/jiahaog/nativefier-icons/master/assets/whatsapp/whatsapp.png
nativefier --name "WhatsApp" --width 700px --height 800px -o --counter --icon whatsapp.png 'https://web.whatsapp.com'
@mvanduijker
mvanduijker / export_itunes_library.sh
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
View export_itunes_library.sh
#!/bin/bash
itunes_folder="/Users/MacBookPro/Music/iTunes/iTunes Media/Music"
output_folder="/Users/MacBookPro/MP3s"
if [ ! -d "$output_folder" ]; then
mkdir -p "$output_folder"
fi
find "$itunes_folder" -type f | while read FILENAME;
do
file=$(basename "$FILENAME")
@mvanduijker
mvanduijker / gist:4bd7b3a8d7956f01c8c0
Created Nov 6, 2015
Doctrine2 repository as a symfony2 service
View gist:4bd7b3a8d7956f01c8c0
services:
orm_repository.your_entity:
class: Doctrine\ORM\EntityRepository
factory_service: doctrine.orm.default_entity_manager
factory_method: getRepository
arguments:
- Acme\Entity\YourEntity
View gist:9bc56a9b13a07aa7f8c5
wget -E -H -k -K -p -e robots=off http://example.com