RSS Feed
^__^

Hosting multiple Express (node.js) apps on port 80

,

In the last days, i was trying to find a solution hosting multiple Express apps on my vServer the same Server.

Starting with Apache and mod_proxy, i ended up with a plain node solution, which i really like. » read more

11 comments

How to add placeholder attributes in Silverstripe Userforms Module

,

to be honest i didn’t find a clean way yet, but i thought this workaround might be worth sharing.

…since SilverstripesUserforms Module Uses jQuery for Validation you can put these lines of code in your UserDefinedForm.ss Template: » read more

5 comments

Javascript benchmarking with jsperf

,

I might be a bit late (yeaikno it exist over a year now and a bunch of blogs had it covered) but nevertheless i would like to point out a very helpful online tool i recently ran into:

jsPerf

Its basically a online benchmark tool for testing different approaches in javascript.
It covers some important aspects of benchmarking, that your homemade bench probably wont have like milliseconds accuracy & statistical analysis.
The tests are run on your browser and the results will feed the “browserscope”. A graph of the “highest known results” for the participating browsers.
So we can see some kind of comparison.
» read more

no comments yet

Tools for jade template development

,

I recently started digging into node.js and the express framework.
One thing i like about it is that it comes with the beautiful jade template engine by default.

Here are some things that come real hany when you are working with jade. » read more

no comments yet

[Symfony 2] composer.json for a assumed-stable symfony 2 distribution

,

This small composer.json file is used in a project i am working on atm, feel free to use it at own risk. I will provide non-periodical updates and hopefully soon a full upgrade to symfony 2.1.x including doctrine orm 2.2.x.

I still did not get the point regarding dependency resolution, so i simply “composed” the composer file by writing down my own requirements (“i want only the hottest, newest stuff!!”, then tracked down the error messages, removing them by explicetly writing down the missing dependencies by using the latest “dev-*” versions. After that i tried to run the project, which actually did not work, but selective downgrade of some of the bundles (framework, security-extra blahblah) finally did the job. » read more

3 comments

Run JavaScript code in PHP 5.3 with the v8js extension

,

…for some reason i needed to get t h i s to work before going to sleep.

I’m running OSX 10.7.3 with macports which usually does the job, but  Google’s V8 Javascript Engine is not available as a port yet. » read more

no comments yet

Silverstripe – has_many- and many_many-relations when duplicating pages

,

When you duplicate a page in the Silverstripe Sitetree, related “has_one” Items are automatically copied, which is nice.

But if you have, lets say, multiple related images on that Page, those are not copied when you duplicate that Page. » read more

1 comment

Modulo in Twig

,

Ever wondered how to use the modulo operator in twig, the template engine of symfony?

Actually its like in PHP:

{{ 11 % 7 }}

As described here

But i guess for most use cases modulus is used to check if a number is divisible by another number.
Therefore Twig has the very conveniant divisibleby test function.

{% if loop.index is divisibleby(3) %}

» read more

3 comments

Silverstripe Setup Script

,

We thought we had to improve our SilverStripe setup script for our development environment.
So Max and me rewrote it to add submodules and some other improvements.

Just run:

./install_silverstripe.sh mynewproject tags/2.4.7

and you have

  • silverstripe project folder structure
  • the tutorial theme
  • a already filled git repository
  • sapphire as submodule
  • cms as submodule
  • Uploadify as submodule
  • DataObjectManager as submodule
  • UserForms as submodule

» read more

no comments yet

Silex and MongoDB simply

,

Using MongoDB in your Silex Project is quite easy.

I will show this with my Superleansilexplate and will integrate it there as an example.
Since i dont want to integrate MongoDB in Superleansilexplate it will just become an additional gist.

Given you have some smaller amount of data like a counter that needs to be stored or other loose coupled datasets, we simply speak to MongoDB “directly” and store the data via Doctrine MongoDB Abstraction Layer.
Since i presume the Data / Document Structure isnt that complex we dont use Doctrine MongoDB ODM (the Object Document Mapper).
If you want to use it instead, try this Silex Extensions.

» read more

2 comments