Skip to content

Instantly share code, notes, and snippets.

View theclanks's full-sized avatar

Luis Carlos Otte Junior theclanks

View GitHub Profile
@theclanks
theclanks / Yii - Grid com datas Brasil
Created November 12, 2012 18:15
Método para converter find no formato Brasil
private function converteData($value)
{
if($value != "" && preg_match('/^(?:\s*(<>|<=|>=|<|>|=))?(.*)$/',$value,$matches))
return $matches[1] . date("Y-m-d",strtotime($matches[2]));
else
return $value;
}
@theclanks
theclanks / firefox_selenium2
Created August 10, 2012 20:03
Problema Firefox - x86_64 - Selenium Webdriver
sudo mv /usr/lib/libX11.so.6 /usr/lib/libX11.so.6.old
sudo ln -s /usr/lib64/libX11.so.6.3.0 /usr/lib/libX11.so.6
from selenium import webdriver
from selenium.webdriver.remote.remote_connection import RemoteConnection
from selenium.webdriver.remote.errorhandler import ErrorHandler
from selenium.webdriver.remote.command import Command
class PersistentWebdriver (webdriver.Remote):
def __init__(self, session_id=None, browser_name=''):
command_executor='http://localhost:4444/wd/hub'
@theclanks
theclanks / _etc_conf.d_Xvfb
Created July 15, 2012 03:05
Xvfb on Gentoo
XVFB=/usr/bin/Xvfb
XVFBARGS=":100 -screen 0 1600x1200x24 -auth /etc/conf.d/Xvfb.cfg -nolisten tcp"
PIDFILE=/var/run/Xvfb.pid
@theclanks
theclanks / gist:3054366
Created July 5, 2012 15:28 — forked from jollychang/gist:1048635
selenium and xvfb services @ gentoo
$ head -1000 /etc/conf.d/xvfb* /etc/init.d/{xvfb,selenium-daemon}
==> /etc/conf.d/xvfb <==
XVFB=/usr/bin/Xvfb
XVFBARGS=":90 -auth /etc/conf.d/xvfb.cfg -nolisten tcp"
PIDFILE=/var/run/xvfb.pid
==> /etc/conf.d/xvfb.cfg <==
localhost
==> /etc/init.d/xvfb <==