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 ReconnectingPDO | |
{ | |
protected $dsn, $username, $password, $pdo, $driver_options; | |
public function __construct($dsn, $username = "", $password = "", $driver_options = array()) | |
{ | |
$this->dsn = $dsn; | |
$this->username = $username; | |
$this->password = $password; |
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
- name: remount root with acl | |
when: item.mount == "/" and not item.options|search("acl") | |
mount: | |
name=/ | |
fstype=ext4 | |
opts=acl,rw,errors=remount-ro | |
src=item.device | |
state=mounted | |
with_items: ansible_mounts |
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
(defn describe-previous-role | |
[{[_ {role :role}] :employment}] | |
role) | |
(describe-previous-role {:name "john" | |
:employment [{:company "Example" | |
:role "Engineer"}, | |
{:company "Example" | |
:role "Engineering Intern"}]}) |
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
def provision | |
resource.catalog.resource('chroot', resource[:chroot].title).provider.source_exec(puppet_apply_cmd) | |
end |
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
SELECT * FROM `table_name` | |
ORDER BY ( CASE | |
WHEN order_column = 2 THEN 0 | |
WHEN order_column = 1 THEN 1 | |
WHEN order_column = 3 THEN 2 | |
END ) |
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 getHtmlFromDomElement($element) { | |
$doc = new DOMDocument(); | |
foreach($element->childNodes as $child) | |
{ | |
$doc->appendChild($doc->importNode($child, true)); | |
} | |
return $doc->saveHTML(); | |
} |
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
<taskdef name=”ExportProperties” classname=”Path.To.Phing.Task.ExportProperties” /> | |
<ExportProperties targetFile=”phing.properties” /> |
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 | |
require_once "phing/Task.php"; | |
/** | |
* Saves currently defined properties into a specified file | |
* | |
* @author Andrei Serdeliuc | |
* @extends Task | |
*/ |
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
def provision | |
resource.catalog.resource('chroot', resource[:chroot].title).provider.source_exec(puppet_apply_cmd) | |
end |
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
provision {'worker': | |
provider => 'puppet', | |
provision => 'worker.pp' | |
require => Chroot['worker'], | |
chroot => Chroot['worker'] | |
} |
NewerOlder