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
// [PackageDev] target_format: plist, ext: tmLanguage | |
{ "name": "Unittest Output", | |
"scopeName": "output.unittest", | |
"patterns": [ | |
{ "match": "FAIL: ([^ ]+) (.+)", | |
"name": "unittest.fail", | |
"captures": { | |
"1": { "name": "entity.name.function" }, | |
"2": { "name": "support.function" } | |
} |
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
Show hidden characters
// Assumes a virtualenv inside ~/.virtualenvs that has the same name as the project | |
// Assumes manage.py is inside src | |
{ | |
"working_dir": "${project_path}/src", | |
"shell_cmd": "~/.virtualenvs/${project_base_name}/bin/python manage.py test", | |
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", | |
"syntax": "Packages/User/Unittest Output.tmLanguage", | |
"quiet": "True", | |
"variants": [ |
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
# Script to aid on a "reverse translation": | |
# * FROM a portuguese codebase with no i18n | |
# * TO an english one with i18n | |
# | |
# Process: | |
# | |
# In the cenario wher your have all your code with portuguese strings and no i18n | |
# (Naturally that applies to other languages as well) | |
# | |
# 1. Mark all your translatable portuguese strings with gettext marks _(...) |
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
#!/bin/bash | |
# This hook is run after every virtualenv is activated. | |
# (~/.virtualenvs/postactivate) | |
DOT_PROJECT="${VIRTUAL_ENV}/.project" | |
if [ -f $DOT_PROJECT ]; then | |
PROJECT_DIR=`head -n 1 ${DOT_PROJECT} | tr -d '[[:space:]]'` | |
# GIT status | |
if [ -d "$PROJECT_DIR/.git" ]; then | |
git -C $PROJECT_DIR status -sb |
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
import getpass | |
from github import Github | |
def main(): | |
username = raw_input("User: ") | |
pw = getpass.getpass('Sua senha: ') | |
g = Github(username, pw) | |
me = g.get_user() |
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
# Sphinx version: 1.1.2 | |
# Python version: 2.6.5 | |
# Docutils version: 0.9 release | |
# Jinja2 version: 2.5.5 | |
Traceback (most recent call last): | |
File "/home/mazza/.buildout/eggs/Sphinx-1.1.2-py2.6.egg/sphinx/cmdline.py", line 189, in main | |
app.build(force_all, filenames) | |
File "/home/mazza/.buildout/eggs/Sphinx-1.1.2-py2.6.egg/sphinx/application.py", line 204, in build | |
self.builder.build_update() | |
File "/home/mazza/.buildout/eggs/Sphinx-1.1.2-py2.6.egg/sphinx/builders/__init__.py", line 196, in build_update |
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
# reverting accidental replace 'tab' -> ' ' in https://github.com/collective/collective.developermanual/commit/b59bd0 | |
import difflib | |
def agregar(lines): | |
diffs = [] | |
d = [] | |
for l in lines: | |
if l.startswith('diff --git'): | |
diffs.append(d) |
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
function short_pwd () { | |
pwd | sed -e "s@$HOME@~@" | |
} | |
function ps1_dir () { | |
dn=$(dirname `short_pwd`) | |
# in ~ yields "./" that becomes "" | |
# in / yields "//" that becomes "/" | |
echo "$dn/" | sed -e 's@^\./$@@' | sed -e 's@^//$@/@' | |
} |
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
# -*- coding: utf-8 -*- | |
#!/usr/bin/python | |
import unicodedata | |
# NO-BREAK SPACE: This is evil to Sphinx syntax highlight | |
print unicodedata.name(u" ") |
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
(defun sphinx-open-html-for-rst nil | |
"Opens the buit html for the current buffer rst file in the browser." | |
(interactive) | |
(browse-url-of-file | |
(replace-regexp-in-string | |
".rst$" ".html" | |
(replace-regexp-in-string "/source/" "/build/html/" (buffer-file-name))))) |
OlderNewer