explorers' clubhttps://jwopitz.wordpress.com
explorations in dev, science, sci-fi, games, and other fun stuff!Thu, 03 May 2018 18:42:28 +0000enhourly1http://wordpress.com/https://s0.wp.com/i/buttonw-com.pngexplorers' clubhttps://jwopitz.wordpress.com
Quickly Sync Mac OS’s Time via Scripthttps://jwopitz.wordpress.com/2018/05/03/quickly-sync-mac-oss-time-via-script/
https://jwopitz.wordpress.com/2018/05/03/quickly-sync-mac-oss-time-via-script/#respondThu, 03 May 2018 18:35:59 +0000http://jwopitz.wordpress.com/?p=1020Continue reading →]]>I’ve noticed lately that my computer’s time is off by over a minute, sometimes several. This happens as after I have put my computer in standby by closing the lid. The problem it causes is that with the time out of sync, I cannot use my auth tokens to log into my work’s VPN. So instead of opening the Time & Date preferences, I use this one line command to quickly update.

Open Terminal and type:

sudo ntpdate -u time.apple.com

You can even create an alias in your .bash_profile to make it simpler:

A UI may want to present some content in a read-only state, only allowing the user to interact with said content if they are permitted to do so. I won’t argue the merits/demerits of this particular UX, only how to solve this requirement.

]]>https://jwopitz.wordpress.com/2016/07/21/permissions-based-uxs-in-angular-using-directives/feed/0jwopitznvm/node: an easy way to use different versions for different projectshttps://jwopitz.wordpress.com/2016/02/17/nvmnode-an-easy-way-to-use-different-versions-for-different-projects/
https://jwopitz.wordpress.com/2016/02/17/nvmnode-an-easy-way-to-use-different-versions-for-different-projects/#respondWed, 17 Feb 2016 05:00:58 +0000http://jwopitz.wordpress.com/?p=924Continue reading →]]>problem

I need to have different versions of node/npm for different projects. I’d prefer to have each project “know” which version of node/npm it needs to use.

solution

prerequisites

Before we get started, there are a few prerequisites:

understand that this is a Mac solution. While I’m sure a similar solution exists for Windows, I am neither knowledgeable enough nor inclined to write a compatible shell script for Windows at this time.

gameplan

leveraging .nvmrc

Much like Ruby has a shortcut for setting the current version of Ruby to use, nvm has a similar feature. When you enter the following command…

nvm use

… then nvm will look for a .nvmrc file and get the correct version number to use from there. So first navigate to a project folder that uses node and create a new file called .nvmrc. Inside just write 4.2. If you’re a command-line geek then do the following:

editing your .bash_profile

So the easiest way to make nvm read your .nvmrc file is to do a check when you change directories. We need to make a function we can call when we cd into a directory:

All this is doing is

checking to see if the current directory matches the previous directory

if it doesn’t , then it stores the current directory to the previous’ variable

then it checks to see if a .nvmrc file exists

if so, then tell nvm to use it

lastly we tell the OS to call this command any time we do something in Terminal/Bash

]]>https://jwopitz.wordpress.com/2016/02/17/nvmnode-an-easy-way-to-use-different-versions-for-different-projects/feed/0jwopitzAngularJS: See if Angular is Using JQuery or JQLitehttps://jwopitz.wordpress.com/2016/01/22/angularjs-see-if-angular-is-using-jquery-or-jqlite/
https://jwopitz.wordpress.com/2016/01/22/angularjs-see-if-angular-is-using-jquery-or-jqlite/#respondFri, 22 Jan 2016 19:48:27 +0000http://jwopitz.wordpress.com/?p=916It’s as easy as:

//true if angular is using jQuery, false if using jqLite
angular.element === window.jQuery

]]>https://jwopitz.wordpress.com/2016/01/22/angularjs-see-if-angular-is-using-jquery-or-jqlite/feed/0jwopitzPersonal: Tap Cancer Outhttps://jwopitz.wordpress.com/2015/07/30/personal-tap-cancer-out/
https://jwopitz.wordpress.com/2015/07/30/personal-tap-cancer-out/#respondThu, 30 Jul 2015 16:06:31 +0000http://jwopitz.wordpress.com/?p=900Continue reading →]]>This isn’t anything to do with javascript or development. Children and BJJ are 2 of my life’s loves and so I see it fitting to post things that I am passionate about here as well as development (not to say I’m not passionate about my work, I am).

Many of you know me as just a father, some of you know me just from BJJ. Children and BJJ are 2 of my passions in life. Both have changed my life forever. To know that we can put men on the moon, that we can land on an asteroid, that we have peered into the inner workings of our universe, but that we can’t save children suffering from cancer is heartbreaking.

On August 15th I’ll be competing in a Brazilian Jiu-Jitsu tournament. However, this is no ordinary fight. I am taking part in the 2015 Tap Cancer Out Summer BJJ Open and along with my competitors, I’ll be fighting for those who are in the fight of their lives – children with cancer.

]]>https://jwopitz.wordpress.com/2015/07/30/personal-tap-cancer-out/feed/0jwopitzNote to Self: DO NOT amend a commit while using SourceTreehttps://jwopitz.wordpress.com/2015/04/13/note-to-self-do-not-amend-a-commit-while-using-sourcetree/
https://jwopitz.wordpress.com/2015/04/13/note-to-self-do-not-amend-a-commit-while-using-sourcetree/#respondMon, 13 Apr 2015 21:55:01 +0000http://jwopitz.wordpress.com/?p=896that is all…. carry on.
]]>https://jwopitz.wordpress.com/2015/04/13/note-to-self-do-not-amend-a-commit-while-using-sourcetree/feed/0jwopitzTrello Label Override Style via Stylishhttps://jwopitz.wordpress.com/2015/04/08/trello-label-override-style-via-stylish/
https://jwopitz.wordpress.com/2015/04/08/trello-label-override-style-via-stylish/#commentsWed, 08 Apr 2015 21:32:41 +0000http://jwopitz.wordpress.com/?p=894Continue reading →]]>At my current gig we use Trello to track tasks, bugs, agile-ish info, etc. One of the biggest issues I had was that once you have more labels than there are available colors, your labels become meaningless. So I wrote a stylish style to a) display the actual label values, and b) as a bonus, prioritize based on priority, pts and then misc. labels. A picture is worth a thousand words so….

]]>https://jwopitz.wordpress.com/2015/04/08/trello-label-override-style-via-stylish/feed/1jwopitzCreating ‘private’ APIs in CoffeeScript Classhttps://jwopitz.wordpress.com/2015/04/01/creating-private-apis-in-coffeescript-class/
https://jwopitz.wordpress.com/2015/04/01/creating-private-apis-in-coffeescript-class/#respondWed, 01 Apr 2015 21:54:13 +0000http://jwopitz.wordpress.com/?p=892This will only work for methods, trying to do so w/ a var will result in simply creating a ‘private’ Class-variable. Why this works is because the function gets called within the context of the class instance.