The name is
Mike Myat Min Han aka 'mmhan'.

I am a developer, mostly do development on Javascript, PHP and CakePHP alongside some development work on C, C++, Obj-C, C# and AS. I also have a thing for Python.

I post here all sorts of crap that I find worthy of sharing: Quotes, Jokes and Notes.

You can check out my blog and follow me on twitter.


Text

May 11, 2011
@ 7:00 pm
Permalink

16 notes

How do you define a variable in MySql?

Here’s how:

SET @name = "Mike", @twitter = "@mmhan";

/** usage **/

SELECT * FROM `users` WHERE `name` = @name AND `twitter` = @twitter;


Text

May 10, 2011
@ 8:05 pm
Permalink

1 note

Many of us believe that when we feel down, we should try to focus inwardly and evaluate our feelings and our situation in order to attain self-insight and find solutions that might ultimately resolve our problems and relieve unhappiness. Susan Nolen-Hoeksema, I, and others have compiled a great deal of evidence challenging this assumption. Numerous studies over the past two decades have shown that to the contrary, overthinking ushers in a host of adverse consequences: It sustains or worsens sadness, fosters negatively biased thinking, impairs a person’s ability to solve problems, saps motivation, and interferes with concentration and initiative. Moreover, although people have a strong sense that they are gaining insight into themselves and their problems during their ruminations, this is rarely the case. What they do gain is a distorted, pessimistic perspective on their lives.

An excerpt from Happiness Project


Text

May 10, 2011
@ 7:00 pm
Permalink

Writing Secure PHP

I was reading this article called Writing Secure PHP, and found a little treasure in that article. 

It’s a hand-out for clients listing out a few basic security details. 

Just noting it down here in case I might need it in time.


Text

May 9, 2011
@ 11:01 pm
Permalink

Using PHP to upload to S3

So, my boredom continues on resulting in this:

Guess what, with this tutorial on nettuts, it’s pretty easy too!


Text

May 9, 2011
@ 9:34 pm
Permalink

Diving into S3

Outta boredom and curiosity, I followed a tutorial on nettuts and viola! The following image is served from Amazon S3!

Image served from S3

It is, however, such a shame that it took me this long to start dipping my toes in S3.


Quote

May 9, 2011
@ 5:23 pm
Permalink

A government big enough to give you everything you want, is strong enough to take everything you have.

— Thomas Jefferson


Text

May 6, 2011
@ 5:50 pm
Permalink

Creating a zip of modified or created files in GIT

So, how do you create a zip file of all the files that was changed to deploy?

Easy does it as answered by Jefromi:

git archive -o [PATH] [NewCommit] $(git diff --name-only [OldCommit] [NewCommit])

So it may goes like:

git archive -o ../latest.zip HEAD $(git diff --name-only 2f646b HEAD)

Text

May 6, 2011
@ 4:14 pm
Permalink

Facebook Graph API OAuthException

Ever encountered an OAuthException that has the following message?

The post's links must direct to the application's connect or canvas URL.

It is due to the settings from the screenshot below.

Just ensure Stream post URL security is disabled.


Photo

May 5, 2011
@ 11:54 pm
Permalink

1,827 notes

(Source: this--too--shall--pass, via cherryodi)


Video

May 5, 2011
@ 8:40 pm
Permalink

Fringe Season 3 “The Day We Died” Exclusive Trailer

Woots! This is neat!

(Source: youtube.com)