Category Archives: Web Development

MongoDB Paging using Ranged Queries (Avoiding Skip())

So on the mongodb-user group we get a question at least once a week from some one wishing to understand how to optimise paging for MongoDB. The most common variants are: Facebook like feeds Twitter like feeds Log pagination Historical Data Pagination Statistical Pagination Now first thing to remember in MongoDB is that some times [...]

Realtime Stats in MongoDB Example (PHP)

Ok so you’ll remember some time ago I talked about realtime statistics in MongoDB, right? Well here is a working version. This script basically records the basic statistics on videos. So this time I am going to skip why and how I made my document structure and just show you my document structure: This may [...]

Cloudflare not giving users IP address on Nginx (FIXED)

This fix is probably even simpler than the Apache one: Fix in Wiki As a further note I actually found out this doesn’t work so well and infact Cloudflare actually gives you the users IP by default now. You can run this PHP snippet to get the users cloudflare IP:

MongoDB Single Key Index or Compound Index

Just got a question on the MongoDB user group as which type of index over multiple fields would be best and why. The user basically had three fields: Type CompanyID Date And was wondering what the difference would be to using a compound index on all three fields and using a single key index per [...]

PHP convert duration timestamp to date() syntax

I fond out while using: That it actually returns incorrectly. It would keep returning an extra hour. I found this was due to DST. So I quickly put my thinking cap on and botched together this: This function will now correctly convert any timestamp into the needed date notation with fear of DST or other [...]

Cloudflare not giving users IP address (FIX)

Follow the link here: Cloudflare Wiki. It takes about 2 secs to install and works a treat.

Realtime Statistics in MongoDB

There is now an example of this sort of aggregation here: Realtime Stats in MongoDB Example (PHP) As I troll the MongoDB user group (mongodb-user) I notice a LOT of questions about realtime statisitics handling in Mongo. As I have repeated myself about 100 times over I will write a blog post about it. Many [...]

Facebook dropdown menu using Jdropdown

This now has a github home: here. I’m new to Github so sorry if it’s not done right Please Note: You must have the latest version of jQuery to use this plugin (v 1.7.x and above). Please get this before you attempt to use this plugin otherwise the plugin will not work. Ok so here [...]

JSTree input widget for the Yii Framework

I made a small but handy little input widget for selecting trees nodes in connection with another table row. You can find the extension here: jstreeinputwidget. Enjoy,

Creating a sometimes-postion-fixed top menu jQuery plugin

Since quite a few people have come here expecting some sort of genius I have decided to rewrite this post a little in an attempt to make me look like one. Of course the most likely out come is that I do not. After reading Ben Nadels post (here: www.bennadel.com/blog/1810-Creating-A-Sometimes-Fixed-Position-Element-With-jQuery.htm) I decided that I wanted [...]

Follow

Get every new post delivered to your Inbox.