I recently switched back to windows as my primary development system and encountered some weirdness with git.
My projects were showing lots of changed files but after inspecting the files for changes, there were none.
Git status on windows is sensitive to changes in file mode (permissions) and line endings (CR/LF).
Like most things in git, this behavior is configurable.
git config core.fileMode false
This lets git ignore those file mode changes and will let you get back to work.
You need to update vagrant to get some work done and trying to use brew to install vagrant is failing with an error message of "Error: Cask 'vagrant' definition is invalid: Bad header line: parse failed".
You probably haven't updated brew in a really long time. Here's how to get that working again.
brew update; brew cleanup; brew cask cleanup
brew uninstall --force brew-cask; brew update
Thanks to adidalal of the caskroom project for this solution.
PHP plays fast and loose with its data types which is one of the features that folks coming from more structured languages find very off-putting.
In phpland it's also the fastest way to sanitize an input which you expect to be an integer.
<?php $var = (int) $var;?>
The result is an integer. If the value of value of var is a number, it's converted into an integer. If it's not a number or doesn't begin with a number, then it's given a value of 0.
Here's a quick test script to illustrate the point. It tests both success and failure conditions.
And the results of this test when run with php 5.5?
Time to complete 1000000 (int) conversion filters:0.46194696426392
Time to complete 1000000 int_val filters:0.72814893722534
Time to complete 1000000 preg_replace filters:6.5657861232758
Time to complete 1000000 filter_var(x,FILTER_SANITIZE_NUMBER_INT) filters:1.5239408016205
The test does a million repetitions of numeric values and not-numeric values. The result being type cast is almost twice as fast as intval(), 3.7 times faster than filter_var() and 18x faster than preg_replace(). If we had not done this in a tight loop the results wouldn't have been so dramatic but you get the idea.
That's something to keep in the toolbox the next time you encounter an integer that needs to be filtered.
Oh KitKat, I really wanted to like you. You took my perfectly functional Nexus7 and its silky smooth menus and app switching and wrecked it. Now I have a whole lot of hurry up and wait. Wait. WAIT!
I haven't been this frustrated with an operating system since Windows 95.
Well, it appears the the solution is really simple: Wipe and Reinstall.
If you've been backing up your device into the cloud, google will automatically reinstall all your apps, contacts etc when you login. My guess is my device was really full when KitKat installed and really needed more space than I had.
If you're a nexus 7 user about to throw away your tablet, give this a try first.