Skip to content

Instantly share code, notes, and snippets.

View andreaswachowski's full-sized avatar

Andreas Wachowski andreaswachowski

View GitHub Profile
@andreaswachowski
andreaswachowski / git_duplicate_commits.md
Last active September 22, 2021 15:52
How duplicate commits in Git happen

Before we start: Note the log-output is generated with the following alias:

l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ai)%Creset'

Start with a main branch

* f57c841 - (HEAD -> main) Second commit (2021-09-12 10:30:47 +0200)
@andreaswachowski
andreaswachowski / limits.cc
Last active August 29, 2015 14:07
Print numeric_limits/size_of for all fundamental types in C++
// Print limits and sizeof information for C++ internal types
//
// This is a nice example of variadic templates and recursion.
#include <limits>
#include <typeinfo>
#include <iostream>
#include <iomanip>
#include "type.h"
@andreaswachowski
andreaswachowski / dbext_vim.diff
Last active August 29, 2015 14:05
Patch to dbext.vim to re-introduce DB_checkModeline as implemented in dbext.vim v11
--- plugin/dbext.vim 2013-06-02 12:59:32.000000000 +0200
+++ plugin/dbext.vim 2014-08-28 16:09:12.451169153 +0200
@@ -449,6 +449,34 @@
endif
endif
"}}}
+function! s:DB_checkModeline()
+ " Users can preset connection string options using Vim's modeline
+ " features.
+ " For example, in a SQL file you could have the following: