This file contains hidden or 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
require 'formula' | |
class Php <Formula | |
url 'http://www.php.net/get/php-5.3.4.tar.bz2/from/br2.php.net/mirror' | |
homepage 'http://php.net' | |
version '5.3.4' | |
md5 '2c069d8f690933e3bf6a8741ed818150' | |
depends_on 'jpeg' | |
depends_on 'libpng' |
This file contains hidden or 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
String.prototype.escapeToRegex = function (){ | |
var parts = []; | |
for (x=0;x<this.length;x++){parts.push("["+this[x]+"]");} | |
return parts.join(""); | |
} | |
String.prototype.escapeToRegexNegative = function (){ | |
var last = "", parts = []; | |
for (x=0;x<this.length;x++){ | |
parts.push(last.escapeToRegex() + "[^"+this[x]+"]"); | |
last += this[x]; |
This file contains hidden or 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
class SeleniumBrowser(object): | |
def __init__(self): | |
self.driver = WebDriver() | |
def _extract_error(self, exception): | |
regex = re.compile(ur'URL = (?P<url>\S+) Response_Code = (?P<status>\d+) Error_Message = (?P<message>.*)') | |
found = regex.search(unicode(exception)) | |
if found: | |
return found.groupdict() |
This file contains hidden or 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 -*- | |
# <bash_profile - for mac> | |
# Copyright (C) <2011> Gabriel Falcão <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the |
This file contains hidden or 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
/*var now = new Date(); | |
var horas = now.getHours() | |
var minutos = now.getMinutes() | |
var agora = horas+":"+minutos; | |
*/ | |
$("div.programa span.hora:visible:contains('07:21')").parents("div.programa").find("span.abrir").click() |
This file contains hidden or 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
""" | |
lockfile.py - Platform-independent advisory file locks. | |
Requires Python 2.5 unless you apply 2.4.diff | |
Locking is done on a per-thread basis instead of a per-process basis. | |
Usage: | |
>>> lock = LockFile('somefile') | |
>>> try: |
This file contains hidden or 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
# #!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Copyright (C) <2011> Gabriel Falcão <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without | |
# restriction, including without limitation the rights to use, | |
# copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# This snippet parses a css file thru csstyle module, finds the | |
# external links, download them, save locally, fixes the css | |
# file to point to new paths and also prettifies the css | |
# | |
# example of usage: | |
# find . -iname '*.css' | cut -d: -f1 | uniq | egrep -v '[.]html' | xargs turn-css-file-links-into-locals.py 2>&1 >> css-hacks.log | |
# |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
import time | |
import urlparse | |
from lettuce import before, after, world | |
from splinter.browser import Browser | |
from django.conf import settings |
This file contains hidden or 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. | |
get_path_for() { | |
echo $HOME/$1/`echo $VIRTUAL_ENV | sed 's,.*/,,g'` | |
} | |
destination_path=`get_path_for Projetos` | |
if [ -e $destination_path ]; then | |
pushd $destination_path; | |
fi; |