Skip to content

Instantly share code, notes, and snippets.

View mvanduijker's full-sized avatar
👀
👨‍👩‍👦‍👦 💻 🎸

Mark van Duijker mvanduijker

👀
👨‍👩‍👦‍👦 💻 🎸
  • The Netherlands
View GitHub Profile
@mvanduijker
mvanduijker / daily-trade.sh
Last active April 15, 2023 19:27
Dollar averaging buy 10 euro of bitcoin with kraken api and it's cli
#!/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 / bitvavo_dca.sh
Created January 10, 2022 14:20
bash script to buy crypto on bitvavo you can use for dca
#!/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 / pagination.php
Created December 11, 2013 16:10
Standard pagination.php to create a override in your template for joomla 2.5 websites
<?php
/**
* Pagination template override
* Functions to override joomla standard behaviour
*/
/**
* From JPagination::_list_render
*
* @param $list
@mvanduijker
mvanduijker / gist:138ee8958f0e3c9627d93004731a7475
Created August 29, 2017 12:08
google page speed jpeg optimisation
#!/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 August 23, 2017 19:21
Create clip from video without re-encoding (fast!)
ffmpeg -i in.mp4 -ss 00:10:00 -to 00:20:00 -c copy out.m4v
@mvanduijker
mvanduijker / HtmlMiniRenderer.rb
Created May 29, 2017 17:32
CommonMark Html Mini Renderer only renders subset of commonmark. Should be good for stuff like user comments where minimal markup is required / desired
# 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,
@mvanduijker
mvanduijker / create_whatsapp_app.sh
Created February 8, 2016 19:10
WhatsApp Mac OSX app
#!/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 January 12, 2013 12:27
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
#!/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 November 6, 2015 08:20
Doctrine2 repository as a symfony2 service
services:
orm_repository.your_entity:
class: Doctrine\ORM\EntityRepository
factory_service: doctrine.orm.default_entity_manager
factory_method: getRepository
arguments:
- Acme\Entity\YourEntity
@mvanduijker
mvanduijker / gist:9bc56a9b13a07aa7f8c5
Created June 13, 2014 18:59
Mirror website with wget
wget -E -H -k -K -p -e robots=off http://example.com