Skip to content

Instantly share code, notes, and snippets.

View protist's full-sized avatar

protist

View GitHub Profile
@protist
protist / kalu.conf
Created July 3, 2014 07:45
~/.config/kalu/kalu.conf
[options]
PacmanConf = /etc/pacman.conf
NotificationIcon = KALU
NotificationIconSize = 20
Interval = 60
Timeout = 4
AutoChecks = NEWS UPGRADES WATCHED AUR WATCHED_AUR
ManualChecks = NEWS UPGRADES WATCHED AUR WATCHED_AUR
CmdLineLink = xdg-open '$URL'
CheckPacmanConflict = 1
@protist
protist / bm: array[index] vs. enum.next
Created September 11, 2014 02:32
Benchmark to compare accessing sequential items in an array. Firstly, array is accessed via an incrementing index. Secondly, array is accessed after conversion into an enumerator.
#!/usr/bin/env ruby
require 'benchmark'
max = 1_000_000
a = (1..max).to_a
Benchmark.bmbm do |bm|
bm.report('array[index]') do # Over 20 times faster than using enum.next.
i = 0
while i < max
@protist
protist / bm: map.compact vs. inject vs. flat_map
Last active August 29, 2015 14:06
Benchmark to compare techniques for selecting and modifying items in an array, in a single block. Mapping + compact vs. inject.
#!/usr/bin/env ruby
require 'benchmark'
max = 10_000_000
Benchmark.bmbm do |bm|
bm.report('pipe') do
a = (1..max).to_a
a.map! do|i|
i + 10 if i.even?
@protist
protist / bm: sort_by vs. sort
Created September 12, 2014 06:14
Benchmark to compare sort_by and sort for an array that contains orderable values within hashes.
#!/usr/bin/env ruby
require 'benchmark'
max = 100_000
a = []
flip_flop = false
(1..max).each do |i|
if flip_flop
a.unshift({c:[i, i+1]})
@protist
protist / Awesome Widget custom command debug
Created May 17, 2015 12:12
DEBUG=yes plasmawindowed org.kde.plasma.awesomewidget 2>&1 | grep ExtScript
$ DEBUG=yes plasmawindowed org.kde.plasma.awesomewidget 2>&1 | grep ExtScript
[ExtScript::readConfiguration]
[ExtScript::setName]
[ExtScript::setName] : Name "Current temp.desktop"
[ExtScript::setComment]
[ExtScript::setComment] : Comment "Get current temperature"
[ExtScript::setApiVersion]
[ExtScript::setApiVersion] : Version 1
[ExtScript::setExecutable]
[ExtScript::setExecutable] : Executable "/home/protist/.local/share/awesomewidgets/scripts/my-script.sh"
@protist
protist / TB 38.0.1 Firetray debugging output
Created June 16, 2015 00:35
Debugging output for Thunderbird 38.0.1 with Firetray as per https://github.com/foudfou/FireTray/issues/152
$ thunderbird
(process:24265): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
[calBackendLoader] Using libical backend at /home/protist/.thunderbird/random.default/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/components/libical-manifest
enigmail.js: Registered components
8:57:25.711 DEBUG firetray.Logging initialized
8:57:25.718 DEBUG firetray.Handler _directory=/home/protist/.thunderbird/random.default/extensions/{9533f794-00b4-4354-aa15-c2bbda6989f8}
mimeVerify.jsm: module initialized
2015-06-16 08:57:33: stackwalker.cc:125: INFO: Couldn't load symbols for: /usr/lib/thunderbird/libxul.so|EA9EA3D45BAB83FE3FAC6A95D548E3C60
2015-06-16 08:57:33: basic_code_modules.cc:88: INFO: No module at 0x7ffc6d8ba4d0
@protist
protist / gist:e0499d05de047358feca
Created August 30, 2015 04:17
owncloud-client log
08-30 14:07:58:614 8203 OCC::ConnectionValidator::checkServerAndAuth: Checking server and authentication
08-30 14:07:58:617 8203 OCC::ConnectionValidator::checkServerAndAuth: Trying to look up system proxy
08-30 14:07:58:618 8229 OCC::SystemProxyRunnable::run: virtual void OCC::SystemProxyRunnable::run() Starting system proxy lookup
08-30 14:07:58:628 8203 OCC::ConnectionValidator::systemProxyLookupDone: void OCC::ConnectionValidator::systemProxyLookupDone(const QNetworkProxy&) Setting QNAM proxy to be system proxy "2://:0"
08-30 14:07:58:629 8203 OCC::AbstractNetworkJob::start: !!! OCC::CheckServerJob created for "https://foo.com/owncloud" + "status.php"
08-30 14:07:58:756 8203 OCC::AccountManager::wantsAccountSavedSlot: Saving account "https://foo.com/owncloud"
08-30 14:07:58:761 8203 OCC::AccountManager::save: Saving 2 unknown certs.
08-30 14:07:58:762 8203 OCC::AccountManager::save: Saving cookies.
08-30 14:07:58:766 8203 OCC::CookieJar::save: "/home/protist/.local/share/data//ownCloud//cookies.db"
08-3
@protist
protist / owncloud.log
Created March 31, 2016 23:02
Owncloud client error log
04-01 09:59:48:161 2409 OCC::ConnectionValidator::checkServerAndAuth: Checking server and authentication
04-01 09:59:48:168 2409 OCC::ConnectionValidator::checkServerAndAuth: Trying to look up system proxy
04-01 09:59:48:170 2409 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "protist@foo.dynu.com"
04-01 09:59:48:171 2409 OCC::AccountState::checkConnectivity: ConnectionValidator already running, ignoring "protist@foo.dynu.com"
04-01 09:59:48:169 2449 OCC::SystemProxyRunnable::run: virtual void OCC::SystemProxyRunnable::run() Starting system proxy lookup
04-01 09:59:48:171 2409 OCC::ConnectionValidator::systemProxyLookupDone: No system proxy set by OS
04-01 09:59:48:171 2409 OCC::AbstractNetworkJob::start: !!! OCC::CheckServerJob created for "https://foo.dynu.com/owncloud" + "status.php" "OCC::ConnectionValidator"
04-01 09:59:48:281 2409 OCC::AccountManager::wantsAccountSavedSlot: Saving account "https://foo.dynu.com/owncloud"
04-01 09:59:48:281 2409 OCC::AccountManager::sa
@protist
protist / awesome-widgets.log
Created April 6, 2016 00:59
awesome-widgets 3.1.0 make failure
$ make
Scanning dependencies of target awesomewidgets_automoc
[ 1%] Automatic moc for target awesomewidgets
Generating moc_qreplytimeout.cpp
Generating moc_abstractextitem.cpp
Generating moc_abstractextitemaggregator.cpp
Generating moc_extquotes.cpp
Generating moc_extscript.cpp
Generating moc_extupgrade.cpp
Generating moc_extweather.cpp
@protist
protist / gist:b8f758dad19c859dce2ec76408f0b443
Created November 4, 2016 04:40
makepkg for vdirsyncer 0.14.0-1
==> Starting check()...
if [ "false" = "true" ]; then \
coverage run --source=vdirsyncer/ --module pytest; \
else \
py.test; \
fi; \
STATUS="$?"; \
set -e; \
[ "false" != "true" ] || codecov; \
[ "false" != "true" ] || scripts/upload-hypothesis-db.sh; \