Continue from my previous post Blogging using your favorite Text editor with Git and Jekyll - Part 1, this time, I’ll demonstrate some more advanced tips to help you get used to blogging with Jekyll.

Blog configuration

By default, Jekyll stores all your global site configuration in _config.yml file (can be found in the root directory of the site). Jekyll Bootstrap has comes with some pre-defined configurations that you can customize like Site title, Author information,… You can also customize post URL style using some Jekyll template variables followed the instruction here http://jekyllrb.com/docs/permalinks/.

One of the most important feature of a blog is the commenting system. Again, Jekyll Bootstrap has the built-in config to help you integrate a commenting system to your blog. Here is the example (you can see in the config file)

comments :
  provider : disqus
  disqus :
    short_name :
  livefyre :
    site_id :
  intensedebate :
    account :
  facebook :
    appid :
    num_posts: 5
    width: 580
    colorscheme: lightp
Read more

In my previous post Jekyll - Blogging platform for geeks, I have introduced Jekyll as well as its interesting features. This time, I wrote this post as a tutorial for those who want to build a static website/blog using Jekyll Bootstrap (an pre-implemented website in Jekyll), Git and hosted it on Github for free. Also, you can deploy it on your own server or use Github to host it with your custom domain.

Requirement

  • As I mentioned above, Jekyll is a blogging platform for geeks, not for newbie. You need to have basic knowledge about web programming and version control.

  • You also need to have your computer running Linux, MacOS, Unix or some similar operating system. You can still run Jekyll on Windows but it’s not encouraged and may cause some issue for you (Jekyll Documentation)

  • Choose a text editor that suitable for you. You can use any text editor that you. However, I recommend Emacs, Vim and SublimeText. In this article, I’ll demonstrate using Emacs (because I use Emacs) but it’s up to you.

  • The last requirement is to have Ruby, RubyGems and Git installed on your computer.

Read more
Agent 069 game
  •  02 May 2013
  •  misc 

Today, we have finish our first game on LibGdx name Agent 069. Actually, all 3 members in our group are programmers, not designer so that we are not good at designing and images so that game graphic is not very good. Also, when swpie up the screen to control the main character to jump up, it’s a bit laggy or slowly react, we still don’t know why.

Agent 069

The game is about X-rider (codename 069). He is a top undercover agent and CIA. He has James Bond’s charm, Bruce Lee’s martial arts mastery and Rambo’s gun skills. His latest mission is to infiltrate a terrorist headquarter deep inside a Chinese rural area. His main activity in this game is to escape from the terrorists after assassinating the boss and having his cover blown and his only tool is his trusty motorbike. 069 will go through 3 areas which are effectively the game’s 3 stages.

For more information like Download link, Game rule, Guideline, Screenshots as well as the Source code, please visit the the game’s homepage at Agent 069 Homepage.

Read more

Update: Now you can simply use https://jekyllrb.com/docs/posts/#post-excerpts

Jekyll does not offer Preview post feature by default. There are plenty of plugins that can help us achieve that task. However, since many Jekyll sites are hosted on Github and Github prohibits us from running plugins (maybe for security reason), we may have to deploy Jekyll site on our own server or generate the site locally and then push it onto Github. Today, after reading some Liquid documentation, I have found a solution that can help us show the preview of the post using only the built-in Jekyll Liquid tag with split and first filter.

Add separator for post

First, open a post and add this line where you want to split it. The text before it will be converted to html (if in markdown) and then show in the preview section.

Read more

Last month, I started researching LibGDX, a game engine mainly targeted for Android. Also, this was the first time I worked with a game engine.

My goal is to develop a platform game like Vector but much simpler. This is also inspired by Temple Run. The main character keeps running and avoid being chased by the NPC. Precisely, I have to say that the main character just stays at one place and the background keeps moving backward.

The first problem that I encounterd was the infinite scrolling background. I have researched through Google with many solutions. However, all of them are too complex to solve that simple task. The code can be up to 100 lines long with tons of complicated mathematical formula to calculate how to scroll the background. Finally, I gave up and decided to come up with my own solution. Amazingly, it took me only less than 15 minutes and about 10 lines of code to achieve it.

The theory is very simple. Assume that you have a background file names bg.jpg, what you have to do now is to draw that background, move and loop it side by side. Let's look at the image below and I'll explain

Read more

Often, when I have a large number of media files playing in VLC, the most annoying problem for me is that for each file, I have to manually adjust the volume for them (so that they are not to loud). Moreover, for those music video files, I have to deal with the issue about screen resolution and ratio. My screen’s ratio is 16:10 but most of my videos are in 4:3 or 16:9 ratio.

The word normalize here means that to force all the media files to behave in a same way so that I can enjoy them without worrying to adjust for each file.

Normalize Audio

Normalize Audio

Read more

LibGdx has the built in support for Gesture detection. However, the Swipe Gesture is not well-supported and a bit simple. I have found a solution from this article. The code on that link contains errors. Here is the fixed version of it.

Gesture

Read more

This post is the sixth part of the series Dired as Default File Manager.

All this section I focus on tmtxt-dired-async, which is a tiny library that I devloped to help the use of Dired become easier. Actually, the code is a bit long so that I cannot post it here, that will make my post become messy. Instead, I move all those functions to a separate file and post it here for easy installation.

tmtxt-dired-async is a library for Emacs Dired mode to copy, compress, decompress files asynchronously. It also provides the ability to mark files in multiple directories and then copy all of them into a destination library. This library is designed for Unix-based system like MacOS, Ubuntu,…

The reason why I developed this library is to overcome Emacs Dired’s drawbacks. Everytime I need to copy, move, compress, uncompress,… big files, Emacs is blocked until those processes finish execution. That’s really annoying. This extension helps solve that problem by providing Emacs with the ability to asynchronously execute those tasks as well as display the output to the user.

Furthermore, it also display the progress of the current task as well as notify you when the task finish and automatically close the output window for you.

Read more

This post is the fifth part of the series Dired as Default File Manager.

Since version 24, Emacs offers a powerful tool to create and maintain custom theme called customize-create-theme. It provides you an visual interface for interacting with all those faces as well as previewing color in Emacs. You can even copy from other theme and then customize it a bit to make it yours.

If you haven’t known about Emacs 24 Color Theming yet, have a look at this post Color Theming in Emacs 24. This post just lists some useful faces that you can customize for Dired.

Read more

This post is the fourth part of the series Dired as Default File Manager.

How Dired works

Dired displays the content of the directory based on the result returned from ls command (of course, I’m talking about Unix-based system, not Windows). We can customize the way it displays by adding some more arguments for the ls command.

Prepare ls program

If you are using a GNU Linux based OS, everything is just simple. The GNU version of ls has many options for you to play with and you can skip to the next part.

Read more