Skip to content

{ Category Archives } Codeprix

How Facebook (probably) implements SMS threads

A lot of web applications provides you the ability to receive or post updates using SMS (text messages). Twitter is the posterboy of such applications.
But the feature that distinguishes Facebook SMS updates from any other service is that you can actually reply to individual messages and your message then becomes a part of the [...]

Tagged , , , , ,

Bing/Google toggle bookmarklet

I’ve been trying out Bing as my default search engine for last few months and the results are definitely at par with that of Google for most of the consumer categories. But sometimes you just need a quick toggle to see what Google would return for your query. So here is a small bookmarklet that [...]

Tagged , , , ,

Minifying Javascript/css without changing file references in your source

Rule 10 of Steve Souders High Performance Web Sites: Minify Javascript
The most common problem faced while implemnting this is how you handle the full and minified version and how to change there reference in referencing documents. One of the easier ways to do this is to make it part of the deployment process.
Here are [...]

Tagged , , , , , , , ,

Humanizing the time difference ( in django )

django.contrib.humanize is a set of Django template filters that adds human touch to data. It provides naturalday filter that formats date to ‘yesterday’, ‘today’ or ‘tomorrow’ when applicable.
A similar requirement which the humanize pacakge does not address is to display time difference with this human touch. so here is a snippet that does so.

1
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
31
32
33
from django [...]

Tagged , , ,

Running Glassfish as a service on CentOS

Here is how you run glassfish as a service on CentOS:

Create a user glassfish (you can call it anything you want) under which Glassfish will run.

#useradd glassfish

Install glassfish in /home/glassfish.
Create the startup script /etc/init.d/glassifsh for glassfish.

1
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#
# glassfish: Startup script for Glassfish Application Server.
#
# chkconfig: [...]

Tagged , , ,