JSB 1.3.0 released - Good bye Inline-Javascript
Today I finally finished JSB 1.3.0. The JsBehavourToolkit is a little toolkit to avoid any inline javascript, allow copy-and-paste of behaviour on html elements.
There is a native version, which works without any framework from (Firefox 3+, Safari 5+, Opera, Chrome and IE9+). The jQuery and Mootools Version works with any browser (even IE6).
New in 1.3.0 is a simple (by design!) event system. It is framework independent and works with simple channel identifier and a json-object as value.
This should be fired by a Js-Behaviour which needs to say something, instead of global variables and direct call. This enables you to use dependency injection if you keep the channel identifier the same.
You can listen to that event, too:
2
3
4
5
6
'HoneyPot::CLICKED', // identifier
function(values) { // callback
alert('The user ' + values.name + ' clicked it already ' + values.times);
}
);
It's even possible to filter for a filter-object when listening:
2
3
4
5
6
7
'HoneyPot::CLICKED', // identifier
{"name": "Bob"}, // filter everything with name = Bob
function(values) { // callback
alert('The user ' + values.name + ' clicked it already ' + values.times);
}
);
You may also use RegExp as channel identifier when calling jsb.on:
2
3
4
5
6
/^HoneyPot.*$, // identifier which starts with HoneyPot*
function(values) { // callback
alert('The user ' + values.name + ' clicked it already ' + values.times);
}
);
Have fun with this release. Sourcecode is of course MIT-Licensed and available on github. Tests for jquery, mootols and native version are shipped in the tests-folder.
Spludo 1.1.0 released
Finally a new spludo 1.1.0 release is available. This is also the start of 1.2-dev development.
The 1.1-branch will stay to support node version 0.4, 1.2 will (soon) support only 0.6 and later.
Changes from 1.0.3 to 1.1.0:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
* generator for monit+upstart configuration
* code generation for migrations extended with shortcut fields definition
* added support for application/json paylod
* generate *ByIds method for services
* added ApiServiceController to register a service as REST service
* context.request now holds the current req instance
* added inflection.js
* added node_modules for own vendor libraries
* replaced own testing system with vows (if you want to run the tests, please install vows!)
* spludo_directory variable is now set always when calling spludo-gen
* added bootstrap_manager.whenLoaded(callback) to get notified as
soon as the app is ready.
* replaced self with that
* fixed core_dev_change_build_version on MACOSX
* added jshint instead of jslint
* added support for node_modules folder in project directory
* added Criteria for DatabaseDrivers
* added code generation for Migrations
* added SqliteDatabaseDriver
* added a Database Migration system
* added MysqlDatabaseDriver
* added code generation for Services
* added DatabaseManager and ServiceManager
* added Logging#addTracing (makes the this.trace(function_name) obsolete)
* Codegeneration loads the spludo application now (this enables the developer
to generate code against the base of the application)
* Codegeneration #validateParameter receives the validated parameters now
* TestCases are now able to call .debug+.log and so on, because the execute
method is applied to the TestSuite.
I have been using this development version for plenty small projects and the code generation, migrations and database driver stuff should really help
you get your app developed way faster!
Loads of documentation and examples can be found in the spludo user guide.
Have fun!
Remote logging with rsyslog, php and agavi
When I tried to get rsyslog running with php I didn't face much problems. Anyways I want to share some things I noticed while getting it to work.
First of all ubuntu uses rsyslog already. Just a simple
and all syslog messages went directly into the database "syslog". Configure /etc/rsyslog.d/mysql.conf to insert this information into a remote machine.
Now let's get to php. You have the option to set:
This however does log all messages with
If you want to replace "php" with a custom message, you have to call
before any error happens. Because LOG_ODELAY is given, it won't connect to syslog unless any error happens, so one should be save to put this call at the top of your dispatcher file.
The final log message will look like that (254 is the process id):
Finally I wanted to log all messages created by agavi's logging system. Since I didn't found an existing AgaviSyslogLoggerAppender, I wrote one and put it up on a github-gist.
Have fun logging!
Nginx always overwrites the Server-Header
When I was configuring the nodejs server behind nginx, I experienced the issue that nginx always overwrote the Server header response.
This is a bit annoying, since I want to know what version of spludo runs on my site.
The solution is not to set
since that would only disable the version number.
The solution is:
Facebook Client for node.js 1.3.0
Today I have an update for the Facebook Client for node.js finished.
The version 1.3.0 is a graph and rest api client for facebook. It has support for the latest stable nodejs 0.4.x.
Now it's possible to post data (for instance into your news feed):
2
3
4
5
6
7
8
"/me/feed", {
"message":"I love node.js!"
},
'POST'
)(function(result) {
console.log('The new feed post id is: ' + result.id);
});
All you need to do is to specify the method parameter (defaults to GET).
Thanks to jharlap for this addition.
Also thanks to tslater and shaisultanov. They found an issue with expires-time (which is fixed now) and requested the brand new FacebookSession#isValid method, which tells you if the session is really alive.
Source may be found at node-facebook-client@github.
The package is also available by using npm:
Installing php 5.3.5/5.3.6 on Ubuntu Maverick/Lucid
Latest Version for PHP 5.3 on Ubuntu is just PHP 5.3.3. This is not so good, if you want to have some of the plenty bugfixes which will be shipped with a later version.
If you want to upgrade to 5.3.5 (5.3.6 support may come later), you can use this inofficial ppa by the nginx user at launchpad: https://launchpad.net/~nginx/+archive/php5.
For ubuntu maverick just create a file:
with the contents
2
3
deb-src http://ppa.launchpad.net/nginx/php5/ubuntu maverick main
and run:
2
$ sudo apt-get dist-upgrade
Now you have php-5.3.5 installed on your ubuntu box! Have fun.


