Skip to main content

Posts

Dvorak and QWERTY

Bàn phím con lap tự nhiên liệt mấy phím. Phím o liệt còn phím ] thi thoảng bị chập nên nhấn liền luôn. Nhớ tới vụ dùng virtual keyboard để click chuột nhưng hơi tù. Tự nhiên nghĩ ra là có bộ gõ Dvorak. Mình hoàn toàn dùng Dvorak  hơn 3 năm rồi nhưng vì ngại con lap người khác dùng bị confuse nên ko nhớ ra. Chỉ cần thêm bộ gõ vô là có thể chuyển qua để gõ "O" = "S". Mặc định nhấn Windows+Space là chuyền bộ gõ. Cách này tươi hơn là dùng phím ảo hay chỉnh Unikey tổ hợp phím, vd oo = ô. Con lap này minh để chơi game thôi nên liệt 1 key cũng ko thành vđ. Thực tế là toàn dùng bàn phím USB ngoài vì lap để trên cái sọt rác nhỏ (tản nhiệt) hơi cao với tay gõ hơi tù ko combat đc.

git ls-files --deleted -z | xargs -0 git rm

git ls-files --deleted -z | xargs -0 git rm http://stackoverflow.com/questions/492558/removing-multiple-files-from-a-git-repo-that-have-already-been-deleted-from-disk Tham số -z gộp list output kiều nhiều dòng về liền nhau. xargs -0 chắc là tham số đầu tiên ám chỉ số 0. Thường thì m hay dùng git ls-files --deleted | xargs git rm $1 Ko rõ -z có tác dụng j. "Phải thế nào" thì người ta mới viết zậy chứ.

LibGdx Game, Screen and ApplicationAdapter

See difference in here  http://stackoverflow.com/questions/31222541/what-is-the-difference-between-game-screen-and-applicationadapter-in-libg ApplicationAdapter allows you to create a listener, but not being forced to implement every method. If you're familiar with Swing, check out KeyAdapter, it's the same idea. An ApplicationListener allows you to handle application events. This allows you to execute code during certain events within the application life-cycle (such as destroy). An ApplicationListener is called when the Application is created, resumed, rendering, paused or destroyed. All methods are called in a thread that has the OpenGL context current. You can thus safely create and manipulate graphics resources. A Game is an ApplicationListener that supports multiple screens. You can create multiple screens and switch between em using setScreen. An ApplicationListener that delegates to a Screen. This allows an application to easily have multiple screens. A Screen...

Coding: Hide function name

/**      * [__call description]      *      * @param string $method    HTTP Methods      *      * @param string $arguments Arguments      *      * @return Response      */     public function __call($method, $arguments)     {         if (in_array($method, array('simple_get', 'simple_post', 'simple_put', 'simple_delete'))) {             // Take off the "simple_" and past get/post/put/delete to _simpleCall             $verb = str_replace('simple_', '', $method);             array_unshift($arguments, $verb);             return call_user_func_array(array($this, '_simpleCall'), $arguments);         }     } So with call name simple_get() it translated to simpl...

iptables suck, ufw using

https://help.ubuntu.com/community/IptablesHowTo sudo ufw status numbered sudo ufw delete allow 80/tcp https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-14-04 ufw allow from 192.168.1.106 proto tcp to any port 22 sudo ufw allow from your_other_server_ip/32 to any port 27017 sudo ufw status verbose ufw allow 22/tcp https://docs.mongodb.com/manual/tutorial/configure-linux-iptables-firewall/

NGINX Laravel config

server {     listen 80 default_server;     listen [::]:80 default_server ipv6only=on;     root /var/www/SadHill/Blondie/public;     index index.php index.html index.htm;     server_name blondie.tuco;     location / {         try_files $uri $uri/ /index.php?$query_string;     }     location ~ \.php$ {         try_files $uri /index.php =404;         fastcgi_split_path_info ^(.+\.php)(/.+)$;         fastcgi_pass unix:/var/run/php5-fpm.sock;         fastcgi_index index.php;         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;         include fastcgi_params;     } }