Skip to content

Instantly share code, notes, and snippets.

//function to define a class
// actual version is a rewrite by anieto2k:
// @current : Object with the methods and attributes of the class
// @previous : Class from witch we wante to extend (optional)
JotaClass = function(current,previous){
previous = typeof previous == 'undefined' ? {} : previous.prototype;
for(p in previous){
if(typeof current[p] == 'undefined') current[p] = previous[p];
else if(typeof previous[p] == 'function'){
#function that takes an array and a block and aplies the block to each element in a thread returning the results in a array
#it is in fact a parallel map
def parmap(arr,&block)
threads = do |element| do
threads.each { |th| th.join } { |th| th.value}
* For now only works with Text filters and only for sfFormFilterDoctrine
* The problem of not escaping quotes was found with mysql
* Since the task doctrine:build-filters generates all formfilters extended from BaseFormFilterDoctrine we rewtirte there the addTextQuery method
abstract class BaseFormFilterDoctrine extends sfFormFilterDoctrine
public function setup()
jdeveloper / databases.yml
Created April 14, 2011 08:08
Configur sql logging in symfony with doctrine
class: sfDoctrineDatabase
dsn: 'mysql:host=HOST;dbname=DBNAME'
username: USERNAME
password: PASSWORD
profiler: true
logging: true
jdeveloper /
Created June 1, 2016 10:32
bash script to start selenium
case "${1:-''}" in
if test -f /tmp/
echo "Selenium is already running."
export DISPLAY=localhost:99.0
java -jar /usr/lib/selenium/selenium-server-standalone.jar -port 4444 -trustAllSSLCertificates > /var/log/selenium/output.log 2> /var/log/selenium/error.log & echo $! > /tmp/
class Circle
public $radius;
public function __construct($radius): void
$this->radius = $radius;