Skip to content

Instantly share code, notes, and snippets.


Rogier van den Berg rogiervandenberg

View GitHub Profile
rogiervandenberg /
Created Jan 2, 2021 — forked from bittercoder/
Convert .heic files to .jpg on linux (coming from an iOS11 device over USB)
# download release from github: and install at ~/tools/tifig
# then run these commands in the folder (just to keep things simple we normalize the file extension case before proceeding).
for f in *.HEIC; do mv "$f" "`echo $f | sed s/.HEIC/.heic/`"; done
for file in *.heic; do echo "~/tools/tifig -v -p $file ${file/%.heic/.jpg}"; done
rogiervandenberg / main.go
Created Oct 5, 2020
Basis Golang HTTP REST server - Best practices interpreted
View main.go
Based on the video's and blogposts of Mat Ryer (@matryer)..
.. I derived the following starting point for a GO HTTP REST server. It can be used to add all explained (see above) concepts.
You could spread the code below in separate files as follows:
rogiervandenberg /
Last active Jul 22, 2019
Start Docker based Rails 6 project with Docker, without installing Ruby and/or Rails

Create new Rails 6 project with Docker

If you want to set-up a new Rails (6) project, but you don't want to go through the hassle of setting op Ruby, node, Yarn, Rails itself, etc. you could do it with Docker.


Prerequisite: Have Docker installed

If not, install Docker first

Create the directory for your project

Open a terminal, create a project folder somewhere and go into that directory:

rogiervandenberg / cloudSettings
Last active Feb 18, 2022
Visual Studio Code Settings Sync Gist
View cloudSettings

Keybase proof

I hereby claim:

To claim this, I am signing this object:

rogiervandenberg /
Last active Jul 11, 2016
Setup Resque with Rails 4 on Heroku and locally

Setup Resque on Heroku for Rails 4

Resque depends on Redis, so first install Redis locally to be able to work on your project...

Install Redis locally on Mac

To install Redis locally, use the following approach on Mac OS X (using Homebrew). $ brew install redis

To test your install, firstly ensure that the Redis server is running. $ redis-server

rogiervandenberg / gmail_to_omnifocus.js
Last active Mar 23, 2016
Bookmarklet to make a link in Omnifocus to the current Gmail e-mail. The body of the mail is added as note, when hightlighting text in the e-mail only that part is added as note. There is always a link included to the original e-mail.
View gmail_to_omnifocus.js
javascript:(function(){var enc=encodeURIComponent,w=window,frames=w.frames,d=document,tn=w.getSelection?w.getSelection():(d.getSelection)?d.getSelection():(d.selection?d.selection.createRange().text:0),pu=w.location.href,\.google\.com/),tt=pt=d.title,subjSpans=d.getElementsByClassName("hP"),i,url;if(isGMail){if(subjSpans){tt=subjSpans[0].innerText}else{tt=d.title.substring(d.title.indexOf("-")+1,d.title.lastIndexOf("-")).replace(/^ +/,"").replace(/ +$/,"")};if(tn!="")tn+="\n\n";tn+="From email subject:("+tt+")\n"+pu;pu=""+enc(tt)+")"};url='omnifocus:///add?note='+enc(tn+"\n"+pu)+'&name='+enc(tt);w.location.href=url})();
View OneName
Verifying that +rogiervandenberg is my blockchain ID.
rogiervandenberg / getLocalTimeStamp.js
Created Nov 18, 2015
Returns a timestamp corrected for the current timezone, instead of getting the UTC timezone. This can be useful for tracking timed-events in the perception of a user/visitor of your application/website in e.g. Google Tag Manager.
View getLocalTimeStamp.js
function getLocalTimeStamp () {
var currentDate = new Date();
var currentTime = currentDate.getTime();
var localOffset = (-1) * currentDate.getTimezoneOffset() * 60000;
var stamp = Math.round(new Date(currentTime + localOffset).getTime() / 1000);
return stamp;
rogiervandenberg / FrontdoorSensorReedSensor.ino
Created Apr 21, 2015
Checks my front door status. Sends status over RF-communication.
View FrontdoorSensorReedSensor.ino
//To make more serial ports
#include <SoftwareSerial.h>
SoftwareSerial remoteSerial(2, 3); //Use pins 2 and 3 to connect the Serial connection
const int light = 13; //output and light
const int reedPin = 5; //read info from the Reed
int output = LOW;