This is a simple way to make yasnippet and autocomplete work together on emacs. Both of them use the Tab key to activate. Everytime you press Tab, yasnippet will run first. If there is no snippet found, autocomplete will be activated.

Download yasnippet and autocomplete and add them to the load path or just simply install them using package.el. After that, add this to your .emacs

First, activate yasnippet.

Read more

The default Jekyll Bootstrap index file contains a simple post list. However, it is really boring. It just gives you very basic information like Pulished date, Post title and the link to that post. After a little researching about the supported liquid tags in Jekyll, I came up with a new index page with the more beautiful post list, including thumbnail, post title, summary of the post, read more buttons and much more things you can add to.

Here are the implementation steps. Remember this is for Jekyll Bootstrap. That means you need Jekyll with Bootstrap to implement. If you don’t use bootstrap you can still apply those steps with a few tweaks.

Read more

Introduction

For Ubuntu Linux (and Mint), we have a powerful package manager called apt-get, which makes the installation, uninstallation and management of packages much easier. Sadly, for MacOS users, we don’t have that powerful tool. The appearance of MacPorts, an open source package manager for MacOS, has changed the way we install and manage our packages. With the help of MacPorts, MacOS users can now quickly install, keep track of the changes, update and maintain many open-source applications. You can even export all your installed packages and then let MacPorts automatically reinstall them for you when you have your computer reinstalled or when you migrate to another system.

Installation

The easiest way to install MacPorts is to download the .pkg installer here. Select the installer corresponding to your current OS. Alternatively, you can build it from source. For more detail, please visit this link.

After finishing the installation, you should consider updating MacPorts. Fortunately, MacPorts has the built-in feature for selfupdating. Everything you need to do is to execute this command

Read more

Sometimes when you run Jekyll server locally to test the preview of your site, you will encounter an error that tells you Address is already in used. The error output in the console when you run the command jekyll –server is something similar to this

[2012-12-30 00:10:58] INFO  ruby 1.9.3 (2012-11-10) [x86_64-darwin12.2.0]
[2012-12-30 00:10:58] WARN  TCPServer Error: Address already in use - bind(2)
[2012-12-30 00:10:58] WARN  TCPServer Error: Address already in use - bind(2)
Read more

The little code below helps us to quickly get tinyurl link for the currently viewed page instead of having to open tinyurl webpage, copy paste the link and get the new link. Put it in your .conkerorrc

// get tiny url for the current page
// press * q and then c to generate and copy the tinyurl into clipboard
define_browser_object_class(
    "tinyurl", "Get a tinyurl for the current page",
    function (I, prompt) {
        check_buffer(I.buffer, content_buffer);
        let createurl = 'http://tinyurl.com/api-create.php?url=' +
            encodeURIComponent(
                load_spec_uri_string(
                    load_spec(I.buffer.top_frame)));
        try {
            var content = yield send_http_request(
                load_spec({uri: createurl}));
            yield co_return(content.responseText);
        } catch (e) { }
    });
define_key(content_buffer_normal_keymap, "* q", "browser-object-tinyurl");
Read more

Introduction to Bitlbee

Quote from Bitlbee homepage

BitlBee brings IM (instant messaging) to IRC clients. It’s a great solution for people who have an IRC client running all the time and don’t want to run an additional MSN/AIM/whatever client.
BitlBee currently supports the following IM networks/protocols: XMPP/Jabber (including Google Talk), MSN Messenger, Yahoo! Messenger, AIM and ICQ, and the Twitter microblogging network (plus all other Twitter API compatible services like identi.ca and status.net).

In short, Bitlbee is an IRC server where you can connect to and use it with your IRC clients to connect to other chat services like Yahoo, FB, Gtalk,…

Bitlbee Homepage: http://www.bitlbee.org/

Read more

Emacs is a great text editor, the most wonderful one I’ve been used :D Also it has built-in support for ERC chat client. And now I used it as my chat client instead of Adium and the f**king Yahoo Messenger for Mac.

There are two ways to run a chat client through Bitlbee. First is to connect to a public Bitlbee server, register an account and start using the service. The second method is to setup your private Bitlbee server and connect to it. Of course I choose the second way because I don’t trust the first one. And also you cannot install or config the server if you’re using a public server.

Read more

Jekyll is great! However, it lacks one important thing compare to the other blogging systems. It’s the search function. I’ve implemented a simple Google search box in my jekyll blog. Below are the steps.

Implement a Search box

First, create a file named my_google_search.html in the _includes folder in your jekyll website directory. Add this code to the newly created html file

Read more
Jekyll - Syntax highlighting
  •  28 December 2012
  •  jekyll 

Jekyll is a blog for hacker so of course it must have syntax highlighting. There are several ways to activate syntax highlighting in Jekyll. I’ll show you 2 popular ways that many people use.

1. Highlight.js

This is a very easy way to have syntax highlighting in jekyll because it works automatically. That means you don’t have to do anything. Once you have include highlight.js, it will auto find code blocks, detect language and highlight them for you.

1.1 Advantages:

  • Easy to use
  • Easy to update (just replace the js file or even auto update)
Read more

Anyone of you who have been using Conkeror all know that Conkeror does not have Reopen last Closed Tab function. How painful it is compare to the other browsers! But we can do it by ourself by adding our own code into the .conkerorrc file.

First, we have to create an Array to hold the closed tabs.

var my_closed_buffers = new Array();
Read more