Monday, September 26, 2016

Gist Test

Gist adalah cara sederhana untuk berbagi snippet. Semua gist adalah repository git yang mendukung versioning, forking, dan dapat digunakan sebagai repository git.

Step 1: Create a Gist 

  1. Log in to Github 
  2. Click the Gist link at the top of the screen (or go to gist.github.com) 
  3. Fill out the file name (description is optional) 
  4. Enter your code 
  5. Click Create Public Gist 
  6. Optional: You can also click Add File at the bottom to split your code snippet up into several different files if you need to.

Step 2: Embed your Gist

Once you create your Gist, you will be presented with a confirmation page. Click the show embed link and copy/paste the script tag on to your website.

Sunday, September 25, 2016

Angular 2

Develop Across All Platforms 

Learn one way to build applications with Angular and reuse your code and abilities to build apps for any deployment target. For web, mobile web, native mobile and native desktop.

Speed & Performance 

Achieve the maximum speed possible on the Web Platform today, and take it further, via Web Workers and server-side rendering. Angular puts you in control over scalability. Meet huge data requirements by building data models on RxJS, Immutable.js or another push-model.

Incredible Tooling

Build features quickly with simple, declarative templates. Extend the template language with your own components and use a wide array of existing components. Get immediate Angular-specific help and feedback with nearly every IDE and editor. All this comes together so you can focus on building amazing apps rather than trying to make the code work.

Loved by Millions

From prototype through global deployment, Angular delivers the productivity and scalable infrastructure that supports Google's largest applications.

Thursday, January 21, 2016

Bangsa besar mana yang tidak pernah hancur.

Dahulu kala sudah pernah ada bangsa-bangsa besar, tapi sebesar apapun bangsa itu, suatu saat mengalami kehancuran. Mereka menguasai ilmu pengetahuan, teknologi, sumber daya alam, dan kekayaan lainya. Contoh, kaum Tsamud. Mereka mampu mengelola pertanian dengan profesional. Mereka terkenal cerdas soal arsitektur. Padahal zaman dahulu mungkin belum ada teknologi konstruksi seperti sekarang ini dan mereka sudah bisa membuat hal yang sangat hebat. Seperti gambar berikut ini:




Ada lagi...
Nenek moyang bangsa kita sendiri, pernah mengalami masa kejayaan, misalnya Kerajaan Majapahit siapa yang tidak kenal? Tapi suatu saat hancur juga.




So...?
Bangga menjadi bangsa yang besar...?
Bangga bisa menguasai berbagai macam ilmu pengetahuan dan teknologi...?
Bangga dangan ini dan itu...?

Suatu saat pasti... akan hancur...!
Gak percaya?

Yuk kita pelajari apa saja penyebab kehancuran-kehancuran itu... tapi next time ya...?!!

:-P ~~~~


My SQL check duplicate value



1. Deteksi value yang dobel.
SELECT book_title, COUNT(*) c FROM `book` GROUP BY book_id HAVING c > 1;

2. Hapus salah satu value yang dobel.
DELETE n1 FROM book n1, book n2 WHERE n1.book_id > n2.book_id AND n1.book_title = n2.book_title;


3. That's it.

Friday, August 29, 2014

Magic (Dynamic) Virtual Host and Subdomain

Berikut ini cara membuat virtual host dan subdomain secara magic / dinamis.
Biasanya restart web server. contoh ubuntu -> service apache2 restart
Sekarang tidak perlu lagi restart webserver. Tinggal arahkan saja A Record pada Control Panel Domain ke IP address server.

Aktifkan dulu module berikut ini:
- vhost_alias
dengan cara :
$: sudo a2enmod vhost_alias

Buat symlink:


Bikin symlink biasa   -> ln -s {/path/to/file-name} {link-name}
Bisa AutoUpdate -> ln -sfn {/path/to/file-name} {link-name}

Magic Virtual Host:


$: cd /var/www/domains
$: ln -sfn /var/www/maheswara /var/www/domains/maheswara.com
atau
$: ln -sfn /var/www/maheswara maheswara.com

Edit httpd.conf atau apache2.conf atau site-avalable/*.conf


###################################################
NameVirtualHost *:80
UseCanonicalName Off
<VirtualHost *:80>
   VirtualDocumentRoot /var/www/domains/%0
    <Directory /var/www/domains>
       Options Indexes FollowSymLinks
      AllowOverride All
      allow from all
   </Directory>
</VirtualHost>
###################################################

Magic Sub Domain:


Kalau mau bikin magic sub domain harus ditentukan dulu domain utamanya.
Binggung juga sih, kalau virtual host dan subdomain dibarengin.
Belum nemu caranya. Mangkanya dibikin alternatifnya seperti dibawah ini.
Kalau kamu ketemu caranya tolong di share ya, di komentar bawah ini.. OK Bro?

Ini karena kedalaman subdomain sendiri berbeda.
misalnya :
- *.maheswara.com ===> ini kedalaman level 3, maka ditulis %-3
- *.maheswara.co.id ==> ini kedalaman level 4, maka ditulis %-4

Nah kalau yang ini perlu melakukan :ubuntu -> service apache2 reload
Tapi cuma sekali saja kok, yaitu ketika ada penambahan domain baru yang memerlukan sub domain secara dinamis/magic.
Oya, direktif ServerName gak usah di tentukan, karena sudah dikenali sama settingan di atas, dikasih pagar #ServerName maheswara.com, atau buang aja deh, biar gak ribet ngelihatnya...

###################################################
<VirtualHost *:80>
  ServerAlias *.maheswara.com
  VirtualDocumentRoot /var/www/domains/maheswara.com/%-3
</VirtualHost>
###################################################

Demikian.
Semoga bermanfaat.


Friday, April 18, 2014

15 Simple Ways To Get Confidence Back


Confidence is essential to survival. If you’re a man, you can’t even attract a mate without it, as women (and even gay men) are attracted to tenacity. There are times, however, when a devastating or unexpected loss can sap you of your poise. If you’re down, here’s how to get confidence back into your system so you’re ready to take on the world again.

1. Find Your Comfort Zone
Everyone has a comfort zone, whether it’s food, music, art, a favorite book, movie, TV show, a specific geographic location or group of people. Whatever it is that makes you feel comfortable, get into that zone. You’re not there to hide from your problems or dwell on them. You’re there to recharge; just like your muscles and mind need time to recharge, so does your mood. Take a staycation in your comfort zone to regain your composure.

2. Change Your Thoughts
Actively make a conscious decision to change your thought processes. Every time you doubt yourself, counter those thoughts with ways you can overcome. Remember most of your problems are in your head. That’s not to say they don’t exist – merely that you’re allowing them to affect you. Stand up to and for yourself, and you’ll learn ways to stand up to and for everyone else.

3. Smile Like You Mean It
A smile goes a long way. Even if you’re not fully sure of yourself, you’ll exude a sureness that encourages people to perceive you as a confident person. You’ll be seen as a leader rather than a follower, and things will be more likely to go your way. The media portrays Special Forces soldiers as killing machines, but one of their most used weapons is a friendly smile. Diplomacy is strong, so put a smile on your face, and make the world a better place.

4. Don’t Slouch!
Your posture and the way you carry yourself goes a long way in determining your appearance. If you’re slouched over, people assume you’re weaker. This is how nature works – every plant and animal species on this planet understands survival of the fittest, and you need to look like you’re fit. Make an effort to sit up and stand up straight and tall.

5. Take Baby Steps
Everything happens in steps. Don’t get discouraged if there’s no magical change that suddenly makes you confident. Focus on your path, and understand it’ll take baby steps to get where you want. You’ll soon be taking baby steps from confidence to full-on success in life.

6. Clean Yourself Up
Cleanliness is close to godliness (or so I’ve heard). Hygiene is vital to your confidence – it’s hard to feel good about yourself when you’re stained, sweaty and smelly. No matter what your circumstances in life are, do your best to stay clean, as it’s the key to your confidence.

7. Face Your Fears
Everyone has a list of fears and phobias, although many don’t want to admit it. I’m afraid of snakes, spiders, heights, loss of control, drowning, the dark, other people, and just about everything under the sun. I’m even afraid of the sun since I have moles and have a high melanoma risk. These are natural fears that everyone has on some level or another – it’s a fear of death and the unknown. Face at least one of your fears. When you survive, you’ll be that much more confident.

8. Define Yourself
You are your present choices. Your past decisions and future aspirations determine how your present choices are perceived, but you are your present choices. Learn how to define yourself. Set your rules and boundaries and follow them. These are your morals and ethics, and they’re the foundation of who you are. Never forget that.

9. Embrace Mistakes
Looking back (even while it was happening), we judge Michael Jordan on his successes. People quote him as the greatest basketball player of all time and use his wins, championships and statistics to back it up. Jordan himself, though, reached that level by focusing on his failures. What drove Michael Jordan wasn’t the high from making a game-winning shot, it was the low of missing one.

10. Live In The Present
Learn to appreciate everything around you. By practicing gratitude, you’ll change your perspective. Instead of being upset about losing an important client or failing a test, you’ll be grateful for the air you breathe, the water you drink, the food you eat, and the people you love. Focus on the now, because it’s all you truly have.

11. Take Inventory
If you’re reading this, you also have a lot of secondary stuff, such as a computer, the Internet, the knowledge to use it, the ability to read. You have a lot of skills and resources available to you, even if they’re not the ones you wish they were. Figure out what you have, and find ways to use them.

12. Socialize
Talk things out with friends and family – they’re normally happy to help you regain confidence. If they (or lack thereof) are the reason you lack confidence, expand your social circle. Go to public places and interact with strangers. If you fail to make an impression or completely blow it, who cares? They weren’t in your life before, and you won’t miss them.

13. Play A Game
Video games are great for a lot of reasons, and gaining confidence is just one of them. In real life you may be a boring file clerk with a dead-end life, but in a video game, you can be whoever you want. Every video game console (as well as the majority of computer and mobile games) has achievements. Hunt down some easy wins to jumpstart your spunk.

14. Do Something Crazy
I’m a firm believer in spontaneity being the spice of life. Go out and do something you said you never would. When I reached a point in my life where it felt like nothing could go right, I jumped out of an airplane. As I fell through the air, I had several epiphanies that forever changed my life. No other decision in my life had more of a direct impact on my life than that one crazy act.

15. Try Again
If your lack of confidence is caused by failure, pick up and try again in any way possible. It doesn’t have to be immediately – you can practice, learn and evolve prior to trying again. This time, however, go in as an experienced veteran who took a few licks and got back up stronger, faster and smarter than before.

It’s easy to lose your confidence. Unexpected things happen, and you can very easily find yourself on the short end of the stick. Even though it seems like you’re the only one it’s happening to, we all experience inequalities and failures. Stick it out, and you’ll eventually get the confidence it takes to succeed.

Sumber: http://www.lifehack.org/articles/communication/15-simple-ways-get-confidence-back.html

12 Things Highly Confident People Don’t Do


I think some people confuse self-confidence with having a big ego. It’s almost like they think that if they love themselves, then other people will think that they are stuck-up and unlikable. I couldn’t disagree more. I always say that truly confident people don’t need to go around telling people how great they are because they don’t need to. People automatically notice their greatness from their positive behavior. Here are things that highly confident people just don’t do:

1. They don’t judge or make fun of other people.
When someone is confident, they want you to be confident too. Confident people are loving people. They want to lift you up, not tear you down.

2. They don’t seek attention for the sake of attention.
They may have an outgoing, life-of-the-party personality, or they might be quiet and shy. But even if an extrovert has high self-confidence, they don’t need the attention. They are fine if they receive it, but they don’t go actively seeking outside validation because they have already validated themselves. And that’s all they need.

3. They don’t brag about their accomplishments.
Confident people are proud of their accomplishments. And they truly want to help people. But they do the things they do because they have passion for it. They don’t have a “Look at me! Look how awesome I am!” attitude.

4. They don’t spread negative energy.
People want to be around them. They ooze positive energy. Contrary to the “energy vampires” of the world who do nothing but suck the life out of you, confident people add to you; they don’t take away.

5. They don’t only talk about themselves.
Confident people are genuinely concerned about others, not just themselves. They ask questions. They offer suggestion and advice if they are asked. They make conversations and relationships a two-way street.

6. They don’t over-complicate things.
They don’t make mountains out of mole hills. Confident people try to act calmly and rationally for the best of all concerned. Sometimes that includes simplifying things so that problems can be solved with a “team” mentality, not a “me vs. you” mentality.

7. They don’t focus on what they don’t want.
If you only focus on what you don’t want, you’re only going to get more of what you don’t want. Confident people know that. They look at the bright side and have a grateful heart. They set goals, hold up a positive vision of their desire, and then they take action and go after it.

8. They don’t act full of themselves.
Confident people never project an attitude. Instead, they project kindness and warmth. They smile and laugh. They want you to feel good about yourself, instead of telling you how great they are.

9. They don’t break their word.
When someone breaks their word, it disappoints other people. Confident people know this. They don’t want other people to feel bad. Their intention is to lift up other people, so they make sure they do everything they can to do what they say they are going to do.

10. They don’t shy away from failure.
Highly confident people know that there really is no such thing as failure. There are only learning opportunities. And when the failures, or learning opportunities, come along, they know that they will be better for it. They don’t judge themselves negatively. They simply say, “thank you for the lesson” and move on.

11. They don’t waste time on things that don’t matter.
Confident people know what really matters in life. People matter. They prioritize time to spend with loved ones because it’s what life is all about. They also don’t sweat the small things. They put things into perspective and have an appreciation for everything.

12. They don’t focus on the negative.
Generally speaking, confident people are optimists. They are happy. They look at what is good, not what is bad. They focus on what can go right, not what can go wrong. They don’t dwell in negativity. Instead, they see the positives in every situation.

Sumber: http://www.lifehack.org/articles/communication/12-things-highly-confident-people-dont.html