Tales of an IT Nobody

devbox:~$ iptables -A OUTPUT -j DROP

Using _.intersection for deep many to many filter June 26, 2015

Sometime you might find yourself needing a fast way to do a complex match on property from an array of objects under a property (confused?)

Let’s say I have a collection of objects as such:

I want to have a fast way to get all items that are in group ID: 1 OR 2.  The transverse can be just as useful, items NOT in groups with ID of 1 OR 2.

UnderscoreJS’s intersection method in conjunction with _.pluck can make short work of this task.

Here’s an example (in Typescript) for the given array of objects as above (array of objects, with property of ‘groups’, which is an array of group objects)

The key here is the _.filter declaration within the Typescript method wrapper.


No Comments on Using _.intersection for deep many to many filter
Categories: programming

PHP Interface rant June 15, 2015

This isn’t my first rant about interfaces (which are finally receiving a due adjustment).

I haven’t tested it, but don’t believe I’ve seen anything pertaining to interface inheritance, look at the following use case for example, which fails in current PHP 5.6:

There are some benefits to doing this, however as you can be implicit with the interface while supporting explicit behavior in other areas.

No Comments on PHP Interface rant
Categories: php rant

How to show us your company is immature. June 9, 2015

I’ve seen ‘Sentry‘ pop up a few times – it’s a neat SaaS that ails the pains of logging and monitoring  for development level logging. It’s pretty neat, has a spot for business for sure.

Here’s the problem and I touched base on this a while ago – your business WILL be judged on it’s class. (As in ‘classy person’).

2015-05-01 21_03_05-Sentry_ Track exceptions with modern error logging for JavaScript, Python, Ruby,

Want my business’s money? Be more eloquent.

Remember, not everyone with a pocketbook is looking to trust critical data and infrastructure decisions on a company that thinks unnecessary words are professional enough for their home page slogan.

I can swear like a fish some days, but I maintain professional behavior to those outside my ‘circle’; there’s a song and dance you need to do for B2B and government relationship to open up the coffers for you. (This ain’t it).

No Comments on How to show us your company is immature.
Categories: rant Uncategorized