dracoblue.net

Lua Implementation of OAuth

Since twitter stopped supporting basic auth, some are searching for a lua implementation of oauth.

A while back (in last 2009) I wrote a library for exactly this, but didn't finished it. So I took some time to polish it up and it works still great ;-).

So have fun with the MIT licensed lua oauth library download or source at github.

In lua, open source by DracoBlue @ 16 Sep 2010 | 64 Words

Different ssh port with rsync

If you want to to backup from/to an ssh server and this server does not run on 22 as port, you can use this workaround:

rsync -r [strong]-e 'ssh -p 4321'[/strong] [email protected]:/home/user/test backup -v

This will sync from the host

[email protected] (by using ssh and port 4321) the folder /home/user/test to the folder backup on your local harddisk.

In bash by DracoBlue @ 16 Sep 2010 | 64 Words

NodeJS Webframeworks Benchmark August 2010

Since now I am releasing spludo pretty soon, I wanted to check out how performance is against other web frameworks for node.js.

I made a previous test for this already, running nodejs 0.1.98.

This results are against: nodejs 0.2.0. To keep it fair (and little expressive) I just took the hello world application from each framework and benchmarked those with apache benchmark.

Concurrency Level: 32 (was 256 in the previous test)

ab -n 10000 -c 32 http://spludo.com:8080/

Results:

josi: 3944.78 [#/sec]
expressjs 1.0: 6480.42 [#/sec]
(fab):  8203.74 [#/sec]
[strong]spludo 7454.60 [#/sec][/strong]

Concurrency Level: 1

ab -n 10000 -c 1 http://spludo.com:8080/

Results:

josi: 3162.31 [#/sec] (was 3012.32)
expressjs 1.0: 3497.71 [#/sec] (was 2744.79 in 0.9)
(fab): 4199.95 [#/sec] (was 4271.43)
[strong]spludo: 3923.69 [#/sec][/strong] (was 3866.12)

The source code for all sample applications may be found at the

public gist post.

The Test PC was a i7-920 Quadcore with HT and 8GB DDR3 RAM and a single node.js instance running.

In javascript, node.js, spludo by DracoBlue @ 29 Aug 2010 | 183 Words

JsBehaviour 1.0 released

This is a tiny library I have been using to create inline dynamic effects at docsforit without inline javascript. Since it is not spludo (serverside javascript mvc framework) specific and works as long as mootools is available, I release it for the public today.

How does it work?

The idea behind JsBehaviour is pretty simple. Put a class ( jsb) on all elements which should be enriched/enhanced by javascript. Additionally put a class [em]jsb keyword[/em] on the element to define which behaviour should be applied to the element.

Each behaviour can register on such keyword by using this

JsBehaviourToolkit.registerHandler('keyword', KeywordBehaviour);

method. As soon as the dom is loaded

JsBehaviourToolkit.applyBehaviour(window.document);

is executed. You might even overwrite your Request.HTML method to do the same.

Hope you enjoy to work and tweak this little piece of MIT-licensed software.

Download @ DracoBlue.net and js-behaviour@dracoblue.

Demo + Spludo-Integration at "Editing the sections" on docsforit (double click on the content, this is all done by using JsBehaviour!!).

In javascript, jsb, mootools, open source, spludo by DracoBlue @ 06 Jul 2010 | 176 Words

Hot reload for node.js servers on code change

If you are working with node.JS, you may experience the need to restart the node server as soon as a file has changed.

There are plenty approaches for this field. One is, to parse for all require statements in the code and watch those files then.

I took a different approach, which could be described by this linux command:

$ find . | grep "\.js$"

It searches for all .js files in the folder and restarts the server, as soon as one of those changed. Very easy, but yet powerful.

To use it, just copy:

rundevserver.js into your server directory.

This script expects your server script to be called run_server.js. If you want to change it, just change the line.

Instead of running your server with

$ node run_server.js

you now start it with:

$ node run_dev_server.js

That's it!

This feature is of course part of the

spludo framework's 1.0-dev version. In spludo, you can use

$ bash run_dev_server.bash

instead of

 $ node run_server.js

to achieve a hot reload on each .js change.

Update 2010/08/27: Wilkerlucio created a version for hot reloading coffee-scripts.

In javascript, node.js, open source by DracoBlue @ 04 Jul 2010 | 218 Words

Page 16 - Page 17 - Page 18

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About