Posts

Adding functionality to Nopcommerce's admin screens without copying and pasting existing views

Image
IntroductionNopcommerce's plugin engine is fairly powerful, providing extension points to expand core functionality. A sizable ecosystem has been built aroudn these extension points. When it works, it adds a lot whole lot of value. However, oftentimes required extension points do not exist, and extending the platform becomes much trickier.In the past I have made modifications directly to the Admin site, but this leads to maintenance pain and I much prefer a plugin approach. In this post, I'll outline how I developed a trivial plugin, adding a button to the Order List screen, without duplicating any code.BackgroundFor a long time administrators on my site have been able to print delivery labels from the Order List and Order Details screens. This requires adding a button to these screens, adding some Javascript to these screens and also adding some controller code. The result looks something like this:
As of right now, Nopcommerce does not have much support for admin page modific…

Siri not working on Mac OS Sierra

I've been holding out on rebuilding/reimaging my 2012 Macbook Pro in the hope of picking up a 2016 model. Underwhelmed by this year's offerings, I went ahead and rebuilt this evening.Everything worked well in its vanilla state, but after installing a bunch of dev tools Siri on Mac OS Sierra failed to work. Clicking on either Siri icon and/or holding the prescribed keyboard shortcut did nothing. No error, no nothing. This happened on my prior build. I logged the issue with Apple's beta feedback team but the conversation was fruitless (despite me sending a video of my actions, the rep asked if I was holding the shortcut keys or merely pressing them...) and I temporarily gave up on Siri on Mac OS.I'm unable to prove it at this juncture but suspect there is something installed as by Donne Martin's awesome dev tools that somehow conflicts with Siri, but cannot be 100% sure without further testing. I'm including this comment not to disparage his setup scripts (they a…

Android Studio - incompatibility between HAXM hypervisor and VirtualBox 4.3.30+

I ran into the following error when launching the simulator in Android Studio on my Macbook Pro today:
emulator: ERROR: Unfortunately, there's an incompatibility between HAXM hypervisor and VirtualBox 4.3.30+ which doesn't allow multiple hypervisors to co-exist. It is being actively worked on; you can find out more about the issue at http://b.android.com/197915 (Android) and https://www.virtualbox.org/ticket/14294 (VirtualBox)For me the fix was a simple one. I run Docker Beta on the same box. Apparently the hypervisor doesn't like this. So, in order to run the simulator, all I had to do was exit Docker completely. Not ideal, but a quick fix...

Issues with default git editor

Sublime is my editor of choice, but I guess at some point in the past I used Textmate as I recently started running into some Textmate-related issues when pulling code from GitHub. Effectively, when pulling code from GitHub for a merge. I got an error stating that the mate command could not be found.$ git pull origin masterFrom github.com:jasonirwin/repo * branch master -> FETCH_HEADCan’t find TextMate.app (error -10814)error: /usr/local/bin/mate -w died of signal 6error: There was a problem with the editor '/usr/local/bin/mate -w'.Not committing merge; use 'git commit' to complete the merge.
I assumed the issue was related to my global git config or my bash profile but, after much digging, the issue was in fact caused by a GIT_EDITOR environment variable$ echo $GIT_EDITOR/usr/local/bin/mate -w
Unsetting this variable got things working againunset GIT_EDITOR

Intel Quick Access breaks Sublime Text Hot Keys

Image
CTRL-ALT-UP and CTLR-ALT-DOWN are two hotkeys that I use *all the time*. They’re used in Sublime to execute multi-select on the previous/next line. Mulit-select is one of those features that is difficult to live without once you’ve experienced it and when I set up my new laptop the shortcuts didn’t work correctly.As it happens those same shortcuts were kidnapped by Intel’s graphic features. What once made me productive was instead hijacked to rotate my display clockwise and counter-clockwise (not something that the majority of people would need a hotkey for, but I digress…)Anyhow, one would assume that disabling hot keys via Intel’s Graphics Options menu would do the trick, but alas it did not.
Instead it is necessary to override each hotkey via Intel’s HD Graphics Control Panel (thanks a lot, Intel)
I’m back to running at full speed with keyboard-invoked multi-select in tow. Happiness.

Windows 7 - %windir% is not recognized as an internal or external command

Image
I’m in the process of getting acquainted with my new work laptop, a Lenovo W550s. I’ve had the laptop for a couple of weeks now, and very recently, and randomly, strange things started to happen.I started getting weird error messages when I attempted to perform any kind of system related tasks and couldn’t modify the domain I was connected to.
Icons in the start menu (Command Prompt, Paint, Snipping Tool, etc.) changed from meaningful to generic, indicating that something was wrong.

I came very close to reimaing by brand new laptop, until the realization that %windir% was not accessible led me to the hunch that my path was corrupted. It wasn’t corrupted, it was just too long. While my user path was short and sweet, the system path environment variable was full of garbage, weighing in at 2164 characters, full of references to varying pre-installed lenovo and intel software. After some more digging it appears that Windows can handle up to 2048 characters but no more. After saving out the …

TSQL–Calculating Date of Irish/UK Mother’s Day

While in the US Mother’s day falls on the second Sunday of May, in western Europe things are a little more complicated. Mother’s Day falls on Mothering Sunday which is the 4th Sunday in Lent. I couldn’t find a T-SQL script to calculate this date, so I rolled my own (with a little help from SO). Let me know if you can have a more succinct method of capturing the same. Here’s the script:/* CALCULATE YEAR
http://stackoverflow.com/questions/2192533/function-to-return-date-of-easter-for-the-given-year
*/
DECLARE @yearINT,
@EpactCalc INT,
@paschal_days_calc INT,
@num_of_days_to_sunday INT,
@easter_sunday_month INT,
@easter_sunday_day INT,
@easter_sunday DATETIME,
@start_of_lent DATETIME
SET @year = 2014
SET @EpactCalc = (24 + 19 * (@year % 19)) % 30
SET @paschal_days_calc = @EpactCalc - (@EpactCalc / 28)
SET @num_of_days_to_sunday = @paschal_days_calc - (
(@year + @year / 4 + @paschal_days_calc - 13) % 7
)
SET @easter_sunday_month = 3 + (@num_of_days_to_sunday + 40) / 44
SET @easter_sunday_d…