Langsung ke konten utama

Postingan

Menampilkan postingan dari Desember, 2012

Ubuntu delete whitespace using vim

MacVim icon, glossy style (Photo credit: Wikipedia)

Well, I share to you to delete white space using vim. Please follow me.
1. Copy function below to ~/.vimrc

function! DelWhiteSpace()
  %s/\s\+$//e
endfunction
autocmd BufWritePre     *.rb :call DelWhiteSpace()

2. Open a file that has whitespace and write
:call DelWhiteSpace()
3. And write to save and quit
:wq


Hopefully this article is useful. :)


fancybox making function condition

Hello guys,
I would to share about making function. You can take condition on your fancybox. In my case:
I have checkbox that should be checked to show the fancybox.

<pre>
<script type="text/javascript">
  $("#invitation-message").fancybox({
    'onStart': function()
    {
      var $list_friends = $('input[id^="friends"][type="checkbox"]:checked');
      var condition_friend = $list_friends.length
      if (condition_friend > 0) {
         alert('a')
      } else {
        alert('b')
      }  
    }  
  });
</script>
</pre>


Hopefully this article to be useful. :)

Ubuntu An error occurred while loading the archive.

Ubuntu-logo-unique-image (Photo credit: Jeffpro57) Archive:  /home/lap048/Documents/ahjah/jh.zip [/home/lap048/Documents/ahjah/jh.zip]   End-of-central-directory signature not found.  Either this file is not   a zipfile, or it constitutes one disk of a multi-part archive.  In the   latter case the central directory and zipfile comment will be found on   the last disk(s) of this archive. zipinfo:  cannot find zipfile directory in one of /home/lap048/Documents/ahjah/jh.zip or           /home/lap048/Documents/ahjah/jh.zip.zip, and cannot find /home/lap048/Documents/ahjah/jh.zip.ZIP, period.

Solution: 1. Open Terminal and go to jh.zip     cd ~/Document/ 2. run this:     jar xvf jh.zip
Hopefully this article useful. Thanks