<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Full Stack Web Development - Medium]]></title>
        <description><![CDATA[Learning how to build powerful web apps - Medium]]></description>
        <link>https://medium.com/full-stack-web-development?source=rss----37c0199db86c---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Full Stack Web Development - Medium</title>
            <link>https://medium.com/full-stack-web-development?source=rss----37c0199db86c---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 10:57:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/full-stack-web-development" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[NeoVim for windows 7]]></title>
            <link>https://medium.com/full-stack-web-development/neovim-for-windows-7-95186131a756?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/95186131a756</guid>
            <category><![CDATA[developer-productivity]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[neovim]]></category>
            <category><![CDATA[windows-7]]></category>
            <category><![CDATA[vim]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Sun, 04 Aug 2019 03:38:02 GMT</pubDate>
            <atom:updated>2019-08-04T03:38:02.717Z</atom:updated>
            <content:encoded><![CDATA[<h4>Find out why I switched from vim to neovim and how you can too with little setup time.</h4><p>Being an avid vim user for several years now I have found that I am pretty comfortable with my settings but as I continue to learn and improve and watching other developers use their tooling, there are new features they are using that have made me look into more options. I will always have the vim mindset of movement with the keyboard, but if there is something that still keeps this philosophy yet includes some of today’s modern ide features then it’s time to upgrade!</p><p>Neovim has been around for a long time now and I tried it once during it’s early days but found it was buggy and very slow. But now after many years it has merited a revisit and I will just briefly lay out some of the reasons for the switch.</p><p><strong>It’s basically vim enhanced.</strong> You don’t have to abandon all of your favorite vim plugins, they are mostly compatible with neovim.</p><p><strong>Large mature community. </strong>Neovim has 32k+ stars as of this writing and over 460 contributors maintaining the library. This allows for quicker releases and better code review.</p><p><strong>Less configuration.</strong> Some neovim plugins incorporate several features which makes configuring vim ez pz.</p><p><strong>It’s very responsive now!</strong> After spending many hours with neovim, it appears to be at par with vim now in speed and maybe even faster in some areas.</p><p>Now I’ll show you a basic setup and let you decide for yourself if you think neovim is worth the jump. You can keep vim on your system and switch back and forth so you won’t lose your vim settings if you decide neovim is not for you.</p><h4>Step One: Download and install neovim</h4><p>If you have Chocolately or Scoop then use this guide:</p><p><a href="https://github.com/neovim/neovim/wiki/Installing-Neovim">Installing Neovim · neovim/neovim Wiki</a></p><p><strong>If you want to install neovim inside of a vagrant box (ie.ubuntu) scroll the document and find your OS. I personally use this way because the linux boxes are a more stable environment for neovim vs windows.</strong></p><p>For all others use this (this binary is at the bottom): <a href="https://github.com/neovim/neovim/releases/tag/v0.3.8">https://github.com/neovim/neovim/releases/tag/v0.3.8</a></p><h4>Step Two: Use your existing .vimrc file for neovim follow this guide:</h4><p><a href="https://neovim.io/doc/user/nvim.html#nvim-from-vim">https://neovim.io/doc/user/nvim.html#nvim-from-vim</a></p><p><strong>windows 7:</strong></p><pre>1. Create a directory in your home directory named config and a file inside of that directory names init.vim.</pre><pre>2. Add these contents to the init.vim file:<br><br><strong>    set runtimepath^=~/.vim runtimepath+=~/.vim/after</strong><br><strong>    let &amp;packpath = &amp;runtimepath</strong><br><strong>    source ~/.vimrc</strong></pre><p><strong>ubuntu 18.04</strong>:</p><pre>cp ~/.vimrc ~/.config/nvim/init.vim</pre><h4>Step Three: Install Python 3+</h4><p>neovim requires a python version of 2.7 or 3+. Download and install the latest version 3:</p><pre>pip3 install — user — upgrade pynvim</pre><p>Then inside your .vimrc add this line:</p><pre>let g:python3_host_prog = ‘/path/to/python3’ “ Python 3</pre><h4>Step Four: Install Essential Plugins</h4><p>There is only one plugin I wanted from neovim. The other plugins I installed were just regular vim plugins.</p><h4><a href="https://github.com/neoclide/coc.nvim/wiki/Install-coc.nvim">coc.nvim</a></h4><p>After installation open nvim and type:</p><p>:CocInstall coc-tsserver coc-eslint coc-json coc-prettier coc-css</p><p>coc-tsserver gives you almost everything you wanted from vscode. Check out the features <a href="https://github.com/neoclide/coc-tsserver">here</a>.</p><p>Other plugins I installed were ones I already use in my vim setup. Here’s what I use if your curious:</p><pre>Plugin &#39;VundleVim/Vundle.vim&#39; &quot; plugin manager</pre><pre>Plugin &#39;vim-airline/vim-airline&#39; &quot; status and tabline</pre><pre>Plugin &#39;vim-airline/vim-airline-themes&#39; &quot; airline themes</pre><pre>Plugin &#39;christoomey/vim-tmux-navigator&#39; &quot; tmux and vim integration (need this to move between nerdtree too)</pre><pre>Plugin &#39;scrooloose/nerdtree&#39; &quot; directory tree for vim</pre><pre>Plugin &#39;jistr/vim-nerdtree-tabs&#39; &quot; nerdtree tabs</pre><pre>Plugin &#39;alvan/vim-closetag&#39; &quot; close html tags</pre><pre>Plugin &#39;tpope/vim-surround&#39; &quot; edit surrounding wtags</pre><pre>Plugin &#39;tpope/vim-fugitive&#39; &quot; git wrapper</pre><pre>Plugin &#39;tpope/vim-commentary&#39; &quot; comment/uncomment code with gcc</pre><pre>Plugin &#39;terryma/vim-multiple-cursors&#39; &quot; sublime multiple cursors</pre><pre>Plugin &#39;ctrlpvim/ctrlp.vim&#39; &quot; fuzzy file finder with ctrl-p</pre><pre>Plugin &#39;gcmt/taboo.vim&#39; &quot; edit tabs</pre><pre>Plugin &#39;mileszs/ack.vim&#39; &quot; ack for vim</pre><pre>Plugin &#39;easymotion/vim-easymotion&#39; &quot; vim easymotion</pre><pre>Plugin &#39;valloric/youcompleteme&#39; &quot; vim autocompletion</pre><pre>Plugin &#39;jparise/vim-graphql&#39; &quot; graphql syntax highlighting</pre><pre>Plugin &#39;SirVer/ultisnips&#39; &quot; the ultimate snippets pkg requires pythos support</pre><pre>Plugin &#39;honza/vim-snippets&#39; &quot; snippets for ultisnips</pre><pre>Plugin &#39;prettier/vim-prettier&#39;, { &#39;do&#39;: &#39;yarn install&#39; }</pre><pre>Plugin &#39;Galooshi/vim-import-js&#39; &quot; auto importing for js</pre><h4>Uninstalling Neovim</h4><p>If you find that something went wrong with your install or you just don’t want to use neovim any more you can use the following line in ubuntu to remove it:</p><pre>$ sudo apt-get purge --auto-remove neovim</pre><p>For window 7 users you can just delete the folder you extracted earlier.</p><h3>Conclusion</h3><p>Now that I’m using neovim I can start to venture into other areas such as adjusting my development environment to other languages with a few simple configuration changes. This allows me to not be afraid to break my existing config and not have to rely on using another ide. An example is switching from using javascript to java, and not having to boot up eclipse. I’m sure there are other things that will help improve my setup, but as for now I don’t worry about vim configuration like I used to and have more time to spend developing. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95186131a756" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/neovim-for-windows-7-95186131a756">NeoVim for windows 7</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ubuntu 18.04 Web Development Environment for Windows 7 Revisited:]]></title>
            <link>https://medium.com/full-stack-web-development/ubuntu-18-04-web-development-environment-for-windows-7-revisited-cfa531f95a6a?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/cfa531f95a6a</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[javascript-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[developer-environment]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Sun, 28 Oct 2018 21:36:14 GMT</pubDate>
            <atom:updated>2018-11-20T01:48:31.479Z</atom:updated>
            <content:encoded><![CDATA[<h4>What this development system will include: ubuntu 18.04, node v10.9.0, mongoDB, nginx, redis 3.0.6, docker 18.09, git, vim 7.4, tmux, curl, python, and my personal <a href="https://github.com/pak11273/dotfiles">dotfiles</a></h4><p>This is a complete guide to setting up a development environment on a Windows 7 OS. As a fullstack JS web developer, I use this environment to build React web applications. But it can be easily customized for other applications. Approx time to complete: 30min. (w/high speed internet)</p><h4>PreRequisites:</h4><p>A shell: I use <a href="https://git-scm.com/download/win">Git Bash</a> (the windows command line is not recommended)</p><p>A virtual machine: I use <a href="https://www.oracle.com/technetwork/community/developer-vm/index.html">Virtual Box</a> (it’s free!)</p><p>A virtual machine manager: <a href="https://www.vagrantup.com/downloads.html">Vagrant</a></p><h4>Step 1 Vagrantfile:</h4><p>Open git bash and create a vagrant directory. Inside the vagrant directory create a Vagrantfile. Copy and paste this code into that file:</p><pre>Vagrant.configure(&quot;2&quot;) do |config|</pre><pre># ref: <a href="https://www.sitepoint.com/vagrantfile-explained-setting-provisioning-shell/">https://www.sitepoint.com/vagrantfile-explained-setting-provisioning-shell/</a><br># Every Vagrant development environment requires a box. You can search for<br># boxes at <a href="https://app.vagrantup.com/boxes/search.">https://app.vagrantup.com/boxes/search.</a></pre><pre>config.vm.box = &quot;minimal/xenial64&quot;<br>config.vm.network :forwarded_port, guest: 80, host: 8080, auto_correct: true<br>config.vm.network :forwarded_port, guest: 8080, host: 8080, auto_correct: true<br>config.vm.synced_folder &quot;./html&quot;, &quot;/var/www/html&quot;, create: true, group: &quot;vagrant&quot;, owner: &quot;vagrant&quot;, mount_options: [&quot;dmode=777&quot;,&quot;fmode=755&quot;]<br>config.vm.network :private_network, ip: &quot;192.168.68.8&quot;</pre><pre># Config for VM Box<br># Find more configuration at https://www.virtualbox.org/manual/ch08.html#vboxmanage-modifyvm</pre><pre>config.vm.provider &quot;virtualbox&quot; do |v|<br>v.name = &quot;my dev environment&quot;<br>v.customize [&quot;modifyvm&quot;, :id, &quot;--memory&quot;, &quot;1024&quot;]<br>end</pre><pre>config.vm.provision &quot;shell&quot; do |s|<br>s.args = [&quot;VAGRANT INSTALL COMPLETE&quot;, &quot;arg2&quot;]<br>s.path = &quot;provision/setup.sh&quot;<br>end<br>config.ssh.insert_key=false<br>end</pre><h4>Step 2 Syncing your vm’s html directory:</h4><p>Create a directory inside the <strong>vagrant</strong> directory and name it <strong>html</strong>. This directory will sync up to your virtual machine’s <strong>html</strong> directory. This serves 2 purposes. 1) If your vm setup messes up in the future for whatever reason and you have to redo everything, this directory will preserve your web applications. 2) There may be cases where you need to work on your apps outside of your virtual machine.</p><h4>Step 3 Vagrant Up:</h4><p>Now create another directory inside <strong>vagrant </strong>and name it <strong>provision</strong>. Then inside of <strong>provision </strong>create a file and name it <strong>setup.sh</strong>.</p><p>Copy/paste the following to the <strong>setup.sh</strong> file:</p><pre>#!/usr/bin/env bash<br>export DEBIAN_FRONTEND=noninteractive<br>apt-get update &gt; /dev/null<br>apt-get install curl git nginx tidy -y</pre><pre>echo &quot;INSTALLING CURL GIT NGINX TMUX TIDY<br>This may take up to 10mins. depending on your connection.&quot;</pre><pre>echo &quot;SETTING UP NODE&quot;<br>#ref: <a href="http://askubuntu.com/questions/589058/node-is-installed-during-provisioning-on-vagrant-but-disappears-upon-connecting">http://askubuntu.com/questions/589058/node-is-installed-during-provisioning-on-vagrant-but-disappears-upon-connecting</a> (used bmans solution)<br>cd ~<br>git clone <a href="https://github.com/creationix/nvm.git">https://github.com/creationix/nvm.git</a> /home/vagrant/.nvm &amp;&amp; cd /home/vagrant/.nvm &amp;&amp; git checkout `git describe --abbrev=0 --tags`<br>source /home/vagrant/.nvm/nvm.sh<br>nvm install 10.9.0<br>nvm use 10.9.0<br>n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local<br> <br> <br>echo &quot;SETTING UP VIM&quot;<br>sudo apt-get update -y &gt; /dev/null<br>sudo apt-get remove vim vim-runtime gvim  -y &gt; /dev/null<br>sudo apt-get remove vim-tiny vim-common vim-gui-common vim-nox -y &gt; /dev/null<br>sudo apt-get install software-properties-common -y &gt; /dev/null<br>sudo add-apt-repository ppa:jonathonf/vim &gt; /dev/null<br>sudo apt-get update &gt; /dev/null<br>sudo apt-get install vim -y &gt; /dev/null<br>su - vagrant<br>su - vagrant -c &#39;cd ~&#39;<br>su - vagrant -c &#39;git clone git://github.com/pak11273/dotfiles.git&#39;<br>su - vagrant -c &#39;cd ~/dotfiles&#39;<br>su - vagrant -c &#39;ls&#39;<br>su - vagrant -c &#39;sudo chmod +x ./dotfiles/makesymlinks.sh&#39;<br>su - vagrant -c &#39;./dotfiles/makesymlinks.sh&#39;<br>su - vagrant -c &#39;git clone <a href="https://github.com/VundleVim/Vundle.vim.git">https://github.com/VundleVim/Vundle.vim.git</a> ~/.vim/bundle/Vundle.vim&#39;<br>su - vagrant -c &#39;sudo apt-get install ack-grep -y &gt; /dev/null&#39;<br>su - vagrant -c &#39;vim +BundleInstall +qa&#39;</pre><pre>echo &quot;SETTING UP Yarn&quot;<br>su - vagrant -c &#39;curl -sS <a href="https://dl.yarnpkg.com/debian/pubkey.gpg">https://dl.yarnpkg.com/debian/pubkey.gpg</a> | sudo apt-key add -&#39;  <br>su - vagrant -c &#39;echo &quot;deb <a href="https://dl.yarnpkg.com/debian/">https://dl.yarnpkg.com/debian/</a> stable main&quot; | sudo tee /etc/apt/sources.list.d/yarn.list&#39;  <br>su - vagrant -c &#39;sudo apt-get update -y&#39;  <br>su - vagrant -c &#39;sudo apt-get install --no-install-recommends yarn -y&#39;</pre><pre>echo &quot;YCM SERVER SETUP&quot; <br>su - vagrant -c &#39;cd ~&#39;<br>su - vagrant -c &#39;sudo apt-get install build-essential cmake -y&#39; <br>su - vagrant -c &#39;sudo apt-get install python-dev python3-dev -y&#39; <br>su - vagrant -c &#39;~/.vim/bundle/youcompleteme/install.py --clang-completer&#39;</pre><pre>echo &quot;MISC&quot;  <br>su - vagrant -c &#39;mkdir ~/.vim/undo&#39;<br>su - vagrant -c &#39;yarn init -y&#39;<br>sudo npm install eslint prettier csslint eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-import -g -y<br>su - vagrant -c &#39;sudo chown vagrant:vagrant -R ~/.nvm&#39;</pre><pre>echo &quot;TMUX SETUP&quot;<br>su - vagrant -c &#39;sudo apt-get update -y&#39;<br>git clone <a href="https://github.com/tmux-plugins/tpm">https://github.com/tmux-plugins/tpm</a> ~/.tmux/plugins/tpm<br>su - vagrant -c &#39;sudo apt-get install libevent-dev -y&#39;<br>su - vagrant -c &#39;sudo apt-get install autogen automake libevent-dev libncurses5-dev -y&#39;<br>su - vagrant -c &#39;sudo apt-get install tmux -y&#39;</pre><pre>echo &quot;SETTING UP MONGODB&quot;<br>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5<br>echo &quot;deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse&quot; | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list<br>sudo apt update<br>sudo apt install -y mongodb-org<br>sudo systemctl start mongod.service</pre><pre>echo &quot;SETTING UP REDIS&quot;<br>sudo apt-get update<br>sudo apt-get install redis-server -y</pre><pre>echo &quot;SSH FIX&quot;<br>sudo apt-get update<br>sudo apt-get install -y lvm2<br>DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y</pre><pre>echo &quot;DOCKER INSTALL&quot;<br>sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y &gt; /dev/null<br>curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -<br>sudo add-apt-repository &quot;deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test&quot;<br>sudo apt-get update<br>sudo apt-get install docker-ce<br>sudo usermod -a -G docker vagrant</pre><pre>echo -e $1</pre><p>Ensure that you are in the vagrant directory cd ~/vagrant</p><blockquote>NOTE: Some of these modules(ie. mongoDB) take several minutes to install so don’t worry if it appears that the installation is hanging.</blockquote><p>Run the command vagrant up</p><p>Note: If you get an error concerning your powershell version then you will need to upgrade. You can download powershell 4 <a href="https://social.technet.microsoft.com/wiki/contents/articles/21016.how-to-install-windows-powershell-4-0.aspx">here</a>. For 64bit systems use the x64 file installation.</p><p><strong>Step 3 Check Installations:</strong></p><p>Run the command vagrant ssh</p><ul><li>Check curl: curl --version should return the version for curl</li><li>Check git: git --version should return the version for git</li><li>Check nginx: Open up a web browser and go to the address 192.168.68.8 You should see a “Welcome to nginx!” page. This address is the primary address to your server that we created in your Vagrantfile. Bookmark it!</li><li>Check mongodb: mongo should run the mongodb shell. exit to exit the shell. If you get a ‘mongo failed to connect error’ then you might have to turn on the service with sudo systemctl start mongod.</li><li>Check node: node -v should return v10.9.0</li><li>Check redis: sudo systemctl status redis should return Active: active(running)</li><li>Check docker: docker -v should return the version for docker</li></ul><h4>Step 4 Setup a password for root:</h4><blockquote>NOTE: This is only for development! In a production environment you want to remove passwords for root.</blockquote><pre>sudo -i<br>passwd<br>// enter a password<br>// retype the password</pre><h4>Step 5 VIM customization:</h4><blockquote>NOTE: You can skip this step if you are not a vim fan, however you cannot skip this step if you didn’t touch the setup.sh because you would have installed vim 8.1 and a dotfile. You will now need to install plugins and configure them.You should check out my other articles on why you should be using vim and tmux with vim if you’re not a vimmer:</blockquote><ul><li><a href="https://medium.com/full-stack-web-development/web-development-with-vim-5aacd4d07c93">Web Development with Vim</a></li><li><a href="https://medium.com/@pak11273/tmux-with-vim-99fd46df375c">TMUX with VIM</a></li></ul><p>Some shortcuts you have available now from the dotfile are:</p><p>c will clear the terminal</p><p>sv = sudo vim</p><p>mk = mkdir, but will also cd inside the directory</p><p>run = npm run</p><p>git s , git cm = git status, git commit</p><p>You can change or add any commands inside of ~/.bashrc</p><h4>Ack</h4><p>What is Ack? Ack is a super fast way to find stuff in your files and a lot more. I use it almost daily. Your vagrant machine already installed Ack for you.</p><p>In every project you will need to add an .ackrc in the root directory. Here is a starter template:</p><pre># Always sort the files<br>#--sort−files<br><br># Always color, even if piping to a another program<br>--color<br><br>--ignore-file=is:tags<br>--ignore-dir=log<br>--ignore-dir=doc<br>--ignore-dir=tmp<br>--ignore-dir=tags<br>--ignore-dir=node_modules/<br>--ignore-dir=.cache-loader/</pre><p>Let’s say you wanted to find every file that has the word “hello” in it. In a vim session you would type this command :Ack hello. This is just a small feature of Ack there is so much more you can do with Ack, like find all occurrences of hello and change them to goodbye.</p><h4>Syntastic Setup</h4><blockquote>NOTE: I want to address why I don’t use <a href="https://github.com/w0rp/ale"><strong>ale</strong></a>? Ale is a realtime checker which checks syntax as you type. I tried it but found it to be very sluggish. Maybe I could have optimized it, but since I’m happy with syntastic I am going to stick with until I see a deal breaker.</blockquote><p>Generally speaking, there are 2 things to configuring syntastic:</p><ol><li>Find a linter on github and install it</li><li>Then add a syntastic checker in your .vimrc.</li></ol><p>There are several checkers are already setup in your .vimrc for syntastic, so we’ll set those up and install them(eslint for javascript, and tidy for html).</p><pre>eslint --init<br>// use popular <br>// choose airbnb<br>// json format<br>// react if you use<br>// install now</pre><pre>// You will also have to add prettier to the eslintrc.json file so you won&#39;t have to deal with the string single quote errors</pre><pre>{<br>  &quot;extends&quot;: [<br>    &quot;airbnb&quot;,<br>    &quot;prettier&quot;<br>  ]<br>}</pre><p>A syntastic checker is already setup in .vimrc. Open a javascript file and edit it. You should see errors when you try to save the file if it’s not in the correct format and your code should auto-format to prettier. This applies to html docs, too.</p><p><strong>import-js</strong></p><p>Globally install npm install -g import-js.</p><p>Include a config file in the root of your projects and name it .importjs.js.</p><p>Use this as a starter template:</p><pre>module.exports = {<br>  excludes: [&quot;./react-components/**/test/**&quot;],<br>  emptyLineBetweenGroups: false,<br>  namedExports: {<br>    lodash: [&quot;isEmpty&quot;]<br>  }<br>}</pre><p>Shortcut keys:</p><p>fw place cursor over a word and it will auto import if a available.</p><p>fe will find all imports and remove unused ones.</p><p>fg goto to the file of the import.</p><p>:e# return to previous file opened.</p><p>That’s it!</p><h4>Step 6 SSH:</h4><p>We need to setup ssh keys so that we can do things like push/pull to git remote repositories.</p><p><strong>Create an ssh key</strong></p><pre>cd ~<br>ssh-keygen<br>// then hit enter <br>// include a passphrase<br>// enter passphrase again</pre><p>You now have a public ssh key you can put on any service that requires it.</p><p><strong>Copy the ssh key</strong></p><p>cat ~/.ssh/id_rsa.pub</p><p>Copy the string returned and place it in services that require it.</p><h4>Step 7 Embellishments:</h4><p>This step includes things which you do not need but I use in my own development.</p><p><strong>Chalk</strong>: <a href="https://github.com/chalk/chalk">https://github.com/chalk/chalk</a></p><p>If you spend a lot of time doing console.log() for debugging in the terminal then this is one library you should look into.</p><p><strong>Redis Commander:</strong> npm install -g redis-commander</p><p>A gui for redis.</p><p><strong>Tmux</strong>:</p><p>Close your terminal with vagrant halt and do a hard restart(exit the terminal &amp; restart your computer). Open up git bash and restart the box with vagrant up.</p><p>tkill = kills all tmux sessions</p><blockquote><strong>WARNING</strong>: Always remember to close tmux before vagrant halt or shutting down your computer. If you can’t shut down your computer because of <strong>active connections </strong>in virtual box, then you will need to reopen your terminal and shut down vagrant.</blockquote><h4>FINAL THOUGHTS:</h4><p>There is a lot of hype around Docker and it would be wise to look into it. Many development teams use it and you probably would have to get involved if you are looking to get hired at the enterprise level. I tried to implement it but it was too much of a hassle because it really doesn’t work on Windows 7. I’m satisfied with this setup because it isn’t that hard to configure and it’s highly customizable. I’ve built MERN and LAMP stacks with it with no problems.</p><p>After 3+ years of using this setup even after upgrading to the latest versions I still have little to no trouble setting environments in less than an hour. I think the biggest takeaway is that in these days one of the biggest killers of production is the constant barrage of new technologies a developer has to learn and to find something that you can rely on for long periods of time. You want to spend more time building stuff rather than learning stuff. Windows 7 came out in 2009 and I still use it for development!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfa531f95a6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/ubuntu-18-04-web-development-environment-for-windows-7-revisited-cfa531f95a6a">Ubuntu 18.04 Web Development Environment for Windows 7 Revisited:</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Development with Vim]]></title>
            <link>https://medium.com/full-stack-web-development/web-development-with-vim-5aacd4d07c93?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/5aacd4d07c93</guid>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[dotfiles]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Tue, 28 Mar 2017 14:20:48 GMT</pubDate>
            <atom:updated>2019-02-18T06:07:57.117Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why use vim and how you can set it up to be a powerful ide for your development. If you don’t have a web development you can follow this <a href="https://medium.com/full-stack-web-development/create-a-lean-dev-environment-for-windows-7-fb9dd0633737">guide</a>. I will be taking a barebones environment taken from that series.</h4><h4>The Pros</h4><ul><li>Longevity — Vim has been around for 25 years and still has a large community of users.</li><li>Increased Productivity — You increase your editing capabilities by eliminating the need for a mouse. What’s faster, a few keystrokes vs moving a mouse and clicking buttons then resetting your right hand back to your keyboard? In some cases this is not an issue but I have found that leaving my hands on the keyboard allow me to manipulate text extremely fast.</li><li>Customization — There is practically no limits to the customization of vim. If you can think of something vim needs, someone probably has come up with a plugin for it.</li><li>Architecture— Vim was designed for programming. It is like another body extension to a programmer. If you look at today’s awesome editors they make you very excited about the editor. If you look at a vim guru they make you very excited about coding.</li></ul><h4>The Cons</h4><ul><li>It has a rather large learning curve.</li><li>To have some of the features modern IDEs you have to do some things that are a bit hacky.</li></ul><h3>The Setup</h3><p>I’ll be installing vim in Ubuntu 16.04 on windows through a virtual machine. The terminal i’ll be using is gitbash which comes with vim for windows, but this guide will be using Ubuntu. Let’s get started by opening your terminal and installing vim.</p><p>sudo apt-get update</p><p>sudo apt-get install vim</p><h4>Plugins</h4><p>You just need to download one — Vundle. Vundle is a plugin manager for vim. Once installed you will need to update your vim configuration file.</p><p>git clone <a href="https://github.com/VundleVim/Vundle.vim.git">https://github.com/VundleVim/Vundle.vim.git</a> ~/.vim/bundle/Vundle.vim</p><p>You might have to create the directories .vim and .vim/bundle if you don’t have them already.</p><p>sudo mkdir ~/.vim</p><p>sudo mkdir ~/.vim/bundle</p><h4>Dotfiles</h4><p>If you’d like to use the exact setup I have you can. If you haven’t heard about dotfiles then here’s where you can get your hands wet. Dotfiles are just configuration files. It’s become very popular to use other people’s dotfiles when you see that they have a setup that you like. Dotfiles can be just a little enhancement to your system preferences to a whole revamp of your OS. I would not use someone else’s dotfile unless I knew exactly what everything does inside that file. A huge reason why I use a dotfile is that if I need to setup vim in a new system, I don’t want to have to do what we just did all over again. With a dotfile I can just download it and run a simple script.</p><h4>My Setup</h4><p>My dotfile has my whole vim setup along with the plugins. It also changes some of my bash preferences. You can have a look at mine <a href="https://github.com/pak11273/dotfiles"><strong>here</strong></a>. If you’re feeling lucky you can follow the README file and set it up on your machine(hopefully a virtual one). I would suggest just browsing over the files and googling some of the plugins. Find which ones you think would help in your workflow and download those. You could eventually create your own dotfile.</p><p>Note: If you are going to use the YouCompleteMe plugin(recommended) then you may have to recompile vim from <a href="https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source">source</a>. This will add the python support you need.</p><h4>Closing Thoughts</h4><p>I used Sublime text for several years. It was so easy to use and it was free. I heard of vim but tried it and found it frustrating because you had to “learn” how to use a text editor. Who wants to do that? Once I changed my mindset to “what’s easy and the latest greatest thing out there” to “what can help me speed up my development” looking into vim became more appealing. It’s almost the equivalent to when you learned to copy text by right clicking it with a mouse and choosing copy. It’s probably so long ago that you forgot the transition to using ctrl-c. Do you still use the mouse for that? I don’t(unless I’m in a very very lazy mood). Ever since I learned Ctrl-C for copy I never looked back. If you think vim is the way to go then I would suggest learning it in little bites.</p><p>Don’t look at everything you COULD learn with vim, but start using vim for little projects until you get the hang of things and then once you are using it consistently, completely transition into it. I started by doing the awesome tutorial that every vim comes with. Just type in your terminal vimtutor. It teaches you basic vim commands that I use on a daily basis. If you already have an editor that you like then stick with it. Vim isn’t for everybody. But if you have a curiosity about it then I would suggest you get started asap. If you consistently use it daily in your coding, you’ll find it will be one of those tools that you can’t live without in a matter of weeks. I promise.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aacd4d07c93" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/web-development-with-vim-5aacd4d07c93">Web Development with Vim</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Closures]]></title>
            <link>https://medium.com/full-stack-web-development/javascript-closures-a828e88b272f?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/a828e88b272f</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Fri, 20 Jan 2017 02:05:14 GMT</pubDate>
            <atom:updated>2017-01-20T02:03:55.416Z</atom:updated>
            <content:encoded><![CDATA[<h4>What are they and how do they work?</h4><p>Let’s tackle this advanced concept in javascript. It’s a must-know for javascript developers for you will see uses of this concept through-out the javascript world. It’s very powerful yet can be very confusing. So what is it?</p><p>A basic closure:</p><pre>function outer() {</pre><pre>  var outside = &quot;i&#39;m outside&quot;;</pre><pre>  function inner() {<br>    var inside = &quot;i&#39;m inside&quot;;<br>    var both = inside + &quot; and &quot; + outside;<br>    console.log(both);<br>  }<br>  <br>  inner();</pre><pre>}</pre><pre>outer(&quot;outer&quot;); //outputs &quot;outer&quot;</pre><p>We add a reference to the outer function’s variable outside. This is possible because of <strong>lexical scoping</strong> — Javascript functions have access to all variables up their <strong>scope chain</strong>. Nothing surprising here, however we have created a simple closure. The inner() function depends upon it’s outer environment to work because it needs the value of outside. So technically speaking, the outer() function has become a closure because it is “enclosing” the inner() function. With this simple idea we can do some very useful things with closure.</p><p>Let’s first implement a cool javascript technique before using the closure. If we know that functions are basically function blocks stored inside of variables, <strong>we can use this knowledge to invoke the inner() function outside of the outer() function</strong>. You can do this by returning the function definition instead of invoking the function.</p><pre>return inner; //will return what&#39;s inside the inner variable.<br>inner(); //will invoke what&#39;s inside the inner variable.</pre><p>So now we can run inner() function outside of outer() by assigning the return value of outer() to a variable.</p><pre>function outer() {</pre><pre>var outside = &quot;i&#39;m outside&quot;;</pre><pre>function inner() {<br>    var inside = &quot;i&#39;m inside&quot;;<br>    var both = inside + &quot; and &quot; + outside;<br>    console.log(both);<br>  }<br>  <br>  <strong>return inner</strong>;</pre><pre>}</pre><pre>var anywhere = outer(); //outer() returns the inner() definition so anywhere becomes the inner() function.</pre><pre>anywhere(); //outputs &quot;i&#39;m inside and i&#39;m outside&quot;</pre><p>So from our scope rules we know that inner() function is the only thing that can access the outer() function. Armed with this knowledge let’s make our inner() function so that we can dynamically change the outside variable.</p><pre>function outer() {</pre><pre>var outside = &quot;i&#39;m outside&quot;;</pre><pre>function inner(<strong>changer</strong>) {<br>    var inside = &quot;i&#39;m inside&quot;;<br>    outside = changer;</pre><pre>    var both = inside + &quot; and i&#39;ve change outside to &quot; + outside;<br>    console.log(both);<br>  }<br>  <br>  <strong>return inner</strong>;</pre><pre>}</pre><pre>var anywhere = outer(); //outer() returns the inner() definition so anywhere becomes the inner() function.</pre><pre>anywhere(&quot;whatever I want&quot;); //outputs &quot;i&#39;m inside and i&#39;ve changed outside to whatever I want&quot;</pre><pre>anywhere(&quot;blah&quot;); //outputs &quot;i&#39;m inside and i&#39;ve changed outside to blah&quot;</pre><p>We have just used closure to help us gain access to an encapsulated variable. <strong>Encapsulation </strong>is a fancy word that means to hide or make private. This is comparable to the implementation of classes in other programming languages. So we learned that by returning a function definition we can change “private” variables. We can also take that same idea and apply it to objects.</p><pre>function outer() {</pre><pre>  var outside = &quot;i&#39;m outside&quot;;</pre><pre>  var inner = {<br>    inside: &quot;i&#39;m inside&quot;,<br>    outside: function(changer) {<br>      var both = inner.inside + &quot; and i&#39;ve change outside to &quot; + changer;<br>      console.log(both);<br>    }<br>  }<br>  <br>  <strong>return inner</strong>;</pre><pre>}</pre><pre>var anywhere = outer(); //anywhere is now the inner object<br>anywhere.outside(&quot;blah&quot;); //outputs &quot;i&#39;m inside and i&#39;ve changed outside to blah&quot;</pre><p>So basically the reason why we can do this is because of one simple rule:</p><blockquote>a function remembers it’s lexical scope even when it’s called outside of that scope.</blockquote><p>This is most important thing to understand about closure.</p><h4>Closing Thoughts</h4><p>To understand closures we need to know how scope works. Closures give us a way to produce objects that can <strong>encapsulate(hide)</strong> and manipulate that data. Closures are used a lot in javascript so the more you experiement with them, the more you’ll understand applications that use them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a828e88b272f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/javascript-closures-a828e88b272f">Javascript Closures</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Scope]]></title>
            <link>https://medium.com/full-stack-web-development/javascript-scope-2cc82302113b?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/2cc82302113b</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Mon, 16 Jan 2017 14:58:49 GMT</pubDate>
            <atom:updated>2017-01-16T14:58:24.154Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is scope? How does Javascript use it? We try to answer these and other important questions to the this very ambiguous concept.</h4><p>It’s probably easier to think of scope in terms of <strong>access</strong>. What does an object have access to? Scope is also known as <strong>context</strong>, or <strong>envronment</strong>. I just use <strong>scope.</strong> It helps me to understand the developer console a little better since that’s the terminology it uses.</p><h4><strong>Lexical</strong></h4><p>We use the term lexical to refer to a language’s vocabulary usually referring to a lexicon, a dictionary of a certain language. So the idea is that when you want the true definition of a word you will consult a dictionary(the source). The true source of scope for javascript happens at compilation. Javascript establishes <strong>ALL </strong>scope at compilation time. There are three kinds of scope in javascript. <strong>Global, Local </strong>and <strong>Lexical</strong>.</p><h4>Global Scope</h4><p>Every thing inside your program has access to everything on the <strong>global scope</strong>. There is a reason why you hear often, “Don’t pollute the global scope.” Everyone has access to it making it easy to change.</p><pre>var x = “x”;</pre><p>Var x has just become a property to the global scope. Some people might call it a member of the global object. The global object <strong>owns </strong>var x. Var x is on the global scope.</p><pre><strong>this</strong>.x //returns &quot;x&quot;</pre><p>The keyword this is a proxy for the global object in this scenario. What happens if you create a variable inside of a function? Anytime you <strong>run </strong>a function, you create <strong>local scope</strong>. Local scope cannot be accessed by anything outside of that scope.</p><h4>Local Scope</h4><pre>function child() {<br>  var x = &quot;x&quot;;<br>}</pre><pre>console.log(x); //x is not defined</pre><p>Now we would describe var x’s scope as being local to the child() function. Var x only exists inside of the child function so it’s scope is just the function that declared it. Also note that local scope isn’t created until the execution of the function.</p><h4><strong>Lexical Scope</strong></h4><pre>function grand() {<br>  var x = &quot;Hi. I&#39;m from grand.&quot;;<br>  function parent() {<br>    function child() {<br>      console.log(x);<br>    }<br>    child();<br>  }<br>  parent();<br>}</pre><pre>grand(); //will output &quot;Hi. I&#39;m from grand&quot;</pre><p><strong>Lexical scope</strong> is when a local scope is dependent upon another local scope. In this example the <strong>lexical scope</strong> for child() function has access to the grand() function because it accesses a variable defined there — variable x. The child() function has access to that function() because of the rules for <strong>lexical scoping. </strong>So we see that the child() function not only has local scope, but it also has lexical scope. On execution, if a local scope <strong>uses </strong>something from another scope, the “enclosing” scope becomes a <strong>closure</strong>. Closures are a big topic in itself and are outside of the “scope” of this article.</p><h4><strong>Lexical Scoping</strong></h4><p>If you can’t define a variable from within it’s own scope, then look into that scope’s outer scope for the definition. If the outer scope doesn’t have it then look to it’s outer scope. Keep doing this until you reach the global scope.</p><h4><strong>Closing Thoughts</strong></h4><p>Scope is a crucial part in understanding javascript. It is one of those things that you don’t want to go through your programming career with a sense of what it means, but rather a definitive answer so that it can be correctly applied to your programs. I would put scope as an absolute <strong>must-know</strong> to having a firm foundation in javascript.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cc82302113b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/javascript-scope-2cc82302113b">Javascript Scope</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Arrays]]></title>
            <link>https://medium.com/full-stack-web-development/javascript-arrays-62378e113201?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/62378e113201</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Fri, 13 Jan 2017 21:46:28 GMT</pubDate>
            <atom:updated>2017-01-13T21:45:56.295Z</atom:updated>
            <content:encoded><![CDATA[<h4>Something really funky about arrays. Find out here.</h4><p>Arrays are objects. Maybe you already heard that, but have you tested that premise? If they are objects, then they should be able to store any types of data like objects.</p><pre>var arr = [];</pre><pre>arr.hello = &quot;world&quot;</pre><pre>console.log(arr.hello); //what will this be?</pre><p>We get the value “world” returned. So it does have some characteristics like objects, but if it’s exactly like a literal object, then why even have arrays? Well, that’s because it has other characteristics that only pertain to arrays. We normally think of arrays as lists. That is, a list of values and not key/pairs like objects. We also think of arrays as being ordered by numbers with 0-index while objects are like hashes(in some programming languages) where the items don’t have any order. So with arrays we can do sort and filter through data through indexes. So let’s take the above example and get the value from the array through an index.</p><pre>console.log(arr[0]);</pre><p>You should have gotten undefined because there is nothing defined at index 0. But didn’t we just add an item to the array? Yes, it wasn’t an indexed value, it was a property(key/pair value). Huh? That’s dumb you say. And quite frankly, it is. That is why we have literal objects and array objects.</p><h4>Array indexes are strings</h4><p>The bracket operator for objects evaluates an expression and coerces that expression to a string.</p><pre>var obj = {};<br>obj.hello = &quot;world&quot;;<br>var hello = &quot;hello&quot;;<br>console.log(obj[hello]); //outputs &quot;world&quot;</pre><p>Let’s see this in arrays using our array example.</p><pre>arr.push(&quot;bye&quot;);</pre><pre>console.log(arr); //outputs [&quot;bye&quot;, hello: &quot;world&quot;]</pre><pre>console.log(arr[0]); //outputs bye</pre><p>So at index “number” 0 is the string “bye”. Let’s add a string “2” property with a value:</p><pre>arr[&quot;2&quot;] = &quot;foo&quot;;<br>console.log(arr); //outputs [&quot;bye&quot;, 2: &quot;foo&quot;, hello: &quot;world&quot;]</pre><p>So at index 0 we have a string “bye”. But what’s at index 1?</p><pre>console.log(arr[1]); //outputs undefined</pre><p>So at index 2 we should get undefined right?</p><pre>console.log(arr[2]); //ouputs foo</pre><p>What?! This makes sense once you understand that indexes are strings. Now look what happens to our property (2: “foo”) once we give something to index 1:</p><pre>arr[1] = &quot;bar&quot;;<br>console.log(arr); //outputs [&quot;bye&quot;, &quot;bar&quot;, &quot;foo&quot;, hello: &quot;world&quot;]</pre><p>(2: “foo”) become “foo”. And there’s still nothing at index 3. Let’s further verify that indexes are strings by seeing what’s at string “0”:</p><pre>console.log(arr[&quot;0&quot;]);</pre><h4>Closing Thoughts</h4><p>So if this all seemed confusing it should be. Arrays are objects but we don’t want to use them as such. We want to use them how we typically are taught to use them. Like lists. If you try and combine the two traditional ideas of objects and arrays like we did in the above examples we get into lots of confusion and trouble. This is also why we have loops that can be used by both, but are better used for their designed purposes. Yes it’s true that functions are objects, but for clarity I’m going to think of arrays as arrays.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62378e113201" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/javascript-arrays-62378e113201">Javascript Arrays</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Hoisting]]></title>
            <link>https://medium.com/full-stack-web-development/javascript-hoisting-4ff9fc1f9b68?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/4ff9fc1f9b68</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Wed, 11 Jan 2017 19:47:27 GMT</pubDate>
            <atom:updated>2017-01-12T17:17:45.841Z</atom:updated>
            <content:encoded><![CDATA[<h4>What javascript really does when it’s hoisting your variables</h4><p>When I first learned about hoisting it was a very simple idea and it made sense. The explanation was that if you access a variable before it’s declared you won’t get an error because javascript will place that variable to the very top of your code but will assign it <strong>undefined</strong>.</p><pre>console.log(a); //outputs undefined</pre><pre>var a = 1;</pre><p>But when I came across this scenario with functions something different happened.</p><pre>foo(); //outputs 1</pre><pre>function foo() {<br>  console.log(1);<br>}</pre><p>It works. The explanation is that functions get “hoisted” up to the top but unlike variables, functions get their definitions. Why couldn’t they do the same with variables? I think it’s fine to code with this definition of hoisting it’s used numerous times in javascript tutorials. However, I think finding out what’s really going on under the hood will not only help you understand hoisting, but other aspects of javascript and why it does certain things.</p><h4>Javascript Parsing</h4><p>What does the javascript engine do when it first runs through your code? It first creates a global scope(environment) for your program to live in. This is referred to as the global execution context. Then it’s starts parsing your code. The parsing takes 2 steps. The first step quickly goes through your code to find any variable and function declarations. This first step is referred to as <strong>Compilation </strong>or <strong>Creation </strong>phase. I like to call it the <strong>hoisting </strong>phase —<strong> t</strong>he very thing we are trying to figure out. Javascript is not putting all the declarations up to the top of your script, but rather it is allocating memory for all of these declarations. It will assign all variables to undefined in this step.</p><pre>//Step 1</pre><pre>function b(<br>  console.log(a);<br>){}; //the engine puts the function body into memory as a string.</pre><pre>b(); //the engine ignore function invocation in this step.</pre><pre>var a = 1; //the engine puts variable a into memory and assigns it undefined. So a = undefined.</pre><p>Once it runs through all of your script it will start parsing at the top again but this time it will assign your values to your variables and also execute your function invocations. This second step is known as the <strong>Execution </strong>phase.</p><pre>//Step 2</pre><pre>function b(<br>  console.log(a);<br>){}; //the engine ignores this declaration in this step.</pre><pre>b(); //the engine finds the function body for b in memory and runs the function.  It will return an error when it reaches the console.log(a); statement.</pre><pre>var a = 1; //parsing has stopped due to the above error.</pre><p>Now if <strong>YOU </strong>were to <strong>hoist </strong>variable a to the top of the script and run it. It will work:</p><pre>var a = 1; //engine has reassigned undefined with 1.</pre><pre>function b(<br>  console.log(a);<br>){}; //the engine has allocated this function to memory.</pre><pre>b(); //the engine finds the function body for b in memory and runs the function.  The output will be 1.</pre><h4>Closing Thoughts</h4><p>So it seems this is a programming issue since javascript has incorporated the <strong>“use strict”</strong> and the <strong>let </strong>identifier. You can’t run into undefined variables using these mechanisms. I think the solution is just to mimic how the old fashioned way of declaring all of your variables at the top of your program. I think this is the reason why so many people relate their explanations with the term hoisting, and also why the creators of javascript implemented this behavior in the first place — I don’t know for sure. But I have a good clue now to as to why I may have undefined variables in my code and how to tackle them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ff9fc1f9b68" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/javascript-hoisting-4ff9fc1f9b68">Javascript Hoisting</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Javascript Clarity]]></title>
            <link>https://medium.com/full-stack-web-development/javascript-clarity-aae8123995f2?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/aae8123995f2</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Wed, 11 Jan 2017 18:51:03 GMT</pubDate>
            <atom:updated>2017-01-13T21:48:18.054Z</atom:updated>
            <content:encoded><![CDATA[<h4>Definitive answers to some ambiguous javascript.</h4><p>Some of the most basic things are confusing because everyone has an opinion on it and describes it in ways that we all may not agree with. Let’s absolutely define the terms so that we don’t have to question what it is every time we come across it.</p><h4>Arguments vs Parameters</h4><p>We interchange these two all the time. It’s not really that big of a deal but what’s the difference and is there one? Yes there is a difference. Parameters is just a variable names for arguments. So then the actual values you use will be the arguments.</p><pre>function (x, y) {<br>  console.log(x + y);<br>};</pre><pre>function(3, 5); //outputs 8</pre><p>So in this example we can conclude:</p><p>Parameters: x, y</p><p>Arguments: 3, 5</p><p>In conversation I still interchange the terms all the time and people still know what I’m talking about. It’s not that big of a deal, but when it comes down to making it clear and definitive, I choose to give them both clear definitions.</p><h4>Statements and Expressions</h4><p>You should check out the stackoverflow for this one. It’s very confusing and it’s seems different for each programming language. I would like a succinct definition that applies across the board and makes sense. I have concluded that:</p><p><strong>expressions </strong>include variables, operators and values, and keywords or a combination of them, and functions.</p><p><strong>statements</strong> consist of expressions but perform a task. All statements are expressions, but not all expressions are statements.</p><p>examples:</p><pre>var a; //expresssion<br>&quot;this is a sentence&quot;; //expression<br>[0,1,2,3] //expression<br>{name: &quot;name&quot;, color: &quot;color&quot;} //expression<br>var a = 1; //both<br>1 + 5; //both<br>function (){}; //both</pre><h4>Function Statements vs Function Expressions</h4><p>So now that we’ve defined statements and expressions. How does that apply to this? This is supposedly a function statement:</p><pre>function test() {<br>  ...<br>};</pre><p>vs a function expression:</p><pre>function() {<br>  ...<br>}</pre><p>Here’s another function expression:</p><pre>var obj = {<br>  <strong>&quot;huh&quot;: function test()</strong> {<br>    ...<br>  }<br>}</pre><p>The “huh” function is a “named” function expression. But isn’t <strong>function test()</strong> a function statement? Very confusing. So here’s what I’ve concluded about the matter. A <strong>function statement in javascript</strong> is a declaration of a function given a name with this format:</p><pre>function &lt;name&gt;() {<br>  ...<br>}</pre><p>Every other function construct is a function expression.</p><h4>Closing Thoughts</h4><p>I find it very hard to think through code when my mind is fighting some ambiguous idea. I like concrete things, i’m not a theorist. I have found that establishing concepts definitively makes coding a lot smoother for me. And even if my definition isn’t completely correct I can easily redefine if I understand why it’s not. I have found that arguing over semantics just make things very confusing.</p><p>The big takeaway is to make things <strong>CONCRETE </strong>in your mind and move forward. Ignore the debates when it’s about who is pronouncing “tomato” correctly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aae8123995f2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/javascript-clarity-aae8123995f2">Javascript Clarity</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Move Vagrant’s storage to save HDD space]]></title>
            <link>https://medium.com/full-stack-web-development/move-vagrants-storage-to-save-hdd-space-cd1a1dc7b179?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd1a1dc7b179</guid>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[developer-environment]]></category>
            <category><![CDATA[vagrant]]></category>
            <category><![CDATA[learn-web-development]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Sat, 07 Jan 2017 15:34:33 GMT</pubDate>
            <atom:updated>2017-01-07T15:33:40.313Z</atom:updated>
            <content:encoded><![CDATA[<p>Vagrant stores it’s virtual machines on the same drive you installed it. We’ll show you how to move Vagrant’s storage location if you want to move it to a different drive. These instructions are for windows 7 and for VirtualBox vms.</p><p>These instructions reference this <a href="https://emptysqua.re/blog/moving-virtualbox-and-vagrant-to-an-external-drive/">tutorial</a>.</p><h4>1. First we’ll need to create a vagrant project if you haven’t done so already.</h4><pre>cd ~<br>mkdir project<br>cd project<br>vagrant init hashicorp/precise64<br>vagrant up</pre><p>Vagrant creates a .vagrant.d folder and stores a vagrant box inside this folder (hashicorp/precise64 box).</p><h4>2. Let’s move and rename the .vagrant.d folder to the desired storage drive and point Vagrant to that drive.</h4><pre>mv .vagrant.d &lt;path to new drive&gt;/vagrant_home<br>vim .bash_profile</pre><pre>&lt;add this line at the end of the file&gt;<br>setx VAGRANT_HOME &quot;&lt;drive&gt;:&lt;path to vagrant_home&gt;&quot;</pre><pre>ie. setx VAGRANT_HOME &quot;d:/vagrant_home&quot;</pre><h4>3. Change VirtualBox settings to match</h4><p>Create a “VirtualBox VMs” folder in your storage drive. If you already have this folder then just move it to the storage drive.</p><pre>cd /&lt;storage drive&gt;<br>mkdir VirtualBox VMs</pre><h4>4. Change VirtualBox storage path</h4><p>Open up VirtualBox and then change File &gt; Preferences &gt; General &gt; Default Machine Folder &gt; (the new path to VirtualBox VMs in your storage drive). Remove any machines you have created before. Any virtual machines you have already created must be reestablished by double-clicking it’s .vbox file to restore it to the VirtualBox Manager.</p><h4>5. Test it</h4><p>Go back inside the project we created earlier start the machine</p><pre>cd ~/project<br>vagrant up</pre><p>You should now be able to go into your storage drive under the “VirtualBox VMs” directory and find your new virtual machine.</p><h4>Done</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd1a1dc7b179" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/move-vagrants-storage-to-save-hdd-space-cd1a1dc7b179">Move Vagrant’s storage to save HDD space</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a Lean Web Dev Environment for Windows 7 — Part III of III]]></title>
            <link>https://medium.com/full-stack-web-development/create-a-lean-web-dev-environment-for-windows-7-part-iii-of-iii-83a2c37ceefd?source=rss----37c0199db86c---4</link>
            <guid isPermaLink="false">https://medium.com/p/83a2c37ceefd</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[developer-environment]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <category><![CDATA[learn-web-development]]></category>
            <category><![CDATA[vagrant]]></category>
            <dc:creator><![CDATA[Isaac Pak]]></dc:creator>
            <pubDate>Thu, 29 Dec 2016 03:19:23 GMT</pubDate>
            <atom:updated>2018-09-03T23:30:07.192Z</atom:updated>
            <content:encoded><![CDATA[<p>In <a href="https://medium.com/full-stack-web-development/create-a-lean-web-dev-environment-for-windows-7-part-ii-of-iii-699f48d9ac47#.qtd5msrgp">Part II</a> we added some more configuration and finally got it up and running. In this final part we’ll look into embellishing our development environment a little more and look to incorporate a nice development workflow.</p><h4>15. Adding another application</h4><p>Let’s add another web application just to test redundancy. Go back to <a href="https://medium.com/full-stack-web-development/create-a-lean-web-dev-environment-for-windows-7-part-ii-of-iii-699f48d9ac47#.eqzwakxyh">part 2</a> and repeat steps 12 to 13 replacing occurrences of app1 to app2. You can skip the section to delete the default page since we’ve already done that. In your index.html file you might want to change the text to differentiate it from app1. Once you can view the app2.local.html you can add more apps depending on how much your server can handle.</p><h4>16. Some routine processes you should know</h4><h4>Shutting down your virtual machine</h4><p>When you’re ready to shut off your computer, you will want to shut off your virtual machine. You must first exit out of the machine by just typing exit. You should then be in your windows environment and use this command to shut down your virtual server:</p><pre>vagrant halt</pre><h4>Restarting your virtual machine</h4><pre>vagrant up</pre><p>Just remember that after your machine is up and running, you are still not inside of your machine. To jump inside use this command:</p><pre>vagrant ssh</pre><h4>Reprovisioning your virtual machine</h4><p>If you want to add more provisioning to your machine you can do so in your /vagrant/provision folder. Once added you can reload it with:</p><pre>vagrant reload --provision</pre><h4>17. Change the user for nginx</h4><p>We will want to change the default user(www-data) for you server on your development machine to you(vagrant). This will alleviate a lot of permission issues when we create files. This is only for a development environment.</p><pre>sudo vim /etc/nginx/nginx.conf<br>&lt;Change this line&gt;<br>user www-data<br>&lt;to&gt;<br>user vagrant<br>&lt;Restart your server&gt;<br>sudo service nginx restart</pre><h4>18. Some helpful facts</h4><p>● You don’t need to use sudo inside your windows environment, just inside your virtual machine. Sudo represents a super user. Your account is automatically part of the sudoers group.</p><p>● You can add a password to the root account by this code:</p><pre>sudo passwd root</pre><p>then login to root with</p><pre>su root</pre><p>this is not advisable in a production setting. But in our case, it comes in real handy.</p><p>● In your windows environment you will find an html directory inside your /vagrant directory. You’ll also find any apps you made there from your virtual machine. That’s because we synced those directories. Which means you could code in that directory and not have to do any code in your virtual machine. As soon as you boot up your virtual machine it syncs the directories together.</p><p>● We set your folder and files to automatically be set to the standard 755, 644 folder/file permissions each time you create one. You will not be able to change those permissions. This is fine in a development environment, but if you want that functionality removed, you can remove it from your Vagrantfile you created in Part I.</p><h3>Closing Thoughts</h3><p>If everything didn’t go as planned it’s not the end of the world. There are many methodologies to development environments on the web that are a little more simplified that you could implement, however I would not recommend something too idiomatic because you learn a lot from building a system that’s more robust and more adopted by the professional industry. The technologies used in this guide are used by industry professionals. If you want to dig in deeper and understand more of what all the code was about you can research this list which have most of the core technologies we used:</p><p>● javascript — the programming language of modern web development</p><p>● vagrant — a virtual machine manager</p><p>●virtualbox — a virtual machine. You could do all of your virtual machinery without vagrant, but vagrant makes life a whole lot easier.</p><p>● nodejs — a javascript backend. Built on google’s V8 engine, this is a real value if even if you only use it for the node packages.</p><p>● nvm — a node version manager. Not necessary, but gives you a lot of control over node versioning for projects.</p><p>● npm — a node package manager</p><p>● git — a version control system. You messed up somewhere in your code and want to rollback, no problem. Makes code collaboration trivial.</p><p>● nginx — an web server. Great for static web serving.</p><p>● vim — the best text editor in the world.</p><p>This development environment is a simple hybrid stack (MySQL, Nodejs, Nginx) but can easily adapt to any of the other stacks (LAMP, MEAN, LEMP etc.) Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83a2c37ceefd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/full-stack-web-development/create-a-lean-web-dev-environment-for-windows-7-part-iii-of-iii-83a2c37ceefd">Create a Lean Web Dev Environment for Windows 7 — Part III of III</a> was originally published in <a href="https://medium.com/full-stack-web-development">Full Stack Web Development</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>