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
| test: | |
| doctrine: | |
| param: | |
| dsn: 'sqlite::memory:' | |
| # dsn: 'mysql:host=localhost;dbname=clipkit_dev' | |
| # dsn: 'sqlite:%SF_DATA_DIR%/test-doctrine.db' | |
| statistic: | |
| param: | |
| dsn: 'sqlite::memory:' | |
| tracking: |
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
| function CallAPI($method, $url, $data = false) | |
| { | |
| $curl = curl_init(); | |
| switch ($method) | |
| { | |
| case "POST": | |
| curl_setopt($curl, CURLOPT_POST, 1); | |
| if ($data) |
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
| $this->widgetSchema['membership_start'] = new sfWidgetFormFilterDate( | |
| array( | |
| 'from_date' => new sfWidgetFormJQueryDate(array( | |
| 'config' => '{}', | |
| 'culture' => 'es', | |
| 'config' => "{firstDay: 1, dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'], | |
| monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']}", | |
| 'date_widget' => new sfWidgetFormDate(array('format' => '%day%-%month%-%year%')) | |
| )), | |
| 'to_date' => new sfWidgetFormJQueryDate(array( |
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
| document.addEventListener("DOMContentLoaded", function() { | |
| var elements = document.getElementsByTagName("INPUT"); | |
| for (var i = 0; i < elements.length; i++) { | |
| elements[i].oninvalid = function(e) { | |
| e.target.setCustomValidity(""); | |
| if (!e.target.validity.valid) { | |
| e.target.setCustomValidity("This field cannot be left blank"); | |
| } | |
| }; | |
| elements[i].oninput = function(e) { |
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
| // Function to remove folders and files | |
| function rrmdir($dir) { | |
| if (is_dir($dir)) { | |
| $files = scandir($dir); | |
| foreach ($files as $file) | |
| if ($file != "." && $file != "..") rrmdir("$dir/$file"); | |
| rmdir($dir); | |
| } | |
| else if (file_exists($dir)) unlink($dir); | |
| } |
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
| function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality = 80) | |
| { | |
| $imgsize = getimagesize($source_file); | |
| $width = $imgsize[0]; | |
| $height = $imgsize[1]; | |
| $mime = $imgsize['mime']; | |
| switch($mime){ | |
| case 'image/gif': | |
| $image_create = "imagecreatefromgif"; |
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
| //Add false as second parameter | |
| $adapter = new DoctrineORMAdapter($queryBuilder, false); |
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 | |
| telegram=(xxxxx, yyyyyy) | |
| if ! pidof apache2 > /dev/null | |
| then | |
| # web server down, restart the server | |
| echo "Server down" | |
| /etc/init.d/apache2 restart > /dev/null | |
| sleep 10 |
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
| $response = [ | |
| [ | |
| 'position'=> 1, | |
| 'name' => 'Test', | |
| ], | |
| [ | |
| 'position'=> 2, | |
| 'name' => 'Test2', | |
| ], | |
| ] |
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
| relative_urls: false, | |
| remove_script_host: true, |