Default image

coder

How to use reserved characters in a URI

If you have to encode a reserved character (such as ‘/’ or ‘@’) so that it can be passed in a URI path, you may need to encode it twice: Example: const ticker = ‘@SMC/2018’, encodedTicker = encodeURIComponent(encodeURIComponent(ticker)), uri =…

Recursion Examples

Recursion in programming can be a mind bender.  Here are two examples of recursive functions coded in JavaScript.  These examples are dependent on lodash methods. Hopefully these code patterns are useful to you. I find them useful as starting points…

Linux Commands Cheat Sheet

This outputs your stuff in a folder called ‘packageName’: tar -xvzf packageName.tar.gz   This can help tell you what version of linux or at least linux kernel you are running: uname -a   Find a process and kill it: Run…

When Making a Directive for AngularJS

Worth Reading:  Especially this at the very bottom of that page: By ‘expose an API’, they mean ‘add some this.doSomething() {…} functions to the controller that are reachable from outside the controller’.  Like public class methods.  If you’re not…

Windows Command Line Cheat Sheet

Change Drive from Command Line You are here: D:\You want to go here: C:\ Type just: C: and hit enter. You are here: C:\Windows\System32\drivers\You want to go here: C:\ Type: C:\ and hit enter. Notice you have to type the…