This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document domain('stackoverflow.com'), | |
domain('stackexchange.com'), | |
domain('superuser.com'), | |
domain('serverfault.com'), | |
domain('stackapps.com'), | |
domain('askubuntu.com'), | |
domain('mathoverflow.com'), | |
domain('answers.onstartups.com'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'rubygems' | |
gem "parallel" | |
require 'parallel' | |
gem "listen" | |
require 'listen' | |
listener = Listen.to('.') do |modified, added, removed| | |
$changetime = Time.now |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def swap(a, i, j) | |
t = a[i] | |
a[i] = a[j] | |
a[j] = t | |
end | |
def sort(a) | |
# Sort first two pairs | |
swap(a,0,1) if a[1] < a[0] | |
swap(a,2,3) if a[3] < a[2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace url(http://www.w3.org/1999/xhtml); | |
/* From https://gist.github.com/akerbos/152d7891d2b8b34edf3a */ | |
@-moz-document domain('stackoverflow.com'), | |
domain('stackexchange.com'), | |
domain('superuser.com'), | |
domain('serverfault.com'), | |
domain('stackapps.com'), | |
domain('askubuntu.com'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def swap(lst, i, j): | |
if min(i,j) >= 0 and max(i,j) < len(lst) and i != j: | |
lst[i], lst[j] = lst[j], lst[i] | |
lst.log() | |
# This is Dual-Pivot Quicksort by Yaroslavskiy et al. | |
# Implemented following Sebastian Wild as in | |
# https://www.uni-trier.de/fileadmin/fb4/prof/INF/TIN/Theorietag/TR.pdf | |
# page 39 | |
def dpquicksort(lst, left=0, right=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def swap(lst, i, j): | |
if min(i,j) >= 0 and max(i,j) < len(lst) and i != j: | |
lst[i], lst[j] = lst[j], lst[i] | |
lst.log() | |
# This is Dual-Pivot Quicksort by Yaroslavskiy et al. | |
# Implemented following Sebastian Wild as in | |
# https://www.uni-trier.de/fileadmin/fb4/prof/INF/TIN/Theorietag/TR.pdf | |
# page 39 | |
# Plus a bugfix: need to swap pivot candidates, otherwise swapping-in pivots in the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cf. http://askubuntu.com/a/863486/69674 | |
# Places to look for shortcuts in dconf-editor: | |
# - org.compiz.integrated | |
# - org.freedesktop.ibus.general.hotkey (?) | |
# - org.gnome.settings-daemon.plugins.media-keys | |
# - org.gnome.desktop.wm.keybindings | |
# - org.gnome.metacity.keybindings | |
shortcuts = { | |
# CTRL + ALT + Backspace |