“15 Tips to Enhance your Github Flow” has lots and lots of good advice for anyone working with GitHub. Tips vary from PR templates all the way to automated dependency management and updates. Really useful!
Month: June 2018
Capture and Report JavaScript Errors with window.onerror
“Capture and Report JavaScript Errors with window.onerror” tutorial shows an easy way to capture, log and troubleshoot client-side errors:
onerror
 is a special browser event that fires whenever an uncaught JavaScript errorhas been thrown. It’s one of the easiest ways to log client-side errors and report them to your servers. It’s also one of the major mechanisms by which Sentry’s client JavaScript integration (raven-js) works.
window.onerror = function(msg, url, lineNo, columnNo, error) { // ... handle error ... return false; }
GLWTPL – Good Luck With That Public License
GLWTPL is awesome!
GLWT Public License
Copyright (c) Everyone, except AuthorThe author has absolutely no clue what the code in this project does.
It might just work or not, there is no third option.Everyone is permitted to copy, distribute, modify, merge, sell, publish, sublicense or whatever they want with this software but at their OWN RISK.
GOOD LUCK WITH THAT PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION, AND MODIFICATION0. You just DO WHATEVER YOU WANT TO as long as you NEVER LEAVE A TRACE TO TRACK THE AUTHOR of the original product to blame for or held responsible.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Good luck and Godspeed.
Reboot and wait for reboot to complete in Ansible playbook
Jeff Geerling shares a handy tip on how to implement the configure-reboot-configure pattern in an Ansible playbook.
--- - name: Do something that requires a reboot when it results in a change. ... register: task_result - name: Reboot immediately if there was a change. shell: "sleep 5 && reboot" async: 1 poll: 0 when: task_result is changed - name: Wait for the reboot to complete if there was a change. wait_for_connection: connect_timeout: 20 sleep: 5 delay: 5 timeout: 300 when: task_result is changed ...
Weird operators in PHP
“Weird operators in PHP” covers a variety of awkward and weird operators in PHP. I don’t think I’ll ever write any code using any of these. But in case I come across any code in the future, that utilizes them, I should be sure to search back in the archives of this blog. Here’s an example to get you started:
X-fighters
In case you want to add some firepower to the previous fleet, you can summon X-fighters to the PHP source : +-0-+. The following code adds 3 to $a.
$a = $a +-0-+ 3;