Your command line welcomes you with a prompt. Default OSX terminal may look like this. PS1 is the variable used by your shell to determine your command line prompt RPS1 determines your right hand prompt. Note, you can always `echo` this variable to see what these are currently set to. By default, mine is set to…
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf1 in position 4: invalid continuation byte
TLDR: Convert your problem file with Sublime Text by opening the file and using “Save with encoding” as utf-8. Alternatively, use iconv -t UTF-8//TRANSLIT -c Zip_Zhvi_SingleFamilyResidence.csv > new_file.csv When does this error happen? I wanted to parse the housing data from Zillow at their research page. Zip code is a great measure of single family home…
Save time: npm install nodemon
Nodemon will allow you to start your node.js project and make changes without manually shutting down and restarting your server. Many people are scared of installing nodemon globally, so here’s a guide to install nodemon locally in your node.js project. Step 1: Install nodemon $ npm install nodemon –save-dev Step 2: Update your npm scripts…
Todidlist.com started as a vim shortcut
Hi all! Todidlist.com started as a vim shortcut that I wrote about way back last year here. I wanted to have the most accessible “did list” and vim served me so so well. However, once I got a new computer, I realized that my did list was missing a key feature: ubiquity. There was one…
Setting up Redis on Heroku for ExpressJS
By default, your express application will store session data in memory. That means if your server restarts all users will need to log back in. Additionally, this does not scale to more than one instance, leaks memory and does other mean things. While this works while developing your local computer (notice how you always need…
Create an interactive terminal cli with node
Let’s create a tool that will track our some text entries. Step 1: Create a new npm project and install the necessary libraries $ mkdir my_cli && cd my_cli && npm init -y && npm i –save inquirer chalk chalk – helps color the terminal prompts inquirer – makes creating interactive prompts a breeze Step 2: create…
Sublime Text shortcut on command line (subl)
TLDR: Create a ~/bin directory and symlink the Sublime command: mkdir ~/bin ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl Note: if ~/bin is not in your $PATH, add it to your zshrc or bash_profile: echo ‘# add ~/bin to path for scripts like subl\nPATH=$PATH:~/bin’ >> ~/.zshrc && source ~/.zshrc The Sublime Text documentation “OS X Command Line”…
How to publish an npm module
Step 0: You need some code to share. Create a new Github repo or choose one you currently want to publish Here is the command line argument to create a repo called “adder” $ curl -u <your_username> https://api.github.com/user/repos -d “{\”name\”: \”adder\”}” Once you have chosen a Github repo clone it Step 1: Create a proper…
Do not use bcrypt-nodejs
“Invalid salt revision” bcrypt-nodejs is no longer maintained and you might run into this Use bcryptjs for a more secure actively maintained experience. Also, check out Django, its great, but if you do, consider adding bcrypt
Express Sequelize Heroku Postgres Configuration Success
You are in flow developing on your local database and you decide to upload everything to heroku and share it with the world. How do you configure your production database? It’s easier than you think. Let’s assume you have already set up your site. If you used the sequelize init command, you will have a…