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
Miscellaneou$

I just got an email from Google saying that someone logged in to my account using some different email address!?

This got me pretty alarmed:

GoogleHackAttemptFullMail

I immediately checked the devices from which it was accessed but couldn’t see any different from what I use usually. Nevertheless, even though I use two-factor authentication, I changed my password immediately.

Now, has any one of you had a similar experience? I thought the “problem” could be related with Google ignoring the dot (.) in the email thus for example [email protected] and [email protected] would come to the same email address. But, someone used the added numbers 33, so this hardly would pass as the same use case.

Anyways, still kind of baffled about it, so would appreciate some insight from more knowledgeable users.

edit: I asked this question on another StackExchange site (StackOverflow is a part of StackExchange btw) called Web Applications and will see if I get some explanation  there.

edit2: The answer, as that usually is the case with StackExchange sites, came pretty swiftly. User Al E. responded:

It’s hard to tell exactly what you’ve got here. (I don’t speak or read the language. (Slovenian? Croatian?)) I suspect one of two possibilities:

  1. Someone logged in (or tried to log in) from an area where you usually aren’t. (I might get a message if someone tried to log in from China, when I’m on the East Coast of the U.S.)
  2. More likely, I think, is someone has set your email address to be their recovery email or alternate email, and probably by mistake

I think you’ve done the responsible thing. You’re already using two-step authentication and you’ve changed your password. This probably won’t ever come up again. I wouldn’t worry any more about it.

And my comment on it was:

Thanks for your answer. Sorry for not translating Croatian (very close guess btw!), but essentially what it says is that someone just signed in to my account [email protected], then some details and then the question with a link if I don’t recognize this activity. Since this email isn’t mine I’m inclined to thinking that the possibility 2 really is the case, be it intentional or unintentional. But yeah, I probably should have a peace of mind having changed the pass immediately and since I have a two-way auth enabled. Thanks for reassurance! –

Stack Overflow

How to rewrite php echo with <<

profile for Nikola at Stack Overflow, Q&A for professional and enthusiast programmers
I’m a big fan of Stack Overflow and I tend to contribute regularly (am currently in the top 0.X%). In this category (stackoverflow) of posts I will will be posting my top rated questions and answers. This, btw, is allowed as explained in the meta thread here.

My question was:

I am wondering how to rewrite this code to work with qq:

  $containerRight = <<<qq
    <div class="container_right">
        {echoLikeBox()}

        <div class="join_us"><a href="#"><img src="images/join_us.png" width="304" height="44" alt=""></a></div>

        <div class="box2"><a href="#"><img src="images/twitter_big.gif" width="304" height="292" alt=""></a></div>

        <div class="box3"><a href="#"><img src="images/facebook.jpg" width="304" height="257" alt=""></a></div>

        <div class="box4"><a href="#"><img src="images/google_ads.gif" width="304" height="164" alt=""></a></div>
    <!-- container_right end --></div>;
    qq;
    echo $containerRight;

The problem is that I don’t know how to echo function inside the <<<. The code for the echoLikBox() is this:

function echoLikeBox()
{
    $likeBox = <<<qq
    <div class="box1">
            <div class="box1_lft"><a href="#"><img src="images/tweet.jpg" width="108" height="20" alt=""></a></div>
            <div class="box1_rht"><a href="#"><img src="images/like.jpg" width="82" height="20" alt=""></a></div>
            <div class="clear"></div>
    </div><!-- box1 end -->
    qq;
    echo $likeBox;
}

edit: found the solution here: Calling PHP functions within HEREDOC strings

 

The answer, by user Gavin Anderegg, was:

You may want to change the “echoLikeBox()” function to, instead of echoing its contents, store them as a string. You can’t make a call to a function inside of heredoc strings, but you can output variables. So, for example, you could have:

function echoLikeBox()
{
    $likeBox = <<<qq
    <div class="box1">
            <div class="box1_lft"><a href="#"><img src="images/tweet.jpg" width="108" height="20" alt=""></a></div>
            <div class="box1_rht"><a href="#"><img src="images/like.jpg" width="82" height="20" alt=""></a></div>
            <div class="clear"></div>
    </div><!-- box1 end -->
qq;
    return $likeBox;
}

and then just

$likeBox = echoLikeBox();

$containerRight = <<<qq
    <div class="container_right">
        $likeBox

        ...

inside of the main body.

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