Skip to content

Instantly share code, notes, and snippets.

View arlimus's full-sized avatar

Dominik Richter arlimus

View GitHub Profile
@arlimus
arlimus / compare_versions1.rb
Last active August 29, 2015 13:59
Compare package versions. Correctly handles numbers and letters.
# usage: provide a list (Array) of package objects
# package.version must contain the version string, e.g. "1.0.0e-1ubuntu3.4"
# Method 1: simple
# blow up all numbers
def sort_packages list
list.map do |x|
[ x, x.version.gsub(/[0-9]+/){|z| "%010x" % z} ]
end.
sort{|x,y| x[1] <=> y[1]}.
@arlimus
arlimus / essential vim
Last active November 17, 2017 16:23
vim.essential.md
Personal most used commands in vim (VSCode, Atom, ... any editor really)
# motion.txt
y c d ... yank / change / delete
v V ... visual mode character-wise/Line-wise
< > ... indent and outdent
/ ? ... search forward or backwards,
eg "/word" => go to "word"
@arlimus
arlimus / Christmas songs
Last active December 24, 2022 09:07
Guess the song (German and English)
⏪🎄
🤫🌃👼🌃
0🎄
🔴👃🏽🦌
❄⚪👗
🤫🌨
0😀
🧒🏽🧒🏻🏃🏽‍♂️
🚗🏡4🎄
🛎🔔🛎🛎