Nov 24, 2014

List of mobile network prefix in phillipine

Seems many mobile network user does not aware on the newly added prefixes for every network provider in Philippine this why I right this to consolidate those prefixes. Since crossing over different networks have different promos and charges, most people must aware on those number they calling or text for so they will not charge an extra credit on their account.


Globe Telecome/Republika TM
0915
0916
0917 - Mostly Globe Postpaid
0925
0926
0927
0935
0936
0937
0947

Smart Communication/Talk and Text
0918
0928

Sun Cellular
0922
0923


All person reading this please post those prefixes that i didn't mention to help other other aware for it.

Nov 6, 2014

TipS: Know the right pronunciation one a word - Power by google

Most the time I do google search on every english words that I don't understand, by typing on search box.
define:WORD
And most the time audio icon was displayed to get hear the how the word pronounce. But in some case you cant see the Audio Icon Button. Try this one.

https://ssl.gstatic.com/dictionary/static/sounds/de/0/WORD.mp3

Example:
https://ssl.gstatic.com/dictionary/static/sounds/de/0/gullible.mp3

NOTE: WORD must replace with word you looking for.

Sep 18, 2014

JS - Infinite scroll sample code.

// START OF INFINITE SCROLLING FUNCTION
var base_url = config.base_url;
var offset = 1;
var request_ajax = true;
var ajax_is_on = false;
var objHeight = $(window).height() - 50;
var last_scroll_top = 0;
    
    
var type = '0';
var csrftoken = $("meta[name='csrf-token']").attr('content');
var csrfname = $("meta[name='csrf-name']").attr('content');
$(window).scroll(function(event) {
  var st = $(this).scrollTop();
  if(st > last_scroll_top){
    if ($(window).scrollTop() + 100 > $(document).height() - $(window).height()) {
      if (request_ajax === true && ajax_is_on === false) {
        ajax_is_on = true; 
        $.ajax({
          url: base_url + 'category_more',
          data:{page_number:offset,id_cat:'459',type:type, parameters:'[]', csrfname : csrftoken},
          type: 'post',
          dataType: 'JSON',
          onLoading:jQuery(".loading").html('<img src="/assets/images/orange_loader.gif" />').show(),
          success: function(d) {
            if(d == "0"){
              ajax_is_on = true;
            }else{ 
              if(d.substring(0,5)  == ""){
                $($.parseHTML(d.trim())).appendTo($('#product_content'));
                ajax_is_on = true;
              }else{
                $($.parseHTML(d.trim())).appendTo($('#product_content'));
                ajax_is_on = false;
                offset += 1;   
              }
            }
            jQuery(".loading").fadeOut();    
          }
        });
      }
    }
  }
  last_scroll_top = st;
});
// END OF INFINITE SCROLLING FUNCTION

Sep 10, 2014

How to resize/increase tmpfs partition.

Increasing linux tmpfs partition have two way to do.

1. Modify you /etc/fstab and put the below. Setting below set the tmpfs size to 2GB
LABEL=/     /           ext4    defaults,noatime  1   1
tmpfs       /dev/shm    tmpfs   defaults        0   0
devpts      /dev/pts    devpts  gid=5,mode=620  0   0
sysfs       /sys        sysfs   defaults        0   0
proc        /proc       proc    defaults        0   0

Add size=2G inline to tmpfs besize defaults.
tmpfs       /dev/shm    tmpfs   defaults,size=2G        0   0
After you modify and save your changes, remount the partitions by issuing command below
# mount -o remount /dev/shm
And you done. Or try easier way below.




2. Or if you want the easier way, issue command below to set the tmpfs to 2GB.
sudo mount -o remount,size=2048M tmpfs /dev/shm
NOTE: The breakdown of doing this, this setting will revert after the system was rebooted, so I recommend to modify the /etc/fstab