Skip to content

Instantly share code, notes, and snippets.

@eMerzh
eMerzh / style.css
Created March 16, 2013 11:12
tt-rss custom style adaptations to have more contrasts
.Selected .cdmHeader {
background-color: #91C3EE;
font-weight: bold;
}
div.cdmFeedTitle > div:first-child {
float: left !important;
margin-right: 5px;
}
define postgresql::db ($name, $ensure=present){
case $ensure {
present: {
exec { "Create $name postgres db":
command => "createdb $name",
unless => "test \$(psql -tA -c \"SELECT count(*)=1 FROM pg_catalog.pg_database where datname='${name}';\") = t",
}
}
absent: {
exec { "Remove $name postgres db":
@eMerzh
eMerzh / mdb2_schema.patch
Created October 25, 2012 22:34
Patch For MDB2 schema migration with PG
diff --git a/3rdparty/MDB2/Driver/Manager/pgsql.php b/3rdparty/MDB2/Driver/Manager/pgsql.php
index f2c2137..3e70f3a 100644
--- a/3rdparty/MDB2/Driver/Manager/pgsql.php
+++ b/3rdparty/MDB2/Driver/Manager/pgsql.php
@@ -363,6 +363,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return MDB2_OK;
}
+ $unquoted_name = $name;
$name = $db->quoteIdentifier($name, true);
@eMerzh
eMerzh / pdo_test.php
Created July 4, 2012 08:51
Pg PDO test
<?php
/** createuser -d -R -S -P test
* => set password to "a b c"
*/
$dsn = "pgsql:dbname=test;host=localhost";
$user = "test";
$psw = "a b c";
try{