Coder's notes

For your infomation

Javascript Game Engines

More ways to write Javascript

Javascript Design Patterns

Create Excel File with Python

Install Xlsx

$ git clone
$ cd XlsxWriter
$ sudo python install


import xlsxwriter

workbook = xlsxwriter.Workbook('hello.xlsx')
worksheet = workbook.add_worksheet()

worksheet.write('A1', 'Hello world')


Create a simple site with Python, CGI, Apache 2 on Fedora

  • su to become root
  • Create the following directory structure
    • /var/www/mysite
      • cgi-bin
      • html
        • index.html
  • Sample content for

    print(“Content-type: text/html\n”)
    Hello Python CGI <br/><a href=’../’>Home</a>

  • Sample content for index.html
    Home <br/>
    <a href=’cgi-bin/’>CGI</a>
  • If you use SQLite, create a sample database file.
  • edit /etc/httpd/conf/httpd.conf, add the following code to the end of the file
    ScriptAlias /mysite/cgi-bin/ /var/www/mysite/cgi-bin/
    Alias /mysite/html /var/www/mysite/

    <Directory “/var/www/mysite/cgi-bin/”>
    AddHandler cgi-script .py
    AllowOverride None
    Options +Indexes +ExecCGI
    Order allow,deny
    Allow from all

    <Directory “/var/www/mysite/”>
    AllowOverride None
    # Allow open access:
    Require all granted

  • Run the following code in the terminal
    chcon -h -t httpd_sys_content_t /var/www/mysite/cgi-bin/
    # You need this line if you want to write to a database file
    chcon -h -t httpd_sys_content_rw_t /var/www/mysite/cgi-bin/database.db
    chcon -h -t httpd_sys_script_exec_t /var/www/mysite/cgi-bin/*.py
    chgrp apache /var/www/mysite/html -R
    chmod uo+r /var/www/mysite/html -R
    chmod uo+x /var/www/mysite/cgi-bin -R
  • Now try to start server by typing
     service httpd start
  • Go to your website from your browser at: http://localhost/mysite/

Using Git

Clone project `foo’ of user `user‘ from Github

git clone --recursive

Add a submodule into a repository

git submodule add
git submodule init
git submodule update

Undo modification

git checkout -- [filename]

Update submodule to latest version

git fetch && git checkout master && git merge origin/master

Generate SSH key for passwordless push to Github


ls -al ~/.ssh
ssh-keygen -t rsa -C ""
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa

# Now add key to Github account (~/.ssh/

# Test connection
ssh -T

# Update the repository remote URL to SSH
git remote set-url origin
git remote -v

LaTeX on Windows

  • Install MikTeX
  • Install TeXMaker
  • Use embedded PDF viewer
    Option > Configure TexMaker > Commands > PDF viewer > Embed (click photo to zoom)texmaker embedded

LaTeX for linguistics

Basic LaTeX for beginners


Online editors




Presentation Slides

Blog at

Up ↑