Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am orangetux on github.
  • I am orangetux (https://keybase.io/orangetux) on keybase.
  • I have a public key whose fingerprint is DEB7 F7A9 6D32 0E76 7D4C EF19 EAED D830 D7B9 116B

To claim this, I am signing this object:

# docker-compose.yml
app:
build: app/
webserver:
image: nginx
links:
- app:app
# dev.yml
@OrangeTux
OrangeTux / gist:d24b0ca0cd33fe6a52c2
Created June 4, 2015 09:56
Decorator which executes callback if wrapped Fabric task fails.
def on_fail(func):
""" Return decorator which executes callback if wrapped tasks failes.
Usage:
def log_failure():
print('Some failure.')
@task
@on_fail(log_failure):
def git_fetch():

Keybase proof

I hereby claim:

  • I am orangetux on github.
  • I am orangetux (https://keybase.io/orangetux) on keybase.
  • I have a public key whose fingerprint is CC0D F424 ECB6 C985 2EA0 9A14 F5FA 76D1 CCBC 6F0B

To claim this, I am signing this object:

@OrangeTux
OrangeTux / n
Created January 19, 2015 11:52
Notification function. Add it to your .zshrc.
# Send notification when command has finished.
# Usage:
# n <command>
#
# Lets say you want to build something that takes a certain time:
# n make
n() {
"$@"
RETVAL=$?
URGENCY="normal"
class MySocket(socket):
def close(self):
""" Closes socket and pushes the destroy button. """
super(MySocket, self).close()
del self
@OrangeTux
OrangeTux / edit_brightness
Created November 17, 2014 21:10
Increase or decrease brightness of screen.
#!/usr/bin/env bash
#
# Increase or decrease brightness of screen.
#
# Example usage:
#
# $ edit_brightness -50
# $ edit_brightness 10
#
# Make sure /sys/class/backlight/radeaon_b10/brightness is writable. This can
@OrangeTux
OrangeTux / gist:b4bdfbc46c921c8d5408
Created October 20, 2014 10:20
$ activator test
$ activator test
[info] Loading project definition from /home/auke/projects/virtualtherapist-web/project
[info] Set current project to virtualcoach-web (in build file:/home/auke/projects/virtualtherapist-web/)
[ERROR] [10/20/2014 12:16:11.216] [sbt-web-akka.actor.default-dispatcher-2] [akka://sbt-web/user/$a/process] null
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:164)
at akka.actor.ActorCell.create(ActorCell.scala:596)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:456)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:478)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:263)
@OrangeTux
OrangeTux / gist:f8c41a12f07b1c04afc7
Created July 25, 2014 12:40
Some pseude test code.
# my_app.py
from math import power
def some_fun(i):
if power(i) > 10:
return True
return False
# test_my_app.py
@OrangeTux
OrangeTux / conftest.py
Created January 9, 2014 10:57
Regenerate database with Py.test.
#conftest.py
import pytest
@pytest.fixture
def db():
test_db.create_all()
return test_db