Skip to content

Instantly share code, notes, and snippets.

@timfenney
timfenney / tiling.py
Last active March 29, 2019 20:16
A short tiling script. Goals include minimal dependencies and few LOC, as it is to run in qubes os dom0.
#!/usr/bin/python2.7
# tiling.py
# Simple tiling for GTK
#
# NB: most of this was cribbed from some poor dev who isn't going to get
# the credit until I find his blog post again. Hopefully will update with
# the source shortly :-|
#
# `tiling.py width height x y -d 1`
@timfenney
timfenney / lower_cyclomatic_complexity.rb
Last active March 21, 2019 04:51
Avoiding conditionals and early return in Ruby...
#!/usr/bin/env ruby
# This is a refactored example from the Travis CI Project. The file originally had several conditionals, as well as early
# returns (`exit` expressions, with exit statuses).
# (Original file: https://raw.githubusercontent.com/travis-ci/travis-api/master/bin/users)
# What follows is the code reworked for the removal of conditionals and early returns.
# You may be thinking, "But doesn't the program in the end have the same complexity?" And you'd be almost right, except for
# the fact that that early return elimination is an immediate win. However cyclomatic complexity is a problem for individual
eval((+![]+[][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]+(!![]+[])[+!+[]]+(![]+[])[+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[!+[]+!+[]+[+[]]]+[+!+[]]+[!
kodekata$ brew -v install povray
Homebrew 0.7.1
==> Build Environment
CC: /usr/bin/cc => /usr/bin/gcc-4.2
CXX: /usr/bin/c++ => /usr/bin/c++-4.2
LD: /usr/bin/cc => /usr/bin/gcc-4.2
CFLAGS: -O3 -w -pipe
CXXFLAGS: -O3 -w -pipe
MAKEFLAGS: -j8
==> Downloading http://www.povray.org/ftp/pub/povray/Official/Unix/povray-3.6.1.tar.bz2