If you're running a cron job as root, and you're running a homebrew command, you'll need to add homebrew to the root user's path. sudo su cat ~/.bash_profile Do you see this? ? If not, run echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile Test it source ~/.bash_profile which mycommand…
Read more about Failed crontab for root on OSX◆
NodeJS scripts from the CLI can be difficult to debug. Often, one doesn't want to modify the core processes. I found the easiest way to hit a breakpoint was to create a shell wrapper. But I was worried... would my code have access to stdin and stdout? The answer is yes, scripts called from within scripts have access to stdin and stdout. Call your script from within a shell script. Here's the wrapper script: exec node --inspect-brk=9229 ./myscript.js. You can use whatever port you like…
Read more about Debugging a nodejs cli script with --inspect◆
Have you ever wanted to .gitignore a file by branch? The classic example for me here is versioning the generated styles.css file on master (which is deployed to production) but not on develop (which is used for pull requests). Versioning the styles.css file can result in merge conflicts or PRs that are just messy. Here's the script I wrote. Read the comments for installation notes…
Read more about .gitignore by branch