Git push over proxy temperately

Git server whitelisted office IP only


$ ssh -D 2001 office.ip

Opened a socks4 proxy on


$ git config --global http.proxy socks4://
$ git push
$ git config --global --unset http.proxy

Bangkok chatuchak lockers

Weekend landing on Bangkok? Want to head straight to chatuchak shopping and checkin hotel next to save some precious time?

Sadly, there is no luggage locker in chatuchak, but only small lockers for small bags and backpack:!Where-is-the-Locker-at-Chatuchak-JJ-market/m...

Really, only the size as seen in above link. You can push your hand carry luggage in. So better checkin and drop your back. Dragging luggage and shopping will make you feels like joined tour de france.

And last, if you are coming for fashion and Thailand handmade, please come during weekend only. Weekday's chatuchak is just like a dead zone and feeling surreal. Except Tuesday afternoon after 3pm, chatuchak will turn into a huge flower market from small table top plants to trees of 2 floors high.

Rsync git diff files to external

git diff -z --name-only HEAD^ HEAD | xargs -0 -IREPLACE rsync -azP REPLACE

oneliner, no need to explain, right?

Alter comments query to order by DESC

Drupal ordinary comment listing under nodes are ordered earliest first.(created ASC)
If you need to make it DESC, without using views:

/* Implements hook_query_TAG_alter().
* * Alter comments query to order by DESC as well as the default ASC. */
function CUSTOM_query_comment_filter_alter(QueryAlterableInterface $query) {
$orderby = &$query->getOrderBy(); 
$expressions = &$query->getExpressions(); 
// Sorting for threaded comments.
if (isset($orderby['torder'])) {  
// Get rid of the expressions that prepare the threads for ASC ordering.
    // Simply order by the thread field.
$orderby['c.thread'] = 'DESC';  
// Sorting for flat comments.  
$direction = 'DESC';
    if (isset(
$orderby['c.cid'])) {
$orderby['c.created'] = $direction;
$orderby['c.cid'] = $direction;

Surprisingly complex. Maybe should just use views...

Adding open graph tags to node page

//custom.module: function custom_preprocess_node(&$vars) {
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:description',
'content' => trim(strip_tags($vars['node']->body['und'][0]['safe_value'])),