NYT: Soda as 12k Steps

Drink Soda? Take 12,000 Steps. Yup. Sugary drinks are total bullshit. Those 12,000 steps clear 75g of sugar, which is just two cans worth.

Tor: Viking Warriors 50% Female

So this is flippin’ awesome. Thank you to Jason for sharing.

It’s with a heavy heart that I admit that Philadelphia’s Federal Donuts is no longer a part of my daily routine. #IllBeBack, though

Bear Saves Crow

Pretty awesome video. Them bears, they often get no respect, but..

grep for naming conventions

I’ve used grep for years, now, though in the past few days I found a nice combination of it and some other command line utilities to do a bit of an audit as to how I’m naming methods and variables in the code I’m writing.

-oh # that’s how it works

a shortcut for --only-matching, this option won’t show the whole line, just the part that matches your search criteria
a shortcut for --no-filename, this will hide the first part of the normal output, so you can look for trends across files more easily

Put these two together, and you can then pipe the output over many files into sort and uniq -c to get an alphabetized, counted list of every instance of the pattern you want to find. You can also then pipe that all into a final sort -n which will sort by the count, such that the biggest fish fall to the bottom.

Use case: camelCase vs. underscores

Putting this all together, you can get a general command something like this:

grep -oh $PATTERN $(find . -name \*${EXT}) \
	| sort | uniq -c | less

To find underscore_separated_words, use PATTERN='\w\+_\w\+'; for camelCase, let PATTERN='[[:lower:]]\+[[:upper:]]\w\+'.

Finally, set EXT='.php' to look over just your PHP files, or change it to any extension of the types of files you want to inspect. You can also use grep’s -r flag with a target directory if you want to recurse through all files, rather than limiting yourself to files with a particular extension.

FC: One Word Stress Relief

How 60 Seconds And One Word A Day Can Reduce Your Stress. Thanks to Sarah for the link. Below is half summary, but more in the way I’ve been seeing things lately.

Stop Hitting Yourself

The first part of the article seems more useful than the second, though both are on the same thread: basically, the point is to stop hitting yourself, with words. Saying negative shit is actually bad for you, and having a negative internal dialogue is even worse.

I’ve been guilty of this long enough myself to know that even making subtle, nicer changes in the words with which you describe yourself can make a big impact. You don’t have to be a double rainbow unicorn, but cutting the shit and doom and gloom is a good first start.

Stand Up

More and more at work, I’ve been conscious of trying to get up out of my chair, especially when there’s a difficult problem to solve. Brood mind can start to carry weight, so dust those shoulders off and shake it off before it takes over in other physical means.

Western Om

Last part is basically about holding one positive thought or idea consciously for 10+ second stretches. Sounds an awful lot like an Om. For me, a sound of silence seems to work better than a word, but if the western PEACE or PLUR or whatever gets you going, why not go for it.

Fist Bumps > Hand Shakes

from the AP, via Yahoo!. Makes sense. I’ve preferred this for a while now, though perhaps now it can gain a bit of traction.