Angular 2 testing directives with events bound to document

I ran into an issue today where I was writing a test for a directive I created. The directive has a HostListener which binds to document:mouseup and the tests were not able to trigger that particular event with the typical triggerEventHandler function. There is currently a feature request to help with this issue. The workaround stated on that feature request wasn't very descriptive, so I had to figure out another way to call the bound event listener on my directive. Here's some code:

@Component({

[more...]

Crazy Bluetooth issues on Linux with Bose QC35 headphones

Update again for Ubuntu 17.04

I was having connectivity issues again after rebooting my laptop. I had to change Enable=Socket back to Disable=Socket. Furthermore, I had to use Blueman to "Trust" the headphones to allow reconnection without setting the headphones up everytime I turned them off and back on. However, I will leave the update below in place, just in case. As it seems to help me overcome my issues initially.

[more...]

External monitors with xrandr and a Lenovo Thinkpad Pro Dock

Recently, I purchased a nice new Lenovo ThinkPad T460s. Naturally, I'm running Ubuntu on it and maintaining my new venture into using the i3 window manager. One problem that I ran into with this was when docking the ThinkPad at work. I wanted to use an external monitor that was plugged into the dock. Since i3 doesn't manage things like this for you, I had to hook into some events that know when the laptop has been docked and undocked and then use xrandr to hook up the external monitor. This is how I managed to make it work. Albeit, with a few bugs...

First, you need to create a script that will handle your xrandr commands. I called this script manage-monitor.sh and I put it inside of /etc/acpi/.

[more...]

i3 window manager

Lately, a buddy of mine, joshtronic, has been getting back into the Linux world after a short hiatus using OSX. During this process, he has been trying different distributions as well as desktop environments and window managers. We both had a stint using xmonad for a while and we both really enjoyed using it. This time, he decided to try i3wm. This sort of inspired me to try it out myself as well... I figured I would make some notes on some of the things I did to get it in a usable state for myself.

The desktop

[more...]

What happens when you sit at a desk for 13 years - and actually exercise.

Update/Note After a bad fall on my mountain bike that jacked up my back and caused a broken rib, I started to exhibit back issues. My doctor and physical therapist recommend I try out a standing desk at work to see if it helped with my back fatigue that was caused by these injuries. As of this update, I have been using a standing desk for 1 week as well as doing my exercises. I will report back in a month (maybe a bit longer if time slips by) and let you know where I stand (get it? tee hee) on this issue and if my opinion has changed at all.

Update June 22nd, 2017 I have been using my standing desk for 6 months. It did not help my back issues. What did help my back issues was stretching and exercise. I went 2 months with just the standing desk and typical exercise and did not notice a difference. When I finally started targeting my back with specific strengthening/stretching exercises, I started to feel the difference. The desk is still super nice and I enjoy it, however, it does not seem to offer any significant or noticeable health benefits for myself. At most, it is just nice to change positions every now and then.

[more...]

page: 1 of 3