I love web technologies, makes everything beautiful and easy, also free. But... too much of it make you sick. Don't like complicated situation, let it be easy. Don't like hard coding, make your own codes library. :)
Selasa, 31 Juli 2012
Simple Language Selector
Ada beberapa cara agar membuat halaman web bisa memberi layanan multi language. Diantaranya adalah dengan: Server side script (PHP, ASP, JSP, dll), Client side script (Javascript), dan CSS. Cara paling mudah adalah dengan menggunakan CSS. Berikut ini adalah contoh scriptnya:
<!DOCTYPE html>
<html>
<head>
<title>Simple Language Selector</title>
<style>
body:lang(id) *:lang(en),body:lang(en) *:lang(id) { display:none; }
</style>
</head>
<body lang="id">
<div>
<a href="#" onclick="document.body.setAttribute('lang','en'); return false;">English</a> | <a href="#" onclick="document.body.setAttribute('lang','id'); return false;">Bahasa</a>
</div>
<h3><span lang="id">Contoh</span><span lang="en">Example</span></h3>
<div><span lang="id">Ini adalah halaman contoh dalam menyediakan fasilitas multi bahasa</span><span lang="en">This is a sample page in supporting of multi-lingual</span>.</div>
</body>
</html>
Download script: http://sites.google.com/site/karuniaprojects/documents/multi-lang.html
Rabu, 11 Juli 2012
The Programmer's Code - 27 Rules to Code By
Daily Disciplines
- Be consistent.
- Fail fast and hard.
- Never write the same code twice.
- Be explicit.
- Code for the maintainer.
- Adapt and adopt.
- Simplify, simplify, simplify. Or I just say, simplify.
- Minimize scope.
Design Disciplines
- Beware the BSOD (Bright Shiny Object of the Day).
- Layers, levels, loops and bubbles.
- Make decisions at the lowest level possible.
- Favor composition over inheritance.
- Minimize dependencies.
- Names matter.
- Don't design the future.
- Functional first.
- Everything is an API.
- Minimize UI code.
Attitudes
- Humility happens.
- Never say *should*, *impossible* or *it works for me*.
- Everything is possible with enough time and money.
- Think like a user.
- The Missouri Mind (Show Me)
Precepts
- Assess often.
- If it's not demoed, it's not done.
- If it can be forgotten, it will be.
- Rules are best broken by those who have mastered them.
Langganan:
Komentar (Atom)