Nikola Brežnjak blog - Tackling software development with a dose of humor
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Home
Daily Thoughts
Ionic
Stack Overflow
Books
About me
  • Home
  • Daily Thoughts
  • Ionic
  • Stack Overflow
  • Books
  • About me
Nikola Brežnjak blog - Tackling software development with a dose of humor
Books

Spell or high water – Scott Meyer

My notes from a book Spell or high water by Scott Meyer, which I rated 4/5 on my Shelfari account and which I think every programmer will enjoy. Bash scripts, hidden files, root access, you’ll love it 🙂

Martin leaned forward and asked what did you do next? I thought about getting myself a bunch of money, but I thought that was probably the fastest way to get caught. Martin decided to never tell Roy how he had gotten caught.

He made an effort to listen more than he talked, which doesn’t come naturally when you seem older than everyone around you by at least 20 years.

Did that sentence made sense when you planned it in your head, or do you just open your mouth and let the words fall out however they like?!

Is killability even the word? If I use it and you know what it means, it’s a word.

Imagine if you could introduced an atheist to God. Will the atheist find religion, or would he find the reasons to disbelieve the evidence of his own eyes?

You make more mistakes because you try more things than they do.

For a smart person to argue with the dumb person they have to dumb down their logic on the fly, while the dumb person thinks in dumb logic naturally, giving them an advantage.

There’s nothing showoff hates more then a competing showoff.

The audience expects us to fool them. They don’t think the magician can really do magic. They come to be entertained by a lie.

My notes from a #book every #programmer will love: Spell or high water by Scott Meyer http://t.co/5Bifx7WjVE

— Nikola Brežnjak (@HitmanHR) September 7, 2015

Wordpress

How to add Logout link to WordPress WooCommerce

First, find the text that says something like Login or register. A tool like AstroGrep, if you’re on Windows, may be of great help if you don’t know in which file you have to look (like I didn’t).

Then you will most probably see something like this:

<div class="account_links">
	<?php if ( is_user_logged_in() ) : ?>
		<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','wpdance'); ?>">Mein Konto</a>
	<?php else : ?>
		<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login','wpdance'); ?>">Anmelden</a>
		<span>oder</span>
		<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Create An Account','wpdance'); ?>">registrieren</a>
	<?php endif; ?>
</div>

In the is_user_logged_in() part of the if add the following statement:

<a href="<?php echo wp_logout_url( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );?>">Logout</a>

so that the final code then looks like this:

<div class="account_links">
	<?php if ( is_user_logged_in() ) : ?>
		<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('My Account','wpdance'); ?>">Mein Konto</a>
		<span> | </span>
		<a href="<?php echo wp_logout_url( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );?>">Logout</a>
	<?php else : ?>
		<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Login','wpdance'); ?>">Anmelden</a>
		<span>oder</span>
		<a href="<?php echo get_permalink( get_option('woocommerce_myaccount_page_id') ); ?>" title="<?php _e('Create An Account','wpdance'); ?>">registrieren</a>
	<?php endif; ?>
</div>

This is it for this quick tip, hope it helps someone. I’ll keep it for reference for when I can’t remember it straight away…

Recent posts

  • Discipline is also a talent
  • Play for the fun of it
  • The importance of failing
  • A fresh start
  • Perseverance

Categories

  • Android (3)
  • Books (114)
    • Programming (22)
  • CodeProject (35)
  • Daily Thoughts (77)
  • Go (3)
  • iOS (5)
  • JavaScript (127)
    • Angular (4)
    • Angular 2 (3)
    • Ionic (61)
    • Ionic2 (2)
    • Ionic3 (8)
    • MEAN (3)
    • NodeJS (27)
    • Phaser (1)
    • React (1)
    • Three.js (1)
    • Vue.js (2)
  • Leadership (1)
  • Meetups (8)
  • Miscellaneou$ (77)
    • Breaking News (8)
    • CodeSchool (2)
    • Hacker Games (3)
    • Pluralsight (7)
    • Projects (2)
    • Sublime Text (2)
  • PHP (6)
  • Quick tips (40)
  • Servers (8)
    • Heroku (1)
    • Linux (3)
  • Stack Overflow (81)
  • Unity3D (9)
  • Windows (8)
    • C# (2)
    • WPF (3)
  • Wordpress (2)

"There's no short-term solution for a long-term result." ~ Greg Plitt

"Everything around you that you call life was made up by people that were no smarter than you." ~ S. Jobs

"Hard work beats talent when talent doesn't work hard." ~ Tim Notke

© since 2016 - Nikola Brežnjak