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
class Circle | |
{ | |
public $radius; | |
public function __construct($radius): void | |
{ | |
$this->radius = $radius; | |
} | |
} |
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 | |
case "${1:-''}" in | |
'start') | |
if test -f /tmp/selenium.pid | |
then | |
echo "Selenium is already running." | |
else | |
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/selenium.pid |
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
all: | |
doctrine: | |
class: sfDoctrineDatabase | |
param: | |
dsn: 'mysql:host=HOST;dbname=DBNAME' | |
username: USERNAME | |
password: PASSWORD | |
profiler: true | |
logging: true |
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
<?php | |
/** | |
* 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() | |
{ |
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 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 = arr.map do |element| | |
Thread.new do | |
block.call(element) | |
end | |
end | |
threads.each { |th| th.join } | |
threads.map { |th| th.value} |
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 to define a class | |
// actual version is a rewrite by anieto2k: http://www.anieto2k.com | |
//params: | |
// @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'){ |