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
| mysql -s -r -uadmin -p`cat /etc/psa/.psa.shadow` -e 'show databases' | while read db; do mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` $db -r ${db}.sql; [[ $? -eq 0 ]] && zip ${db}.zip ${db}.sql -r9; done |
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
| # classic connection | |
| mysql -uadmin -p`cat /etc/psa/.psa.shadow` | |
| # classic dump | |
| mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` viacombi_eu_forum > viacombi_eu_forum.sql |
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
| lftp ftp://user:password@domain.ltd -e "mirror -e -R /local/folder /remote/folder ; quit" |
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
| find . -name '*.DS_Store' -type f -delete |
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 num2alpha($n) { | |
| $r = ''; | |
| for ($i = 1; $n >= 0 && $i < 10; $i++) { | |
| $r = chr(0x41 + ($n % pow(26, $i) / pow(26, $i - 1))) . $r; | |
| $n -= pow(26, $i); | |
| } | |
| return $r; | |
| } |
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
| public function beforeRender() { | |
| // Enable HABTM validation | |
| $model = Inflector::singularize($this->name); | |
| foreach($this->{$model}->hasAndBelongsToMany as $k=>$v) { | |
| if(isset($this->{$model}->validationErrors[$k])) | |
| { | |
| $this->{$model}->{$k}->validationErrors[$k] = $this->{$model}->validationErrors[$k]; | |
| } | |
| } |
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 highlight($text, $words) { | |
| preg_match_all('~\w+~', $words, $m); | |
| if(!$m) | |
| return $text; | |
| $re = '~\\b(' . implode('|', $m[0]) . ')\\b~'; | |
| return preg_replace($re, '<b>$0</b>', $text); | |
| } | |
| $text = ' | |
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod |
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
| /** | |
| * Validation rules | |
| * | |
| * @var array | |
| */ | |
| public $validate = array( | |
| 'phone_number_1' => array( | |
| 'notEmpty' => array( | |
| 'rule' => array('notEmpty'), |
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
| convert source.pdf[0] output.jpeg |
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
| <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?language=fra&sensor=false"></script> | |
| <script type="text/javascript"> | |
| var map; | |
| var Markers = {}; | |
| var infowindow; | |
| var locations = [ | |
| [ | |
| 'Samsung Store Madeleine', | |
| '<strong>Samsung Store Madeleine</strong><p>5 Boulevard Malesherbes, 75008 Paris<br>10h – 20h</p>', | |
| 48.8701925, |
OlderNewer