Skip to content

Instantly share code, notes, and snippets.


Berik Visschers berikv

View GitHub Profile
berikv /
Created Jul 25, 2019
Raspberry pi ssh headless setup
berikv / install_relative_commit
Created Jul 12, 2019
Installs HEAD^ as the default relative commit for arc
View install_relative_commit
# See:
for dir in "$REPOSITORY_DIR"/*/.git/arc/
echo "HEAD^" > "$dir/default-relative-commit"
berikv / tictactoe.swift
Last active Sep 13, 2020
A TicTacToe game written with SwiftUI, works in Xcode 11.0 beta Playground
View tictactoe.swift
import PlaygroundSupport
import SwiftUI
// MARK: - Game
extension TicTacToe.Board {
var hasNonEmptyCells: Bool {
self.flatMap { $0 }
.contains(where: { $0 != .empty })
berikv / .lldbinit
Created May 29, 2019
LLDB print description for object at memory location
View .lldbinit
expr -l objc++ -O -- (id)0x12345678
// Replace 0x12345678 with the memory location of the object

Add this to your ~/.vimrc:

" Add reviewers as a dictionary
set dictionary=~/.reviewers

" Use dictionary in completion suggestions
set complete+=k
berikv /
Created Jan 7, 2019
RaspberryPI Media server

Add the dev2day repository to your package source list

wget -O - | sudo apt-key add -

Add dev2day’s repository to the package source list

echo "deb jessie main" | sudo tee /etc/apt/sources.list.d/pms.list

Update the package list

sudo apt-get update

Download plex

berikv /
Last active Nov 10, 2018
Exit current program

Mac-os app





ctrl-a ctrl-d (detach)
ctrl-a ctrl-\ (kill)

SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
echo "Add $HOMEBREW_PATH/bin to PATH"
echo "Add $HOMEBREW_PATH/opt/binutils/bin to PATH"
export PATH=$HOMEBREW_PATH/opt/binutils/bin:$PATH
export LDFLAGS=-L$HOMEBREW_PATH/opt/binutils/lib
export CPPFLAGS=-I$HOMEBREW_PATH/opt/binutils/include
berikv / dev_env
Last active May 1, 2019
Setup headless raspberry pi from scratch
View dev_env
1) `sudo apt-get install git-core`
Setup git remote
2) `scp -r <your project> <your username>@<ip of raspberry pi>:`
3) `ssh <your username>@<ip of raspberry pi>:`
4) `cd <your project>`
5) `git config --bool core.bare true`
6) Go back to your local machine (Ctrl-D)
berikv /
Last active Jul 12, 2019
Some convenient and readable git aliases
# Paste these lines into your ~/.bashrc or other shell initialisation script
# Note that for most of these, your gitconfig has to have the aliasses from the .gitconfig in this gist
alias co='git checkout'
alias st='git status'
alias add='git add'
alias commit='git commit'
# Amend anything that is staged