Skip to content

Instantly share code, notes, and snippets.

View odino's full-sized avatar
shipping!

Alessandro Nadalin odino

shipping!
View GitHub Profile
+ function DataSource(exchange) {
+ this.exchange = exchange;
+ this.queries = _.map(queryTpls, function (templateFile) {
+ var queryString = '';
+
+ _.forEach(databases, function (database) {
+ queryString = tpl(path.join(__dirname, templateFile), {db: database});
+ });
+
+ return queryString;
# express
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
});
var server = app.listen(3000, function () {
require('http').createServer(function(req, res){
console.log("Hello...")
res.writeHead(200, {})
res.end("...world!")
}).listen(8888)
click('Save', array('qredd_content' => array(
'content_type_id' => 1,
'title' => 'Content sample',
'aggregator_id' => '0',
'is_active' => true,
)))->
with('request')->begin()->
isParameter('module', 'content')->
isParameter('action', 'create')->
// FIXME: workaround for lime! Lime sucks so much
// proper code $content_type = $this->object->getTemplate()
if (!$this->object->isNew())
{
$this->object->setTemplate(Doctrine::getTable('QreddCckTemplateFlat')->find($this->object->content_type_id));
}
$content_type = $this->object->getTemplate();
foreach($content_type->getAdditionalFields() as $field)
class QreddContentForm extends BaseQreddContentForm
{
public function configure()
{
$content_type = $this->object->getTemplate();
foreach($content_type->getAdditionalFields() as $field)
{
// FIXME: workaround for lime! Lime sucks so much
// proper code $content_type = $this->object->getTemplate()
if ($this->object->isNew())
{
$content_type = new QreddCckTemplateFlat;
}
else
{
$content_type = Doctrine::getTable('QreddCckTemplateFlat')->find($this->object->content_type_id);
}
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: mysql:host=localhost;dbname=db
username: nsd
password: nsdtodb
test:
doctrine:
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
UP VAR!!1
IZ VAR BIGGER THAN 10? KTHX
VISIBLE VAR
IM OUTTA YR LOOP
KTHXBYE
public function getImage()
{
$asset = Doctrine::gettable('Asset')->find($this->thumbnail_id);
if ($asset)
{
return $asset->getId();
}
return false;