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
UPDATE table SET column = REPLACE(REPLACE(column, '\r', ''), '\n', ''); |
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
Single records: | |
SELECT column, COUNT(*) AS c | |
FROM table | |
GROUP BY column | |
HAVING COUNT(c) > 1 | |
All records: | |
SELECT * |
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
/** | |
* Metoda konfiguruje formularz | |
*/ | |
public function configure() | |
{ | |
$this->widgetSchema['cities'] = new sfWidgetFormChoice(array( | |
'expanded' => true, | |
'multiple' => true, | |
'choices' => Doctrine_Core::getTable('hall')->getListNameForOpenHall(), | |
'renderer_options' => array('formatter' => array($this, 'formatter')) |
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 getFileExtension($file_name) | |
{ | |
return substr(strrchr($file_name, '.'), 1); | |
} |
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 foreach ($jobs as $i => $job): ?> | |
<tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>"> | |
<?php endforeach; ?> |
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 | |
/** | |
* Function creates url properly slug from $text | |
* | |
* @param string $text | |
*/ | |
public function slugify($text) | |
{ | |
// replace non letter or digits by - | |
$text = preg_replace('#[^\\pL\d]+#u', '-', $text); |
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 | |
class FlxZipArchive extends ZipArchive | |
{ | |
/** | |
* Add a Dir with Files and Subdirs to the archive | |
* | |
* @param string $location Real Location | |
* @param string $name Name in Archive |
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
<html> | |
<body> | |
<script type="text/javascript"> | |
var BrowserDetect = { | |
init: function () { | |
this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; | |
this.version = this.searchVersion(navigator.userAgent) | |
|| this.searchVersion(navigator.appVersion) | |
|| "an unknown version"; | |
this.OS = this.searchString(this.dataOS) || "an unknown OS"; |
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
var int = $(this).attr('id').match(/\d+/); |
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 | |
/** | |
* Function generates password depend on configuration sets | |
* | |
* @param int $length | |
* @param boolean $add_dashes | |
* @param string $available_sets | |
* @return string | |
*/ | |
public static function generateStrongPassword($length = 10, $add_dashes = false, $available_sets = 'luds') |
OlderNewer