Joined October 2012
·

padawin

UK
·
·

Posted to Format json output over 1 year ago

Hi, Thanks!

However this is php specific. I used php just as an example.

For example in javascript:

ghislain@debian: /tmp
> cat test.js 
console.log(JSON.stringify([{"name": "John"},{"name":"Peter"},{"name":"Dave"}]));
ghislain@debian: /tmp
> node test.js 
[{"name":"John"},{"name":"Peter"},{"name":"Dave"}]
ghislain@debian: /tmp
> node /tmp/test.js | python -mjson.tool
[
    {
        "name": "John"
    },
    {
        "name": "Peter"
    },
    {
        "name": "Dave"
    }
]

or to use to parse an API response for example.

Nice.

And if you want some more informations, you can add:

export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1

With that, after the branch name, you will have:
- a * if you have local unstaged changes
- a + if you have staged changes
- a $ if your stash stack is not empty

Posted to A way to write a method in a class over 1 year ago

Thanks guys for the contributions and feedbacks ;-)

For the (class|method) comments, I don't always use them (not enough?). I think, as @datishans said, if the signature is clear enough, the comments are not necessary.
I've seen guidelines (used along with phpcs and some hooks) where the comments are mandatory, and in the end that creates a lot of noise in the code, which could be prevented (especially on setters/getters for example...)

Achievements
229 Karma
34,863 Total ProTip Views