honeypot.js - because SPAM sucks

We all hate spam. Doesn't matter if it's an email from the Nigerian prince or gazillions of comments posted to your website by bots offering famous blue pill. On my personal website, I deal with it using the Drupal Honeypot package. It worked quite well, but still it was introducing bit of administrative headache. (Hence I recently switched all comments to Disqus).

While working on an expres.js powered website, I noticed there are plenty of SPAM fighting tools available for PHP, but very few for my favourite platform of choice - node.js.

This has bitten me hard on one of the express.js powered websites I worked on - pretty much as soon as we deployed it live and made adding new text content available to unauthenticated users (good luck with that!), we noticed wave of SPAM.

So in order to mitigate this, I've created a small npm package powered by great API from https://www.projecthoneypot.org/

Introducing:
https://www.npmjs.com/package/honeypot



Let me know if you find it useful. Docs are available on the npm and in the related github repo: https://github.com/rochal/honeypot
Tags: 

Conway's Game of Life in JavaScript

GridOptions
Recording
Interval:

Conway's Game of Life is an example of cellular automation created by British mathematican John Horton Conway in 1970. It is a very specific type of game as it does not involve any players. Game 'plays itself' using the environment configuration that was set up earlier.

For some reason I found the idea of a game that plays itself very interesing, so.. I decided to implement it in JavaScript. (Because everything should be implemented in JavaScript one day, right?)

Fun With Flags winning awards and stuff!

What a day!

Very quickly I wanted to share with that my little quiz game - Fun With Flags has been named as the Winner of Blackberry mobile app competition at Web Directions 2013 Conference in Melbourne!

You can checkout conference page here: http://code13melb.webdirections.org/

Tags: 

Few thoughts on jQuery 1.9.0

After 4 months since the last software release the guys behind jQuery finally published the newest version of the framework. jQuery version number 1.9.0 finally hit the shelves containing few interesting and surprising changes.

I wouldn't normally care about a version update - we are used to those and they usually contain performance/speed improvements or add new features not affecting the rest of the code. 1.9.0 however, changes few things, and boy o'boy, I think those changes will cause problems to web designers / javascript developers out there who are hoping for easy upgrade.

Introducing Fun With Flags!


Android app on Google Play

Today I would like to share with you my new mobile app, I finally released on Google Play Store. It's called "Fun With Flags!" and it's a simple quiz game that helps the players learn all the flags of the world.

I've worked with mobile before, writing JavaScript code running on mobile-friendly websites, however I have never had an opportunity to get involved in full, end-to-end mobile application development and publishing process. This project was a great way for me to see how it's done and surly it will help me release more stuff in the future.

The idea of the app is nothing new, there are plenty of similar ones already on the market, but since I love travel and geography I thought simple quiz game about all the colorful flags of the world is definitely something worth exploring.

During the process I learnt few valuable things about the JavaScript development for web and mobile and the differences between the two; I hit couple of bumps and had to compromise a thing or two. Luckily in overall I managed to create an app I wanted to and I am happy with the result.

Plasmatic! Creating plasma fractals with JavaScript and canvas

This is just a static image. Use controls on the right to create your fractal.
Roughness:
Red:
Green:
Blue:
Draw time: 0ms

Use the controls to modify plasma in real-time! Plasma fractal also known as Random Midpoint Displacement Fractal is not only a cool visual effect but also an extremely useful algorithm often employed in the computer games industry. Also known by its other name - "diamond-square algorithm" is used to create realistic heightmaps for 3D computer graphics and it can also create clouds or smoke effects. But most of all, it creates wicked plasma effect you can see above. And what is cooler than programatically generated plasma? Programatically generated plasma in JavaScript!

Fun with pixels and HTML5 video canvas

HTML5 video pixel manipulation

Original
Transformed
Mode:
(Example above tested in Chrome 17, Firefox 10 and Safari 5)

Recently, there has been a lot of hype about the HTML5 video. No wonder why - Google thinks the format is hot enough it is worth encoding thousads of the YouTube videos as webm and make them available through new HTML5 version of youtube: http://www.youtube.com/html5.

Tilde or the Floor? Practical use for JavaScript bitwise operators. (#1)

JavaScript bitwise operators are one of these features of JavaScript that we always forget about. It seems like we assume there is no good use for them in a client-side code. Why would we care about ones and zeros if we're not using binary? Why would we ever care for binary AND, OR, XOR or left/right shift?

I am not going to explain how these operators are affecting binary numbers because there are plenty of resources available covering this topic.

Instead, in a series of articles, I will focus on a practical use for few of them showing how to make your JavaScript code faster, more compact and unfortunately often less readable.

Tags: 

HTML5 Mohawk Generator

Note: Jump here to read full article or play with the Mohawk Generator below.

Mohawk Configurator

Size:
Number of spikes:
Number of colors:
Colors:

Share your creation!

Copy the link below:
Or post it directly on Twitter:

Excuse me, there's an (HTML5) elephant in the room!

Background

On September 27th I attended cool JavaScript meetup in Brighton called asyncjs. During two sessions (unfortunately I missed the first one so I had loads of catching-up to do) we built an amazing JavaScript Jungle / JavaScript environment.

We were asked to fill this environment with jungle creatures that respond to the occurring changes - sun, rain, time of the day and so on. Creatures could move around, eat grass or even eat each other.

Entire environment was created using jQuery and we were also allowed to use HTML5 canvas support libraries such as paper.js and raphael.js. In addition to that, we used fantastic little library called broadcast.js to create event-driven environment for our jungle.

Pages

Social/Code

profile for rochal on Stack Exchange, a network of free, community-driven Q&A sites