Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am noisebleed on github.
  • I am noiselabs (https://keybase.io/noiselabs) on keybase.
  • I have a public key ASBKwekwhwRMvNONRMd2CQ50n58V2BzpoJt1EMCStORI7Ao

To claim this, I am signing this object:

@vitorbrandao
vitorbrandao / phpunit.xml
Created February 16, 2016 10:15
PHPUnit config for a ZF2 app.
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors = "true"
convertErrorsToExceptions = "true"
convertNoticesToExceptions = "true"
convertWarningsToExceptions = "true"
processIsolation = "false"
stopOnFailure = "true"
syntaxCheck = "true"
bootstrap = "vendor/autoload.php">
@vitorbrandao
vitorbrandao / ghost-upgrade.py
Created December 11, 2014 14:10
Ghost upgrade script (Python)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Vítor Brandão <vitor@noiselabs.org>
import subprocess
from contextlib import closing
import glob
import os
import requests
@vitorbrandao
vitorbrandao / python-exec2.original.py
Created November 21, 2014 10:39
/usr/lib64/python-exec/python-exec2
#!/usr/lib/python-exec/python-exec2-c
# vim:fileencoding=utf-8:ft=python
# (c) 2012 Michał Górny
# Released under the terms of the 2-clause BSD license.
#
# This is not the script you are looking for. This is just a wrapper.
# The actual scripts of this application were installed with -python*,
# -pypy* or -jython* suffixes. You are most likely looking for one
# of those.
@vitorbrandao
vitorbrandao / python-exec
Created November 21, 2014 10:35
/usr/lib64/python-exec/python-exec2 (broken)
#!/usr/bin/python2.7
# EASY-INSTALL-ENTRY-SCRIPT: 'Sphinx==1.1.3','console_scripts','sphinx-autogen'
__requires__ = 'Sphinx==1.1.3'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('Sphinx==1.1.3', 'console_scripts', 'sphinx-autogen')()
)
@vitorbrandao
vitorbrandao / python-exec2.broken.py
Last active August 29, 2015 14:10
/usr/lib64/python-exec/python-exec2 (broken)
#!/usr/bin/python2.7
# EASY-INSTALL-ENTRY-SCRIPT: 'Sphinx==1.1.3','console_scripts','sphinx-autogen'
__requires__ = 'Sphinx==1.1.3'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('Sphinx==1.1.3', 'console_scripts', 'sphinx-autogen')()
)

Keybase proof

I hereby claim:

  • I am noisebleed on github.
  • I am noiselabs (https://keybase.io/noiselabs) on keybase.
  • I have a public key whose fingerprint is 3AAB E94B 277F 7D44 29AB 4318 9944 5351 2250 E987

To claim this, I am signing this object:

@vitorbrandao
vitorbrandao / GlobalVariablesContainer.php
Created March 14, 2014 13:18
SmartyBundle - Assign variables to every template
<?php
namespace Vendorx;
class GlobalVariablesContainer
{
protected $vars;
public function __construct($three = 3)
{
@vitorbrandao
vitorbrandao / gist:5323678
Created April 6, 2013 00:25
PPI app/console
$ ./app/console
PPI version 2.1.0-DEV - development/debug
Usage:
[options] command [arguments]
Options:
--help -h Display this help message.
--quiet -q Do not output any message.
--verbose -v Increase verbosity of messages.
@vitorbrandao
vitorbrandao / overlay.py
Created July 28, 2012 21:04
Portage API - Return all packages available in given Overlay [Gentoo Linux]
import portage
from gentoolkit.package import Package
def get_all_packages(overlay_path):
"""Returns all packages from a given overlay path.
"""
packages = {}
porttree = portage.db[portage.root]['porttree']
vartree = portage.db[portage.root]['vartree']