<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: slooker</title>
    <description>The latest articles on DEV Community by slooker (@slooker).</description>
    <link>https://dev.to/slooker</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F30672%2F90b2d6d8-e6b2-46de-b877-65f5489177b4.jpeg</url>
      <title>DEV Community: slooker</title>
      <link>https://dev.to/slooker</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/slooker"/>
    <language>en</language>
    <item>
      <title>Developing from an iPad</title>
      <dc:creator>slooker</dc:creator>
      <pubDate>Tue, 22 Aug 2017 01:59:25 +0000</pubDate>
      <link>https://dev.to/slooker/developing-from-an-ipad</link>
      <guid>https://dev.to/slooker/developing-from-an-ipad</guid>
      <description>&lt;p&gt;When the iPad Pro came out, I was skeptical about it being useful for a developer for much, but I decided to splurge for one when I found out about &lt;a href="https://www.duetdisplay.com/" rel="noopener noreferrer"&gt;Duet&lt;/a&gt;, which lets me use it as a secondary screen for my Macbook.  This is invaluable for having documentation on a second monitor.&lt;/p&gt;

&lt;p&gt;Recently, I've been reading up on a lot of tools that let you use your iPad as an actual development box, which makes it incredibly more useful to me.  To be clear, most of these things are going to require you to have a network connection on your iPad so you can connect to another server like &lt;a href="https://m.do.co/c/30da16b13cc2" rel="noopener noreferrer"&gt;Digital Ocean&lt;/a&gt; (disclaimer, that's my referral link for DO), although you can use cloud based tools like Google Cloud, AWS, etc to push up to.  The only downside to the cloud based option is that you'll have to push your changes up every time you want to test something, as opposed to just being able to save, switch to Chrome, and reload.&lt;/p&gt;

&lt;h5&gt;
  
  
  Mosh
&lt;/h5&gt;

&lt;p&gt;The first thing I had issues with when developing from an iPad was getting disconnected every time I stayed away from my SSH terminal too long looking at a page in Safari.  Then I stumbled across &lt;a href="//www.mosh.org"&gt;Mosh&lt;/a&gt;.  Mosh uses UDP instead of TCP, and can be setup pretty easily on your server.  There's no lag, and it works even through network latency.  &lt;/p&gt;

&lt;h5&gt;
  
  
  Blink Shell
&lt;/h5&gt;

&lt;p&gt;This leads me to my next app.  &lt;a href="http://www.blink.sh/" rel="noopener noreferrer"&gt;Blink Shell&lt;/a&gt; is an iOS client for using SSH or Mosh.  It's $20, which I initially balked at, but it's well worth the money if you're going to connect to another server regularly from your iPad.  It's open source, so if you &lt;strong&gt;really&lt;/strong&gt; don't want to spend that $20, you can always compile it by yourself from the &lt;a href="https://github.com/blinksh/blink" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  Screen
&lt;/h5&gt;

&lt;p&gt;GNU Screen is probably my most used app on a day to day basis.  GNU Screen lets you have multiple windows open that you can switch between with a few key strokes.  I'm an old school unix guy, and I hate having to use the mouse or take my fingers off the keyboard for anything.  GNU Screen lets me swap between windows easily without having to do that.  On most systems, you can install Screen by running &lt;code&gt;apt-get install screen&lt;/code&gt; for an Ubuntu/Debian system, or &lt;code&gt;yum install screen&lt;/code&gt; for a Red Hat/Fedora based system.  The &lt;strong&gt;biggest&lt;/strong&gt; benefit though is that if you get disconnected, you can ssh/mosh back into your system and run &lt;code&gt;screen -x&lt;/code&gt; and re-attach your screen session.  All of your work is still there, and you don't have to setup your environment each time.&lt;/p&gt;

&lt;p&gt;Screen reads from &lt;code&gt;~/.screenrc&lt;/code&gt; and I have mine setup to display a bar across the bottom so that I know what windows I have open and can easily switch to them.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fimgur.com%2Fp1U0901.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fimgur.com%2Fp1U0901.png" alt="GNU Screen screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the &lt;code&gt;~/.screenrc&lt;/code&gt; file I use to make this happen:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;caption always "%{.bW}%-w%{.rW}%n %t%{-}%+w %= %{..W}[%l] %{..G}%2`@%H %{..Y} %D %d/%m/%Y %c "
termcapinfo xterm ti@:te@
defscrollback 30000 # Use a 30000-line scrollback buffer
autodetach on # Autodetach session on hangup instead of terminating screen completely
startup_message off # Turn off the splash screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's a list of the most common commands I use for GNU Screen.  A more complete reference can be found &lt;a href="http://aperiodic.net/screen/quick_reference" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The quick things that you want though are &lt;code&gt;ctrl-a&lt;/code&gt; is the default "command" key
so you do &lt;code&gt;ctrl-a&lt;/code&gt; then another key.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ctrl-a c&lt;/code&gt; creates a screen&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ctrl-a k&lt;/code&gt; kills a single screen terminal, after you answer &lt;code&gt;y&lt;/code&gt; at the prompt (but you can just type &lt;code&gt;exit&lt;/code&gt; or &lt;code&gt;ctrl-d&lt;/code&gt; at a prompt to exit it)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ctrl-a a&lt;/code&gt; lets you change the name of the current screen (that’s what shows at the * bottom using that .screenrc file I showed you)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ctrl-a d&lt;/code&gt; detaches your screen (brings you out of screen and back to the command prompt, * still saving your screen sessions)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;screen -x&lt;/code&gt; is what I run when logging in if I have a screen session already running, and if there’s not a screen session already running, I just run &lt;code&gt;screen&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Vundle
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://github.com/VundleVim/Vundle.vim#quick-start" rel="noopener noreferrer"&gt;Vundle&lt;/a&gt; is a VIM plugin manager.  It makes life a lot easier, and I'm not really certain how I lived without it before.  &lt;/p&gt;

&lt;p&gt;To install it, assuming you already have vim installed, just run &lt;code&gt;git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim&lt;/code&gt;.  You'll also need to edit your &lt;code&gt;~/.vimrc&lt;/code&gt; file to use Vundle.  You can look at the &lt;a href="https://github.com/VundleVim/Vundle.vim#quick-start" rel="noopener noreferrer"&gt;Vundle quick start docs&lt;/a&gt; or you can use &lt;a href="https://paper.dropbox.com/doc/.vimrc-WSMgdT0JMm33Na1jca0R3" rel="noopener noreferrer"&gt;my .vimrc&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have it installed, startup vim, and type &lt;code&gt;:PluginInstall&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Bash
&lt;/h5&gt;

&lt;p&gt;This one needs no introduction for most people, and is the default shell for most Linux distributions.  The one minor thing I add is the Git branch in my command prompt.  You can do this easily by adding this to your &lt;code&gt;~/.bashrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## Bash prompt stuff
parse_git_branch() {
     git branch 2&amp;gt; /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives you a prompt that looks like this (at least on my machine):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fimgur.com%2FuoDGwj1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fimgur.com%2FuoDGwj1.png" alt="Example bash prompt with github branch"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Vim
&lt;/h5&gt;

&lt;p&gt;My editor of choice when using my iPad with Digital Ocean is vim.  I grew up using vi, so vim is second nature to me.  Here's a simple cheat sheet for the things I use most in vim, but you can find a much more lengthy cheat sheet &lt;a href="https://vim.rtorr.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dd&lt;/code&gt; will delete a line, &lt;code&gt;p&lt;/code&gt; will put back a deleted line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;V&lt;/code&gt; to start a visual block, then you can use your arrows to move up and down to select what you want to use &lt;code&gt;dd&lt;/code&gt; and &lt;code&gt;p&lt;/code&gt; on&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt; goes to the end of a line and &lt;code&gt;^&lt;/code&gt; goes to the beginning of one&lt;/li&gt;
&lt;li&gt;Use #G` where # is a number, to go to a specific line.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;m&amp;lt;Letter&amp;gt;&lt;/code&gt; to mark something (like a bookmark) and &lt;code&gt;'&amp;lt;letter&amp;gt;&lt;/code&gt; to go to it.  Example: if I’m swapping between two methods, I’ll do &lt;code&gt;ma&lt;/code&gt; and &lt;code&gt;mb&lt;/code&gt; to mark them, and then do &lt;code&gt;'a&lt;/code&gt; and &lt;code&gt;'b&lt;/code&gt; to go to them.&lt;/li&gt;
&lt;li&gt;Other than that, I just use regex replaces.  I’ll use &lt;code&gt;V&lt;/code&gt; to select a block, then hit &lt;code&gt;:&lt;/code&gt; which will change your prompt a t the bottom to &lt;code&gt;:'&amp;lt;, '&amp;gt;&lt;/code&gt; and then you can do &lt;code&gt;s/word/replace/g&lt;/code&gt; etc&lt;/li&gt;
&lt;li&gt;Typing &lt;code&gt;:&lt;/code&gt; without a visual block will let you do &lt;code&gt;%s/word/replace/g&lt;/code&gt; to do it in the whole file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;:wq&lt;/code&gt; will write and quit, &lt;code&gt;:q&lt;/code&gt; will quit an unedited file, and &lt;code&gt;:q!&lt;/code&gt; will quit a file without saving, even if it’s been edited.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the things I can't live without with vim is this line in my &lt;code&gt;~/.vimrc&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;map &amp;lt;Tab&amp;gt; &amp;lt;C-W&amp;gt;w&amp;lt;C-W&amp;gt;_&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;This makes it so that when I open up more than one file using &lt;code&gt;:split &amp;lt;filename&amp;gt;&lt;/code&gt;, I can hit &lt;code&gt;&amp;lt;tab&amp;gt;&lt;/code&gt; to switch between the two files, and it will maximize the file that I just switched to.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fimgur.com%2FJVoCXqv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fimgur.com%2FJVoCXqv.gif" alt="Example showing switching between two files"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last two things I use in vim to make my life easier are &lt;a href="https://github.com/jistr/vim-nerdtree-tabs" rel="noopener noreferrer"&gt;Nerdtree Tabs&lt;/a&gt; and &lt;a href="https://github.com/ctrlpvim/ctrlp.vim" rel="noopener noreferrer"&gt;Ctrl-P&lt;/a&gt;.  Nerdtree tabs are what you see on the left side of the image just above.  It's similar to most editors you see like VS Code, Sublime or Atom when you open a folder instead of a single file.&lt;/p&gt;

&lt;p&gt;Ctrl-P is a fuzzy search file finder for vim.  If you type &lt;code&gt;ctrl-p&lt;/code&gt; and start typing a word, it will do a search through your file tree to find it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Frecordit.co%2FpTvj3WTMER.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Frecordit.co%2FpTvj3WTMER.gif" alt="Ctrl-P in action"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally posted on &lt;a href="https://blog.slooker.us/developing-from-an-ipad/" rel="noopener noreferrer"&gt;blog.slooker.com&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ipad</category>
      <category>developers</category>
      <category>digitalocean</category>
    </item>
  </channel>
</rss>
