Postingan

Menampilkan postingan dari 2012

Dec 11, 2012

What will I do today? 1. I should be succeeded to set phusion passenger on my computer.

Ubuntu delete whitespace using vim

Gambar
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.

Gambar
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

Belajar Regular Expresion

Ini adalah link yang akan membantu untuk belajar Regular Expresion http://www.icewarp.com/support/online_help/203030104.htm

Ruby On Rails Job

Hi Everyone. I will to share to you about finding job on the foreign. this is the link: http://railsjobs.in/ You can write your country what you want. Hopefully this acticle useful.

Bahaya bahasa Alay :D

Gambar
  Gambar ini dapat dari facebook.

Ruby on Rails creating constant on model

Gambar
Ruby on Rails (Photo credit: Wikipedia ) Follow me to create a constant on model. Many people ask where a good place to take a constant. I recommend to you to take a constant on your model. For instance: 1. I have song.rb class Song < ActiveRecord::Base   #--   # constants   #++   KEY_SIMBOLS = [ "C", "C#", "D", "D#", "E", "F", "F#", "G",      "G#", "A", "A#", "B" ] #-- # public class methods #++  def initial_key initial_key_sym = KEY_SIMBOLS end end 2. I have constant KEY_SIMBOLS 3. You can access with: song = Song.first song.initial_key Thanks

Kurnia Nurhajijah Profile

Gambar
Muhamad Akbar Bin Widayat dan Kurnia Nurhajijah Ini adalah foto saya dengan adik saya.  Foto ini diambil di Klatakan - Tanggul, Jember. Ini adik saya suka di foto. hehe

@karapitan, Bandung

Selamat pagi semua.. Hari ini saya ada di Jalan Karapitan NO. 100 Bandung. @wgs :D

Vim Highlight baris dan setting maksimal karakter

Gambar
Langkahnya: 1. masuk ke .vimrc. Dengan: vim ~/.vimrc 2. Ketikkan  match ErrorMsg '\%>80v.\+' 3. Save dan keluar ketik: wq Semoga bermanfaat

Ubuntu cara mengganti / mengubah password mengunakan command line atau console atau terminal

Ini langkah - langkahnya: 1. Buka terminal atau console. Klik menu Applications > Accessories > Terminal 2. Ketik passwd 3. Isi current password sekarang 4. Isi password baru 5. Isi confirmation password 6. Maka akan mucul pesan "password updated successfully" Semoga bermanfaat.

Ubuntu Cara menggunakan Vim

Gambar
vim logo (Photo credit: Wikipedia ) Bagi pengguna Vim pada Ubuntu ini ada beberapa settingan default saat menggunakan Vim. 1. Ketika sudah menginstall vim. 2. Buat file pada menggunakan vim. 3. Ketik vim ~/.vimrc 4. Kemudian ketik :set number :set smartindent :set tabstop=2 :set shiftwidth=2 :set expandtab 5. Kemudian ketik :wq Saya akan jelaskan satu persatu 1. :set number untuk menambahkan line 2. :set smartindent untuk auto indent line 3. :set tabstop untuk menambahkan tab 2 spasi Semoga bermanfaat..

vim copy and paste outside terminal

When you want to copy, cut, and paste line outside terminal. Please follow me. 1. Put   set clipboard=unnamed on .vimrc 2. restart your vim 3. write v and select what line that you want 4. press p on another file I hope you can success. Thank Note : for the first point, you can put set using gedit or nano.       for instance: nano ~/.vimrc       do not forget save this file.

Iphone 4 Cara Setting Internet XL

Saat ini saya akan berbagi pengalaman untuk Setting Internet XL pada iPhone 4.. 1. Masuk ke Setiing icon 2. Kemudian pilih General 3. Kemudian pilih Network 4. Aktifkan 3G menjadi On 5. Aktifkan Cellular Data menjadi ON 4. - Setting APN: internet     - Setting Username: (di kosongin saja)     - Setting Password: (di kosongin saja) 5.  Ketika icon 3G belum muncul pada menu bar paling atas      Cobalah di restart iphonenya. Semoga bermanfaat  

semangat yang baru di hari senin

Semoga bulan Ramadhan ini, menjadikan saya semakin dekat sama Allah. Amin.. Saya ingin bersemangat kembali.. bismillahhirrahmanirrahim..

semangat

Semangat

Ubuntu Compaq Presario install Webcam

Go to : 1. Applications 2. Ubuntu Sofware Center 3. Search => Cheese Webcam Booth 4. Click Install 5. After that check in Application> Sound and Video> Cheese Webcam Booth 6. Finish

rails 3 Recaptcha::RecaptchaError (uninitialized constant Recaptcha::Verify::Net)

put line: require 'net/http' in config/initializer/recapcha.rb

ruby on rails devise skip validation of password, when edit user in user form

If you want to skip password validation in devise login. In users controller, you only add line below: sign_in @user, :bypass => true unless params[:user][:password].blank? for example: def update     if @user.update_user_data(params[:user])       sign_in @user, :bypass => true unless params[:user][:password].blank?       if current_user.is_admin?         redirect_to users_path       else         redirect_to edit_user_path(current_user)       end     else       render :action => :edit     end   end

Javascript simple prompt

var name; // Prompt for the user's name here. prompt("what's your name?"); if(name === "Sam") {   console.log("Your name is Sam!"); } else{   console.log("Your name isn't Sam!"); }

ubuntu ruby on rails /gems/activesupport-2.3.2/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)

1. go to config/boot.rb 2. add require 'thread' below:     RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)     require 'thread'

Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

gem install -v=2.3.8 rails

ruby on rails 3.2.1 in ubuntu 10.10 `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

1. Go to terminal 2. sudo apt-get install nodejs 3. rails s again

rails 3 Installing pg (0.11.0) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!

Installing pg (0.11.0) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /home/lap048/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /home/lap048/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb --with-pg-config=/usr/local/Cellar/postgresql/9.1.2/bin/pg_config Using config values from /usr/local/Cellar/postgresql/9.1.2/bin/pg_config *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-li

Ubuntu 10.10 how to install netbeans for rub on rails

Install netbeans for ruby on rails di ubuntu 10.10 1. http://netbeans.org/downloads/6.9.1/ 2. Download netbeans for ruby 3. In terminal you should to go to the directory after you finished to download. for example: cd home/your_computer/Downloads 4. sudo apt-get install openjdk-6-jdk 5. sudo sh  ./netbeans-6.9.1-ml-javase-linux.sh 6. finish.

rvm ERROR: Loading command: install (LoadError) no such file to load -- zlib

you can do this: 1. $ rvm pkg install zlib 2. $ rvm reinstall 1.9.2 --with-zlib-dir=$rvm_path/usr if you want to learn more you can go to this link

ruby on rails 3 authlogic session[:return_to] = request.request_uri

reverse below     def store_location       session[:return_to] = request.request_uri     end   by    def store_location       session[:return_to] = request.fullpath     end

ubuntu gedit for rails

http://runningwithrails.com/2011/02/configuring-gedit-for-rails/

ruby on rails phymyadmin make new user

How to make user in phpmyadmin: 1. you must log in as root 2. choose Previllage menu 3. click Add new a User link 4. fill the field username with your username 5. select Local to become localhost 6. fill your password 7. click radio button grand all privilages 8. click Go.

JavaScript how to count of length the array

var lost = [4, 8, 15, 16, 23, 42]; var count = lost.length; var isLost = function (n) {   for ( i=0; i<6; i++ ) {     if ( n === lost[i]) {       return true;     }   }   return false; }; if ( isLost(12) ) {   console.log('12 is a lost number'); } if ( isLost(16) ) {   console.log('16 is a lost number'); }

JavaScript make squaring

var square = function (x) {   x = x * x;   return x; }; square(3);

ruby on rails Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

tambahkan di gemfile, 1. gem 'therubyracer' 2. jalankan bundle install lagi 3. jalankan rails s

ruby on rails helper category

    def category            str = "<ul>"       Category.parent_categories.each do |parent| str +=  "<li>#{link_to parent.name, category_path(parent.id)}<li>"         parent.child_categories.each do |child|        str += "<ul><li>#{child.name}</li></ul>"                 end end str += "</ul>"   return str          end