Skip to content

Instantly share code, notes, and snippets.

@tommyvdv
tommyvdv / feature-ckeditor-no-dimension-styles-inline.patch
Last active August 29, 2015 14:12
Forkcms fix: Unminified version of image plugin. The backend ckeditor no longer suggests image width and height automatically when inserting an image. Additionally the inline-styles for the set width and height are replaced by element attributes.
From bcb9a6feb17294e86692a08afcaeaab50196efd3 Mon Sep 17 00:00:00 2001
From: Tommy Van de Velde <[email protected]>
Date: Fri, 23 Jan 2015 09:24:35 +0100
Subject: [PATCH] no more auto-sizes or inline styles upon inserting an image
in an editor
---
src/Backend/Core/Js/backend.js | 48 +-
.../Js/ckeditor/plugins/image/dialogs/image.js | 1424 +++++++++++++++++++-
2 files changed, 1456 insertions(+), 16 deletions(-)
# creates a new gitignore file that ignores everything except the gitignore file itself
add_gitignore()
{
directory=$1
if [[ "$directory" == "" ]]
then
directory="."
fi
@tommyvdv
tommyvdv / gist:d978d8a4f0fafd302e41
Created October 14, 2015 06:31
Calendar incrementing badge
$HOME/Library/Calendars/Calendar\ Cache is a sqlite3 embedded database.
1) Close your Apple iCal.
2) Open your Terminal or any shell application
3) Go to the above directory "$HOME/Library/Calendars"
4) Open the db using "sqlite3 Calendar\ Cache"
5) ".tables" will show you all the tables in this database
6) "select * from ZMESSAGE" will show you all the pending notifications
7) To remove all the pending notifications, use "delete from ZMESSAGE;"
8) to quit, type ".quit"
@tommyvdv
tommyvdv / git-tabs-in-indent-1.png
Last active February 22, 2016 08:17
Make tabs stand out in git.
git-tabs-in-indent-1.png
@tommyvdv
tommyvdv / after.png
Last active February 19, 2016 16:09
Making tabs stand out in Atom.
after.png
@tommyvdv
tommyvdv / rpi-resolution.md
Last active August 3, 2016 19:04
Raspberry Pi misc

resolution

from bleroy

tvservice -d edid
edidparser edid

example output: HDMI:EDID DMT mode (82) 1920x1080p @ 60 Hz with pixel clock 148 MHz

@tommyvdv
tommyvdv / useful-linux-commands.md
Last active June 26, 2018 10:36
useful linux commands

Far from a comprehensive list.

Switching back and forth between directories using cd -;

$ cd ~/Downloads
$ cd ~/Documents
$ cd -

Use cd to enter directory Downloads then Document and then return to directory Downloads.

@tommyvdv
tommyvdv / osx-port-80.txt
Last active March 6, 2019 10:32
osx port 80
Port 80 happens to close every reboot.
Opening it should work using these. It is however quite unclear why my setup closes it (and others don't.
$ cat /etc/pf.conf
# Allow access to port 80
pass in proto tcp from any to any port 80
$ sudo pfctl -F all
No ALTQ support in kernel
@tommyvdv
tommyvdv / bash-alias-docker-cleanup.sh
Created October 26, 2018 07:28
free up disk-space when done with docker
#!/bin/bash
alias dck="echo '-- docker cleanup: kill..' && docker ps -q | xargs docker kill"
alias dcrm="echo '-- docker cleanup: rm..' && docker ps -q | xargs docker rm"
alias dcrmi="echo '-- docker cleanup: rmi..' && docker images -q -f dangling=true | xargs docker rmi"
alias dcrmia="echo '-- docker cleanup: rmia..' && docker images -q | xargs docker rmi"
alias dockercleanup="echo '-- docker cleanup: all..' && dck; dcrm; dcrmi; dcrmia"
# usage, output:
# $ dockercleanup
# -- docker cleanup: all..
@tommyvdv
tommyvdv / sync.sh
Last active October 31, 2018 11:35
quick sync & reboot
#!/bin/bash
# usage:
# $ ./sync.sh /home/user/tmp/A /home/user/tmp/B /home/user/tmp/C /home/user/script.py
source="$1"
temp="$2"
destination="$3"
scriptpath="$4"
rsync -avr "${source}/" "${temp}/" > /dev/null
diff "${temp}" "${destination}" > /dev/null
exitcode="$?"