• Setup nginx and puma for Rails apps on Ubuntu

    Continue from previous post Setup Ruby on Rails, PostgreSQL and Redis on Ubuntu, in this post I will share with you how I set up nginx and puma to deploy my Rails application on Ubuntu server.



    sudo apt-get update
    sudo apt-get install nginx


    Disable default site by removing the symlink in folder /etc/nginx/site-enabled:

    sudo rm /etc/nginx/site-enabled/default
    Continue Reading →
  • Setup Ruby on Rails, PostgreSQL and Redis on Ubuntu

    In this post, I will share with you how I set up a Ruby on Rails, PostgreSQL and Redis on Ubuntu for deploying Rails applications from scratch.


    Update Ubuntu packages

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade

    After updating, you may have to restart your server for the changes. Continue Reading →

  • iOS scrollable UINavigationBar follows UIScrollView

    Inspired by the navigation bar functionality seen in Chrome, Facebook and Instagram iOS apps which it can shrink or expand based on the scrolling of a UIScrollView object such as UITableView, I have coded a custom navigation bar, called GTScrollNavigationBar at https://github.com/luugiathuy/GTScrollNavigationBar


    Continue Reading →
  • iOS7 interactivePopGestureRecognizer for UINavigationController with hidden navigation bar

    iOS7 introduces interactivePopGestureRecognizer property which is used for popping current view controller stack by a gesture (swipe right gesture from left edge as default). However if the navigation bar is hidden or the app uses a custom back button for navigation bar, this feature will not work. A bit lines of code can make this feature works again for those cases. In viewDidLoad() of view controller (or application:didFinishLaunchingWithOptions: of AppDelegate), we set the interactivePopGestureRecognizer.delegate to nil as below:

    if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1) {
      self.navigationController.interactivePopGestureRecognizer.delegate = nil;
    Continue Reading →
  • Facebook Hacker Cup 2013 Qualifying Round

    I have participated in Facebook Hacker Cup this year and gone through Qualifying Round. Round 1 will start on Dec 6th and last 24 hours. Here are my solutions for problems in Qualifying Round: https://github.com/luugiathuy/FacebookHackerCup

    More about Facebook Hacker Cup: https://www.facebook.com/hackercup

    Continue Reading →
  • GLSL Shader Manager OpenGL

    Nowadays most of OpenGL applications use shaders (programmable pipeline) for rendering effects on graphics hardware instead of old provided functions in OpenGL 1.0 (fixed-function pipeline). There are many advantages of using shaders, such as performing arbitrary transformations on vertices and pixels, easily maintaining effect algorithms, etc. In this post I will share with you how I load, link and manage GLSL shaders in my projects. Continue Reading →

  • Create Frame Buffer Object OpenGL

    In OpenGL, frame buffer is the final destination in the rendering pipeline. When we create a window for our OpenGL application, it automatically create frame buffer object for us. However we need to create our own frame buffer object in some cases, such as offscreen rendering. OpenGL applications in iOS also need to create frame buffer object. In this post, I will share with you how we can create a frame buffer object (FBO). Continue Reading →

  • Set up Qt for Visual Studio 2008

    My upcoming project will need to work with Qt. Our team have decided to not use Qt Creator for the project. We use Visual Studio 2008 since it is easy to configure and all members are familiar with it. In this post, I will share with you how to configure Qt for visual studio 2008. Continue Reading →

  • Reversi (Othello) Game

    Reversi (Othello) is a board game (board size of 8x8) played by two players. Each player tries to turn the other’s pieces to his/her own pieces. In the end the player which has more pieces on the board is the winner. You can find the detail rules on Wikipedia

    The strategy I implemented for this game is based on this website. Continue Reading →

  • File Download Manager in Java

    Download manager is a program that helps us download files from Internet efficiently.The program can pause or resume downloads. It also can split the files to be downloaded into 2 or more segments, which are processed in parallel, making the download faster.In this post, I will share with you how I write a download manager program in Java with those features. Continue Reading →

  • Simple Web Proxy Python

    When I was in year 3, I studied the module “Computer Network 2”. There was an assignment about implementation of a simple web proxy. In this post, I will share with you my program for the assignment (written in Python).

    The proxy sits between the client (usually web browser) and the server (web server). In our simple case, the client sends all its requests to the proxy instead of sending requests directly to the server. The proxy then opens a connection to the server, and passes on the client’s request. Continue Reading →

  • Simple Android and Java Bluetooth Application

    Last week was my school’s recess week. I had a lot of free time and decided to learn Java and Android Bluetooth by reading the Bluetooth development guide for Android. Then I had an idea to make my Android phone become a simple remote control for my laptop, just for controlling the Power Point slides for presentation. The volume up and volume down become buttons for going to next and previous slide respectively. Continue Reading →

  • Setup OpenCV for Python in Windows

    I have always struggled when trying to set up OpenCV for Python before. So I decide to write this post to help myself in the future and share with you =). My setup is for OpenCV 2.2 but I think you can apply for any version of OpenCV. Continue Reading →

subscribe via RSS