Joined October 2012

Peter Mescalchin

Web applications developer at Magnetikonline
Web applications developer
Melbourne, Australia

Can you give an example?

Posted to Utilizing Nginx's FastCGI cache over 1 year ago

Check the docs:

  • fastcgi_cache_valid controls cache time
  • debugging is/can be done with add_header X-Cache $upstream_cache_status; which will add a HIT/BYPASS HTTP header to responses.
  • The setup of fastcgi_skipcache is a job left to the reader, it's working great here but does require a good understanding of your application and/or usage patterns to get it right.
Posted to A good .gitconfig starting point. over 1 year ago

I'll throw mine into the ring.

I much prefer "git status -sb" for the "git st" alias. Smaller status output FTW! :)

Posted to CSS Class Inheritance in CSS over 1 year ago

Certainly would look at using Sass and the @extend operator, rather than potentially expensive attribute selectors.

@gxorgxo much nicer way IMHO - doesn't mess with the source array - useful for working over nodeLists too (since they won't evaluate false).

Posted to Bye Bye CSS Box Model... over 1 year ago

@davsket @nikola exactly, that's always been my understanding of single selectors like */h1/p/div/etc. it's only when chained up with parent selectors that the browser needs to start sniffing the DOM tree and flex it's muscles... ;)

Posted to Bye Bye CSS Box Model... over 1 year ago

@davsket since everything works "right to left" a universal selector is really only going to be slow if it's part of a CSS chain - e.g. "* { my-css-rule: value }" would be much, much worse if I wrote ".my-class * { my-css-rule: value }" - since now EVERY element needs to know if it has ".my-class" anywhere as it's (grand)parent or higher.

This is where CSS parsing is going to really choke, if anywhere.

Posted to Bye Bye CSS Box Model... over 1 year ago

@elad2412 true, true - but for the sake of one line of CSS I personally keep it in to provide some backward compat. support.

Posted to Bye Bye CSS Box Model... over 1 year ago

Nice summary - note your first CSS snippet should have a "-webkit-box-sizing:" in there too :D

Posted to CSS3 Width Transitions over 1 year ago

Ahhh @rylnd, CSS3 transition support only kicked in with IE10 - so anything below will ignore the transition directives.

Posted to Screw @mixin, use @extend! over 1 year ago

Was about to add extend placeholders - probably worthwhile adding to this tip - as it's probably the closest behaviour to what your mixin will achieve (e.g. the mixin itself does not emit output).

This also works perfectly in ST2 - it's the way I roll with my editor, always :D

@dpashkevich I really can't say - since I typically deploy using rsync and some custom PHP scripts to minify CSS/JS and bundle assets (which I hope to clean up and put on GitHub someday....).

Posted to MySQL Query Optimization over 1 year ago

@smidwap for the data between your database -> application it can be a huge difference depending on the datatypes/sizes in each row. And this is compounded if the database -> application aren't on the same machine using sockets, and are using TCP/IP for the transit.

Your point on query caching makes this even worse, since your cache sizes are going to full up much quicker, since you run the risk of caching more data than you actually need/use - which could be considered wasteful.

Interesting, but have to admit, I have never seen this in the wild. Usually it's someone adding a closing ?> to PHP class files - and then additional bytes getting emitted on the require()/include()

@dpashkevich very simple infact - a quick search turned up this which will give you exactly that the magic sauce is in core.worktree and the hooks/post-receive script.

Posted to The Bestest Git Setup over 1 year ago

Probably the most valuable difftool switch I have found recently is "-d", which is available in more recent Git builds. Great for diffing many files in a visual diff tool that can handle directories.

As used here with the "da" alias.

Posted to Parsing Large XML Files Using PHP over 1 year ago

Something like this - you should be running from CLI/Shell anyway and not from a HTTP request - in which case the PHP execution time limit is always hard coded to zero (e.g. - unlimited time)..

Posted to Another few tips for Sublime Text over 1 year ago

Ctrl+; and Alt + F3 were new to me - thanks!

Posted to Your PHP site may not be secure over 1 year ago

Also, more than likely this will be dropped from PHP 5.5 once it goes final -> along with the logo/image GUID's that exist.

Posted to var_dump vs. var_export over 1 year ago

@pyrech exactly - that's the comment I wanted to see :)

Posted to Less + Sublime Text 2 in ubuntu over 1 year ago

Or if SASS is more your thing - my notes:

Posted to Your PHP site may not be secure over 1 year ago

Good tip there - and something I have been doing for years - but good to share it around! :D

Nice work - PHP 5.5 should put most of these password hashing issues to bed with the new in-built password hashing API.

Posted to Speed up Drupal with realpath cache over 1 year ago

Nice tip - but it's a shame more PHP webapps turn to using absolute require/include calls instead of relative paths - which is rather trivial with __FILE__ and __DIR__ (5.3+) magic constants in PHP.

Using an absolute path skips use of the realpath cache completely so this becomes a non-issue as PHP doesn't need to convert a relative -> absolute path and then cache the result.

Love it - I think there is something big in this to get everyone out of "chained event listener hell" (trademark!).

Posted to Add some color to your diff output over 1 year ago

@shawncplus lol - all good :D thx for the vid, will check it out!

906 Karma
52,925 Total ProTip Views