digitaldrummerj.me - RSS









Search Preview

Justin James

digitaldrummerj.me
Justin Jameshttps://digitaldrummerj.me/ on Justin JamesHow to Download and Extract a Zip File with Nodehttps://digitaldrummerj.me/node-download-zip-and
.me > digitaldrummerj.me

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Justin James
Text / HTML ratio 98 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud
    install
  1.  
      file add

      run >

    • command Studio post = Visual
       blog create 				
Keywords consistency
Keyword Content Title Description Headings
    320
    259
    install 201
  1. 200
    198
      183
      Headings Error! The website does not use (H) tags.
      Images We found 0 images on this web page.

      SEO Keywords (Single)

      Keyword Occurrence Density
        320 16.00 %
        259 12.95 %
        install 201 10.05 %
      1. 200 10.00 %
        198 9.90 %
          183 9.15 %
          file 183 9.15 %
          add 183 9.15 %

          180 9.00 %
          169 8.45 %
          run 169 8.45 %
          >

        • 151 7.55 %
          command 146 7.30 %
          Studio 127 6.35 %
          post 127 6.35 %
          = 124 6.20 %
          Visual 112 5.60 %
          111 5.55 %
          blog 110 5.50 %
          create 103 5.15 %

          SEO Keywords (Two Word)

          Keyword Occurrence Density
          of the 267 13.35 %
          to the 215 10.75 %
          in the 185 9.25 %
          need to 177 8.85 %
          on the 139 6.95 %
          that you 134 6.70 %
          you can 106 5.30 %
          with the 105 5.25 %
          Visual Studio 101 5.05 %
          all of 97 4.85 %
          you will 93 4.65 %
          the following 90 4.50 %
          that we 88 4.40 %
          for the 85 4.25 %
          to be 84 4.20 %
          you are 82 4.10 %
          that I 79 3.95 %
          able to 79 3.95 %
          you have 77 3.85 %
          add the 77 3.85 %

          SEO Keywords (Three Word)

          Keyword Occurrence Density Possible Spam
          we need to 70 3.50 % No
          all of the 67 3.35 % No
          are going to 56 2.80 % No
          be able to 51 2.55 % No
          you need to 47 2.35 % No
          we are going 43 2.15 % No
          2015 000000 0000 35 1.75 % No
          to be able 34 1.70 % No
          you want to 31 1.55 % No
          part of the 26 1.30 % No
          that you can 25 1.25 % No
          add the following 24 1.20 % No
          to add the 24 1.20 % No
          the original repository 24 1.20 % No
          and navigate to 23 1.15 % No
          as part of 22 1.10 % No
          to get the 22 1.10 % No
          
          							
          22 1.10 % No
          make sure that 21 1.05 % No
          2016 000000 0000 21 1.05 % No

          SEO Keywords (Four Word)

          Keyword Occurrence Density Possible Spam
          we are going to 43 2.15 % No
          to be able to 33 1.65 % No
          as part of the 19 0.95 % No
          browser and navigate to 17 0.85 % No
          the following command to 17 0.85 % No
          the continuing series on 16 0.80 % No
          In this tutorial we 14 0.70 % No

          Now that we have

          14 0.70 % No
          this tutorial we are 14 0.70 % No
          tutorial we are going 14 0.70 % No
          continuing series on using 13 0.65 % No
          to make sure that 13 0.65 % No
          series on using Jekyll 13 0.65 % No
          on using Jekyll In 13 0.65 % No
          using Jekyll In this 13 0.65 % No
          Jekyll In this tutorial 13 0.65 % No

          Welcome the continuing series

          13 0.65 % No
          are now ready to 12 0.60 % No
          thing we need to 11 0.55 % No
          
          							
          11 0.55 % No

          Digitaldrummerj.me Spined HTML


          Justin James https://digitaldrummerj.me/ on Justin James How to Download andPericopea Zip File with Node https://digitaldrummerj.me/node-download-zip-and-extract/ Wed, 07 Feb 2018 00:00:00 +0000 https://digitaldrummerj.me/node-download-zip-and-extract/ <p>Downloading and extracting a zip file using Node seemed like a pretty easy task but alas it took some time to icon out.</p> <p>While researching how to do this, I didn&rsquo;t find a library that had all of the requirements within it but I did find a few that unliable me to meet the requirements</p> <h2 id="requirements">Requirements</h2> <ol> <li>Download zip file from a url</li> <li>Extract zip file to a directory location</li> <li>Extract a single directory and all of its sub-directories within the zip file</li> </ol> <h2 id="downloading-the-zip-file">Downloading the Zip File</h2> <p>Step 1 was to get the zip file downloaded using Node and make sure that I could manually unshut it. To download the zip file, I am using the superagent package and piping the download to a file using fs.</p> <ol> <li><p>Install superagent package</p> <pre><code class="language-shell">npm install --save superagent </code></pre></li> <li><p>Using superagent withal with fs we can download a zip file and save the zip to a local file. In the lawmaking below, I am downloading the zip for the master workshop of the Github repo located at <a href="https://github.com/digitaldrummerj/node-zip-download-sample">https://github.com/digitaldrummerj/node-zip-download-sample</a>.</p> <blockquote> <p>There are &ldquo;TODO&rdquo; statements in the lawmaking unelevated for the things that you would need to transpiration to use this lawmaking for your own zip file.</p> </blockquote> <pre><code class="language-javascript">'use strict'; // Import const request = require('superagent'); const fs = require('fs'); // TODO: transpiration to where your zip file is located const repoName = 'node-zip-download-sample'; const href = `https://github.com/digitaldrummerj/${repoName}/archive`; const zipFile = 'master.zip'; const source = `${href}/${zipFile}`; // TODO: transpiration to the directory instead of the zip that you want to pericope const extractEntryTo = `${repoName}-master/`; // TODO: transpiration to the directory where you want to pericope to const outputDir = `./${repoName}-master/`; request .get(source) .on('error', function(error) { console.log(error); }) .pipe(fs.createWriteStream(zipFile)) .on('finish', function() { // add lawmaking unelevated to here }); </code></pre></li> </ol> <p>Now that the zip file is downloaded we can unzip it.</p> <h2 id="unzipping-the-zip-file">Unzipping the Zip File</h2> <p>For unzipping, I didn&rsquo;t find anything built into Node but I did find the <a href="https://www.npmjs.com/package/adm-zip">Adm-Zip</a> package on NPM.</p> <p><a href="https://www.npmjs.com/package/adm-zip">Adm-Zip</a> has functions for dealing with the unshortened zip file or a single file/directory within the zip file. In my specimen all of my files were contained within a directory in the zip file and I wanted to pericope the files contained within that directory.</p> <ol> <li><p>Install <a href="https://www.npmjs.com/package/adm-zip">Adm-Zip</a></p> <pre><code class="language-shell">npm install --save adm-zip </code></pre></li> <li><p>Add Adm-Zip to the list of requires</p> <pre><code class="language-javascript">const admZip = require('adm-zip'); </code></pre></li> <li><p>Within the on finish statement from the previous section, add the lawmaking unelevated to use Adm-Zip to pericope a directory from the downloaded zip file and pericope it to a directory</p> <pre><code class="language-javascript">console.log('finished downloading'); var zip = new admZip(zipFile); console.log('start unzip'); zip.extractEntryTo(extractEntryTo, outputDir, false, true); console.log('finished unzip'); </code></pre></li> </ol> <p>Just like that we had our zip file downloaded and extracted to a directory.</p> <p>You can find a working sample at <a href="https://github.com/digitaldrummerj/node-zip-download-sample">https://github.com/digitaldrummerj/node-zip-download-sample</a></p> <p>Leave a scuttlebutt unelevated if you end up using this solution or are doing it flipside way.</p> How I Record MyPrimingTalks https://digitaldrummerj.me/recording-my-conference-talks/ Thu, 01 Feb 2018 00:00:00 +0000 https://digitaldrummerj.me/recording-my-conference-talks/ <p>When I got started as a priming speaker I would see <a href="http://www.jeremybytes.com/">Jeremy Clark</a> recording his talks and I thought I should record my talks too. It would help me modernize as a speaker by seeing how I unquestionably was on stage versus how I think I was. As well, it gives attendees the worthiness to watch a replay of the talk in specimen they missed something or weren&rsquo;t worldly-wise to see it. This is thesping though that the recordings are posted somewhere and advertised to the attendees, which I used to be really bad about. It was difficult for a long time for me to watch myself giving a talk.</p> <p>So I started recording my talks. Unfortunately, in 2015 and 2016 I didn&rsquo;t process most of those videos. However, at the start of 2017 I decided that if I was going to take the time to record a talk I would process it and post it. A side goal was to moreover see if I could post the video while at the priming so that I could ensure that I unquestionably posted it. For 2017, I posted 9 talks publicly and 15 talks as unlisted (paid workshops) to my <a href="https://www.youtube.com/channel/UCDMvOL1XSKclxwplUT0fzLA">YouTube channel</a>. I plane managed to post all of the public talks while at the conference. Don&rsquo;t forget to subscribe to my waterworks to get notified when my talks are posted.</p> <h2 id="general-recording-requirements">General Recording Requirements</h2> <p>Before we get into the specifics, I have some vital recording requirements that guided me as I figured out this process and what equipment to use.</p> <ol> <li>First and foremost be worldly-wise to record my priming talks as painlessly as possible with good audio and HD video</li> <li>Can be setup in less than 5 minutes</li> <li>Be worldly-wise to capture both my screen and me presenting</li> <li>Be worldly-wise to upload the recordings to YouTube</li> <li>Be worldly-wise to use a similar setup to create training videos outside of my priming talks</li> <li>Have the equipment be lightweight unbearable that I don&rsquo;t have to bring an uneaten bag with me just for equipment</li> <li>Keep the upkeep as low as possible (e.g. don&rsquo;t need to spend $1000&rsquo;s on professional grade equipment)</li> <li>Be worldly-wise to process the videos fast unbearable that I can upload them while at the conference</li> <li>Be worldly-wise to reuse a majority of the equipment to record meetups that I shepherd but am not presenting at</li> </ol> <p class="alert-box warning radius"> Note: Many of the product links unelevated areWrenunite links. I won&rsquo;t get rich from them but every little bit helps me be worldly-wise to protract to speak and record my talks. </p> <h2 id="history">History</h2> <blockquote> <p>If you don&rsquo;t superintendency well-nigh the equipment that I tried out surpassing settling on my current equipment, you skip this section.</p> </blockquote> <p>Before we get into my current setup, lets take a quick squint at some of the other equipment that I have used surpassing settling in on my current setup.</p> <p>For the camera, I started out with a GoPro Hero 3 Silver since I once had this camera. The camera was small, easy to use, and recorded decent video but shower life was an issue as well as it started to wilt really unreliable and where would just randomly power off. Next, I used my iPhone 6 (64 gig) mounted on a tripod withal with the <a href="https://itunes.apple.com/us/app/moviepro-video-recorder/id547101144?mt=8">MoviePro</a> app. Using my phone worked unconfined since I unchangingly had my phone with me and the video quality was good. However, disk space was an issue as the phone only had 64 gigs and an hour of footage would take ~12 gigs. Then it would take over an hour to get the file off the phone and it was very flaky when copying it over which totally sucked. As well several times I had talks tropical unbearable together that I wasn&rsquo;t worldly-wise to transfer the recording to the computer in time and had to rush to well-spoken off unbearable space for 2 hours worth of footage. I was moreover starting to do increasingly workshops of 4-8 hours in length and the phone didn&rsquo;t have unbearable space or shower life for those recordings.</p> <p>For audio, since I wanted good audio, I knew from the start that I couldn&rsquo;t use the cameras seated microsoft. So I started with a Zoom H2 mounted on a small table top tripod since I once had it.Planethough Zoom is known for their audio quality it still was just recording the audio in the room so it was hit and miss plus moving virtually the stage profoundly effected the quality of the audio. Next, I went with a Zoom H1 with an external lapel mic which gave plane largest audio and I didn&rsquo;t lose quality as I moved around. The downside to both Zoom devices was that it was a 3rd device that I had to worry well-nigh getting setup and then syncing up the footage in editing.</p> <p>I moreover tried a live steaming type setup with a 2nd palmtop plus video capture vellum so that I wouldn&rsquo;t have to do any editing. This setup was a total bust. It took too long to get setup.Deliveringa 2nd palmtop was annoying. I had to get the camera, capture vellum and microphone synced since there is a slight wait with capture cards which manufacturers don&rsquo;t publish and If I screwed this up then the whole video was ruined as there was no way to post edit the video to fix it.</p> <h2 id="current-equipment">Current Equipment</h2> <p>For my current setup, I have used it to record over 30 talks and it hasn&rsquo;t let me lanugo yet. Yes that is increasingly talks than is on my <a href="https://www.youtube.com/channel/UCDMvOL1XSKclxwplUT0fzLA">YouTube channel</a> as some of the talks are internal talks at work.</p> <h3 id="microphone">Microphone</h3> <p>A key piece to a unconfined video is unconfined audio. You can get yonder with an ok video but if you have crappy audio no one will watch your video.</p> <h4 id="audio-requirements">Audio Requirements</h4> <ol> <li>Needs to record directly on the computer</li> <li>Needs to be wireless so that I can move virtually the stage</li> <li>Needs to be a lapel microphone (just in specimen the event gives me a headset mic for the room I can still record)</li> <li>Battery in transmitter uses either AA or 9V batteries</li> </ol> <p>Meeting requirement #2 and 3 was nonflexible as most wireless lapel microphones are XLR connections which ways that I would need to siphon virtually an audio interface to go from XLR to USB. I am once delivering unbearable equipment and didn&rsquo;t want increasingly equipment. Also, XLR Wireless microphones are pretty expensive as they start virtually $299 plus the audio interface. Since I once had an audio interface, I did try out a few of the cheaper XLR wireless microphones but the quality was terrible and they were quickly returned.</p> <p>The microphone I am currently using is the <a href="http://amzn.to/2Gtj9EX">Samson Stage XPD1</a> which is a wireless usb lapel microphone that forfeit &lt; $100 and provides a good compromise between quality and cost.</p> <p><a href="https://www.amazon.com/Samson-SWXPD1BLM5-Stage-XPD1-Presentation/dp/B014803CMK/ref=as_li_ss_il?_encoding=UTF8&pd_rd_i=B014803CMK&pd_rd_r=NX45M2C8EGX6139BM0S7&pd_rd_w=RjkWv&pd_rd_wg=3YlJn&psc=1&refRID=NX45M2C8EGX6139BM0S7&linkCode=li3&tag=digitaldrumme-20&linkId=513d044a7dce457517f945ed03936d40" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B014803CMK&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li3&o=1&a=B014803CMK" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>PROS:</strong></p> <ul> <li>Sound quality is good</li> <li>The range on the wireless is good. Never had it cut out as I was moving around</li> <li>It just worked when I plugged it in</li> <li>Since it is USB it records directly into the computer without an uneaten device</li> </ul> <p>All of the videos on my <a href="https://www.youtube.com/channel/UCDMvOL1XSKclxwplUT0fzLA">YouTube channel</a> are using this microphone. Don&rsquo;t forget to subscribe to my waterworks to get notified when my talks are posted.</p> <p><strong>CONS:</strong></p> <ul> <li>There is no shower indicator. Since I am paranoid well-nigh batteries dying in the middle of a recording, I have no track how long they really last since I switch them out every couple of hours. This in turn meant that at one point I had a huge bag of used but still good batteries that I didn&rsquo;t trust for anything important.</li> <li>The specimen is made of plastic</li> <li>The prune is plastic</li> <li>The USB dongle is quite wide and tends to imbricate increasingly than 1 port</li> </ul> <p>To solve the shower problem, I purchased a set of <a href="http://amzn.to/2EhYi6L">Rechargeable batteries</a>. I needed a charger since I didn&rsquo;t have one and AAA batteries are used for my <a href="http://amzn.to/2DQwUjD">Logitech R400 Slide Advancer</a>.</p> <p><a href="https://www.amazon.com/gp/product/B01LWCW3WY/ref=as_li_ss_il?ie=UTF8&psc=1&linkCode=li3&tag=digitaldrumme-20&linkId=f41bbb078e144400d38990ee758d1e40" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B01LWCW3WY&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li3&o=1&a=B01LWCW3WY" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <blockquote> <p>Pro Tip: If the event is moreover giving you a lapel mic for the room, put their microphone whilom yours. The regulars in the room deserves the weightier sound possible. Yes, I am moreover enlightened that you will be wearing 2 lapel microphones and 2 transmitter packs.</p> </blockquote> <blockquote class="warning"> <p><strong>Warning:</strong> If you are using a room microphone, you most likely will hear a slight value of reverb in the recording and you can&rsquo;t fix it without getting an audio feed directly from the room mic. Getting a uncontrived feed for the room mic is not typically possible at most events. To see an example of what I am talking about, trammels out my <a href="https://www.youtube.com/watch?v=IV5i0znk9Os&amp;t=12s">Angular Mix Talk</a>.</p> </blockquote> <h3 id="software">Software</h3> <p>The two pieces of software that I needed were screen capture and video editing. My main goal was to find something that was easy to use and had a very small learning curve.Withoutall, I am not an expert video editor nor do I want to wilt one.</p> <h4 id="screen-capture-requirements">Screen Capture Requirements</h4> <ol> <li>Needed to be worldly-wise to record my screen with the microphone and optionally include the system sounds</li> <li>Be worldly-wise to capture the full screen or a portion of the screen</li> <li>Be worldly-wise to select which audio device to use</li> <li>Be worldly-wise to capture system sounds if needed</li> <li>Have no time limit on how long the screen capture can be</li> </ol> <h4 id="video-editing-requirements">Video Editing Requirements</h4> <ol> <li>First and foremost, it needed to be really easy to do the simple edits that I was doing</li> <li>Needed to be to combine multiple sources into the final video (camera, screen, intro, outro, music, etc)</li> <li>Needed to be worldly-wise to show both the screen and presenter at the same time in the final video</li> <li>Needed to be worldly-wise to separate the audio from the video of a prune so I can get rid of the bad audio from the camera</li> <li>Needed to be worldly-wise to slice up the footage to remove unwanted portions such as the time surpassing the talk unquestionably starts</li> <li>Needed to be worldly-wise to add transitions between scenes</li> <li>Needed to be worldly-wise to do vital audio editing (add gain, noise filter or silence bad audio, fade in/out, etc)</li> <li>Needed to be worldly-wise to work with MOV videos (the camera unelevated records in this format)</li> <li>Needed to be worldly-wise to output in HD (1920x1080). If you are doing any kind of showing of code, anything unelevated 720p is typically nonflexible to read.</li> </ol> <p>I went with <a href="https://www.techsmith.com/video-editor.html">Camtasia</a> for both the screen capture and video editing as it meet all of my requirements in one piece of software.</p> <p><a href="https://www.techsmith.com/video-editor.html"><img src="/images/recording-conference/camtasia-logo.png" alt="" /></a></p> <p><strong>PROS:</strong></p> <ul> <li>Was easy to figure</li> <li>There are lots of self-ruling and easy to follow tutorials misogynist from Techsmith as well as the community</li> <li>Comes with a good value of ready to use resources such as intros, backgrounds, and music.</li> <li>Is very easy to create your own assets</li> <li>Full featured and only forfeit $200</li> <li>Can batch produce videos</li> <li>Only takes ~1 gig of space for a 1 hour screen capture</li> <li>Price was low for the functionality provide</li> </ul> <p><strong>CONS:</strong></p> <blockquote> <p>Note: These are increasingly nitpicks than cons.</p> </blockquote> <ul> <li>Can only unshut 1 project at a time. Not a huge deal but sometimes I have something I want to reprinting from flipside project.</li> <li>File paths in the project file are wool so if you move the raw footage around, you have to manually update the paths in the project file. Wish they were relative to the project file since normally the videos are within the same directory as the project file.</li> <li>Only the main exhibit is recorded if you have multiple monitors and are extending the screen instead of just indistinguishable the screen. To not have to worry well-nigh this limitation, when I present I have the palmtop and projector duplicated. The downside is that I do not get to use any notes but I don&rsquo;t like using notes anyway so I can live with this downside.</li> </ul> <h3 id="camera">Camera</h3> <p>The camera is technically optional but since one of my goals is to use the videos to modernize my speaking, I need to be worldly-wise to see myself.</p> <h4 id="camera-requirements">Camera Requirements</h4> <ol> <li>Can record in HD (1920x1080)</li> <li>Has a seated microphone (you need this to be worldly-wise to sync up the camera and screen capture)</li> <li>Can fit into my palmtop bag</li> <li>Has a metal tripod screw slum (some cameras are plastic and they are not durable)</li> <li>Can record at least 2 hours without running out of shower or can record using an external power source</li> <li>Can be run off an external power battery. External shower is very important since there is not normally power misogynist out in the regulars at a conference.</li> <li>Not related to priming talks, but I wanted to be worldly-wise record my drums or concerts in a point and shoot malleate which meant I needed a good microphone built into the camera. This was the deciding factor in the camera the I went with. If I didn&rsquo;t have this requirement I most likely would have went with a cheaper camera.</li> </ol> <p>The camera I use is the <a href="http://amzn.to/2Ehsnn0">Zoom Q4n</a>. Make sure it is the Q4<strong>n</strong> as they moreover make a Q4. Since this is the 3rd product from Zoom in this post and 4th product that I own from them, I really like their equipment. I can get unconfined audio and good video for a reasonable price.</p> <p><a href="https://www.amazon.com/Zoom-Portable-Handy-Screen-Recorder/dp/B01BHDB0ZC/ref=as_li_ss_il?s=electronics&ie=UTF8&qid=1517199880&sr=1-4&keywords=zoom+q4n&linkCode=li2&tag=digitaldrumme-20&linkId=d7c1f03ee688f962311bf2be232f3366" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B01BHDB0ZC&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B01BHDB0ZC" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>PROS:</strong></p> <ul> <li>It is basically point and shoot</li> <li>It has wheels proceeds so I do not have to worry much well-nigh it overloading the audio or having the audio too quiet</li> <li>It has a flip virtually screen so I can see what is stuff recorded. This was increasingly important when I was going to use it as a Webcam (see cons to why I don&rsquo;t)</li> <li>It is lightweight</li> <li>The microphone can either be set as X/Y or A/B patterns. X/Y is unconfined for musical performances or video blogging while A/B is platonic for recording the sound of people taking in variegated parts of a room.</li> <li>Runs off 5v 1A which ways I can use my phone charger or any external usb batteries that I have</li> <li>Comes with a wind screen and lens hood (not that I have used either of them yet)</li> </ul> <p><strong>CONS:</strong></p> <ul> <li>It advertises that it can be used as a 720p webcam but it looks horrible. Looks increasingly like a 240 resolution. My <a href="http://amzn.to/2GADeJD">Logitech C922x</a> is far superior 720p as a webcam</li> <li>The casing is plastic so it does finger a bit unseemly for the price</li> <li>The memory vellum slot is on the marrow which ways you have to take it off the tripod to transpiration the memory card</li> <li>You can transpiration the shower without taking it completely off the tripod.</li> <li>If you forget to put the screen out surpassing mounting it on the tripod, it is difficult to get the screen to unshut but not impossible</li> <li>Doesn&rsquo;t come with a wall charger</li> <li>Doesn&rsquo;t come with a case</li> <li>Uses a proprietary battery</li> <li>About every 3.5 GB, you will get a new video file that you will have to splice together in editing. It is easy to slice together but it does add an uneaten step.</li> </ul> <h3 id="accessories">Accessories</h3> <p>There are lots of little things that you don&rsquo;t think well-nigh such as travel tripods, memory cards, and cases to protect it all in travel that I moreover purchased.</p> <p><strong>Tripod:</strong> I have to say that it was difficult to find a tripod that was full size, lightweight, sturdy unbearable that I would trust my camera on it, and most important it would fit in siphon on luggage. I went with the <a href="http://amzn.to/2DJQF83">Neewer Carbon Fiber Portable Mini Tripod</a>. It extends to 56 inches and folds lanugo to 13 inches. It is moreover really light but still very sturdy.</p> <p><a href="https://www.amazon.com/gp/product/B01MZDDWYK/ref=as_li_ss_il?ie=UTF8&psc=1&linkCode=li2&tag=digitaldrumme-20&linkId=81c4e6821d9b654a1d1aafce27b49acd" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B01MZDDWYK&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B01MZDDWYK" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>Camera memory vellum 64 GB:</strong> I went with two <a href="http://amzn.to/2E4p4SA">Sandisk 64 GBMatriculation10 SD Card</a> for no other reason than I have other cameras that can use the same card, so now I can do a multiple camera setup which I have washed-up surpassing with some pulsate videos. Space wise, at 1920x1080, I am worldly-wise to get well-nigh 5.5 hours of footage.</p> <p><a href="https://www.amazon.com/Sandisk-Ultra-Micro-UHS-I-Adapter/dp/B073JYVKNX/ref=as_li_ss_il?s=electronics&ie=UTF8&qid=1517203688&sr=1-3&keywords=sdxc+64gb+memory+card+class+10&linkCode=li2&tag=digitaldrumme-20&linkId=bac654abc3b5b5a3b64361e7d5d19458" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B073JYVKNX&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B073JYVKNX" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>ExternalShowerfor Camera:</strong> Since the camera can run off 5V 1A, I can use the iPhone portable charger that I once have. I am using the <a href="http://amzn.to/2EkgHzQ">UNU Superpak 10000 mAH</a> and can get virtually 4 full phone charges out it. It moreover has a really nice shower tuition light so I know if I need to tuition it or not. Don&rsquo;t unbelieve the value of having the status lights.</p> <p><a href="https://www.amazon.com/gp/product/B00LXL6L9E/ref=as_li_ss_il?ie=UTF8&psc=1&linkCode=li2&tag=digitaldrumme-20&linkId=930a00452221343b8cae003d1469c933" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00LXL6L9E&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B00LXL6L9E" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>iPhone Wall Charger:</strong> Since the camera does not come with the wall charger, I got a [cheap pack of 5V 1A wall chargers][<a href="http://amzn.to/2BHRr3O">http://amzn.to/2BHRr3O</a>]. I am unchangingly misplacing them so having uneaten on hand never hurts.</p> <p><a href="https://www.amazon.com/Charger-FREEDOMTECH-Adapter-Travel-Samsung/dp/B013F1WCFQ/ref=as_li_ss_il?_encoding=UTF8&pd_rd_i=B013F1WCFQ&pd_rd_r=352HKA1Y55KK1XB0CDD6&pd_rd_w=j80I1&pd_rd_wg=Nea0w&psc=1&refRID=352HKA1Y55KK1XB0CDD6&linkCode=li2&tag=digitaldrumme-20&linkId=bba764f1576e3688cc4b438a67d7836b" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B013F1WCFQ&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B013F1WCFQ" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>USB Extender Cable:</strong> - Unfortunately the USB subscription that is included with the camera does not reach to the floor when the tripod is fully extended. I went with an <a href="http://amzn.to/2Gpo49U">AmazonNuts6 foot USB Extender cable</a></p> <p><a href="https://www.amazon.com/AmazonBasics-Extension-Cable-Male-Female/dp/B00NH134L6/ref=as_li_ss_il?s=electronics&ie=UTF8&qid=1517199618&sr=1-2-spons&keywords=usb+extender&psc=1&linkCode=li2&tag=digitaldrumme-20&linkId=f7ad6e941d0f24473acf1288dcc9b6b1" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00NH134L6&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B00NH134L6" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <p><strong>Case for Camera, Microphone, Extender Cable, Batteries, and Memory Cards:</strong> I didn&rsquo;t want all of the equipment just hanging out in my palmtop bag expressly since the casings are plastic. Since this equipment is meant to be travelled with, I went with the <a href="http://amzn.to/2nmmI74">CaseMatrix HardSpecimenwith Diced Foam</a>. This specimen is big unbearable to hold all of the equipment except the tripod and still fits into my palmtop bag.</p> <p><a href="https://www.amazon.com/gp/product/B00RMGXZTS/ref=as_li_ss_il?ie=UTF8&psc=1&linkCode=li2&tag=digitaldrumme-20&linkId=9e76e6e97b05e14350f9ca295c25a9d2" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00RMGXZTS&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li2&o=1&a=B00RMGXZTS" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <blockquote> <p>Note: I just purchased a <a href="http://amzn.to/2FyF8Jw">camera walkabout with a palmtop compartment</a> that I am going to try instead of the specimen and the <a href="http://www.ogio.com/backpacks/gambit-laptop-backpack/spr4704908.html">OGIO Gambit</a> palmtop backpack.</p> </blockquote> <p><strong>Travel Power Strip:</strong> To make sure that I get everything charged up in the hotel room and don&rsquo;t have to worry well-nigh running out of power outlets in hotel rooms, I got a <a href="http://amzn.to/2DLDu6K">Belkin travel surge protector with 2 usb ports</a>.</p> <p><a href="https://www.amazon.com/Belkin-3-Outlet-SurgePlus-Protector-BST300/dp/B00ATZJ5YS/ref=as_li_ss_il?s=electronics&ie=UTF8&qid=1517285862&sr=1-3&keywords=belkin+travel+surge+protector&linkCode=li3&tag=digitaldrumme-20&linkId=e270ae3e78bd89d89faba15471a76c17" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B00ATZJ5YS&Format=_SL250_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=digitaldrumme-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=digitaldrumme-20&l=li3&o=1&a=B00ATZJ5YS" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></p> <h2 id="syncing-audio">Syncing Audio</h2> <p>With this setup, we will have 2 audio tracks: camera and screen capture. We will need to sync the audio in editing and then remove the camera audio. This sounds like a pain to do but I am going to requite you the weightier trick that I overly learned that will enable you to sync the audio in 30 seconds.</p> <p><strong>Recording The Audio</strong></p> <ol> <li>Turn on the microphone</li> <li>Start recording in camtasia</li> <li>Start the camera recording</li> <li>While standing in front of the camera either loudly snap your fingers or thunderous your hands (this makes everyone in the room stare at you, so I normally snap my fingers)</li> <li>Now requite your talk</li> </ol> <p>What we did was to create a big spike in the audio that you will be worldly-wise to see in the audio wav form in Camtasia when you zoom into the timeline.</p> <p><strong>Syncing the Audio</strong></p> <ol> <li>Open the Camtastia screen capture footage</li> <li>Find the spot in the screen capture that you snapped your fingers and add a marker to it</li> <li>Import the camera footage</li> <li>Add the 1st video from the camera to the timeline. You will be moving it virtually on the timeline so you only want the 1st one at this point</li> <li>Turn off the screen capture footage so that you can hear the camera audio</li> <li>Find the spot in the camera video that you snapped your fingers and add a marker to it</li> <li>Enable the screen capture footage</li> <li>Roughly uncurl the markers for the footages</li> <li>Make the footage for the screen and camera taller so that you can hands see the audio wav form. It sometimes takes a few minutes for Camtasia to show the wav</li> <li>Zoom all the way into the timeline and fine tune the alignment</li> <li>Listen to the audio to make sure you do not have an echo. If you have an echo, alimony making adjustments until it goes away.</li> <li>Add the rest of the camera footage</li> <li>Right-click on the camera footage that is in the timeline and select the separate audio and video option</li> <li>Now either delete the camera audio or turn it off. Note if you turn it off and splice up the video the disable audio doesn&rsquo;t get touched and will be out of sync so you have to remember to turn when on the audio surpassing removing any portion of the video.</li> </ol> <p>After a few times of doing this you will get really good at syncing multiple audio sources and will plane be worldly-wise to sync the audio just by looking at the way forms.</p> <h2 id="adding-an-intro-and-outro">Adding an Intro and Outro</h2> <p>I like to add an intro and outro prune onto my videos. I made both of these clips once and then widow them to the windfall library. Now for the intro all I have to do is add it onto the timeline and transpiration the talk title and event name. For the outro, I don&rsquo;t have to make any changes and just put it at the end without all of the editing is done. It nows takes me all of 2 minutes to add the intro and outro. This has been a huge time saver for me and made it possible to get the video editing washed-up while at the conference.</p> <blockquote> <p>To add the clips to the Camtasia windfall library, you highlighted the set of elements on the timeline that make up the click, right-click on them and select save to library. Then requite the new windfall a name and you are ready to use it.</p> </blockquote> <h2 id="conclusion">Conclusion</h2> <p>Now you are ready to record your talks. Make sure to do some practice runs with the equipment to work out any kinks. Leave a scuttlebutt unelevated and let me know where your recordings are and how the process worked out for you.</p> <p>Also, remember that the most important thing is that you can requite the talk, not that you can record the talk so if the recording isn&rsquo;t working for whatever reason, don&rsquo;t wait your talk just for the recording. There will be times where the equipment will just not work for whatever reason and you won&rsquo;t be worldly-wise to capture that talk. It sucks when it happens but honestly the recording of the talk is an widow bonus.</p> AngularJS - Why is there an ! in my url now? https://digitaldrummerj.me/angularjs-url-prefix-update/ Thu, 25 Jan 2018 00:00:00 +0000 https://digitaldrummerj.me/angularjs-url-prefix-update/ <blockquote> <p>Note: This post applies to AngularJS. The 1.x version of Angular.</p> </blockquote> <p>Recently, I upgraded one of my apps to AngularJS 1.6 withal with a tuft of other changes and a tuft of my routes broke. Unfortunately, I didn&rsquo;t reservation the routing issue surpassing making a tuft of other changes. The one thing I noticed for all of the wrenched routes is the urls now had an #! (<code>https://myapp.com/#!/</code>) in them instead of just the # (<code>https://myapp.com/#/</code>). I thought maybe I had washed-up something in one of my changes. Low and behold though, it was not something I did but was a breaking transpiration in AngularJS 1.6 per the <a href="https://docs.angularjs.org/guide/migration#commit-aa077e8">AngularJS version migration guide</a>. Thankfully the fix to revert the functionality to the previous version of AngularJS was really easy.</p> <p>In my AngularJS module config I needed to inject the <code>$locationProvider</code> and set to the hashPrefix to an empty string like so:</p> <pre><code class="language-javascript">appModule.config(['$locationProvider', function($locationProvider) { $locationProvider.hashPrefix(''); }]); </code></pre> <p>Now my routes work then they did before.</p> Automatically Tweet New Blog Post https://digitaldrummerj.me/jekyll-automatically-tweeting-new-post/ Tue, 16 Jan 2018 00:00:00 +0000 https://digitaldrummerj.me/jekyll-automatically-tweeting-new-post/ <p>After each blog post is published, we need to let people know that a new post is published. We can&rsquo;t expect people to only find out well-nigh the new post through the RSS feed. For this blog, I tweet out that I have a new blog post. However, I don&rsquo;t want to have remember to send out the tweet considering I will forget or get rented with something else. Instead, sending out a tweet should be washed-up for me.</p> <p>To automate the process we are going to use Zapier to monitor the RSS feed for new post and then add it to <a href="https://buffer.com">Buffer</a>. I use <a href="https://buffer.com">Buffer</a> as a way to schedule tweets to go out at specific times throughout the day.</p> <p>I could have moreover used <a href="http://ifttt.com">IFTTT</a> but they do not have the worthiness to submit to the top of the <a href="https://buffer.com">Buffer</a> list, so instead I would either have to have my post wait in the buffer list withal with everything else I am retweeting or would have to immediately send it to Twitter. This wasn&rsquo;t the desired functionality that I wanted.</p> <p>If you haven&rsquo;t heard of either of these systems surpassing they both work pretty much the same way. They monitor something and then take whoopee when it changes. They both have hundreds of task that you can automate versus a variety of variegated systems like Trello, Github, Google Sheet, etc.</p> <p>You will need an worth in order to use these systems. Both of them are self-ruling but Zapier limits the number of streamlined task to 5 and the number of times it can run to 100 times per month. IFTTT does not towards to have any limits.</p> <p>Both systems work extremely well it is just a matter of which system has the worthiness to interact with the system you trying to automate.</p> <h2 id="setting-up-zapier">Setting up Zapier</h2> <ol> <li>Sign up for a self-ruling Zapier worth at <a href="https://zapier.com/sign-up">https://zapier.com/sign-up</a></li> <li><p>Click on the <img src="images/tweet-new-post/make-a-zap.png" alt="Make a Zap" /> button. <strong>Note:</strong> Zaps are their name for the streamlined task</p></li> <li><p>Search for RSS as the App Name and select RSS by Zapier from the results.</p> <p><img src="images/tweet-new-post/search-rss.png" alt="" /></p></li> <li><p>Select New Item In Feed</p> <p><img src="images/tweet-new-post/new-item-in-feed.png" alt="" /></p></li> <li><p>Click the <img src="images/tweet-new-post/save-continue.png" alt="save and continue" /> button</p></li> <li><p>Input your RSS feed url</p> <p><img src="images/tweet-new-post/feed-url.png" alt="" /></p></li> <li><p>Leave everything else with the defaults and click the <img src="images/tweet-new-post/continue.png" alt="continue" /> button</p></li> <li><p>Click the <img src="images/tweet-new-post/fetch-continue.png" alt="fetch and continue" /></p></li> <li><p>If everything with the feed setup is correct you will get a successfully message</p> <p><img src="images/tweet-new-post/fetch-continue-test-successful.png" alt="" /></p></li> <li><p>Click the <img src="images/tweet-new-post/continue.png" alt="continue" /> button</p></li> <li><p>Search for buffer as the App Name and select Buffer from the results.</p> <p><img src="images/tweet-new-post/search-buffer.png" alt="" /></p></li> <li><p>Select the Add to Buffer option</p> <p><img src="images/tweet-new-post/add-to-buffer.png" alt="" /></p></li> <li><p>Click the <img src="images/tweet-new-post/save-continue.png" alt="save and continue" /> button</p></li> <li><p>Select your BufferWorthor click the <img src="images/tweet-new-post/connect-buffer-account.png" alt="connect to account" /></p></li> <li><p>For the profile waif lanugo select your Twitter profile</p> <p><img src="images/tweet-new-post/twitter-profile.png" alt="" /></p></li> <li><p>For the text field, input what you want your new post tweet to say. The important piece to add into the text field is the link to the new blog post.</p></li> <li><p>To add the link, click on the <img src="images/tweet-new-post/plus-button.png" alt="plus" /> and select the link option</p> <p><img src="images/tweet-new-post/blog-link.png" alt="" /></p></li> <li><p>For my text field, it looks like</p> <p><img src="images/tweet-new-post/text-field.png" alt="" /></p></li> <li><p>For top? field select yes to put your new blog post tweet at the top of your Buffer queue.</p> <p><img src="images/tweet-new-post/top-field.png" alt="" /></p></li> <li><p>Click the <img src="images/tweet-new-post/continue.png" alt="continue" /> button</p></li> <li><p>Click the <img src="images/tweet-new-post/send-to-buffer.png" alt="send test to buffer" /> button</p></li> <li><p>If everything is working, you should see a test successful message</p> <p><img src="images/tweet-new-post/send-to-buffer-successful.png" alt="" /></p></li> <li><p>Also, go to buffer and verify that a new post has been widow to the buffer queue. You will moreover want to delete the new post from your buffer queue</p> <p><img src="images/tweet-new-post/new-post-test.png" alt="" /></p></li> <li><p>Click the <img src="images/tweet-new-post/finish.png" alt="finish" /> button</p></li> </ol> <p>Zapier is now setup to put a tweet at the top of your Buffer queue whenever you publish a new blog post into your RSS feed.</p>Weedy- No Test Found https://digitaldrummerj.me/ng2-karma-not-finding-tests/ Fri, 06 Jan 2017 00:00:00 +0000 https://digitaldrummerj.me/ng2-karma-not-finding-tests/ <blockquote> <p>Note: This post applies to Angular. The 2+ version of Angular.</p> </blockquote> <p>Are you trying to run yourWeedy2 unit test and the Karma test runner is not finding any tests to execute? This is exactly what happened to me when I tried to run the unit tests that are included as part of the project that theWeedyCLI generates.</p> <p><img src="/images/ng2-karma-not-finding-test/no-test-found.png" alt="Karma 0 test found" /></p> <p>The test runner should have found 3 tests to execute but as your could see whilom it didn&rsquo;t find any test to execute. Never having used Karma before, I was unsure what the issue was or where to start troubleshooting. However, when the Karma test runner executes it started up Chrome and the UI had a Debug sawed-off on it so I figured that would be a good first step.</p> <p><img src="/images/ng2-karma-not-finding-test/karma-browser.png" alt="Karma Browser" /></p> <p>I was slightly disappointed when I clicked on the Debug sawed-off as it just opened up a new tab zippo tab.Withouta bit of reading, it turns out that you are supposed to unshut the Chrome Developer Tools on that new zippo tab that the Debug sawed-off opened. Once I opened the Chrome Developer Tools, I noticed that the panel had the pursuit error.</p> <p><img src="/images/ng2-karma-not-finding-test/karma-debug.png" alt="Karma Error" /></p> <p>Chrome should have run the test.ts file with no problems and it is obviously not a video file.Withouta bit of searching, I ran wideness <a href="https://github.com/angular/angular-cli/issues/2125">Angular CLI Issue 2125</a> that had a potential workaround of subtracting a mime type to the Karma configuration.Unelevatedis the configuration that you need to add to the karma.conf.js file.</p> <pre><code class="language-json">mime: { 'text/x-typescript': ['ts', 'tsx'] } </code></pre> <p>Once you update the configuration you need to stop Karma and re-run it with the <code>npm run test</code> command. It should now find and execute 3 tests.</p> <p><img src="/images/ng2-karma-not-finding-test/test-found.png" alt="Karma Running" /></p> <p>Now you are ready to go test yourWeedyapplication. If you are looking for a good testing reference, trammels out the <a href="https://angular.io/docs/ts/latest/guide/testing.html">Angular Testing Guide</a>.</p>Weedy-SubtractingBootstrap Library https://digitaldrummerj.me/ng2-add-bootstrap/ Thu, 05 Jan 2017 00:00:00 +0000 https://digitaldrummerj.me/ng2-add-bootstrap/ <blockquote> <p>Note: This post applies to Angular. The 2+ version of Angular.</p> </blockquote> <p>Welcome to the standing series on Getting Started withWeedy2. In the [previous post][], we created our project using theWeedyCLI. In this post, we will be subtracting the <a href="https://getbootstrap.com/">Bootstrap</a> library to the project to make it easier to style our application.</p> <p>To make <a href="https://getbootstrap.com/">Bootstrap</a> play nice withWeedywe are going to use the <a href="https://valor-software.com/ng2-bootstrap/">ng2-bootstrap</a> library which rewrites the <a href="https://getbootstrap.com/">Bootstrap</a> components to be powered byWeedyinstead of JQuery. The <a href="https://valor-software.com/ng2-bootstrap/">ng2-bootstrap</a> library moreover works with both Bootstrap <a href="https://getbootstrap.com">v3</a> and <a href="http://v4-alpha.getbootstrap.com/">v4</a> which ways when <a href="http://v4-alpha.getbootstrap.com/">v4</a> is finally released to production you will only have to transpiration the Bootstrap css reference and fix any breaking changes listed in the <a href="http://v4-alpha.getbootstrap.com/migration/">v4 migration guide</a>. <a href="http://v4-alpha.getbootstrap.com/">Bootstrap v4</a> is not yet recommend for production. The rest of this vendible is going to focus on using <a href="https://getbootstrap.com/">Bootstrap v3</a>.</p> <h3 id="install-libraries">Install Libraries</h3> <blockquote> <p>If you need the lawmaking from the previous post, you can get it from this <a href="https://github.com/digitaldrummerj/angular2-getting-started">Github</a> repository in the 1-CreateProject branch.</p> </blockquote> <p>The first thing that we need to do is install the ng2-bootstrap and bootstrap-sass libraries as dependencies for the project. Since we generated our project with the --style=scss flag, we need to use the bootstrap-sass module to get the sass versions of bootstrap instead of the css versions that are contained in the bootstrap module.</p> <ol> <li>Open a writ prompt and navigate to your project directory</li> <li><p>Run the npm install writ unelevated to install ng2-bootstrap and bootstrap-sass</p> <pre><code>npm install bootstrap-sass ng2-bootstrap --save </code></pre></li> </ol> <h3 id="updating-the-angular-cli-configurations">Updating theWeedyCLI Configurations</h3> <p>Now we need to tell theWeedyCLI well-nigh the <a href="https://getbootstrap.com/">Bootstrap</a> scss file.</p> <ol> <li>In your lawmaking editor, unshut up the angular-cli.json file.</li> <li><p>Search for the styles node and add the bootstrap file</p> <pre><code>&quot;styles&quot;: [ &quot;styles.scss&quot;, &quot;../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss&quot; ], </code></pre></li> </ol> <h3 id="using-bootstrap">Using Bootstrap</h3> <p>Now that we have told theWeedyCLI to include the bootstrap library, we are ready to use it.</p> <ol> <li>In your lawmaking editor, unshut up the src\app\app.component.html file</li> <li><p>Replace the contents of the file with:</p> <pre><code>&lt;div class=&quot;container&quot;&gt; &lt;div class=&quot;page-header&quot;&gt; &lt;h1&gt; {{ title }} &lt;/h1&gt; &lt;/div&gt; &lt;/div&gt; </code></pre></li> <li><p>We are now ready run <code>ng serve</code> and view our home page at <a href="http://localhost:4200">http://localhost:4200</a></p></li> </ol> <blockquote> <p>Note: If you once have ng serve running, you will need to stop it using ctrl+c and run ng serve again.Unendinglyyou make changes to the angular-cli.json file, they will not take effect until ng serve is restarted.</p> </blockquote> <ol> <li><p>The page should now squint like</p> <p><img src="/images/angular2-add-bootstrap/view-page.png" alt="Page with Bootstrap" /></p></li> </ol> <h2 id="wrapping-up">Wrapping up</h2> <p>At this point you have yourWeedy2 project with the <a href="https://getbootstrap.com/">Bootstrap</a> library widow for styling. The lawmaking for this post is misogynist on <a href="https://github.com/digitaldrummerj/angular2-getting-started/tree/2-AddBootstrap">Github</a>.</p> <p>In the next post, we will create a header and footer component that will be used on each page.</p>Weedy- Your First Project https://digitaldrummerj.me/ng2-your-first-project/ Tue, 03 Jan 2017 00:00:00 +0000 https://digitaldrummerj.me/ng2-your-first-project/ <blockquote> <p>Note: This post applies to Angular. The 2+ version of Angular.</p> </blockquote> <p>Welcome to the series on Getting Started with Angular.Weedy2 was released in September 2016 and and so far I have been enjoying working with it. I have been using the TypeScript version ofWeedy2. It is has been pretty easy for me so far to pick it up but there have been a few things that have made me scratch me head. In this series I am going to walk you through creating a simpleWeedy2 project that has a header/footer, routing to components/modules, show how to add new components/services, create multiple modules, lock lanugo routes, waffly UI configurations based on the environment parameter and subtracting in the Bootstrap library. When you are washed-up with the series, you will have a good structure for any project that you want to start.</p> <p>In this post we will get everything setup on your machine to doWeedyminutiae and then you will create yourWeedyproject that the rest of the series will build on. We will be using the newWeedyCLI to generate the project and several of the features such as components, services, modules, and pipes.</p> <h2 id="installing-the-angular-cli">Installing TheWeedyCLI</h2> <p>TheWeedyCLI is a node based utility which ways that we need to first install Node surpassing we can install the npm package angular-cli. The minimum version of Node that is required for the theWeedyCLI requires is Node 4.x but I would suggest installing the latest LTS version from <a href="https://nodejs.org">https://nodejs.org</a> which at the time of this writing is 6.9.1. To verify the version of node that you have installed, launch a writ prompt and run <code>node -v</code>. If you need to install Node, download the LTS installer from <a href="https://nodejs.org">https://nodejs.org</a> and winnow any prompts that the installer has.</p> <p>After you have Node installed, we need to globally install theWeedyCLI by running (it will take several minutes):</p> <pre><code>npm install -g @angular/cli </code></pre> <blockquote> <p>On Linux and Mac, you may need to run the writ with sudo.</p> </blockquote> <p>You can verify that theWeedyCLI installed and the version by running the writ below. As of this writing, theWeedyCLI version is 1.0.0-beta.25.5</p> <pre><code>ng --version </code></pre> <blockquote> <p>If it says that ng is unknown, tropical the writ prompt, re-open it and run ng --version again. If you are still having issues, leave a scuttlebutt unelevated and I will try to help you out.</p> </blockquote> <h2 id="generating-your-angular-2-project">Generating YourWeedy2 Project</h2> <p>After theWeedyCLI is installed you can create a new project with the ng new command.</p> <p>The ng new writ does several things for you:</p> <ul> <li>Creates a directory named without the project name.<br /></li> <li>Installs the npm dependencies</li> <li>Configures Webpack</li> <li>Adds a minutiae and production environment configuration file</li> <li>Adds a placeholder file for the stylesheet. By default it is css based but with the --style=scss parameter that we are using below, it will make it scss based instead.</li> <li>Adds a routing file for the app module and import it into the App Module with the --routing parameter</li> <li>Adds unit testing spec files</li> </ul> <h3 id="generate-project-steps">Generate Project Steps</h3> <ol> <li>Open a writ prompt</li> <li><p>Navigate to where you want to store your project</p> <ul> <li>On Windows, I store mine at c:\projects and on Mac I stored it at ~/projects</li> </ul></li> <li><p>Generate the new project tabbed angular2-getting-started by running the writ below. It will take a few minutes to create and install the dependencies. I like to use scss instead of css for my styles which the style parameter enables. The routing parameter sets up the routing that we will use later on when we have increasingly than 1 page to navigate to.</p> <p>ng new angular2-getting-started --style=scss --routing</p> <p><img src="/images/ng2-getting-started/ng-new-output.png" alt="ng new output" /></p></li> </ol> <p>You can view the full documentation for theWeedyCLI at <a href="https://github.com/angular/angular-cli">https://github.com/angular/angular-cli</a></p> <h2 id="running-your-angular-2-project">Running YourWeedy2 Project</h2> <p>Now that we have our project generated, we can view it in a web browser by running <code>ng serve</code> to build it and start up a web server with live reload. Once <code>ng serve</code> has completed, unshut a web browser and navigate to <a href="http://localhost:4200">http://localhost:4200/</a>. You should be looking a page that says:</p> <p><img src="/images/ng2-getting-started/app-works.png" alt="App Works" /></p> <h2 id="project-layout">Project layout</h2> <p>If you squint at the project directory and file layout there are some key pieces of the project that I have highlighted below.</p> <div class="row"> <div class="medium-12 large-6 columns"> <p class="solidborder"><img src="/images/ng2-getting-started/ng-project-layout.png" alt="Project Layout"></p> </div> <div class="medium-12 large-6 columns"> <ul> <li>src <ul> <li>app -> YourUsingCode</li> <li>asset -> StaticResources(images, non-npm libaries, custom javascript that you created)</li> <li>environments -> Environment specific files. Will will squint at these in a later post.</li> <li>styles.scss ->Usingwide css. Any CSS that is not component specific.</li> </ul> </li> <li>angular-cli.json -> Configuration for theWeedyCLI and Webpack build</li> <li>package.json -> Standard npm configuration file for dependencies, scripts, project info</li> </ul> </div> </div> <h2 id="wrapping-up">Wrapping up</h2> <p>At this point you have yourWeedy2 project created and are ready to start coding. In the next post, we will add bootstrap for our styling.</p>Weedy- WTF Module Won't Route https://digitaldrummerj.me/ng2-wtf-my-module-wont-route/ Thu, 29 Dec 2016 00:00:00 +0000 https://digitaldrummerj.me/ng2-wtf-my-module-wont-route/ <blockquote> <p>Note: This post applies to Angular. The 2+ version of Angular.</p> </blockquote> <p>I have been really enjoying working withWeedy2 over the last few months but the other day I spent well over an hour sacrilegiousWeedywondering why my new module would not route. I didn&rsquo;t have this much trouble when I created my other modules a few weeks before. However, this time when I navigated to my new module route it kept going to my reservation all route.</p> <p>I verified that I had spelled everything correctly in the routing configuration and in the browser url. I verified that I had imported the new module in the app module. I swore everything was setup correctly. WTF. What was going on? What did I miss.</p> <p>Turns out that order is important when importing modules in the app.module.ts file expressly when you have configured a route to reservation any unknown routes and redirect them to a 404 page. In this scenario, you have to import the AppRoutingModule last. This was so obvious once I figured it out but never thought well-nigh it surpassing then. I unsupportable that it would automatically widow the child routes into the routing configuations surpassing the reservation all route. Nope it doesn&rsquo;t work that way. It adds the routes as they are imported.Unelevatedshows the wrenched lawmaking and then the stock-still code.</p> <p class="alert-box zestful radius"> OriginalWrenchedCode: app.module.ts </p> <p>Notice that the MyNewModule is listed in the @NgModule imports section without the AppRoutingModule. Note that the order of import statements at the top of the lawmaking does not matter.</p> <pre><code>import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { MyNewModule } from './my-new-module/my-new-module.module'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, HttpModule, AppRoutingModule, MyNewModule, ], providers: [], bootstrap: [AppComponent] }) export matriculation AppModule { } </code></pre> <p class="alert-box success radius">Stock-stillCode: app.module.ts </p> <p>Notice that now the MyNewModule is listed in the @NgModule imports section surpassing the AppRoutingModule. Note that the order of import statements at the top of the lawmaking does not matter.</p> <pre><code>import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { MyNewModule } from './my-new-module/my-new-module.module'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, FormsModule, HttpModule, MyNewModule, AppRoutingModule, ], providers: [], bootstrap: [AppComponent] }) export matriculation AppModule { } </code></pre> <p>Such a simple solution to a problem that will have you sacrilegious at Angular. Hopefully in the future they can transpiration this withinWeedyso that import order doesn&rsquo;t stupefy routing like this.</p> <p>Leave a scuttlebutt below, if you have run into other issues withWeedy2 that have been making you scratch your throne and expletive at the framework.</p> Ionic v2 - How to setup on Windows https://digitaldrummerj.me/ionic-v2-setup-windows/ Tue, 01 Nov 2016 00:00:00 +0000 https://digitaldrummerj.me/ionic-v2-setup-windows/ <p>In order to work with the Ionic framework version 2 there is a bit of software installs and configuration that needs to happen in order to deploy to devices. However, many of the guides out there leave out a number of steps that tripped me up when I first started using Ionic.</p> <p>This guide will go through all of the steps needed for deploying to an Android device using a Windows machine. Note that deploying to an iOS device requires a Mac.</p> <p>Since I love to automate setup work so that I can hands repeat it, we will be using <a href="http://www.chocolatey.org">Chocolatey</a> and <a href="http://www.boxstarter.org">Boxstarter</a> for all of the installs and configurations.</p> <h2 id="software-to-be-installed">Software to be installed</h2> <ul> <li><a href="https://chocolatey.org/packages/nodejs">NodeJS</a></li> <li><a href="https://chocolatey.org/packages/git">Git</a></li> <li><a href="http://chocolatey.org/packages/gradle">Gradle</a></li> <li><a href="https://chocolatey.org/packages/jdk8">JDK8</a></li> <li><a href="https://chocolatey.org/packages/android-sdk">Android SDK</a></li> <li><a href="https://chocolatey.org/packages/AndroidStudio">Android Studio</a></li> <li><a href="https://chocolatey.org/packages/GoogleChrome">Google Chrome</a></li> <li>Npm Modules: <ul> <li><a href="https://www.npmjs.com/package/cordova">cordova</a></li> <li><a href="https://www.npmjs.com/package/ionic">ionic</a></li> </ul></li> <li><a href="https://code.visualstudio.com/">Visual Studio Code</a></li> <li><a href="https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx">Visual Studio Android Emulator (Hyper-V Based)</a> or <a href="https://www.genymotion.com/fun-zone/">Genymotion (Virtualbox Based)</a></li> </ul> <h2 id="installing-software">Installing Software</h2> <p>Most of the software installs are streamlined using Chocolatey which is an superstitious Software Package Manager for Windows. Chocolatey packages take superintendency of downloading, installing, and configuring the software for you so that you do not have to worry well-nigh to do it.</p> <p>Once you install Chocolatey we will be using a Chocolatey package tabbed Boxstarter to take superintendency of orchestrating the multiple installs with a single command.</p> <ol> <li><p>To install <a href="http://www.chocolatey.org">Chocolatey</a> you need to unshut an legalistic writ prompt.</p> <ul> <li>Go under the start menu</li> <li>Type cmd</li> <li>Find the writ prompt result and ctrl + shift + click on it</li> <li>If prompted, winnow the User AccessTenancyrequest.</li> </ul></li> <li><p>Run the pursuit writ in the writ prompt you just opened</p> <pre><code>@powershell -NoProfile -ExecutionPolicy unrestricted -Command &quot;iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))&quot; &amp;&amp; SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin </code></pre></li> <li><p>After installing Chocolatey, in the same writ prompt run the pursuit writ to install <a href="http://boxstarter.org">BoxStarter</a>.</p> <pre><code>choco install -y BoxStarter </code></pre></li> <li><p>You can now tropical the legalistic writ prompt</p></li> </ol> <p>Now that we have the infrastructure components installed we are ready to use Boxstarter to run our installation script.</p> <ol> <li><p>To run the script we need to run the Boxstarter Shell by clicking on the icon on your desktop</p> <ul> <li>If the icon is not on the desktop, then unshut up a writ prompt and type BoxStarterShell.</li> </ul></li> <li><p>In the Boxstarter Shell run the pursuit command</p> <pre><code>Install-BoxStarterPackage -PackageName https://gist.githubusercontent.com/digitaldrummerj/3fe2eb057004b6742b89/raw/021eb3bb7e48745c68507904cecde1625ed0eac1/ionic2 -DisableReboots </code></pre> <blockquote> <p>You can view the very script in the your browser at <a href="https://gist.githubusercontent.com/digitaldrummerj/3fe2eb057004b6742b89/raw/021eb3bb7e48745c68507904cecde1625ed0eac1/ionic2">link</a></p> </blockquote></li> </ol> <p>Before we test if ionic is working or ot, we have one last bit of software to install which is an Android Emulator. Unless you plan on unchangingly deploying to a physical Android device during your minutiae you will need an Android Emulator.</p> <p>There are 2 options for the Android emulator:</p> <ol> <li><a href="https://www.visualstudio.com/vs/msft-android-emulator/">Visual Studio Android Emulator (Hyper-V Based)</a></li> <li><a href="https://www.genymotion.com/fun-zone/">Genymotion (Virtualbox Based)</a></li> </ol> <blockquote> <p>If you are using virtualization software on your machine other than Hyper-V be enlightened that VMWare and Virtualbox does not work when Hyper-V is turned on. It requires a reboot of Windows to turn Hyper-V off. {:.warning}</p> </blockquote> <p>Both of the emulator works well but my preference is the <a href="https://www.visualstudio.com/vs/msft-android-emulator/">Visual Studio Android Emulator</a>.</p> <p>Once you install one of the emulators, you will want to download at least 1 device. Both emulator platforms have Android machines from 4.4.0 to the current release.</p> <h2 id="verify-that-everything-works">Verify that everything works</h2> <ol> <li>Open a writ prompt</li> <li>Navigate the directory where you store you minutiae projects (I use c:\projects)</li> <li><p>From c:\projects create a new project based on the Tabs template by running:</p> <pre><code>ionic start todo tabs --v2 </code></pre></li> <li><p>cd into c:\projects\todo (directory was created by the ionic start command)</p></li> <li><p>The first test that we are going to run is to make sure that we can test the todo app that we generated in the web browser by running:</p> <pre><code>ionic serve --lab </code></pre> <ul> <li>This will start up a node based web server and the --lab will tell it to launch a page that shows what the app would squint like on an iOS, Android and Windows phone. Granted the node based serve is well-nigh 80% well-judged but good unbearable to do a majority of our testing. Ultimately you should test on a device surpassing releasing into the app stores.<br /></li> </ul></li> <li><p>Next we are going to test our Android device setup but first we need to tell ionic that we want to add the Android platform to our todo app by running:</p> <pre><code>ionic platform add android </code></pre></li> <li><p>Now that the Android platform has been widow we can build our using for the platform by running:</p> <pre><code>ionic build android </code></pre></li> <li><p>The last thing we need to verify is that we can deploy the todo app to the Visual Studio Android Emulator or a Physical device.</p> <ul> <li>For the emulator you need to the emulated device surpassing proceeding</li> <li>For a physical device, you need to make sure that Windows sees that device and the USB debugging is turned on.<br /></li> </ul></li> <li><p>To run on either the emulator or physical device run:</p> <pre><code>ionic run android </code></pre></li> </ol> <h2 id="congratulations">Congratulations</h2> <p>Congratulations, you made it through the guide and have everything setup to create your ionic applications for Android devices. Unfortunately, if you want to develop for iOS devices you have to do it on a Mac since XCode only runs on a Mac.</p> Ionic v2 - Setup on OSx https://digitaldrummerj.me/ionic-v2-setup-osx/ Tue, 01 Nov 2016 00:00:00 +0000 https://digitaldrummerj.me/ionic-v2-setup-osx/ <p>In order to work with the Ionic framework there is a bit of software installs and configuration that needs to happen in order to deploy to devices. However, many of the guides out there leave out a number of steps that tripped me up when I first started using Ionic.</p> <p>This guide will go through all of the steps needed for deploying to an Android and iOS device using a Mac.</p> <h2 id="general-install-steps">General Install Steps</h2> <p>For the first part of this tutorial, we will be installing everything to do Ionic minutiae and test your using in Google Chrome. This will be how you will do well-nigh 80% of your minutiae since deploying to a device or emulator can be time consuming.</p> <h3 id="node">Node</h3> <blockquote class="warning"> <p>If you once have Node installed, you can skip this section.</p> </blockquote> <ol> <li><p>Download the LTS version of node from <a href="https://www.nodejs.org">https://www.nodejs.org</a></p> <ul> <li>If you are using Chrome to download, it may tell you that a file with a pkg extension could be harmful to your computer and ask if you want to alimony the file. Make sure to click on the alimony button.</li> </ul> <p><img src="images/ionic2-osx/node-0.png" alt="NodeJs LTS download link" /></p></li> <li><p>After the download completes, double-click on the pkg file to run it</p></li> <li><p>Click Continue</p> <p><img src="images/ionic2-osx/node-1.png" alt="NodeJs Install Screen 1" /></p></li> <li><p>Click Continue</p> <p><img src="images/ionic2-osx/node-2.png" alt="NodeJs Install Screen 2" /></p></li> <li><p>Click Agree</p> <p><img src="images/ionic2-osx/node-3.png" alt="NodeJs Install Screen 3" /></p></li> <li><p>Click Install</p> <p><img src="images/ionic2-osx/node-4.png" alt="NodeJs Install Screen 4" /></p></li> <li><p>Fill in your login user name and password and click &ldquo;Install Software&rdquo;</p> <p><img src="images/ionic2-osx/node-5.png" alt="NodeJs Install Screen 5" /></p></li> <li><p>It will take a few minutes for NodeJs to install. Once it does, click theTropicalbutton</p> <p><img src="images/ionic2-osx/node-6.png" alt="NodeJs Install Screen 6" /></p></li> <li><p>Open a terminal and run the pursuit to verify that node and npm was installed and is misogynist from the writ line</p> <pre><code>node -v npm -v </code></pre></li> </ol> <blockquote> <p>As of the writing of this post, you should have gotten node v6.9.1 and npm 3.10.8</p> </blockquote> <h3 id="npm-packages">Npm Packages</h3> <p>Next we need to install 3 npm packages for cordova, gulp and ionic. At the time of this publication, ionic is on release candidate 0.</p> <ol> <li><p>Open a terminal and run the pursuit commands to install the Global NPM packages that we need:</p> <pre><code>sudo npm install -g cordova ionic </code></pre></li> <li><p>In the terminal run the pursuit to verify that Cordova install correctly. As of the writing of this post, you should get Cordova version 6.4.0</p> <pre><code>cordova -v </code></pre> <blockquote> <p>When prompted with &ldquo;May Cordova anonymously report usage statistics to modernize the tool over time?&rdquo;, wordplay Yes or No depending on your preference.</p> </blockquote></li> <li><p>In the terminal run the pursuit to verify that Ionic install correctly. As of the writing of this post, you should get Ionic version 2.1.4</p> <pre><code>ionic -v </code></pre></li> </ol> <h3 id="google-chrome">Google Chrome</h3> <blockquote class="warning"> <p>If you once have Google Chrome installed, you can skip this section.</p> </blockquote> <ol> <li>Download from <a href="https://www.google.com/chrome/browser/desktop/">https://www.google.com/chrome/browser/desktop/</a></li> <li>Double click the dmg file to run it</li> <li><p>Drag the Google Chrome icon to theUsingfolder</p> <p><img src="images/ionic2-osx/chrome-1.png" alt="Google Chrome stilt toUsingfolder" /></p></li> </ol> <h3 id="visual-studio-code">Visual Studio Code</h3> <blockquote class="warning"> <p>If you once have Visual StudioLawmakinginstalled, you can skip to step 5.</p> </blockquote> <ol> <li><p>Download from <a href="https://code.visualstudio.com">https://code.visualstudio.com/</a></p> <p><img src="images/ionic2-osx/vscode-download.png" alt="VSLawmakingDownload" /></p></li> <li><p>Double-click on the downloaded gazetteer to expand the contents.</p></li> <li><p>Drag Visual Studio Code.app to the Applications folder, making it misogynist in the Launchpad.</p></li> <li><p>Add VSLawmakingto your Dock by right-clicking on the icon and choosing Options,Alimonyin Dock.</p></li> <li><p>Open Visual Studio Code</p></li> <li><p>Open theWritPalette (⇧⌘P) and type shell writ to find the Shell Command: Install &lsquo;code&rsquo; writ in PATH writ and double-click on it.</p> <p><img src="images/ionic2-osx/vscode-cli.png" alt="VSCode install lawmaking shell command" /></p></li> <li><p>Open theWritPalette (⇧⌘P) and type ext writ to find the Extensions: Install Extensions and double-click on it.</p> <p><img src="images/ionic2-osx/vscode-ext.png" alt="VSCodeUnshutExtensions: Install Extensions" /></p></li> <li><p>Enter Cordova into the search box, find the Cordova Tools from Microsoft, and click the Install button</p> <p><img src="images/ionic2-osx/vscode-ext-cordova.png" alt="VSCode Install Cordova Extensions" /></p></li> <li><p>When the install is completed, the Enable sawed-off will be misogynist and will restart Visual StudioLawmakingto make the extension after.</p> <p><img src="images/ionic2-osx/vscode-ext-enable.png" alt="VSCode Install Cordova Tools Enable" /></p></li> <li><p>Click Ok on the confirmation prompt</p> <p><img src="images/ionic2-osx/vscode-ext-enable-confirm.png" alt="VSCode Extension Enable Confirmation" /></p></li> <li><p>Visual StudioLawmakingwill restart and the extensions will be enabled</p></li> </ol> <h3 id="validating-general-install-steps">ValidatingUnstipulatedInstall Steps</h3> <ol> <li>Open terminal</li> <li>Navigate the directory where you store you minutiae projects (I use ~/projects)</li> <li><p>Run the pursuit writ to generate an ionic v2 project based on the tabs template</p> <pre><code>ionic start todo tabs --v2 </code></pre></li> <li><p>cd into todo (directory was created by the ionic start command)</p></li> <li><p>We are going to run is to make sure that we can run the todo app in the web browser by running:</p> <pre><code>ionic serve --lab </code></pre></li> <li><p>This will start up a node based web server and the --lab will tell it to launch a page that shows what the app would squint like on an iOS, Android and Windows phone. Granted the node based serve is well-nigh 80% well-judged but good unbearable to do a majority of our testing. Ultimately you should test on a device surpassing releasing into the app stores.</p></li> </ol> <p>At this point, we can create ionic projects and test them in a web browser. However, you have some increasingly steps to well-constructed in order to deploy to Android and iOS devices.</p> <h2 id="android-setup-steps">Android Setup Steps</h2> <p>In this section, we will be installing everything that is needed in order to deploy your using to an Android device or emulator. We will be installing JDK8, Android Studio, Android SDK, Gradle, and Genymotion.</p> <h3 id="jdk-8">JDK 8</h3> <ol> <li>Open a web brower and navigate to <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a></li> <li>Download the Java SEMinutiaeKit 8u101 for Mac OSx</li> <li>Open the dmg file without it downloads</li> <li><p>Double Click on the icon</p> <p><img src="images/ionic2-osx/jdk8-1.png" alt="JDK8 Install Screen 1" /></p></li> <li><p>Click continue</p> <p><img src="images/ionic2-osx/jdk8-2.png" alt="JDK8 Install Screen 2" /></p></li> <li><p>Click Install</p> <p><img src="images/ionic2-osx/jdk8-3.png" alt="JDK8 Install Screen 3" /></p></li> <li><p>Fill in your login user name and password and click &ldquo;Install Software&rdquo;</p> <p><img src="images/ionic2-osx/jdk8-4.png" alt="JDK8 Install Screen 4" /></p></li> <li><p>Once the install completes, click theTropicalbutton</p> <p><img src="images/ionic2-osx/jdk8-6.png" alt="JDK8 Install Screen 6" /></p></li> <li><p>Open a terminal and run the pursuit to verify that you can run java from the writ line. As of this writing it should return javac 1.8.0_101</p> <pre><code>javac -version </code></pre></li> <li><p>Open up the vi editor and edit your whack profile. We need to add in the JAVA_HOME environment variable</p> <pre><code>vi ~/.bash_profile </code></pre></li> <li><p>To edit in vi hit <code>i</code> to enter edit mode and add the text unelevated to the .bash_profile</p> <pre><code>export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home </code></pre></li> <li><p>Press the <code>esc</code> key to exit edit mode</p></li> <li><p>Press <code>:</code> (colon key) to enter writ mode.</p></li> <li><p>type <code>wq</code> and printing enter to save and exit vi</p></li> <li><p>Run the pursuit to make the transpiration zippy in your existing session</p> <pre><code>source ~/.bash_profile </code></pre></li> <li><p>Test that the $JAVA_HOME variable was set. If should return /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home</p> <pre><code>echo $JAVA_HOME </code></pre></li> </ol> <h3 id="android-sdk">Android SDK</h3> <ol> <li><p>If you are using Safari to download files you need to transpiration the preference to &ldquo;open unscratched files without downloading&rdquo; else Safari will automatically unzip the downloaded file into the Download folder and delete the zip file. You can transpiration this option by going into the preferences and unchecking the &ldquo;Open unscratched files without downloading&rdquo; box</p> <p><img src="images/ionic2-osx/safari-2-uncheck.png" alt="uncheck unshut unscratched files without downloading" /></p></li> <li><p>Download from <a href="https://developer.android.com/studio/index.html#downloads">https://developer.android.com/studio/index.html#downloads</a></p> <ul> <li>Version 24.4.1 as of this writing</li> </ul> <p><img src="images/ionic2-osx/android-sdk-1.png" alt="android sdk download" /></p></li> <li><p>When prompt for the license agreement, trammels the &ldquo;I have read and stipulate withthe whilom terms and conditions&rdquo; box and then click on the &ldquo;Download Android-SDK_R24.4.1-MACOSX.zip&rdquo; button</p> <p><img src="images/ionic2-osx/android-sdk-2.png" alt="android sdk license agreement" /></p></li> <li><p>You can tropical the next dialog as it just tells you there is nothing else to do.Tropicalit by clicking on the X in the upper right of the dialog</p> <p><img src="images/ionic2-osx/android-sdk-3.png" alt="nothing else to do dialog" /></p></li> <li><p>Open a terminal</p></li> <li><p>Run the pursuit to unzip the android sdk to theMinutiaedirectory that is under your user home directory</p> <pre><code>mkdir ~/Library/Android &amp;&amp; unzip ~/Downloads/android-sdk_r24.4.1-macosx.zip -d ~/Library/Android/sdk &amp;&amp; mv ~/Library/Android/sdk/android-sdk-macosx/* ~/Library/Android/sdk &amp;&amp; rmdir ~/Library/Android/sdk/android-sdk-macosx </code></pre></li> <li><p>Open up the vi editor and edit your whack profile. We need to add in the JAVA_HOME environment variable</p> <pre><code>vi ~/.bash_profile </code></pre></li> <li><p>To edit in vi hit <code>i</code> to enter edit mode and add the text unelevated to the .bash_profile</p> <pre><code>export PATH=${PATH}:~/Library/Android/sdk/tools:~/Library/Android/sdk/platform-tools </code></pre></li> <li><p>Press the <code>esc</code> key to exit edit mode</p></li> <li><p>Press <code>:</code> (colon key) to enter writ mode.</p></li> <li><p>type <code>wq</code> and printing enter to save and exit vi</p></li> <li><p>Run the pursuit to make the transpiration zippy in your existing session</p> <pre><code>source ~/.bash_profile </code></pre></li> <li><p>Test that the $PATH variable was updated. The writ unelevated will return the $PATH variable and the end of the output should include the android-sdk-macosx/tools and android-sdk-macosx/platforms-tools directories.</p> <pre><code>echo $PATH </code></pre></li> <li><p>Now that the Android SDK manager is installed we need to install the Android SDKs that we will be using</p> <pre><code>echo 'y' | android update sdk --filter tools,platform-tools,build-tools-24.0.3,android-19,android-20,android-21,android-22,android-23,android-24,source-24 --all --no-ui </code></pre> <blockquote class="warning"> <p><pre><code>Keep an eye on the output from this command. I had it error downloading one of the packages a time or two and had to run the writ a 2nd time. </code></pre> </p> </blockquote></li> </ol> <h3 id="android-studio">Android Studio</h3> <ol> <li><p>Download from <a href="https://developer.android.com/studio/index.html#downloads">https://developer.android.com/studio/index.html#downloads</a></p> <ul> <li>Version 2.2.2.0 as of this writing.</li> </ul> <p><img src="images/ionic2-osx/android-studio-download.png" alt="Android Studio Download" /></p></li> <li><p>Double-click on the dmg file without it downloads</p></li> <li><p>Drag the Android Studio Icon to the Applications folder</p> <p><img src="images/ionic2-osx/android-studio-1.png" alt="Android Studio icon stilt to Applications" /></p></li> <li><p>In the Applications folder, launch the Android Studio Application</p> <p><img src="images/ionic2-osx/android-studio-2.png" alt="Android Studio icon in Applications folder" /></p></li> <li><p>In theWell-constructedinstallation dialog, select &ldquo;I do not have a previous version of Studio or I do not want to import my settings&rdquo;</p> <p><img src="images/ionic2-osx/android-studio-3.png" alt="Complete Installation selection" /></p></li> <li><p>Click Next</p> <p><img src="images/ionic2-osx/android-studio-4.png" alt="Android Studio Setup Wizard Step 1" /></p></li> <li><p>Select Standard for the setup type</p></li> </ol> <p><img src="images/ionic2-osx/android-studio-5.png" alt="Android Setup type. select Standard" /></p> <ol> <li><p>Most of the Android SDK items were installed as part of the Android SDK isntall but Android Studio has a couple of spare ones that it wants to install. Click the Finish sawed-off to install them.</p> <p><img src="images/ionic2-osx/android-studio-6.png" alt="Android Studio Verify Settings" /></p></li> <li><p>It will take a few minutes to download the components</p> <p><img src="images/ionic2-osx/android-studio-7.png" alt="Android Studio download components" /></p></li> <li><p>When prompted for the HAXM installation, enter your user name and password then click Ok</p> <p><img src="images/ionic2-osx/android-studio-8.png" alt="HAXM installation user credential prompt" /></p></li> <li><p>When the install is completed, click the Finish button</p></li> </ol> <h3 id="virtualbox">Virtualbox</h3> <p>In order to run the Genymotion emulator, we need to install Virtualbox.</p> <ol> <li><p>Navigate to <a href="https://www.virtualbox.org/wiki/Downloads">https://www.virtualbox.org/wiki/Downloads</a> and click on the install link for OSx and the extension package. Version 5.1.4 as of this writing.</p> <p><img src="images/ionic2-osx/virtualbox-download.png" alt="Virtualbox Download Page" /></p></li> <li><p>Click on the Virtualbox dmg file without it downloads</p></li> <li><p>Double-click on the Virtualbox Icon</p> <p><img src="images/ionic2-osx/virtualbox-1.png" alt="Virtualbox Icon" /></p></li> <li><p>Click theProtractbutton to determine if it can install Virtualbox</p> <p><img src="images/ionic2-osx/virtualbox-3.png" alt="Virtualbox Install dialog to see if you can proceed with install" /></p></li> <li><p>Click Continue</p> <p><img src="images/ionic2-osx/virtualbox-4.png" alt="Virtualbox Install Intro" /></p></li> <li><p>Click Install</p> <p><img src="images/ionic2-osx/virtualbox-5.png" alt="Virtualbox Install Space Needed" /></p></li> <li><p>Fill in your login user name and password and click &ldquo;Install Software&rdquo;</p> <p><img src="images/ionic2-osx/virtualbox-6.png" alt="Virtualbox Install Username and Password Dialog" /></p></li> <li><p>Click Close</p> <p><img src="images/ionic2-osx/virtualbox-8.png" alt="Virtualbox Install Completed" /></p></li> </ol> <p>Now that Virtualbox is installed, we need to install the extension pack.</p> <ol> <li>Double click on the extension pack file that you downloaded earlier.</li> <li><p>Once Virtualbox is launched, it will ask you if you want to install the extension pack. Click Install</p> <p><img src="images/ionic2-osx/virtualbox-ext-1.png" alt="vritualbox extension pack" /></p></li> <li><p>When the license try-on comes up, once you get to the marrow of it the &ldquo;I Agree&rdquo; sawed-off is enable for you to click it.</p> <p><img src="images/ionic2-osx/virtualbox-ext-2.png" alt="virtualbox license agreement" /></p></li> <li><p>When prompted input your username and password then click Ok</p> <p><img src="images/ionic2-osx/virtualbox-ext-3.png" alt="username and password prompt" /></p></li> <li><p>Once the install is completed, click the Ok button</p> <p><img src="images/ionic2-osx/virtualbox-ext-4.png" alt="virtualbox extension installed" /></p></li> </ol> <h3 id="genymotion">Genymotion</h3> <ol> <li>Download Genymotion from <a href="https://www.genymotion.com/fun-zone/">https://www.genymotion.com/fun-zone/</a> <ul> <li>Version 2.7.2 as of this writing.</li> </ul></li> <li><p>Click the &ldquo;Download Genymotion Personal Edition&rdquo; button</p> <p><img src="images/ionic2-osx/genymotion-download.png" alt="Genymotion Download Genymotion package button" /></p></li> <li><p>Sign in to your GenymotionWorthif you have one. If not, then click on the CreateWorthbutton</p> <p><img src="images/ionic2-osx/genymotion-download-signin.png" alt="GenymotionWorthsignin" /></p></li> <li><p>After creating the worth and logging in, click on the &ldquo;Download the Mac OSX&rdquo; button</p> <p><img src="images/ionic2-osx/genymotion-download-osx.png" alt="Genymotion download osx" /></p></li> <li><p>Once Genymotion is downloaded, double click the genymotion-2.8.0.dmg file to launch the installer</p></li> <li><p>Drag Genymotion and Genymotion Shell to the Applications folder</p> <p><img src="images/ionic2-osx/genymotion-install-1.png" alt="Genymotion reprinting to Applications folder" /></p></li> <li><p>After Genymotion is installed, unshut up the Applicaton folder and launch the Genymotion UI</p> <p><img src="images/ionic2-osx/genymotion-app-icon.png" alt="GenymotionUsingIcon" /></p></li> <li><p>On the Usage notice dialog click Accept</p> <p><img src="images/ionic2-osx/genymotion-app-license-agree.png" alt="Genymotion UsageTry-onDialog" /></p></li> <li><p>Click on the Yes sawed-off on the &ldquo;You don&rsquo;t have any devices dialog&rdquo;</p> <p><img src="images/ionic2-osx/genymotion-app-add-new.png" alt="Genymotion Yes to add a new device" /></p></li> <li><p>Click the Sign in button</p> <p><img src="images/ionic2-osx/genymotion-app-sign-in.png" alt="Genymotion Signin button" /></p></li> <li><p>Input your worth information that you create as part of the Genymotion download.</p> <p><img src="images/ionic2-osx/genymotion-app-add-new-signin.png" alt="Genymotion add new device accoun sign in" /></p></li> <li><p>After you are logged in, from the Android Version waif lanugo select 6.0.0</p> <p><img src="images/ionic2-osx/genymotion-app-android-version.png" alt="Android Version Dropdown" /></p></li> <li><p>Then select a device from the misogynist list and click next. In this specimen I selected the &ldquo;Custom Phone - 6.0.0 - 768x1280&rdquo;</p> <p><img src="images/ionic2-osx/genymotion-app-download-device.png" alt="GenymotionMisogynistVirtual devices" /></p></li> <li><p>It will take several minutes to download the virtual device. When the download is done, click the Finish button</p> <p><img src="images/ionic2-osx/genymotion-app-add-new-finished.png" alt="Genymotion Virtual device install finished" /></p></li> </ol> <h3 id="gradle">Gradle</h3> <ol> <li><p>If you are using Safari to download files and you didn&rsquo;t transpiration the preference to &ldquo;open unscratched files without downloading&rdquo; when you downloaded the Android SDK, you need to transpiration it surpassing downloading Gradle. Go into the Safari preferences and uncheck the &ldquo;Open unscratched files without downloading&rdquo; box. Without doing this, Safari will automatically unzip the downloaded file into the Download folder and delete the zip file.</p> <p><img src="images/ionic2-osx/safari-2-uncheck.png" alt="uncheck unshut unscratched files without downloading" /></p></li> <li><p>Download the Gradle Binary Only Distribution from <a href="https://gradle.org/gradle-download/">https://gradle.org/gradle-download/</a></p> <p><img src="images/ionic2-osx/gradle-1-download.png" alt="gradle download" /></p></li> <li><p>Open a terminal</p></li> <li><p>Run the pursuit to unzip the android sdk to theMinutiaedirectory that is under your user home directory</p> <pre><code>unzip ~/Downloads/gradle-3.1-bin.zip -d ~/Development </code></pre></li> <li><p>Open up the vi editor and edit your whack profile. We need to add in the GRADLE_HOME environment variable</p> <pre><code>vi ~/.bash_profile </code></pre></li> <li><p>To edit in vi hit <code>i</code> to enter edit mode and add the text unelevated to the .bash_profile</p> <pre><code>export GRADLE_HOME=~/Development/gradle-3.1/bin </code></pre></li> <li><p>Press the <code>esc</code> key to exit edit mode</p></li> <li><p>Press <code>:</code> (colon key) to enter writ mode.</p></li> <li><p>type <code>wq</code> and printing enter to save and exit vi</p></li> <li><p>Run the pursuit to make the transpiration zippy in your existing session</p> <pre><code>source ~/.bash_profile </code></pre></li> <li><p>Test it by running</p> <pre><code>echo $GRADLE_HOME </code></pre></li> </ol> <h3 id="verify-android-setup">Verify Android Setup</h3> <p>Next we are going to test our Android device setup. The first thing we need to do is tell ionic that we want to add the Android platform to our todo using that we created earlier.</p> <ol> <li>Open a terminal and navigate to ~/projects/todo</li> <li><p>Add the android platform</p> <pre><code>ionic platform add android </code></pre></li> </ol> <p>Now we need to validate that we can build for Android, run the following:</p> <pre><code> ionic build android </code></pre> <p>The last thing we need to verify is that we can deploy the todo app to the Genymotion Emulator.Surpassingwe can deploy the application, we need to start up Genymotion Device that we want to deploy to.</p> <ol> <li><p>Once the Genymotion device is started, you can deploy to it by running:</p> <pre><code>ionic run android </code></pre></li> </ol> <p>You are now ready to go create your ionic applications for the Android platform.Protractwith the guide to setup for developing for the iOS platform.</p> <h2 id="ios-setup-steps">iOS Setup Steps</h2> <h3 id="xcode">XCode</h3> <ol> <li>Install Xcode from app store. This will take awhile since it is ~2 gigs in size.</li> <li><p>Once install is completed, unshut xcode and winnow the license</p> <ul> <li><p>If prompted to install spare required components, click Install</p> <p><img src="images/ionic2-osx/xcode-1.png" alt="xcode spare components prompt" /></p></li> <li><p>When prompted for credentials, enter username and password then click Ok</p> <p><img src="images/ionic2-osx/xcode-2.png" alt="credentials for xcode install" /></p></li> <li><p>It will take a few minutes to well-constructed the install</p> <p><img src="images/ionic2-osx/xcode-3.png" alt="installing xcode spare components" /></p></li> </ul></li> </ol> <h3 id="ios-simulator">iOS Simulator</h3> <ol> <li><p>Install the iOS Simulator that Ionic will use.</p> <p>npm install -g ios-sim</p> <blockquote> <p>You may need to start the npm install writ with sudo depending on your node setup.</p> </blockquote></li> </ol> <h3 id="ios-deploy-package">iOS Deploy Package</h3> <ol> <li><p>Install the iOS Deploy npm package</p> <p>npm install -g ios-deploy</p> <blockquote> <p>You may need to start the npm install writ with sudo depending on your node setup.</p> </blockquote></li> </ol> <h3 id="verifying-ios-setup">Verifying iOS Setup</h3> <ol> <li>Open terminal</li> <li>Navigate the directory where you store you minutiae projects (I use ~/projects)</li> <li><p>Run the pursuit writ to generate an ionic v2 project based on the tabs template</p> <p>ionic start todo tabs --v2</p></li> <li><p>cd into todo (directory was created by the ionic start command)</p></li> </ol> <p>The first test that we are going to run is to make sure that we can test the todo app that we generated in the web browser by running:</p> <pre><code> ionic serve --lab </code></pre> <p>This will start up a node based web server and the --lab will tell it to launch a page that shows what the app would squint like on an iOS, Android and Windows phone. Granted the node based serve is well-nigh 80% well-judged but good unbearable to do a majority of our testing. Ultimately you should test on a device surpassing releasing into the app stores.</p> <p>Next we are going to test our iOS device setup. The first thing we need to do is tell ionic that we want to add the iOS platform to our todo app by running:</p> <pre><code> ionic platform add ios </code></pre> <p>This sets up the todo app to be worldly-wise to be build and deployed to an iOS device. To validate that we can build for iOS, run the following:</p> <pre><code> ionic build ios </code></pre> <p>The last thing we need to verify is that we can deploy the todo app to the iOS Simulator.</p> <ol> <li><p>For the iOS Simulator, run the following:</p> <p>ionic run ios</p></li> </ol> <h2 id="congratulations">Congratulations</h2> <p>Congratulations, you made it through the guide and have everything setup to create your ionic applications for both Android and Ionic.</p> ASP.NET Web Api - Setup Generic Response Handler https://digitaldrummerj.me/webapi-standard-response/ Thu, 29 Sep 2016 00:00:00 +0000 https://digitaldrummerj.me/webapi-standard-response/ <p>Welcome to the standing series on getting started with ASP.NET Web Api. In the previous post, we created our ASP.NET Web Api project, created our 1st controller, enabled Windows hallmark and configured JSON to be camel cased for our returned C# class. In this vendible we will learn how to setup a generic response handler for all of Api calls. This will indulge us to consolidate the logic needed to create a proper response as well as it will indulge us to consolidate the exception handling logic.</p> <p>Before we get started, if you have not read the previous post, I would suggest that you do so surpassing standing with this artcle so that you are at the same starting point as I am.</p> <p>Our generic response handler will inherit from IHttpActionResult which basically defines an HttpResponseMessage factory.</p> <p>Some of the advantages of using IHttpActionResult are:</p> <ul> <li>Simplifies unit testing your controllers</li> <li>Moves worldwide logic for creating HTTP responses into separate classes.</li> <li>Makes the intent of the controller whoopee clearer, by hiding the low-level details of constructing the response.</li> </ul> <p>IHttpActionResult contains a single method, ExecuteAsync, which asynchronously creates an HttpResponseMessage instanc that returns when an Http response message.</p> <h2 id="create-the-response-handler">Create the Response Handler</h2> <p>Lets go superiority and start creating our generic reponse handler.</p> <ol> <li>Open the solution in Visual Studio and within the Api project create a new directory tabbed Helpers.<br /></li> <li>Within the Helpers directory, create a matriculation tabbed WrapResponseResult.cs.</li> <li>To the WrapResponseResult matriculation definition add <code>&lt;T&gt;</code> to the matriculation name, inherit the matriculation from IHttpActionResult, and add the ExecuteAsync method.</li> </ol> <pre><code class="language-C#">public matriculation WrapResponseResult&lt;T&gt; : IHttpActionResult { public Task&lt;HttpResponseMessage&gt; ExecuteAsync(CancellationToken cancellationToken) { throw new NotImplementedException(&quot;Not Implemented Yet.&quot;); } } </code></pre> <p>Now that we have the structure for the WrapResponseResult, we need to add some functionality to it. The first thing we are going to do within the WrapResponseResult matriculation is to add a variable to hold the value for our function in Func<T> and a 2nd variable to hold the HttpRequestMessage. Then we will set the values in the constructor.</p> <p>The Func<T> is not something that you see everyday but it is very useful. Basically it is a placeholder for a function and returns when whatever object we tell it to. This is very useful when creating generic handlers like we are doing. The value that we will set the Func<T> variable to when we undeniability our wrapper is the function that will requite us the results for the response.</p> <pre><code class="language-c#">private readonly Func&lt;T&gt; _func; private readonly HttpRequestMessage _request; public WrapResponseResult(Func&lt;T&gt; func, HttpRequestMessage request) { _func = func; _request = request; } </code></pre> <p>Next we are going to create a method within the WrapResponseResult matriculation to create our HttpResponseMessage. This method will take in two parameters: Func<T> and HttpRequestMessage. Then it will execute the Func<T> to get the result to add to the response. If the execution is successful it will return when a status message of 200. If it is not successful, it will trammels if it is an HttpResponseException and if it is will just rethrow the error since it is once in the format needed. If it is not an HttpResponseException it will return an HttpResponseMessage with a status lawmaking of 500 Internal Server Error.</p> <pre><code class="language-c#">public HttpResponseMessage CreateResponse(Func&lt;T&gt; func, HttpRequestMessage request) { try { return request.CreateResponse(HttpStatusCode.OK, func()); } reservation (HttpResponseException ex) { throw; } reservation (Exception ex) { return request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message); } } </code></pre> <p>The last thing to do is update the ExecuteAsync method to undeniability the CreateResponse method and pass in our _func and _request variables.</p> <pre><code class="language-c#">public Task&lt;HttpResponseMessage&gt; ExecuteAsync(CancellationToken cancellationToken) { return Task.FromResult(CreateResponse(_func, _request)); } </code></pre> <h2 id="completed-wrapresponseresult">Completed WrapResponseResult</h2> <p>The completed WrapResponseResult should squint like:</p> <pre><code class="language-c#">public matriculation WrapResponseResult&lt;T&gt; : IHttpActionResult { private readonly Func&lt;T&gt; _func; private readonly HttpRequestMessage _request; public WrapResponseResult(Func&lt;T&gt; func, HttpRequestMessage request) { _request = request; _func = func; } public Task&lt;HttpResponseMessage&gt; ExecuteAsync(CancellationToken cancellationToken) { return Task.FromResult(CreateResponse(_func, _request)); } public HttpResponseMessage CreateResponse(Func&lt;T&gt; func, HttpRequestMessage request) { try { return request.CreateResponse(HttpStatusCode.OK, func()); } reservation (HttpResponseException ex) { throw; } reservation (Exception ex) { return request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message); } } } </code></pre> <h2 id="updating-api-method-to-use-generic-response-handler">Updating Api Method to Use Generic Response Handler</h2> <p>Now that we have our WrapResponseResult matriculation created, we need to update our FirstController to return a WrapResponseResult<UserModel>.</p> <ol> <li><p>Open up the Controllers\FirstController.cs file</p></li> <li><p>Change the return type of the Get method to WrapResponseResult<UserModel></p> <pre><code>public WrapResponseResult&lt;UserModel&gt; Get() { } </code></pre></li> <li><p>Replace the contents of the Get method with the lawmaking below. When the WrapResponseResult ExecuteAsync method is tabbed it will run the lawmaking in the () =&gt; { } function.</p> <pre><code>return new WrapResponseResult&lt;UserModel&gt;(() =&gt; { string userName = RequestContext.Principal.Identity.Name; return new UserModel { UserName = userName }; }, this.Request); </code></pre></li> </ol> <p>If you unshut a web browser and do a get versus the api/First endpoint, you won&rsquo;t see any difference from what is returned when compared to just returning UserModel. However, the goody is that you now have a single generic method that will execute the function to get the results, format out the results, and trammels for errors. This profoundly simplifies the logic and value of lawmaking that you will need to write for all of your Web Api methods. As well since all of the methods will be using the same response handler, if you overly had to make a transpiration to how the response is generated, all of the logic is contained within one class.</p> ASP.NET Web Api - Setup JSON Camel Cased Fields https://digitaldrummerj.me/webapi-json-setup/ Wed, 31 Aug 2016 00:00:00 +0000 https://digitaldrummerj.me/webapi-json-setup/ <p>Welcome to the standing series on getting started with ASP.NET Web Api. In the last post, we created our ASP.NET Web Api project, created our 1st controller and enabled Windows authentication. In this vendible we will learn how to set the JSON response to convert the .NET pascal cased properties into camel cased properties.</p> <p>The naming institute between .NET and JSON is variegated but we should present our Api users the naming institute that they expect without having to write all kinds of conversion code. Luckily this is very easy to succeed with a few lines of lawmaking in ASP.NET Web Api.</p> <p>For the naming convention, .NET uses pascal specimen which ways that properties start each word in the property name with a captial letter (e.g. UserName). JSON uses camel specimen which ways that the property names start with a lowercase letter and then each word without that starts with a captial letter (e.g. userName). Notice the lower specimen u in userName and then the uppercase N for the next work.</p> <p>Before we get started, if you have not read the first post, I would suggest that you do so surpassing standing with this artcle so that you are at the same starting point as I am. It will take you well-nigh 10 minutes to well-constructed the 1st article.</p> <p>The first thing that we are going to do is create a C# matriculation to hold the information well-nigh the logged in user. Then we will update the FirstController that we created in the previous post to return the C# matriculation that we created.</p> <h3 id="creating-a-class-to-return-from-web-api-method">Creating AMatriculationto Return from Web Api Method</h3> <ol> <li>Open up the solution that we created in the previous vendible in Visual Studio</li> <li>In the solution explorer, right-click on the Models directory</li> <li>Select Add</li> <li>Select Class</li> </ol> <p><img src="/images/web-api-getting-started/webapi-add-new-model.png" alt="Add NewMatriculationto Model Folder in Visual Studio" /></p> <p>In the &ldquo;Add New Item&rdquo; dialog that comes up, name the file UserModel.cs and click ok</p> <p><img src="/images/web-api-getting-started/webapi-add-new-model-filename.png" alt="Set new model file name to UserModel.cs" /></p> <p>In the UserModel.cs replace the contents with the pursuit code:</p> <pre><code class="language-c#">using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Web Api_Demo.Models { public matriculation UserModel { public string UserName { get; set; } } } </code></pre> <p>Next we need to update the FirstController Get method to return a UserModel with the UserName set to the logged in user.</p> <ol> <li>Open the Controllers\FirstController.cs file</li> <li>Change the return type of the Get method to <code>UserModel</code></li> <li>Change the return statement to create a new UserModel with the UserName set to RequestContext.Principal.Identity.Name</li> </ol> <pre><code class="language-c#">public UserModel Get() { return new UserModel { UserName = RequestContext.Principal.Identity.Name }; } </code></pre> <p>You will moreover need to add the pursuit using statement so that is knows how to find the UserModel matriculation we created.</p> <pre><code class="language-c#">using Web Api_Demo.Models; </code></pre> <h2 id="testing-default-behavior">Testing Default Behavior</h2> <p>We are now ready to test our changes. However, surpassing we do, we need to make 1 configuration change. Previously we were worldly-wise to test in our browser since we didn&rsquo;t superintendency if XML was returned. This time we do superintendency well-nigh the return type as we want it to be JSON. By default XML is returned when hitting the url directly from the browser since it sends application/xml as the content-type from the browser. There are two options to fix this: 1.) Use the Google Chrome Extension Postman to do our testing and tell it the type is application/json 2.) Turn off XML as a format option.</p> <p>Since we do not need XML to be returned from our Web Api we are going to go with option #2.</p> <ol> <li>Open the file App_Start\Web ApiConfig.cs</li> <li>In the <code>Register</code> method, add the pursuit lawmaking without the undeniability to config.Routes.MapHttpRoute</li> </ol> <pre><code class="language-c#">config.Formatters.Remove(config.Formatters.XmlFormatter); </code></pre> <p>Press F5 to compile our lawmaking and start a debug session. Go to the api/first endpoint and you will notice that the output casing currently matches that of our C# class.</p> <pre><code class="language-json">{&quot;UserName&quot;:&quot;[My User Name]&quot;} </code></pre> <p>Now that we have our Api updated to return the UserModel C# matriculation that we created, we need to configure the JSON formatter to convert the C# matriculation properties to camel case.</p> <h2 id="updating-web-api-configuration">Updating Web Api Configuration</h2> <p>To fix the casing, we will use the CamelCasePropertyNamesContractResolver that is part of the JSON.NET library that is included with Web Api.</p> <ol> <li>Open the file App_Start\Web ApiConfig.cs</li> <li>In the <code>Register</code> method, add the pursuit lawmaking without the undeniability to config.Routes.MapHttpRoute</li> </ol> <pre><code class="language-c#">var json = GlobalConfiguration.Configuration.Formatters.JsonFormatter; json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); </code></pre> <p>We moreover need to add the using statement to tell .NET where to find the CamelCasePropertyNamesContractResolver</p> <pre><code class="language-c#">using Newtonsoft.Json.Serialization; </code></pre> <p>Now unendingly we return when a serialized .NET class, all of the properties will be converted to the standard JSON camel specimen instead of using the standard .NET Pascal case.</p> <p>If you printing F5 to compile our lawmaking and start a debug session and go to the api/first endpoint, you will notice that the output casing is now camel cased</p> <pre><code class="language-json">{&quot;userName&quot;:&quot;[My User Name]&quot;} </code></pre> <h2 id="conclussion">Conclussion</h2> <p>In this guide we learned how to convert the JSON output response to be camel cased instead of the .NET pascal specimen without having to modify all of our .NET classes. In the next post, we will squint at creating a worldwide response format to all of the endpoint return values.</p> ASP.NET Web Api - Getting Started https://digitaldrummerj.me/webapi-getting-started/ Tue, 23 Aug 2016 00:00:00 +0000 https://digitaldrummerj.me/webapi-getting-started/ <p>Welcome to the series on getting started with ASP.NET Web Api. In this vendible we will create a vital C# Web Api with Windows IntegratedHallmarkand create our first Web Api endpoint.</p> <p>ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a wholesale range of clients, including browsers and mobile devices. ASP.NET Web API is a unconfined platform for towers RESTful applications using the .NET Framework.</p> <p>In this series we will learn how to:</p> <ul> <li>Create a vital C# Web Api with Windows Integrated Authentication</li> <li>Setup camel-cased json properties for the response</li> <li>Setup A Standard Response</li> <li>Solving CORS Issues When Using Credentials</li> </ul> <h2 id="create-a-new-web-api-project">Create a new Web Api Project</h2> <p>To make a C# using with Visual Studio:</p> <ul> <li>Open Visual Studio 2015. Any edition will work. I am usingPolityEdition.</li> <li><p>Click File -&gt; New -&gt; <em>Project&hellip;</em></p> <p><img src="/images/web-api-getting-started/vs-start-project.png" alt="New Project" /></p></li> <li><p>Find and select <em>ASP.NET Web Application</em>, requite your using a name and select <em>ok</em></p> <ol> <li>On the left side under Installed -&gt; Templates, select Web</li> <li>Select &ldquo;ASP.NET Web Application&rdquo; <ul> <li><strong>Note:</strong> Your list of templates may differ but as long as your have the ASP.NET WebUsingtemplate listed we are good to go.</li> </ul></li> <li>Give the project a name (Web Api-Demo in this case)</li> <li>Select a location to store the project (c:\projects in this case)</li> <li>Uncheck the &ldquo;Application Insights&rdquo; box since we are not going to be usingUsingInsights</li> <li>Click the Ok button</li> </ol> <p><img src="/images/web-api-getting-started/vs-new-web-app.png" alt="New Web Application" /></p></li> <li><p>On the next screen, we need to select the New ASP.NET Project Options</p> <ol> <li>Select Web Api for the template<br /></li> <li>Click on the &ldquo;Change Authentication&rdquo; sawed-off <ul> <li>Select &ldquo;Windows Authentication&rdquo;</li> <li>Click Ok</li> </ul></li> <li>Uncheck &ldquo;Host in the cloud&rdquo;</li> <li>Click Ok to generate the project</li> </ol> <p><img src="/images/web-api-getting-started/vs-new-web-app-options.png" alt="Web App Options" /></p></li> <li><p>You project has now been generated and you should see a screen similar to the follow in Visual Studio</p> <p><img src="/images/web-api-getting-started/vs-new-web-app-finished.png" alt="Generated Project" /></p></li> <li><p>If you hit F5 your default browser will launch with the Web Api Start Page.</p> <p><img src="/images/web-api-getting-started/chrome-initial-start-page.png" alt="Initial Start Page in Chrome" /></p></li> <li><p>The Web Api project comes with a couple of Web Api Endpoints and a very useful Api documentation page that shows all of the misogynist Api endpoints. Click on the API link in the top nav bar to view the documentation page.</p> <p><img src="/images/web-api-getting-started/chrome-api-doc-page.png" alt="Api Doc Page in Chrome" /></p></li> </ul> <h2 id="creating-our-first-controller">Creating Our First Controller</h2> <p>Now that we have a working Web Api project, lets add some functionality to it. The first thing we are going to do is to create a controller that will return when the logged in Windows user using Windows Integrated Authentication.</p> <blockquote> <p>Note: You should only uses Windows IntegratedHallmarkwithin a merchantry and not for a public Api. {:.warning}</p> </blockquote> <ol> <li>In the Solution Explorer, right-click on the Controllers<br /></li> <li>Select Add from the menu the comes up</li> <li>Select &ldquo;Controller&hellip;&rdquo; from the list of templates</li> </ol> <p><img src="/images/web-api-getting-started/webapi-new-controller.png" alt="Web Api New Controller" /></p> <p>This will unshut up the Controller type options.</p> <ol> <li>Select &ldquo;Web API 2 Controller - Empty&rdquo;</li> <li><p>Click the Add button</p> <p><img src="/images/web-api-getting-started/webapi-new-controller-template.png" alt="Web Api Controller Template Selection" /></p></li> </ol> <p>Next you will need to input the file name.</p> <ol> <li>Change the file name to FirstController</li> <li><p>Click the Add button</p> <p><img src="/images/web-api-getting-started/webapi-new-controller-filename.png" alt="Web Api Controller File Name" /></p></li> </ol> <p>We now have a zippo Web Api Controller that is ready for us to create methods within.</p> <pre><code class="language-c#">using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; namespace Web Api_Demo.Controllers { public matriculation FirstController : ApiController { } } </code></pre> <p>We are now going to add a GET method that will return when the logged in user.</p> <pre><code class="language-c#">public string Get() { return RequestContext.Principal.Identity.Name; } </code></pre> <p>Before we test our new controller, we need to make sure that WindowsHallmarkis enabled and AnonymousHallmarkis disabled.</p> <ol> <li>Open Solution Explorer, select the Solution and printing F4 to unshut the Properties window</li> <li>Set &ldquo;Anonymous Authentication&rdquo; to disabled</li> <li>Set &ldquo;Windows Integrated&rdquo; to enabled</li> </ol> <p><img src="{{&quot;iisexpress-windows-auth.png" alt="VS Solution Properties Set Dev ServerHallmarkOptions" /></p> <p>Now we are ready to test our Api. In Visual Studio, printing F5 to start up a debugging session. This will launch your default web browser. Once the initial page for Web Api has loaded navigate to the /api/first page (e.g. <a href="http://localhost:58842/api/First">http://localhost:58842/api/First</a>). Your port number will be variegated than mine.</p> <p>The response you get when will be an xml document that contains a string with your domain and user name that you are logged in with. In this specimen it is [Your Domain]/[Your User Name]. It will squint similar to below.</p> <pre><code class="language-xml">&lt;string xmlns=&quot;http://schemas.microsoft.com/2003/10/Serialization/&quot;&gt;[Your Domain]/[Your User Name]&lt;/string&gt; </code></pre> <h2 id="conclusion">Conclusion</h2> <p>In this guide we learned how to create a vital C# Web Api project that uses Windows Integrated Authentication. In the next guide, we will learn how to convert the JSON responses to be camel cased instead of pursuit the .NET pascal specimen institute without having to update all of our .NET class.</p> Running Multiple Version of Node On Windows https://digitaldrummerj.me/windows-running-multiple-versions-of-node/ Wed, 20 Jul 2016 00:00:00 +0000 https://digitaldrummerj.me/windows-running-multiple-versions-of-node/ <p>I am sure that many of you are in the same situation that I am in with needing a variegated version of node for variegated projects and you don&rsquo;t want to have to create a new virtual machine for each project just considering of node. Luckily with <a href="https://github.com/coreybutler/nvm-windows/">nvm</a> you can install multiple versions of Node on the same machine and switch between them with a simple writ line call.</p> <p>The one downside to having multiple versions of Node installed is that you have to install the global packages for each version of node that you want them misogynist to. There is no worthiness to share packages between versions. This ways that it will take a bit increasingly disk space but most node packages are fairly small so this should be a none issue.</p> <h2 id="installing-nvm">Installing NVM</h2> <p>The first thing that we need to do is install NVM.</p> <ol> <li>Uninstall existing version of node since we won&rsquo;t be using it anymore</li> <li>Delete any existing nodejs installation directories. e.g. &ldquo;C:\Program Files\nodejs&rdquo;) that might remain. NVM&rsquo;s generated symlink will not overwrite an existing (even empty) installation directory.</li> <li>Delete the npm install directory at C:\Users[Your User]\AppData\Roaming\npm</li> </ol> <p>We are now ready to install nvm. Download the installer from <a href="https://github.com/coreybutler/nvm/releases">https://github.com/coreybutler/nvm/releases</a></p> <p><strong>To upgrade</strong>, run the new installer. It will safely overwrite the files it needs to update without touching your node.js installations. Make sure you use the same installation and symlink folder. If you originally installed to the default locations, you just need to click &ldquo;next&rdquo; on each window until it finishes.</p> <h2 id="installing-and-picking-a-node-version">Installing and Picking a node version</h2> <ol> <li><p>Get a the list so you can see what is available</p> <pre><code>$ nvm list misogynist </code></pre></li> <li><p>Pick the one you want to install.Unelevatedwe are installing 4.4.5 and 5.10.1. You can pick any version that you want.</p> <pre><code>$ nvm install 4.4.5 $ nvm install 5.10.1 </code></pre></li> <li><p>Select the node version to use. Note that only 1 node version can be vivify at a time.</p> <pre><code>$ nvm use 4.4.5 $ nvm use 5.10.1 </code></pre></li> </ol> <p><strong>Reminder!</strong> Any global npm modules you may have installed are not shared between the various versions of node.js you have installed. Additionally, some npm modules may not be supported in the version of node you&rsquo;re using, so be enlightened of your environment as you work.</p> <h2 id="installing-packages">Installing Packages</h2> <p>Installing Node packages is the same as you are used to. Nvm just switches out which version is referenced in your path variables.</p> <pre><code>npm install [package name] [--save or --save-dev] npm install -g [package name] </code></pre> <h2 id="other-commands">Other Commands</h2> <p><strong>View Default Node ArchitectureStuffUsed</strong></p> <pre><code>$ nvm wily </code></pre> <p><strong>Change Default Node Architecture</strong></p> <pre><code>$ nvm wily 32 $ nvm wily 64 </code></pre> <p><strong>Install Node Version</strong></p> <pre><code>$ nvm install 4.4.5 $ nvm install 4.4.5 64 $ nvm install 4.4.5 32 </code></pre> <p><strong>Get Installed Versions</strong></p> <pre><code>$ nvm list </code></pre> <p><strong>GetMisogynistVersions to Install</strong></p> <pre><code>$ nvm list misogynist </code></pre> <p><strong>Turn On nvm</strong></p> <pre><code>$ nvm on </code></pre> <p><strong>Turn Off nvm</strong></p> <pre><code>$ nvm off </code></pre> <p><strong>Set Proxy</strong></p> <pre><code>$ nvm proxy [url] </code></pre> <p><strong>Remove Proxy</strong></p> <pre><code>$ nvm proxy none </code></pre> <p><strong>View Proxy Setting</strong></p> <pre><code>$ nvm proxy </code></pre> <p><strong>Uninstall Node Version</strong></p> <pre><code>$ nvm uninstall [version number] $ nvm uninstall 4.4.5 </code></pre> <p><strong>Select Node Version to Use</strong></p> <blockquote> <p>Note: The [arch] parameter unelevated is optional</p> </blockquote> <pre><code>$ nvm use [version] [arch] $ nvm use 4.4.5 64 </code></pre> <p><strong>Get the Nvm Version</strong></p> <pre><code>$ nvm version </code></pre> <p>Now you can hands switch between Node versions and don&rsquo;t have to worry well-nigh compatibility with your lawmaking not working on your installed Node version.</p> Docker - Running Container As a Service https://digitaldrummerj.me/docker-running-container-as-service/ Wed, 15 Jun 2016 00:00:00 +0000 https://digitaldrummerj.me/docker-running-container-as-service/ <p>In the <a href="../docker-windows-mounting-directories/">previous tutorial</a> we learned how to mount spare directories within the Docker containers. In this tutorial we are going to learn how to run a Docker container as a service a.k.a daemon for nginx and mysql.</p> <p>To run a Docker container as a daemon, we run it with the -d flag. This will tell Docker to start up the container in the preliminaries and return when to the writ prompt.</p> <h3 id="nginx">nginx</h3> <p>The Docker Hub image for run an nginx server, is tabbed nginx. If you do not once have the nginx image the run writ will download it from the Docker hub. To start the nginx container run:</p> <pre><code> docker run -d -p 8000:80 nginx </code></pre> <ul> <li>-d: runs container in the background</li> <li>-p: set the port to forward to.</li> </ul> <p>Once the nginx container is up and running, we can verify it is running by executing</p> <pre><code> docker ps </code></pre> <blockquote> <p>To see all of the containers plane if they are not running execute add a <code>-a</code></p> </blockquote> <p>To connect to the nginx web page, we need to know the ip write of the docker machine.</p> <pre><code> docker-machine ip </code></pre> <blockquote> <p>In my specimen it is 192.168.99.100. To navigate to the web page, unshut up a browser and navigate to <a href="http://192.168.99.100:8000/">http://192.168.99.100:8000/</a>.</p> </blockquote> <p>If you need to to nail to a shell within the running container, run</p> <pre><code>docker nail [container id] </code></pre> <blockquote> <p>If docker nail never connects, run docker exec -i -t [container id] /bin/bash {:.warning}</p> </blockquote> <p>If you need to stop the container, run</p> <pre><code>docker stop [container id] </code></pre> <p>You can verify it stopped by running</p> <pre><code>docker ps -a </code></pre> <p>If you are washed-up with the container and ready to delete it, run</p> <pre><code>docker rm [container id] </code></pre> <h3 id="mysql-sample">MySQL Sample</h3> <p>This example will download the mysql image, create a mysql database and expose it to your local machine to interact with.</p> <pre><code class="language-shell">$ docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_USER=mysql_user -e MYSQL_PASSWORD=mysql_user1 -e MYSQL_DATABASE=mysql_test -p 3306:3306 -d mysql </code></pre> <ul> <li>--name: is the name to requite the container</li> <li>-e: sets environment variables</li> <li>-d: runs container in the background</li> <li>-p: set the port to forward to.</li> </ul> <p>Once the MySql container is up and running we can see that it is running with</p> <pre><code> docker ps </code></pre> <blockquote> <p>To see all of the containers plane if they are not running execute add a <code>-a</code></p> </blockquote> <p>To connect to the MySql database, we need to know the ip write of the docker machine</p> <pre><code> docker-machine ip </code></pre> <p>Then we need to install MySql Workbench from <a href="https://www.mysql.com/products/workbench/">https://www.mysql.com/products/workbench/</a> to connect to the database to interact with the database.</p> <p>If you need to to nail to a shell within the running container, run</p> <pre><code>docker nail [container id] </code></pre> <blockquote> <p>If docker nail never connects, run docker exec -i -t [container id] /bin/bash {:.warning}</p> </blockquote> <p>If you need to stop the container, run</p> <pre><code>docker stop [container id] </code></pre> <p>You can verify it stopped by running</p> <pre><code>docker ps -a </code></pre> <p>If you are washed-up with the container and ready to delete it, run</p> <pre><code>docker rm [container id] </code></pre> <blockquote> <p>WARNING: This will delete any data that you widow to the database {:.warning}</p> </blockquote> <p>You have learn how to run 2 variegated types of Docker containers as preliminaries containers. Any Docker container can be run as a preliminaries container by using the -d when starting up the container for the first time.</p> Docker - Mounting Windows Directories in Containers https://digitaldrummerj.me/docker-windows-mounting-directories/ Fri, 03 Jun 2016 00:00:00 +0000 https://digitaldrummerj.me/docker-windows-mounting-directories/ <p>In the <a href="../docker-on-windows-getting-started/">previous tutorial</a> we learned how to install Docker and get our first container running. In this tutorial we are going to learn how to mount spare directories within our Docker container that are outside of the c:\Users directory. By default, Docker only mounts the c:\Users directory inside the docker machine and containers. For myself, I have all of my project files two places: c:\projects and c:\personal. I didn&rsquo;t want to transpiration my standard configuration just for Docker. Luckily, it is really easy to mount spare directories.</p> <p>To mount spare directories, you need to add the directory as a shared folder within Virtualbox and then enable long file paths and symlinks. Once the Virtualbox shared folders are setup, you need to mount the directories within the docker machine so that they are misogynist to the containers.</p> <h2 id="step-1-adding-shared-folders">Step 1:SubtractingShared Folders</h2> <p>The first step is to add the directories as Virtualbox shared folders by using the VBoxManage.exe utility that comes with Virtualbox. VBoxManage.exe is located in your Virtualbox install directory, which by default is C:\Program Files\Oracle\VirtualBox.</p> <blockquote class="warning"> <p><strong>Warning:</strong> To make symlinks works when you start up the docker-machine, you need to run the Docker Quickstart Terminal orWritLine as an administrator. This is a security limitation of Windows for symlinks.</p> </blockquote> <p>Before subtracting the shared folders, we need to make sure that no docker machines are running. We are going to trammels for running docker containers and machines as both a non-admin and admin.</p> <p><strong>Non-Admin Checking For Running Machines</strong></p> <p>Launch the WindowsWritPrompt and run</p> <pre><code>$ docker-machine ls </code></pre> <p>If any machines comes when with the state of running, you will need to stop the machine.</p> <ol> <li><p>Before stopping the machine you will want to make sure that your containers are stopped.</p> <pre><code>$ docker ps </code></pre></li> <li><p>For any containers that are returned you can stop them by running</p> <pre><code>$ docker stop [Container ID] </code></pre></li> <li><p>Once all of the containers are stop, you can stop the docker machine. Replace the &ldquo;[machine name]&rdquo; with you machine name that we returned from the docker-machine ls command. Typically you will only have 1 machine and it will be named default</p> <pre><code>$ docker-machine stop [machine name] </code></pre></li> </ol> <p><strong>Admin Checking For Running Machines</strong></p> <ol> <li>Open the WindowsWritPrompt as an administrator. <ul> <li>Start Menu</li> <li>Search for writ prompt</li> <li>Right-click on theWritPrompt and select Run as Administrator</li> </ul></li> <li><p>To trammels if any docker machines are running, run the command:</p> <pre><code>$ docker-machine ls </code></pre></li> </ol> <p>If any machines comes when with the state running, you will need to stop the machine.</p> <ol> <li><p>Before stopping the machine you will want to make sure that your containers are stopped.</p> <pre><code>$ docker ps </code></pre></li> <li><p>For any containers that are returned you can stop them by running</p> <pre><code>$ docker stop [Container ID] </code></pre></li> <li><p>Once all of the containers are stop, you can stop the docker machine. Replace the &ldquo;[machine name]&rdquo; with you machine name that we returned from the docker-machine ls command. Typically you will only have 1 machine and it will be named default</p> <pre><code>$ docker-machine stop [machine name] </code></pre></li> </ol> <p>We are now ready to add in our shared folders.</p> <ol> <li><p>Navigate to the Virtualbox directory.</p> <pre><code>$ cd &quot;c:\Program Files\Oracle\Virtualbox&quot; </code></pre></li> <li><p>Run the pursuit writ to add the shared folders. For your shared folders, replace the projects or personal name in the name and hostpath options.</p> <pre><code>$ VBoxManage.exe sharedfolder add default --name &quot;c/projects&quot; --hostpath &quot;\\?\c:\projects&quot; --automount $ VBoxManage.exe sharedfolder add default --name &quot;c/personal&quot; --hostpath &quot;\\?\c:\personal&quot; --automount </code></pre></li> </ol> <blockquote class="warning"> <p>The \?\ in the hostpath tells Windows to enable long file paths.</p> </blockquote> <h2 id="step-2-allow-long-paths-and-symlinks">Step 2:IndulgeLong Paths and Symlinks</h2> <p>If you are using node many of the modules will create symlinks which are supported under Virtualbox but you need to make a configuration transpiration to enable them.</p> <pre><code> $ VBoxManage.exe setextradata default VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root 1 </code></pre> <p>Next you need to enable symlinks for each of the shared folders. Replace SharedFolderName with the --name value that you used when creating the sharedfolder.</p> <pre><code>$ VBoxManage.exe setextradata default VBoxInternal2/SharedFoldersEnableSymlinksCreate/c/personal 1 $ VBoxManage.exe setextradata default VBoxInternal2/SharedFoldersEnableSymlinksCreate/c/projects 1 </code></pre> <h2 id="step-3-mounting-shared-folders-in-docker">Step 3: Mounting Shared Folders in Docker</h2> <blockquote class="warning"> <p><strong>Warning:</strong> To make symlinks works when you start up the docker-machine, you need to run the Docker Quickstart Terminal as an administrator. This is a security limitation of Windows for symlinks. Right-click on the Docker Quickstart Terminal and select Run As Administrator.</p> </blockquote> <p>Unfortunately plane with auto-mount Docker will only mount the c/Users folder in the docker-machine. If you want the folders to auto-mount you will need to manually mount them each time you start up the default docker machine.</p> <ol> <li><p>Open the Docker Quickstart Terminal as an administrator</p> <ul> <li>Start Menu</li> <li>Search for Docker Quickstart Terminal</li> <li>Right-click on the Docker Quickstart Terminal and select &ldquo;Run as Administrator&rdquo;<br /> <br /></li> </ul></li> <li><p>In order to mount the directories we need to ssh into the docker machine</p> <pre><code>$ docker-machine ssh default </code></pre></li> <li><p>Once you have ssh&rsquo;ed into the docker machine run the pursuit commands to mount the shared folders we created.</p> <pre><code> $ sudo mkdir --parents /c/projects $ sudo mount -t vboxsf c/projects /c/projects/ $ sudo mkdir --parents /c/personal $ sudo mount -t vboxsf c/personal /c/personal/ </code></pre></li> <li><p>Within the docker machine you should now be worldly-wise to see the files and directories in /c/projects and c/personal</p> <pre><code>$ ls /c/projects $ ls /c/personal </code></pre></li> <li><p>exit the ssh session</p></li> <li><p>You are now ready to start up or create your containers</p></li> </ol> <h2 id="step-4-using-the-shared-folders">Step 4: Using the Shared Folders</h2> <p>Now that the shared folders are mounted in the docker machine to use them from a container -v argument. The writ unelevated will mount the local directory c:\projects (in unix form /c/projects) to /projects within the container. The -it say run interactively, ubuntu is the image name and whack is the type of interactive shell</p> <pre><code> $ docker run -v /c/projects:/projects -it ubuntu whack </code></pre> <p>From the container, you can squint at the projects directory by running</p> <pre><code> $ ls /projects </code></pre> <p>You are now ready to start using the container for your minutiae work. In the next tutorial we will squint at running docker containers in the preliminaries for processes like mysql and postgres.</p> Docker - Getting Started On Windows https://digitaldrummerj.me/docker-on-windows-getting-started/ Tue, 31 May 2016 00:00:00 +0000 https://digitaldrummerj.me/docker-on-windows-getting-started/ <p>After seeing a Docker presentation recently I decided to finally icon out how to get Docker working correctly on Windows. Luckily it worked out of the box fairly well but I did run into issues with Windows file path lengths and proxy issues. This series of vendible will documented how I got Docker working and overcame those issues.</p> <p>To get started, you will need the docker toolkit. I followed the instructions on the Docker website to get the Docker Toolkit with Virtualbox installed. The instructions for Windows are at <a href="https://docs.docker.com/windows/">https://docs.docker.com/windows/</a>. The instructions moreover have links to the Linux and Mac instructions. As I am a Windows user, I can only verify that this tutorial all worked under Windows.</p> <p>Once you get the Docker toolkit installed you are probably wondering now what do I do. On the desktop, it installed a shortcut to the &ldquo;Docker Quickstart Terminal&rdquo;. This terminal will ensure that you have the wiring image that Docker uses for Virtualbox on Windows and you can run all of the Docker commands from this terminal.</p> <p>The reason that we need Virtualbox is considering Windows does not yet natively support Docker containers. All of the containers run within a Linux virtual machine that Docker is using.</p> <p>Below are a few examples to help get you started with usage of Docker.</p> <h2 id="example-1-basic-hello-world">Example 1:VitalHello World</h2> <p>This will download the hello-world image if it is not once one your machine. Then is will create a container, run hello-world and finally remove the container (--rm).</p> <pre><code> docker run --rm hello-world </code></pre> <h2 id="example-2-nginx">Example 2: nginx</h2> <p>This example will start up an nginx web server.</p> <p>When you run the docker run command, it will pull lanugo the nginx image if you do not once have it, the -d will leave the container running in the background, and the -p will set port forwarding of port 8000 to port 80 in the container.</p> <pre><code> docker run -d -p 8000:80 nginx </code></pre> <p>Once the nginx container is up and running we can see that it is running with</p> <pre><code> docker ps </code></pre> <p>To connect to the nginx web page, we need to know the ip write of the docker machine.</p> <pre><code> docker-machine ip </code></pre> <p>In my specimen it is 192.168.99.100. To navigate to the web page, unshut up a browser and navigate to <a href="http://192.168.99.100:8000/">http://192.168.99.100:8000/</a></p> <p>Since the container is running overdue the scenes, to stop the container you need to issues the</p> <pre><code> docker stop command. docker stop [Container ID from docker ps command] </code></pre> <h2 id="example-3-ubuntu-bash-shell">Example 3: UbuntuWhackShell</h2> <p>This example will download the ubuntu docker image and start up an interactive whack shell that will indulge you to make changes to the image.</p> <pre><code> docker run -it ubuntu whack </code></pre> <blockquote> <p>If you want to interact with files on the host system you can do this as long as they are in the c:\Users directory. Docker wheels mounts this directory for you. In a future post will imbricate the ins and outs of mounting other directories. {:.warning}</p> <p>Also, in a future post, we will imbricate how to save the transpiration made to a container to a new image that you can use as the wiring for future containers.</p> </blockquote> <h2 id="finding-additional-docker-images">FindingSpareDocker Images</h2> <p>So far we have used a few vital images but there are many increasingly Docker images misogynist in the Docker Hub at <a href="http://hub.docker.com">http://hub.docker.com</a>. The Docker Hub host a number of worldwide containers that you might use for your using such as node, mysql, postgres, couchbase, plus many more.</p> <p>Once you find an image that you want to get run</p> <pre><code> $ docker pull [Image Name] </code></pre> <p>If you want to pull only a specific version of any image which is worldwide with the nodejs so that you can get the version of node that you need versus the latest version of node, run the following</p> <pre><code> $ docker pull [image name]:[tag or version] </code></pre> <h2 id="common-docker-commands">Common Docker Commands</h2> <p>Below is a list of worldwide commands that you will get you started using Docker.</p> <p><strong>List Docker Images</strong></p> <pre><code> $ docker images </code></pre> <p><strong>Get Docker image from Docker Hub</strong></p> <pre><code> $ docker pull [image name] </code></pre> <p><strong>Get Docker Image from at specific version</strong></p> <pre><code> $ docker pull [image name]:[tag or version] </code></pre> <p><strong>Update an existing image</strong></p> <pre><code> $ docker pull [image name] </code></pre> <p><strong>list of running containers</strong></p> <pre><code> $ docker ps </code></pre> <p><strong>Seeing Existing Containers</strong></p> <pre><code> $ docker ps -a </code></pre> <p><strong>See last nth Container Created</strong></p> <pre><code> $ docker ps -n=1 </code></pre> <blockquote> <p>Will pull last container created. -n says how many when to pull</p> </blockquote> <p><strong>Connect to Existing Container</strong></p> <pre><code> $ docker start -i [Container ID] </code></pre> <blockquote> <p>-i connects to the standard in/out.</p> </blockquote> <p><strong>Delete image</strong></p> <pre><code> $ docker rmi [image id] </code></pre> <blockquote> <p>It will warn you if you have a container based on the image {:.warning}</p> </blockquote> <p><strong>Delete container</strong></p> <pre><code> $ docker rm [container id] </code></pre> <h2 id="wrap-up">Wrap-up</h2> <p>Docker is a powerful tool to have in your arsenal. Once you get it working on Windows, you will never install services that can run within Docker locally again. With Docker you can run light-weight containers for services such as mysql, postgres, mongodb, redis, node, plus many more.</p> <p>This is the first of several post on using Docker. In future post we will imbricate mounting spare directories, saving changes to a container into an image, saving our image to the Docker Hub and creating our own Docker image from scratch.</p> Jekyll Tip: Showing LiquidLawmakinginLawmakingSnippets https://digitaldrummerj.me/jekyll-show-liquid-in-code-snippet/ Thu, 26 May 2016 00:00:00 +0000 https://digitaldrummerj.me/jekyll-show-liquid-in-code-snippet/ <p>When blogging with Jekyll there are times when you want to be worldly-wise to output a lawmaking snippet that contains what Jekyll thinks is liquid code. This expressly happens when you are doingWeedytutorials since using the double brackets (&#123;&#123; &#125;&#125;) for data binding. Since the lawmaking snippets are enclosed in a pre tag, you are not worldly-wise to html encode the brackets.</p> <p>Instead, to include liquid markup in the lawmaking snippet you need to surround the lawmaking snippet with the raw and endraw tags like so</p> <pre><code class="language-liquid">{% raw %} {{ Notice the double brackets will be in the output }} {% endraw %} </code></pre> <p>This will output:</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-liquid" data-lang="liquid">{{ Notice the double brackets are output }}</code></pre></div> Jekyll Tip:SubtractingStyling To Html Output https://digitaldrummerj.me/styling-jekyll-markdown/ Tue, 24 May 2016 00:00:00 +0000 https://digitaldrummerj.me/styling-jekyll-markdown/ <p>As I was writing some tutorials recently I wanted to be worldly-wise to style the html elements that Jekyll outputs with variegated css classes without having to write the unquestionably html in the markdown.</p> <p>For example I wanted to use a blockquote for items to be enlightened of that has a undecorous highlight as well as warnings to watch out for that has a red highlight. Here is the output of the blockquote with the variegated styles.</p> <blockquote> <p>This is a normal blockquote. Without doing anything uneaten in markdown this is my default blockquote.</p> <p>This is a warning blockquote. {:.warning}</p> </blockquote> <p>With the kramdown markdown parser that Jekyll uses you can hands add these css classes without having to write out the html code.</p> <h2 id="basics">Basics</h2> <p>In order to specify spare nature to output in the html on the element, you start it with:</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">{: }</code></pre></div> <p>To specify a matriculation it is</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">{:.MyClass}</code></pre></div> <p>To specify a title symbol it is</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">{:title=&#34;My Title&#34;}</code></pre></div> <p>Below are some specific examples.</p> <h2 id="paragraph">Paragraph</h2> <p><strong>markdown</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">{:.fake-h2} This will be styled as a p tag with the css matriculation fake-2</code></pre></div> <p><strong>html output</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">&lt;<span style="color:#f92672">p</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;fake-h2&#34;</span>&gt;This will be styled as a p tag with the css matriculation fake-2&lt;/<span style="color:#f92672">p</span>&gt;</code></pre></div> <h2 id="list">List</h2> <p><strong>markdown</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">* {:.done} washed-up - Completed this * Not washed-up yet</code></pre></div> <p><strong>html output</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">&lt;<span style="color:#f92672">ul</span>&gt; &lt;<span style="color:#f92672">li</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;done&#34;</span>&gt;done - Completed this&lt;/<span style="color:#f92672">li</span>&gt; &lt;<span style="color:#f92672">li</span>&gt;Not washed-up yet&lt;/<span style="color:#f92672">li</span>&gt; &lt;/<span style="color:#f92672">ul</span>&gt;</code></pre></div> <h2 id="blockquotes">blockquotes</h2> <p>With the blockquote you can moreover optional elements such as a title and id tag.</p> <p><strong>markdown</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">&gt; The npm install writ will take several minutes to run depending on internet speed {:.warning} {:title=&#34;my title&#34;} {: #myid }</code></pre></div> <p><strong>html output</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">&lt;<span style="color:#f92672">blockquote</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;warning&#34;</span> <span style="color:#a6e22e">id</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;myid&#34;</span> <span style="color:#a6e22e">title</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;my title&#34;</span>&gt; The npm install writ will take several minutes to run depending on internet speed &lt;/<span style="color:#f92672">blockquote</span>&gt;</code></pre></div> <h2 id="inline">inline</h2> <p>In the previous examples, we were subtracting classes to the whole element. However, there are times where you just want to highlight something within an element or sentence. For these times, you write the styling the same way as whilom but have to put it inline with the text.</p> <p><strong>markdown</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">This *is*{:.underline} some `code`{:#id}{:.class}. A [link](google.com){:rel=&#39;something&#39;} and some **tools**{:.tools}. this *is italic*{::}*marked*{:.special} text</code></pre></div> <p><strong>html output</strong></p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-html" data-lang="html">&lt;<span style="color:#f92672">p</span>&gt;This &lt;<span style="color:#f92672">em</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;underline&#34;</span>&gt;is&lt;/<span style="color:#f92672">em</span>&gt; some &lt;<span style="color:#f92672">code</span> <span style="color:#a6e22e">id</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;id&#34;</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;class highlighter-rouge&#34;</span>&gt; code&lt;/<span style="color:#f92672">code</span>&gt;. A &lt;<span style="color:#f92672">a</span> <span style="color:#a6e22e">href</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;google.com&#34;</span> <span style="color:#a6e22e">rel</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;something&#34;</span>&gt;link&lt;/<span style="color:#f92672">a</span>&gt; and some &lt;<span style="color:#f92672">strong</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;tools&#34;</span>&gt;tools&lt;/<span style="color:#f92672">strong</span>&gt;.&lt;/<span style="color:#f92672">p</span>&gt; &lt;<span style="color:#f92672">p</span>&gt;this &lt;<span style="color:#f92672">em</span>&gt;is italic&lt;/<span style="color:#f92672">em</span>&gt;&lt;<span style="color:#f92672">em</span> <span style="color:#a6e22e">class</span><span style="color:#f92672">=</span><span style="color:#e6db74">&#34;special&#34;</span>&gt;marked&lt;/<span style="color:#f92672">em</span>&gt; text&lt;/<span style="color:#f92672">p</span>&gt;</code></pre></div> <p>With these new tricks you can make you markdown output squint plane largest without having to resort to writing a lot of html within your markdown.</p> Add Table of Contents to Markdown https://digitaldrummerj.me/adding-toc-to-markdown/ Tue, 10 May 2016 00:00:00 +0000 https://digitaldrummerj.me/adding-toc-to-markdown/ <p>When you are writing tutorials that are wrenched up by sections it is nice to have a table of contents at the top to help the users navigate. However, maintaining this by hand is a no go. Luckily there is a unconfined npm package tabbed doctoc that will squint at the headings in your markdown file and generated a table of contents for you.</p> <p><strong>Table of Contents Sample Using This Post</strong></p> <!-- START doctoc generated TOC please alimony scuttlebutt here to indulge wheels update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <ul> <li><a href="#installing">Installing</a></li> <li><a href="#adding-to-all-files">Adding to All Files</a></li> <li><a href="#add-to-single-file">Add to Single File</a> <ul> <li><a href="#examples">examples</a></li> </ul></li> <li><a href="#skipping-files">Skipping Files</a></li> <li><a href="#specifying-location-of-the-table-of-contents">Specifying Location of the Table of Contents</a></li> <li><a href="#changing-the-title-to-the-table-of-contents">Changing the Title to the Table of Contents</a></li> <li><a href="#changing-max-level-of-headings">Changing Max Level of Headings</a></li> <li><a href="#site-compatibility">Site Compatibility</a></li> <li><a href="#using-with-jekyll">Using with Jekyll</a></li> <li><a href="#running-doctoc-as-a-git-pre-commit">Running doctoc as a Git pre-commit</a></li> <li><a href="#more-info">More Info</a></li> </ul> <!-- END doctoc generated TOC please alimony scuttlebutt here to indulge wheels update --> <h2 id="installing">Installing</h2> <pre><code>$ npm install -g doctoc </code></pre> <h2 id="adding-to-all-files">Adding to All Files</h2> <pre><code>$ doctoc . </code></pre> <h2 id="add-to-single-file">Add to Single File</h2> <pre><code>$ doctoc /path/to/file [...] </code></pre> <h3 id="examples">examples</h3> <pre><code>$ doctoc README.md $ doctoc CONTRIBUTING.MD LICENSE.MD </code></pre> <h2 id="skipping-files">Skipping Files</h2> <p>There is no seated mechanism out of the box for doctoc to skip unrepealable files from having a table of contents. However you can add a scuttlebutt to each file and then use a little bit of writ line logic to exclude those files.Unelevatedare examples using Ack and out-of-the-box Windows commands.</p> <p>The first step is to add this line of text to the markdown files to skip of:</p> <pre><code>&lt;!-- DOCTOC SKIP --&gt; </code></pre> <p>Using <a href="http://beyondgrep.com/">Ack</a> which requires Perl</p> <pre><code>$ ack -L 'DOCTOC SKIP' | xargs doctoc </code></pre> <p>Here is an example using seated Windows writ line options. If you are not running it in the directory that contains your markdown files that you want a table of contents on then make sure to update the source variable.</p> <pre><code>@echo off setlocal set source=. set extension=*.md set string=&quot;DOCTOC SKIP&quot; for /f &quot;tokens=*&quot; %%G in ('dir &quot;%source%\%extension%&quot; /a:-d /b') do ( find /c /i %string% &quot;%%G&quot; &gt; NUL || ( reverberate &quot;Add TOC to %%G&quot; doctoc --github --title &quot;**Table of Contents**&quot; &quot;%%G&quot; ) ) pause </code></pre> <h2 id="specifying-location-of-the-table-of-contents">Specifying Location of the Table of Contents</h2> <p>By default doctoc will add the table of contents at the top of the file. You can however indicate where you would like to have it placed with the following:</p> <pre><code>&lt;!-- START doctoc generated TOC please alimony scuttlebutt here to indulge wheels update --&gt; &lt;!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --&gt; &lt;!-- END doctoc generated TOC please alimony scuttlebutt here to indulge wheels update --&gt; </code></pre> <h2 id="changing-the-title-to-the-table-of-contents">Changing the Title to the Table of Contents</h2> <p>Pass in the --title option</p> <pre><code>doctoc --title '**Contents**' . </code></pre> <h2 id="changing-max-level-of-headings">Changing Max Level of Headings</h2> <p>By default it will process 4 levels. You can transpiration this with the maxlevel option</p> <pre><code>doctoc --maxlevel 3 . </code></pre> <h2 id="site-compatibility">Site Compatibility</h2> <p>By default doctoc generated github formatted links. To transpiration use the following:</p> <pre><code>--bitbucket bitbucket.org --nodejs nodejs.org --github github.com --gitlab gitlab.com --ghost ghost.org </code></pre> <p><strong>example</strong></p> <pre><code>doctoc README.md --bitbucket </code></pre> <h2 id="using-with-jekyll">Using with Jekyll</h2> <blockquote> <p>UPDATED 2016-05-10: For Jekyll the recommendation is now to use the kramdown table of contents seated generator</p> </blockquote> <p>With the kramdown parser that Jekyll uses by default you can hands add in a table of contents. The one limitation that had stopped me from using it for the pages that I wanted a table of contents is that it gets all headers and not just the ones without he table of contents. Granted most of the time that table of contents is at the top of the page but I had an objectives section whilom my table of contents that was stuff widow in the table of contents which I did not want. However, I was worldly-wise to work virtually this issue by using html and CSS instead of markdown for the headers I wanted to exclude. I would style the div tag just like it was an H1-H6 tag without it unquestionably stuff a header.</p> <p>To use add a table of contents using kramdown on your Jekyll blog, add the follow to your file where you are want your table of contents.</p> <pre><code>* TOC {:toc} </code></pre> <p><strong>Jekyll Kramdown TOC Sample Showing All Headers</strong></p> <ul> <li>TOC {:toc}</li> </ul> <p>This will rationalization the * TOC to be replaced with the very table of contents when the jekyll build/serve is run.</p> <h2 id="running-doctoc-as-a-git-pre-commit">Running doctoc as a Git pre-commit</h2> <p>To remember to unchangingly update the Table of Contents surpassing committing to you can use a git vaccinate to run your doctoc undeniability surpassing committing any files to Github for your repo.</p> <ol> <li>Go into the .git\hooks directory</li> <li>Copy the pre-commit.sample to pre-commit with no file extension</li> <li>Add your doctoc writ to the file and save</li> <li>Now the next time you do a git commit the table of contents will automatically updated</li> </ol> <h2 id="more-info">More Info</h2> <p><a href="https://github.com/thlorenz/doctoc">Github Repo</a></p> <p><a href="https://www.npmjs.com/package/doctoc">npm package</a></p> Factory Reset Dell Venue 7 x86 Android Tablet https://digitaldrummerj.me/reset-dell-tablet/ Wed, 13 Apr 2016 00:00:00 +0000 https://digitaldrummerj.me/reset-dell-tablet/ <p>I rarely use my Dell tablet and when I went to use it then I couldn&rsquo;t remember the lock pattern. No problem I thought I will just reset it but I had since reverted or my router and the tablet wasn&rsquo;t worldly-wise to connect to the Internet.</p> <p>So my only option was to icon out to do a factory reset of the device. This device does not have a reset sawed-off on it. So off to Google I went.</p> <p>So long story short.Withoutmuch searching I figured it out.</p> <ol> <li>Hold power sawed-off lanugo to shutdown the device</li> <li>Power on device and immediately hold volume lanugo button. <ol> <li>This will bring you to a screen where you can selected DruidBoot or Recovery. Use could sawed-off to navigate to Recovery option and then printing the power sawed-off to select it.</li> <li>You will then get the Android logo will an exclamation point over it. This is Androids way of saying you don&rsquo;t have a custom recovery. Hold lanugo the power and printing the volume up to get a mini menu.</li> <li>Select factory reset from the options. Use volume buttons to navigate up and down.Printingpower once you have factory reset selected.</li> <li>On the next screen is a menu that ask are you sure you want to reset. Use the volume buttons to navigate to the I am sure option.<br /></li> <li>It will take several minutes to reset the device and deleted all of the data. When washed-up it will return you to the initial menu.</li> <li>Select the reboot option and when it completes the start up it will walk you through the initial setup agasetup Android. <br /></li> </ol></li> </ol> <p>Figuring out these instructions was a pain. I was ready to requite up on the tablet stuff worldly-wise to be used then and just put it in a drawer to collect dust. Now I can use the tablet then and it only took a few minutes once I figured out the instructions.</p> Jekyll Part 14: How To Validate Links and Images https://digitaldrummerj.me/jekyll-validating-links-and-images/ Mon, 01 Feb 2016 00:00:00 +0000 https://digitaldrummerj.me/jekyll-validating-links-and-images/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to go through how you can validate your link and image references.</p> <p>As your blog grows and you get increasingly posts, it becomes harder to validate images and links are still valid on older post. On new post it is pretty easy since you only have one last to squint for. However, this is a process that can be fully streamlined so got don&rsquo;t plane have to worry well-nigh it anymore.</p> <p>Since Jekyll is Ruby based we are going to use a ruby gem tabbed <a href="https://github.com/gjtorikian/html-proofer/">html-proofer</a>. Html-proofer is a writ line utility that will run a set of tests to validate your HTML output. These tests trammels if your image references are legitimate, if they have alt tags, if your internal links are working, and so on. It&rsquo;s intended to be an all-in-one checker for your output.</p> <h2 id="installation">Installation</h2> <p>You can either install the gem as part of your Gemfile or as flipside ruby gem.</p> <p>Add this line to your Gemfile</p> <pre><code>gem 'html-proofer' </code></pre> <p>and then execute</p> <pre><code>bundle </code></pre> <p>or install it yourself, just like any other ruby gems</p> <pre><code> gem install html-proofer </code></pre> <h2 id="generating-report">Generating Report</h2> <p>To generate a report unshut up the writ line and run the writ the corresponds to how you install html-proofer.</p> <h3 id="gemfile">Gemfile</h3> <pre><code>bundle exec htmlproofer ./_site/ --only-4xx </code></pre> <h3 id="ruby-gem">Ruby Gem</h3> <pre><code>htmlproofer ./_site/ --only-4xx </code></pre> <p>The --only4xx parameter whilom tell it to only reports errors for links that fall within the 4xx status lawmaking range. This would capture not found (404) and not authorized (401) errors but would ignore 500 internal server errors. The reason to ignore 500 errors is that we don&rsquo;t want validation to goof if their web server is throwing an error since we are only testing that the link went some place valid.</p> <p>You will now get a report of any wrenched links or image tags. Since html-proofer is evaluating the Jekyll output, you may need to squint at some of the include or layout file to fix links.</p> <p>Once you get the initial set of issues fixed, you will mainly have to worry well-nigh the new updates to your blog.</p> <p>Overall, this will help modernize the quality of your blog by ensuring that you fix wrenched links and images surpassing your users spot them.</p> AngularJS - Calling Filters in YourWeedyController https://digitaldrummerj.me/angular-calling-filters-in-your-controller/ Thu, 28 Jan 2016 00:00:00 +0000 https://digitaldrummerj.me/angular-calling-filters-in-your-controller/ <blockquote> <p>Note: This post applies to AngularJS. The 1.x version of Angular.</p> </blockquote> <p>Here is a quick tip for how to undeniability a filter from within yourWeedycontroller. This example assumes that you once know what a filter is and have one created.</p> <ol> <li><p>Inject $filter into your controller</p> <pre><code class="language-javascript">angular.module('sample').controller('SampleController', SampleController); /* @ngInject */ function SampleController($filter) { } </code></pre></li> <li><p>Call your filter by calling:</p> <ul> <li><strong>View</strong> undeniability your filter tabbed &ldquo;myFilter&rdquo; on myDateVariable with arguments arg1 and arg2, you would use:</li> </ul> <pre><code class="language-html">&lt;p&gt;{{myDateVariable | myfilter : arg1 : 'arg2' }}&lt;/p&gt; </code></pre> <ul> <li><strong>Controller</strong> undeniability the same filter from within your controller:</li> </ul> <pre><code class="language-javascript">function SampleController($filter) { var value = $filter(&quot;myFilter&quot;)(myDateVariable, arg1, arg2); } </code></pre></li> </ol> AngularJS - Communicating Between Parent And Child Scopes https://digitaldrummerj.me/angular-communication-between-parent-and-child-scopes/ Mon, 25 Jan 2016 00:00:00 +0000 https://digitaldrummerj.me/angular-communication-between-parent-and-child-scopes/ <blockquote> <p>Note: This post applies to AngularJS. The 1.x version of Angular.</p> </blockquote> <p>Here is a quick tip inWeedyon how to communicate between parent and child scopes.</p> <p>If you have a need to send notification of an event from a parent telescopic to a child scope, you use $scope.$broadcast to send the event.</p> <pre><code>$scope.$broadcast(&quot;parent event name&quot;, dataTo Send); </code></pre> <p>If you then need to send notification of an event from the child telescopic when to the parent telescopic you use $scope.$emit</p> <pre><code>$scope.$emit(&quot;child event name&quot;, dataTo Send); </code></pre> <p>To listen to the events regardless of if it sent from the parent or child scope, you use $scope.$on.</p> <pre><code>$scope.$on(&quot;parent event name&quot;, function(){ }); $scope.$on(&quot;child event name&quot;, function(){ }); </code></pre> AngularJS InWhoopeeBook Review https://digitaldrummerj.me/angular-in-action-book-review/ Thu, 21 Jan 2016 00:00:00 +0000 https://digitaldrummerj.me/angular-in-action-book-review/ <blockquote> <p>Note: This post applies to AngularJS. The 1.x version of Angular.</p> </blockquote> <p><img style="float: left;" src="/images/bookreviews/angular_in_action_cover.jpg"> At the <a href="http://holidayjs.com">HolidayJs</a> event I won a typesetting and I picked a reprinting of <a href="https://www.manning.com/books/angularjs-in-action">Angular In Action</a> by <a href="http://onehungrymind.com/">Lukas Ruebbelke</a>. I had once been usingWeedyfor a few projects and wasn&rsquo;t expecting to get much out of the book. Honestly I got it to use as increasingly of a requite yonder at one of my talks but figured I would at least glance through a few chapters of it first. Needless to say I ended up reading the whole typesetting and plan to alimony it.</p> <p>This typesetting is one of the weightier introductions toWeedythat I have read. Lukas does a fantastic jobs of explaining how it all works with lots of good lawmaking examples in a way that is very easy to understand. The typesetting walks you through towers a Trello clone with a pre-built backend so that you can stay focused onWeedyand not worry well-nigh the data storage.Withoutreading this typesetting and going through the lawmaking examples you will be well on your way to stuff worldly-wise to create your ownWeedyapplication.</p> <p>The typesetting starts off explaining how all of the parts ofWeedyplay together: configurations, routes, views, directives, controllers, services, and $scope. It is one of the weightier subtitle that I had read or seen.Surpassingthis typesetting I had understood how it played together unbearable to be worldly-wise to lawmaking with it but couldn&rsquo;t explain it well to others. Not anymore. If nothing else the opening installment was increasingly than worth it.</p> <p>Before diving into the details of each component, Lukas tasks well-nigh how to structure yourWeedyapplications. He covers the nuts and some worldwide weightier practices. For detailed style guides he refers you to John Papa and Todd Moto&rsquo;s style guides. I very much fathom that he didn&rsquo;t rehash their style guides.</p> <p>Next the typesetting dives into the details of each of the components. He starts with views and controllers, then discusses services and finishes off with directives. He spends a while installment on each component and the subtitle of each is extremely easy to understand. He walks through each of the sections as he is towers the sample app which really help to reinforce the concepts.</p> <p>Then we take a trip into polishing the UI with animations. At first I was thinking this is a throw yonder installment but it turned out to be a really fun chapter. Lukas did a good job of explaining how to quickly and hands create both CSS and Javascript animations. All of the lawmaking was very easy to understand and could hands be unromantic to any application. I may just have to start thinking well-nigh how to use volatility in my application.</p> <p>After animations, he jumps into how to navigate to the variegated views using routing with ngRoute. Like the rest of the book, it was a well explained installment and a good overview for how routing unquestionably works. I do wish that he had used UI router instead of ng-route since many of the projects that I have been working are using UI router but that is just me stuff greedy. ngRoute is increasingly than unbearable for the coding examples. The loading spinner tenancy was tomfool to see since this is something that every using should have to indicate something is happening to users.</p> <p>Next up is a quick trip into forms and forms validation. This installment imbricate the nuts of form validation for textboxes using required and minimum length. He covered a nice bit of the vital form validation lawmaking that you would need to know. I do wish that he would have imbricate increasingly of the Html controls such as waif downs, multiple select, checkboxes, etc.</p> <p>One increasingly tomfool thing that Lukas does is include a testing with Karma section in each of the chapters. Coming from an Agile preliminaries where I have washed-up a good value of streamlined unit tests for my projects, it was nice to see Lukas imbricate this topic. Lukas covers just unbearable to get you started on streamlined testing and shows you how easy it is to get started with it.</p> <p>Overall, I would requite this typesetting 5 out of 5 stars. If you are once anWeedydeveloper or just getting intoWeedythis is a must have book. Wish I would have had it a long time ago.Unconfinedjob Lukas.</p> <p>Link to typesetting <a href="https://www.manning.com/books/angularjs-in-action">https://www.manning.com/books/angularjs-in-action</a></p> Ionic - Stop Icons from Overlapping in Ion List https://digitaldrummerj.me/ionic-ion-item-multiple-icon-inline/ Tue, 19 Jan 2016 00:00:00 +0000 https://digitaldrummerj.me/ionic-ion-item-multiple-icon-inline/ <p>Today I ran into an issue using Ionic, where I was trying to put two icons on the right side of an ion list item. There is really easy to do with the item-icon-right css class. Unfortunately, when you have multiple icons, it overlaps instead of showing them side by side. I was not expecting this as I had only used 1 icon surpassing and unsupportable that item-icon-right would just put them side by side.</p> <p><img src="/images/ionic-ion-list-inline-icons/icons-overlapped.png" alt="Overlapped Icons" /></p> <p>Here is the lawmaking that causes the overlapped icons.</p> <pre><code>&lt;ion-list&gt; &lt;ion-item class=&quot;item item-icon-right&quot;&gt; Task 1 &lt;i class=&quot;icon ion-ios-circle-outline&quot;&gt;&lt;/i&gt; &lt;i class=&quot;icon ion-close icon-accessory&quot;&gt;&lt;/i&gt; &lt;/ion-item&gt; &lt;ion-item class=&quot;item item-icon-right&quot;&gt; Task 2 &lt;i class=&quot;icon ion-checkmark-circled&quot;&gt;&lt;/i&gt; &lt;i class=&quot;icon ion-close icon-accessory&quot;&gt;&lt;/i&gt; &lt;/ion-item&gt; &lt;/ion-list&gt; </code></pre> <p>Luckily, there is an easy fix for this using some seated Ionic css classes. We need to convert the icons into buttons, surround them with a div that has the matriculation &ldquo;buttons&rdquo; on it, and transpiration the ion-item matriculation from item-icon-right to item-button-right.</p> <p>Also, to make the buttons still squint like icons and not requite them a border, we can use the button-icon class.</p> <pre><code>&lt;ion-list&gt; &lt;ion-item class=&quot;item item-button-right&quot;&gt; Task 1 &lt;div class=&quot;buttons&quot;&gt; &lt;button class=&quot;button button-icon ion-ios-circle-outline&quot;&gt;&lt;/button&gt; &lt;button class=&quot;button button-icon ion-close icon-accessory&quot;&gt;&lt;/button&gt; &lt;/div&gt; &lt;/ion-item&gt; &lt;ion-item class=&quot;item item-button-right&quot;&gt; Task 2 &lt;div class=&quot;buttons&quot;&gt; &lt;button class=&quot;button button-icon ion-ios-circle-outline&quot;&gt;&lt;/button&gt; &lt;button class=&quot;button button-icon ion-close icon-accessory&quot;&gt;&lt;/button&gt; &lt;/div&gt; &lt;/ion-item&gt; &lt;/ion-list&gt; </code></pre> <p><img src="/images/ionic-ion-list-inline-icons/icons-not-overlapped.png" alt="Not Overlapped Icons" /></p> Preparing APrimingTalk https://digitaldrummerj.me/preparing-a-presentation/ Thu, 14 Jan 2016 00:00:00 +0000 https://digitaldrummerj.me/preparing-a-presentation/ <p>I have washed-up a tuft of priming talks and brown bag sessions this year (~45 in the past 2 years) and here is how I prepare for those talks. Sorry that the reply is a little long but I wanted to make sure you had a process to get started with. Remember that this is my process and you have to find what works weightier for you.</p> <p>There is no set time for how long each phase takes. It all depends on the presentation and the length of it. I have had talks where I spent several weeks working on it while other talks were washed-up in less than a day.</p> <p>You can see a good number of my presentations at <a href="http://slides.com/digitaldrummerj" title="http://slides.com/digitaldrummerj">Presentations by Justin</a></p> <h2 id="phase-1-brainstorming">Phase 1: Brainstorming</h2> <p>In this phrase you are spitball the spritz and content of the talk. I like using Post-In notes for this since it is very easy to move them virtually and add/remove them and I don&rsquo;t get into the rut of worrying well-nigh the content/format in powerpoint. I have moreover used mindmapping software for this but I like the low tech post-it notes better.</p> <ol> <li><p>Jot lanugo the goals for the talk.Substantiallywhat do I want attendees to walk yonder with and what am I solving for them. Do I want attendees to be excited well-nigh a new technology? Is it having lawmaking samples that they can immediately implement into their projects? Is it helping them solve a worldwide problem that I think they will run into?</p></li> <li><p>Brainstorm the main categories/themes that the talk with be split into. I try not to have increasingly increasingly than 3 categories/theme. Don&rsquo;t worry well-nigh wording here as long you know what the idea is.</p></li> <li><p>Brainstorm the content under each category/theme. Since we are using post-in notes, it is meant to be just a few words and not the whole slide of content. I don&rsquo;t have a limit on post-in notes per category. Each post-it equals 1 slide.</p></li> <li><p>Arrange the categories and content post-in notes for each category in the order that I think it would go in.</p></li> </ol> <p>At this point, the brainstorming for the overall content is washed-up and I start drafting in powerpoint.</p> <p>Also, a couple of times I have review these post-it notes with other people to get their feedback surpassing I start drafting very slides so that I can make sure that the content is something that makes sense and that I didn&rsquo;t forget anything that they would want to see.</p> <h2 id="phase-2-drafting">Phase 2: Drafting</h2> <p>Typically I move to powerpoint during this phrase but I have moreover times where I have washed-up a full outline using just OneNote surpassing moving into drafting in powerpoint.</p> <p>Using the post-it note order from phrase 1, I create a slides for each post-in note. As I create each slide I populate the content of it. I find many times as I am drafting that what I thought would be slides either go yonder or change, so that is why I create the content as I got.</p> <p>I do have a few rules I try to follow during this phrase to make sure that I don&rsquo;t get bogged lanugo in the details.</p> <ul> <li>Don&rsquo;t squint for pictures for the slides. Focus on the content first. If I want a picture I make a note on the slide of what kind of picture I am looking for and once I finalize the content I go squint for the pictures.</li> <li>Don&rsquo;t worry well-nigh the powerpoint template. Focus on the content first. If it is an Intel presentation, I normally start with the Intel template. If I am doing the presentation outside of Intel and it is not an Intel sponsored presentation, I don&rsquo;t worry well-nigh the template until later.</li> <li>Don&rsquo;t worry well-nigh the number of bullet points per slide yet. That will come during the editing phase.</li> <li>Don&rsquo;t worry well-nigh transitions or only showing 1 bullet point at a time. Those get widow during the finalizing phase.</li> </ul> <p>At this point, you should have a good start to the talks content and slide deck. Now we need to focus the content and edit the slide deck.</p> <p>Also, I normally don&rsquo;t show other people the powerpoint during this phase since I have found that they get hung up the stuff you will be doing in the editing phase instead of review the overall structure and message.</p> <h2 id="phase-3-editing">Phase 3: Editing</h2> <p>In this phrase, we need to focus and tighten up the content of the presentation.</p> <ul> <li>I edit each slide to have 3-5 single line bullet points max.</li> <li>I remove glut words to make each bullet point short and sweet.</li> <li>I make sure that I alimony the font size between 24-28 pt for each bullet. This makes it so that people in the when of the room can read the bullets with ease and makes you focus each bullet point.</li> <li>I make sure that the slide is a summary of what I want to say and not everything that I will be saying. People don&rsquo;t want to listen to you read the slide to them.</li> </ul> <p>Once the content editing is done, then I squint for images and powerpoint templates.</p> <p>Now onto the last phase where the presentation is finalized and you are ready to requite it.</p> <p>This is moreover the point that I would send out the presentation for people to review since it is substantially done.</p> <h2 id="phase-4-finalizing">Phase 4: Finalizing</h2> <p>Now it is time to put the finishing touches on the presentation.</p> <ol> <li>Add transitions between slides. Nothing crazy, just a vital fade. I have gotten feedback from multiple presenters and attendees that having nothing makes it difficult for their vision and smart-ass to move to the next slide.</li> <li>Have bullets come in 1 at a time (appear volatility in powerpoint terms). Having all of the bullets show at once normally has the effect of having people reading the slide instead of listening to you.</li> <li>Double trammels that the font is big enough</li> <li>Double trammels that the font colors have unbearable unrelatedness to be readable</li> <li>Run though the slide in presentation mode and make sure everything works as expected (transitions, bullet animations, etc). Try to stand when 5-10 feet from the monitor and make sure that you can read the presentation.</li> <li>If you are going to be giving it on a projector or TV, vaccinate it up to one and make sure that it looks rights (fonts, font size, colors, etc)</li> </ol> <p>##Phase 5: Practice</p> <p>Practice you talk out loud as much as you can. By practicing the talk out loud you will find any spots where you might stumble on words or phrases or that something doesn&rsquo;t make sense said out loud.</p> <p>If you are going to use a slide advancer, make sure to practice with it. I strongly recommend a slide advancer if you don&rsquo;t have one. Not having to run when to the palmtop to go to the next slide or hunting for the page lanugo makes your presentation smoother. I have the Logitech R400 slide advancer, <a href="http://www.amazon.com/Logitech-910-001354-Wireless-Presenter-R400/dp/B002GHBUTK/ref=sr_1_1?s=pc&amp;ie=UTF8&amp;qid=1449186602&amp;sr=1-1&amp;keywords=logitech+slide+advancer" title="http://www.amazon.com/Logitech-910-001354-Wireless-Presenter-R400/dp/B002GHBUTK/ref=sr_1_1?s=pc&amp;ie=UTF8&amp;qid=1449186602&amp;sr=1-1&amp;keywords=logitech+slide+advancer">http://www.amazon.com/Logitech-910-001354-Wireless-Presenter-R400/dp/B002GHBUTK/ref=sr_1_1?s=pc&amp;ie=UTF8&amp;qid=1449186602&amp;s…</a></p> <p>If giving the talk outside of an Intel facility, plan for slow network connections or no internet at all unless you tether to your phone. If you plan to tether to your phone make sure to test it out increasingly than once to make sure it works. If you are going to be downloading anything, make sure to have an once downloaded reprinting in specimen you do have no internet.</p> <p>If you are doing any kind of demos, have a one click reset button.</p> <p>If giving the talk outside of Intel, make sure to have replacement copies of your slides, demos, etc on either a usb momentum just in specimen something happens with your computer and you are worldly-wise to find a someone that can loan you one that you might have a endangerment to still requite the talk that you would have from your laptop.</p> <h2 id="phase-6-giving-the-talk">Phase 6: Giving the Talk</h2> <p>Now is the fun part, giving the very talk. Remember to vapor and that everyone in the regulars is rooting for you to do well. If you have washed-up all of the prep work then you will be worldly-wise to work through anything that comes up.</p> <ol> <li>If the content is something that you can requite out, have your material misogynist online for people to have as soon as you are washed-up with your talk.</li> <li>If you are asked a question that you don&rsquo;t know the wordplay to, don&rsquo;t be wrung to say you have not squint what they are asking or that you are not sure and can get when to them later with an answer.</li> <li>Make sure to have a water snifter with you. Beside your throat getting horse, it is a unconfined way to add a pause into the talk without it feeling worrisome to you.</li> <li>Make sure to pace yourself and not rush. It is extremely easy to rush through a talk and finish in half the time.</li> </ol> AngularJS - Calling Service Methods fromPanelhttps://digitaldrummerj.me/angular-running-service-in-console/ Mon, 11 Jan 2016 00:00:00 +0000 https://digitaldrummerj.me/angular-running-service-in-console/ <blockquote> <p>Note: This post applies to AngularJS. The 1.x version of Angular.</p> </blockquote> <p>Here is a quick tip for how you can run yourWeedyservice and factory methods within the Chrome Dev Tools console. No longer will you have to go through the process of navigating through the UI to trigger a Service/Factory method to run. Now you can just load up the web site and do all of your debugging through the Chrome console.</p> <p>If your service/factory was tabbed &ldquo;YourFactory&rdquo; and the ng-app symbol is on the soul tag, you can get a reference to the &ldquo;YourFactory&rdquo; with the pursuit line in the console.</p> <pre><code>var t = angular.element(document.querySelector('body')).injector().get('YourFactory'); </code></pre> <p>After you have the reference, then you can undeniability any method that is exposed by the &ldquo;YourFactory&rdquo; service such calling the method &ldquo;myServiceMethod&rdquo; and using the returned promise from the method.</p> <pre><code>t.myServiceMethod().then(function(response) { console.log(response); }); </code></pre> <p>Now you can quickly debug your service/factory.</p> 2015 Year In Review https://digitaldrummerj.me/year-in-review/ Thu, 31 Dec 2015 00:00:00 +0000 https://digitaldrummerj.me/year-in-review/ <p>2015 was a unconfined year with lots of new adventures. I did a tuft of travelling, started a new position at work, competed in my first hackathon (and win), and started a couple of meetups. At the whence of 2015 I set a few goals for myself:</p> <ol> <li>Speak at increasingly events</li> <li>Start blogging again</li> <li>Be increasingly zippy in my local dev community</li> </ol> <h2 id="speaking">Speaking</h2> <p>I spoke at a good value of events this year considering this was my first year putting myself out there. I found that I really love presenting and helping people.</p> <p>I presented 32 talks between 20 events. I found that I moreover don&rsquo;t mind presenting a tuft of talks at a single event. In fact I like presenting increasingly than 1 talk events.</p> <ul> <li>10 User Groups / Meetups</li> <li>5 Conferences</li> <li>4LawmakingCamps</li> <li>1 podcast</li> </ul> <p>It was wondrous meeting all of the variegated people. Many of whom I worshiped as speakers and developers. It was nonflexible to believe that I was presenting at the same event that they were.</p> <p>Thank you to those that attended my talks. I couldn&rsquo;t do it without you.</p> <p>Thank you as well to those that provided me feedback and helped me wilt a largest speaker.</p> <p>I plane got to fulfill a long time dream of stuff on the <a href="http://dotnetrocks.com">.Net Rocks podcast</a>. I never imagined I would be on the podcast and it was a total out of the undecorous thing. I got introduced to Carl and Richard at <a href="http://nebraskacode.com">Nebraska Code</a>. Then I saw Richard then at <a href="http://anglebrackets.org">Angle Brackets</a> where I was an attendee and I mentioned to him that one of my goals is to speak at the conference. As we got to talking well-nigh potential talks, he said my Vagrant talk would be a unconfined podcast episode. Luckily for me, we were both going to be at NDC Oslo and he was just starting planning the NDC episodes. You can listen to me on <a href="https://www.dotnetrocks.com/?show=1158">episode 1158 </a>.</p> <p>As well you can see all my presentations at <a href="http://digitaldrummerj.me/speaking">http://digitaldrummerj.me/speaking/</a></p> <h3 id="speaking-goals-for-2016">Speaking Goals for 2016</h3> <ul> <li>Submit to increasingly conferences. Want to put speak at increasingly but since it is CFP for them the selection part is out of my control.</li> <li>Complete my Pluralsight hearing and hopefully a course</li> <li>Come up with at least 1 new talk</li> <li>Turn my net promoter feedback system into an very application.</li> </ul> <h2 id="blogging">Blogging</h2> <p>I had tried blogging in the past and it never lasted increasingly than a few post. Well, not this time. In January, I created <a href="http://digitaldrummerj.me">http://digitaldrummerj.me </a>.</p> <p>This year I wrote 50 posts with 54,000 page views. For my first year blogging, overall I consider it a success.</p> <p>I used Jekyll for the blog engine and hosted it on Github Page. It was a lot of fun using Jekyll and creating the layout and theme for my blog. I could have hands went with WordPress or one of the canned solutions but I took it as an opportunity to sharpen my html and css skills as well as learn some new things like using Jekyll, and integrating Google Analytics and Disqus.</p> <p>I plane redid the theme for the blog in the middle of the year which was an venture in itself. However, I don&rsquo;t plan on doing this very often as it took a lot of time yonder from writing blog post. I am much happier though with the new theme, so the time was at least worth it.</p> <p>I moreover figured out how to use Zapier to create a scheduling engine for the blog using Google Calendar and Github Pull Request. Since Jekyll is a static site generator it does not have admin functions like scheduling. It was one of the things that I did miss compared to other blogging engines. Since using Zapier for this, I have used it as well as <a href="http://ifttt.com">IFTTT</a> to automate a few things.</p> <p>It was moreover fun figuring out how in Jekyll to hands create a series post and get a listing of all of the post for the series in order. Originally I did this by hand but that got old quickly. Now I just have to add a series tag to the front matter and it does it for me. This was important toe since several of the topics I was writing on were too big for a single blog post.</p> <p>I have a whole series of blog post detailing out setting up Jekyll, integrating Disqus and Google Analytics, creating series, plus several other ones. View the series at <a href="http://digitaldrummerj.me/blogging-on-github-part-1-Getting-Started/">http://digitaldrummerj.me/blogging-on-github-part-1-Getting-Started/</a></p> <h3 id="blogging-goals-for-2016">Blogging Goals for 2016</h3> <ul> <li>Double the number of post</li> <li>Stick to the schedule of post in Trello</li> <li>Write every day plane if it is just 10 minutes</li> <li>Submit to be a guest blogger on at least one popular blog</li> <li>Get superiority in my completed post so everything is not last minute. Be nice to have at least 2 post scheduled at all times.<br /></li> </ul> <h2 id="dev-community">Dev Community</h2> <p>I have been part of various user groups over the years but was never part of the organizing committee nor did I requite when as much as I wanted to.</p> <p>This year I decided to transpiration that. I am now running 2 meetups, mentored at some events, and am on the planning comittee for a couple events.</p> <h3 id="phoenix-version-control-meetup">Phoenix VersionTenancyMeetup</h3> <p>Right without I started using Jekyll and Github Pages, what is now the Phoenix VersionTenancymeetup was started and I was asked if I wanted to be a co-organizer. Originally it started as a Github Pages group but quickly reverted to increasingly well-nigh version tenancy with a focus on Github.</p> <p>This was my first wits organizing a meetup and it had been a unconfined learning experience. This group has struggled a bit to get going but we have a monthly meeting with well-nigh 10 people peekaboo regularly. Not sure what 2016 will bring for this group.</p> <h3 id="ionic-arizona-meetup">Ionic Arizona Meetup</h3> <p>Then virtually August of this year I saw on meetup that Michael Iglesias was starting an Ionic Arizona meetup. I had moreover been thinking well-nigh starting one as well, so I sent a message to Michael offering to present at one of the meetings and asking if he needed a co-organizer. He graciously wonted both offers.</p> <p>After some searching for a venue, we held our first meeting at the end of September with well-nigh 30 people attending. Since then we have had 3 increasingly meetings with 20-25 people at each meeting.</p> <p>For 2016, we once have a unconfined set of talks for the first half of the year scheduled. We are doing &ldquo;Releasing Your to the App Stores&rdquo; in January, &ldquo;IoT with Octoblu and Ionic&rdquo; in February, &ldquo;Database as a Service with Backand&rdquo; in March, &ldquo;ionic 2 and weedy 2&rdquo; in April and &ldquo;An Ionic Showcase of thing members have built with Ionic&rdquo; in May. If you would like to speak at one of the meetings, please let me know.</p> <p>In December, I moreover registered <a href="http://ionic-az.org">ionic-az.org</a>, created a Twitter worth (<a href="http://twitter.com/ionic_az">@ionic_az</a>), created email finance using <a href="http://zoho.com">Zoho</a>, and created a newsletter for the group.</p> <p>The reason for the newsletter is to be worldly-wise to share all of the unconfined Ionic wares that I run wideness without spamming the group with a ton of messages. The first newsletter went out the week of Christmas and the next one is ready and will be going out next week. The newsletter will be bi-weekly.Squintfor a blog post soon on how I created the newsletter using a combination of a tuft of tools to automate most of the work.</p> <p>We have moreover been work nonflexible to get sponsorship for the group. So far we have a venue/food sponsor in <a href="http://www.integrate.com">Integrate</a> and <a href="http://jetbrains.com">JetBrains</a> has been gracious unbearable to requite a self-ruling license each month for an idea of the winners choice.</p> <p>The one not so unconfined part of the Ionic Az group is that my co-leader, Michael, moved out of Phoenix and when to the East Coast. We worked well together and it was a pleasure running the group with him. I will be standing the group and am looking for a co-leader.</p> <h3 id="conference-planning">Conference Planning</h3> <p>I have moreover joined the planning comittee for an AgilePrimingin Portland that is scheduled for April and I will be helping with the planning for DesertLawmakingCamp in Phoenix.</p> <h3 id="mentoring">Mentoring</h3> <p>I moreover helped out as a mentor at the Chandler Startup weekend. Was moreover suppose to mentor at She Hacks AZ but that event got cancelled. It was fun doing the mentoring and stuff on that side of the process.</p> <h3 id="community-goals">Community Goals</h3> <ul> <li>Continue to grow Ionic AZ attendance.</li> <li>Grow Ionic AZ to where I do not have to present a topic at each meeting</li> <li>Continue to build my polity network.</li> <li>Figuring out to organize increasingly workshops locally on various topics.<br /></li> </ul> <h2 id="wrapping-up">Wrapping up</h2> <p>Well this post turn out way longer than I thought it would be. Guess I did a lot increasingly in 2015 than I realized. Every time I thought I was washed-up I remembered something else. 2015 was a unconfined year and I am looking forward to 2016.</p> <p>To start 2016 I am running an <a href="https://www.eventbrite.com/e/use-your-existing-web-skills-to-create-native-mobile-applications-tickets-19830200664">Ionic Workshop</a> on January 16th at Gangplank Chandler, will be speaking at the Javascript Summit VirtualPrimingin February and in March will be running an <a href="http://conferences.oreilly.com/fluent/javascript-html-us/public/schedule/speaker/219565">Ionic workshop</a> at O&rsquo;Reilly Fluent Conf.</p> <p>If you see me out at any events, come up and say hi.</p> <p>Looking forward to seeing everyone in 2016.</p> Ionic - Using Local Notifications https://digitaldrummerj.me/ionic-local-notification/ Tue, 01 Dec 2015 00:00:00 +0000 https://digitaldrummerj.me/ionic-local-notification/ <p>When you are creating a mobile applications there are times where you need to notify users well-nigh something such as an upcoming appointment. If the using is running and the user is using it in the foreground, this is easy to accomplish. However, if the using is running in the preliminaries this can be a challenging task. You could do push notifications but that takes a decent value of work to setup with both iOS and Android app stores. If all you need to do is zestful them on their local device you can just use the cordova local notification plugin and skip the headache of setting up push notifications.</p> <p>In this post we will walk you through creating an ionic using that uses the <a href="http://ngcordova.com/docs/plugins/localNotification/">ngCordova local notification plugin</a>.</p> <h2 id="environment-setup">Environment Setup</h2> <p>Before we get started, we need to make sure that you have your minutiae environment configured with either an emulator or physical device as the local notification only works on a device and not a web browser. If you have once configured the Ionic Framework and an emulator/physical device, you can skip this section.</p> <p>Make sure that you meet these requirements:</p> <ul> <li>Android environment configured - <ul> <li>Java 7+</li> <li>Android SDK</li> <li>Android Studio</li> <li>Either emulator, genymotion, or physical device</li> </ul></li> <li>iOS environment configured (if on a MAC) <ul> <li>XCode</li> <li>Either iOS Simulator or Device</li> <li>XCodeWritLine Tools<br /></li> </ul></li> <li>nodejs</li> <li>ionic</li> <li>cordova</li> <li>gulp</li> <li>bower</li> </ul> <p>You can refer to the pursuit wares to configure your environment:</p> <ol> <li><a href="/images/IonicLocalNotifications/Ionic-Setup-Windows">Setup Ionic on Windows</a></li> <li><a href="/images/IonicLocalNotifications/ionic-setup-osx/">Setup Ionic on Mac</a></li> </ol> <h2 id="creating-project">Creating Project</h2> <p>The first thing we need to do is create a new ionic project that we will use to test the local notifications.</p> <pre><code>ionic start ionic-local-notifications zippo cd ionic-local-notifications </code></pre> <p>Now we need to add the platforms to the ionic using since we need to deploy to a device in order for the local notifications to work. It will not work correctly in the browser.</p> <p>To add the android platform:</p> <pre><code>ionic platform add android </code></pre> <p>To add the iOS platform (for Mac users):</p> <pre><code>ionic platform add ios </code></pre> <p>Remember, if you’re not using a Mac, you cannot build for the iOS platform.</p> <h2 id="install-ngcordova">Install ngCordova</h2> <p>ngCordova is a hodgepodge of 70+ AngularJS extensions on top of the Cordova API that make it easy to build, test, and deploy Cordova mobile apps with AngularJS. These extensions indulge us to interact with device features such as the camera, shower status, and geolocation.</p> <p>To install ngCordova run:</p> <pre><code>bower install ngCordova --save </code></pre> <p>Include ng-cordova.js or ng-cordova.min.js in your www\index.html file surpassing cordova.js and without your AngularJS / Ionic file.</p> <pre><code>&lt;script src=&quot;lib/ionic/js/ionic.bundle.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;lib/ngCordova/dist/ng-cordova.min.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;cordova.js&quot;&gt;&lt;/script&gt; </code></pre> <h2 id="install-the-local-notification-plugin">Install the local notification plugin</h2> <p>To install the plugin run:</p> <pre><code>ionic plugin add https://github.com/katzer/cordova-plugin-local-notifications.git </code></pre> <p>If you unshut up the package.json file, you will see the local notification plugin add withal with the other cordova plugins.</p> <pre><code>&quot;cordovaPlugins&quot;: [ { &quot;locator&quot;: &quot;https://github.com/katzer/cordova-plugin-local-notifications.git&quot;, &quot;id&quot;: &quot;de.appplant.cordova.plugin.local-notification&quot; } ] </code></pre> <h2 id="add-ngcordova-as-a-dependency">Add ngCordova as a dependency</h2> <p>Open up the www/js/app.js file and inject ngCordova into the module</p> <p>angular.module(&lsquo;starter&rsquo;, [&lsquo;ionic&rsquo;, &lsquo;ngCordova&rsquo;])</p> <h2 id="creating-a-new-controller">Creating a New Controller</h2> <p>We need to create anWeedycontroller that the UI will interact with. At the marrow of the www/js/app.js file add the following</p> <pre><code>.controller('SampleController', function($scope, $cordovaLocalNotification) { }); </code></pre> <p>Now we need to tell the UI what the controller is.Unshutup the www/index.html page and add the controller to the ion-content.</p> <pre><code>&lt;ion-pane&gt; &lt;ion-header-bar class=&quot;bar-stable&quot;&gt; &lt;h1 class=&quot;title&quot;&gt;Local Notification Sample&lt;/h1&gt; &lt;/ion-header-bar&gt; &lt;ion-content ng-controller=&quot;SampleController&quot;&gt; &lt;/ion-content&gt; &lt;/ion-pane&gt; </code></pre> <h2 id="adding-functions-to-create-notifications">Adding Functions to Create Notifications</h2> <p>Within the SampleController, we need to add all of the functions to do the scheduling of the notifications.</p> <p>All of the local notification functions should be contained within an ionic platform ready function and inside of a trammels that makes sure we are running in a WebView on a device. This will at least indulge us to see the UI in the browser without error, it just won&rsquo;t run any of the local notification function unless on a WebView.</p> <pre><code>$ionicPlatform.ready(function () { if (ionic.Platform.isWebView()) { } }) </code></pre> <p>Make sure to inject $ionicPlatform into the SampleController</p> <pre><code>.controller('SampleController', function($scope, $cordovaLocalNotification, $ionicPlatform) { }); </code></pre> <h3 id="instant-notification">Instant Notification</h3> <p>To schedule an firsthand notification, add the pursuit function within the ionicPlatform.ready function</p> <pre><code>$scope.scheduleInstantNotification = function () { $cordovaLocalNotification.schedule({ id: 1, text: 'Instant Notification', title: 'Instant' }).then(function () { alert(&quot;Instant Notification set&quot;); }); }; </code></pre> <p>In the www/index.html page within the ion-content, add a sawed-off and set the ng-click to undeniability the scheduleInstantNotification function.</p> <pre><code>&lt;button class=&quot;button&quot; ng-click=&quot;scheduleInstantNotification()&quot;&gt; Instant &lt;/button&gt; </code></pre> <h3 id="notification-x-seconds-from-now">Notification X Seconds from Now</h3> <p>To schedule a notification 5 seconds from now, add the pursuit function within the ionicPlatform.ready function.</p> <p>The difference between this function and the firsthand notification is the stage property is stuff set.</p> <pre><code>$scope.scheduleNotificationFiveSecondsFromNow = function () { var now = new Date().getTime(); var _5SecondsFromNow = new Date(now + 5000); $cordovaLocalNotification.schedule({ id: 2, date: _5SecondsFromNow, text: 'NotificationWithout5 Seconds Has Been Triggered', title: 'After 5 Seconds' }).then(function () { alert(&quot;NotificationWithout5 seconds set&quot;); }); }; </code></pre> <p>In the www/index.html page within the ion-content, add a sawed-off and set the ng-click to undeniability the scheduleNotificationFiveSecondsFromNow function.</p> <pre><code>&lt;button class=&quot;button&quot; ng-click=&quot;scheduleNotificationFiveSecondsFromNow()&quot;&gt; In 5 Sec &lt;/button&gt; </code></pre> <h3 id="notification-every-minute">Notification Every Minute</h3> <p>To schedule a notification every minute, add the pursuit function within the ionicPlatform.ready function</p> <pre><code>$scope.scheduleEveryMinuteNotification = function () { $cordovaLocalNotification.schedule({ id: 3, title: 'Every Minute', text: 'Give a real message', every: 'minute' }).then(function (result) { console.log('Every Minute Notification Set'); }); }; </code></pre> <p>Note: The every options possible values are second, minute, hour, day, week, month, or year.</p> <p>In the www/index.html page within the ion-content, add a sawed-off and set the ng-click to undeniability the scheduleEveryMinuteNotification function.</p> <pre><code>&lt;button class=&quot;button&quot; ng-click=&quot;scheduleEveryMinuteNotification()&quot;&gt; Every Minute &lt;/button&gt; </code></pre> <h3 id="update-notification-text">Update Notification Text</h3> <p>To update a the every minute notification, add the pursuit function within the ionicPlatform.ready function. You moreover need to trammels that the notification is scheduled surpassing trying to update it. This functions requires that you clicked on the Every Minute sawed-off to schedule the every minute notification.</p> <pre><code>$scope.updateNotificationText = function () { $cordovaLocalNotification.isPresent(3).then(function (present) { if (present) { $cordovaLocalNotification.update({ id: 3, title: 'Notificaton Update', text: 'Notification Update Details' }).then(function (result) { console.log('Updated Notification Text'); }); } else { alert(&quot;Must Schedule Every Minute First&quot;); } }); }; </code></pre> <p>In the www/index.html page within the ion-content, add a sawed-off and set the ng-click to undeniability the updateNotification function.</p> <pre><code>&lt;button class=&quot;button&quot; ng-click=&quot;updateNotificationText()&quot;&gt; Update Text for Every Minute &lt;/button&gt; </code></pre> <h3 id="update-notification-interval">Update Notification Interval</h3> <p>To update a the every minute notification to be scheduled every second, add the pursuit function within the ionicPlatform.ready function. You moreover need to trammels that the notification is scheduled surpassing trying to update it. This functions requires that you clicked on the Every Minute sawed-off to schedule the every minute notification.</p> <pre><code>$scope.updateNotificationEvery = function () { $cordovaLocalNotification.isPresent(3).then(function (present) { if (present) { $cordovaLocalNotification.update({ id: 3, title: 'Notification Update', text: 'Every Minute transpiration to second', every: 'second' }).then(function (result) { console.log('Updated Notification Every'); }); } else { alert(&quot;Must Schedule Every Minute First&quot;); } }); }; </code></pre> <p>In the www/index.html page within the ion-content, add a sawed-off and set the ng-click to undeniability the updateNotification function.</p> <pre><code>&lt;button class=&quot;button button-block button-positive&quot; ng-click=&quot;updateNotificationEvery()&quot;&gt; Update Every Min to Second &lt;/button&gt; </code></pre> <h3 id="cancel-notification">Cancel Notification</h3> <p>To cancel a notification, add the pursuit function within the ionicPlatform.ready function. You moreover need to trammels that the notification is scheduled surpassing trying to cancel it. This functions requires that you clicked on the Every Minute sawed-off to schedule the every minute notification.</p> <pre><code>$scope.cancelNotification = function () { $cordovaLocalNotification.isPresent(3).then(function (present) { if (present) { $cordovaLocalNotification.cancel(3).then(function (result) { console.log('Notification EveryMinute Cancelled'); alert('Cancelled Every Minute'); }); } else { alert(&quot;Must Schedule Every Minute First&quot;); } }); }; </code></pre> <p>In the www/index.html page within the ion-content, add a sawed-off and set the ng-click to undeniability the cancelNotification function.</p> <pre><code>&lt;button class=&quot;button&quot; ng-click=&quot;cancelNotification()&quot;&gt; Cancel Every Minute &lt;/button&gt; </code></pre> <h2 id="deploy-to-device">Deploy to Device</h2> <p>In order for the local notifications to work, you need to deploy the using to a device or an emulator. It will not work correctly in the browser.</p> <p>Note: You can only compile and deploy ios using on a Mac.</p> <p>Android:</p> <pre><code>$ ionic run android </code></pre> <p>iOS:</p> <pre><code>$ionic run ios </code></pre> <p>Note: You may need to pass in --device to the writ to get it to run on a device vs an emulator.</p> <h2 id="wrap-up">Wrap-up</h2> <p>Local notifications are a unconfined option for stuff worldly-wise to zestful a user to something in your application. As you saw it only took a few lines of lawmaking to enable them. This vendible touched on the vital but there is increasingly that you can do with local notifications. You can interact with multiple notifications at once for scheduling, updating, and cancelling. You can pass spare data into each notification that you can then use when the notification is trigger. On the rootscope you can listen for notifications to be scheduled, tiggered, updated or cancelled.</p> <p>Source lawmaking for this vendible is misogynist at <a href="https://github.com/digitaldrummerj-ionic/ionic-local-notifications-sample">https://github.com/digitaldrummerj-ionic/ionic-local-notifications-sample</a>.</p> Running Gulp Task in Visual Studio https://digitaldrummerj.me/running-gulp-task-in-visual-studio/ Sun, 15 Nov 2015 00:00:00 +0000 https://digitaldrummerj.me/running-gulp-task-in-visual-studio/ <p>When I am working in an lawmaking editor such as Visual Studio, I do not want to have to have to leave the editor to run writ line programs such as Gulp task. I want to be worldly-wise to run the gulp task right from instead the editor. Starting with Visual Studio 2013, you could do this with the <a href="https://visualstudiogallery.msdn.microsoft.com/8e1b4368-4afb-467a-bc13-9650572db708">Task Runner Explorer extension</a>. Microsoft then integrated the Task Runner Explorer into Visual Studio 2015 so you no longer have to install an extension.</p> <p>In this post, we will squint at how to run your Gulp task within Visual Studio and then how to integrate them into the Visual Studio build process.</p> <h2 id="code-for-this-tutorial">Code for this tutorial</h2> <p>The sample lawmaking for this tutorial is misogynist at <a href="https://github.com/digitaldrummerj/pluralsight-audition">https://github.com/digitaldrummerj/pluralsight-audition</a>.</p> <h2 id="pulling-up-the-task-runner-explorer">Pulling up the Task Runner Explorer</h2> <p>You can get to the task runner explorer, by going under the View Menu, selecting Other Windows, and then selecting the Task Runner Explorer.<br /> <img src="/images/GulpInVisualStudio/TaskRunnerExplorer_FindInMenu.png" alt="Open Task Runner Explorer" /></p> <p>When the Task Runner Explorer opens it will pull up all of the task from gulpfile.js that is in the root directory of the project.</p> <p><img src="/images/GulpInVisualStudio/TaskRunnerExplorer.png" alt="Task Runner Explorer Initial View" /></p> <p>In this specimen it shows the 5 task that are misogynist in the gulpfile.js</p> <ul> <li>default</li> <li>clean</li> <li>inject</li> <li>release</li> <li>watch</li> </ul> <h2 id="running-a-task">Running a Task</h2> <p>After the task is opened up, to run a task, right-click on it and select the run option.</p> <p><img src="/images/GulpInVisualStudio/TaskRunnerExplorer_TaskRun_RightClickMenu.png" alt="Running a Task" /></p> <p>When a task it run, it will unshut up a tab in the Task Runner explorer and show the results of the gulp task</p> <p>For the demo, we have right-clicked on the default task and selected the run option.</p> <p><img src="/images/GulpInVisualStudio/TaskRunnerExplorer_TaskRun.png" alt="Results of Task Run" /></p> <h2 id="integrating-into-visual-studio-build-process">Integrating into Visual Studio Build Process</h2> <p>Manually running a task is nice but it is plane largest if you can integrate it into the Visual Studio build process. Luckily the Task Runner Explorer, requite you just that option. If you right-click on a task and select Bindings, you can see the options.</p> <p><img src="/images/GulpInVisualStudio/TaskRunnerExplorer_BuildBindings.png" alt="Task Build Options" /></p> <p>There are 4 bindings options:</p> <ul> <li>Before Build - task will run surpassing the Visual Studio build.</li> <li>After Build - task will run without the Visual Studio Build.</li> <li>Clean - task will run when the project is cleaned.</li> <li>ProjectUnshut- task will run when the project is opened.</li> </ul> <p>For this example, we are going to set the &ldquo;Before Build&rdquo; tightness for the default task. Right-click on the default task, select Bindings, and thenSurpassingBuild.</p> <p>When you set the binding, 2 things happened in the Task Runner Explorer:</p> <ol> <li>The default task now shows up in the Bindings tab under theSurpassingBuild secton.<br /></li> <li><p>If you right-click on the default task and select tightness there will be a checkmark next to the &ldquo;Before Build&rdquo; to indicate that it is set for this task.</p> <p><img src="/images/GulpInVisualStudio/TaskRunnerExplorer_BindingSetForBeforeBuild.png" alt="Before Build Binding" /></p></li> </ol> <p>Also, if you unshut up the gulpfile.js, you will notice that the first line now has a scuttlebutt with the bindings in it.</p> <p><img src="/images/GulpInVisualStudio/TaskRunnerExplorer_GulpfileWithBeforeBuildSet.png" alt="Gulpfile with BeforeBuild set" /></p> <h2 id="wrap-up">Wrap-up</h2> <p>Now as a Visual Studio user, you kow how to run your gulp task without leaving Visual Studio and how to integrate it into the Visual Studio build process.</p> Strongloop - Fixing Security When Extending User Model https://digitaldrummerj.me/strongloop-extending-user-model-security/ Fri, 30 Oct 2015 00:00:00 +0000 https://digitaldrummerj.me/strongloop-extending-user-model-security/ <p>After pursuit Raymond Camden&rsquo;s <a href="http://www.raymondcamden.com/tags/strongloop/">Strongloop Introduction</a>, I was ready to update the <a href="https://github.com/Ionic-AZ/Todo-Lab1-LocalStorage">todo demo application</a> that I have been using for the <a href="http://meetup.com/ionic-az">Ionic Arizona Meetup</a>. So I created a models for projects and app users. The app users model wiring matriculation was User. Then within the project model I associated a project to an app users with a belongsTo and in the app users model I associated multiple projects to a single user with a hasMany. At this point, when I examined the API explorer I could see that it can me a rest endpoint to get the projects associated to a user. However, I ran into an issue with getting 401 Unauthorized errors when I tried to query any of the rest endpoints to get the projects associated to the user.</p> <p>I could not find anything in the Strongloop docs that told me how to get virtually the 401 errors or what was causing them except that the ACL security was causing the issue and that I should be worldly-wise to set the ACL security for appuser. However, without much research, it turns out that the seated user model has security (ACL) on it to restrict everyone from stuff worldly-wise to query the user endpoints that do not have an explictly specified security setup. This is unconfined except for the fact that plane if you add spare ACLs in your extended user model the default security has once denied the user surpassing it gets to the security you setup.</p> <p>You can view the default security by navigating to your strongloop project directory and looking in the node_modules\loopback\common\models\user.json file. You can see looking at the ACL list that the first item in the list is to DENY $everyone</p> <pre><code> { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;DENY&quot; } </code></pre> <p>The way Strongloop orders the ACLs is that it starts at the marrow of the ACL list and reads it to the top. Since we are extending the user class, the DENY $everyone will come surpassing our specified ACL. Strongloop strongly suggest that you do not modify the seated user class, so then how do we indulge users to query our spare endpoints?</p> <p>When you generate a model there is an twin file for each model in the common\models directory, that has a .js extension to write custom lawmaking to add spare functionality to the model. For example if your model is tabbed appuser, you will see two files: appuser.json and appuser.js.</p> <p>Go superiority and unshut up the .js extension for your model. You will the pursuit lawmaking where Appuser is your model&rsquo;s name.</p> <pre><code>module.exports = function(Appuser) { }; </code></pre> <p>The first thing to do is well-spoken out the existing security for the model</p> <p>Appuser.settings.acls.length = 0;</p> <p>Next we need to create a file in the models directory to hold the ACL for the model. My file naming institute is to add &ldquo;acl&rdquo; without the model name like so [Your Model]acl.json, ex: appuseracl.json</p> <p>To ensure that you do not lose any of the default security, reprinting the ACLs json from the node_modules\loopback\common\model\user.json file</p> <pre><code>&quot;acls&quot;: [ { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principal&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;DENY&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;create&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$owner&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;deleteById&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;login&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;logout&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$owner&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;findById&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$owner&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;updateAttributes&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;confirm&quot; }, { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;resetPassword&quot;, &quot;accessType&quot;: &quot;EXECUTE&quot; } ] </code></pre> <p>Now that the ACL configuration is setup, you need to tell Strongloop to load it by add the pursuit line to the [Your Model].js file</p> <pre><code>Appuser.settings.acls = require('./appuseracl.json'); </code></pre> <p>If you test your rest endpoints, at this point you will have the security as your started with.</p> <p>To add the security for your widow endpoints, add them surpassing the DENY everyone configuration that is at the top of the ACL list.</p> <pre><code> { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$everyone&quot;, &quot;permission&quot;: &quot;DENY&quot; } </code></pre> <p>For example here is the ACL for my app users model to get the list of projects associated to that user.</p> <pre><code> { &quot;principalType&quot;: &quot;ROLE&quot;, &quot;principalId&quot;: &quot;$owner&quot;, &quot;permission&quot;: &quot;ALLOW&quot;, &quot;property&quot;: &quot;__get__projects&quot; } </code></pre> <p>If you test your rest endpoints again, you will be worldly-wise to successfully undeniability the endpoints that were widow when you associated projects to a user in your user model.</p> Installing Gulp 4.x https://digitaldrummerj.me/installing-gulp-4/ Thu, 29 Oct 2015 00:00:00 +0000 https://digitaldrummerj.me/installing-gulp-4/ <p>Gulp 4 is not released yet but if you have a need to install it here is how to do it. I will imbricate how to globally install it as well as how to update your package.json for your projects.</p> <h2 id="globally-installing-gulp">Globally Installing Gulp</h2> <p>The first thing we need to do is install the Gulp writ line to be worldly-wise to run the gulp task.</p> <ol> <li>Open aWritPrompt (Windows) or Terminal (Mac or Linux)</li> <li><p>Check if you have Gulp CLI &lt; 1.2.1 installed</p> <pre><code>$ gulp -v </code></pre></li> <li><p>If a Gulp version is &lt; 1.2.1, you will need to upgrade by running the pursuit commands</p> <pre><code>$ npm install -g gulp-cli </code></pre></li> <li><p>Verify Gulp CLI 1.2.1 installed correctly</p> <pre><code>$ gulp -v </code></pre></li> </ol> <h2 id="updating-your-projects-package-son">Updating Your Projects package.son</h2> <p>Now we need to tell our project to use Gulp 4.0 when it runs the gulp task.</p> <p>If you using a previous version of Gulp in your package.json file, you can upgrade it if you would like or protract to use Gulp 3.x. I have not had any issue with leaving my local repository at 3.9 while having Gulp 4 installed globally.</p> <ol> <li>Open aWritPrompt (Windows) or Terminal (Mac or Linux)</li> <li>Navigate to the directory that contains your package.json</li> <li><p>Uninstall gulp. <strong>Note:</strong> If your package.json has gulp listed as a dev dependency use --save-dev. If gulp is listed as a dependency use --save.</p> <pre><code>$ npm uninstall gulp --save-dev $ npm install git+https://git@github.com/gulpjs/gulp.git#4.0 --save-dev OR $ npm uninstall gulp --save $ npm install git+https://git@github.com/gulpjs/gulp.git#4.0 --save </code></pre></li> </ol> <h2 id="wrap-up">Wrap-up</h2> <p>You can alimony up to stage on Gulp 4 at <a href="https://github.com/gulpjs/gulp/tree/4.0">https://github.com/gulpjs/gulp/tree/4.0</a> and <a href="https://twitter.com/gulpjs?lang=en">https://twitter.com/gulpjs?lang=en</a></p> Sync your Git Fork to the Original Repo https://digitaldrummerj.me/git-sync-fork-to-master/ Tue, 27 Oct 2015 00:00:00 +0000 https://digitaldrummerj.me/git-sync-fork-to-master/ <p>Syncing your forked repository to the original repository is an important step surpassing submitting any pull request to the original repository for the changes in your forked repository.Planeif you are not going to submit a pull request to the original repository, there are times that you want the spare features and/or bug fixes that have been washed-up since you forked the original repository.</p> <p>You could do a pull request but this adds an spare commit into your forked repository instead of making your forked repository match the original repository. In order to sync the forked repository without subtracting any spare commits as part of the process you need to configure the original repository as an upstream remote, merge in the changes from the original repository and then push the merged version when to Github.</p> <h2 id="adding-original-repo-as-an-upstream-repo">Adding Original Repo As an Upstream Repo</h2> <p>In order to pull the changes from the original repository into your forked version, you need to add the original git repo as an upstream repository.</p> <ol> <li>Open aWritPrompt (Windows) or Terminal (Mac or Linux)</li> <li>Navigate to the directory that contains your forked repository</li> <li><p>Run the pursuit writ to list the currently configured remote repositories</p> <pre><code class="language-shell">$ git remote -v origin https://github.com/[Your UserName]/[Your Fork].git (fetch) origin https://github.com/[Your UserName]/[Your Fork].git (push) </code></pre></li> <li><p>Add the original repository as an upstream repository</p> <pre><code class="language-shell">$ git remote add upstream https://github.com/[Original Owner Username]/[Original Repository].git </code></pre></li> <li><p>If you run the git remote writ again, you will now see both origin and upstream are configured</p> <pre><code class="language-shell">$ git remote -v origin https://github.com/[Your UserName]/[Your Fork].git (fetch) origin https://github.com/[Your UserName]/[Your Fork].git (push) upstream https://github.com/[Original Owner UserName]/[Original Repository].git (fetch) upstream https://github.com/[Original Owner UserName]/[Original Repository].git (push) </code></pre> <p>You are now ready to pull the changes from the original repository to the your forked repository.</p></li> </ol> <h2 id="merging-original-repo-into-your-fork">Merging Original Repo Into Your Fork</h2> <ol> <li>Open aWritPrompt (Windows) or Terminal (Mac or Linux)</li> <li>Navigate to the directory that contains your forked repository that you configured with the upstream repository</li> <li><p>The first thing is to fetch all of the changes from the original repository. Note that commits to the original repository will be stored in a local workshop called, upstream/master</p> <pre><code>$ git fetch upstream remote: Counting objects: 75, done. remote: Compressing objects: 100% (53/53), done. remote: Total 62 (delta 27), reused 44 (delta 9) Unpacking objects: 100% (62/62), done. From https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY * [new branch] master -&gt; upstream/master </code></pre></li> <li><p>Make sure that you are on your fork&rsquo;s master branch</p> <pre><code>$ git checkout master Switched to workshop 'master' </code></pre></li> <li><p>Merge the changes from the upstream/master into your local master branch. This will bring your fork&rsquo;s master workshop into sync with the upstream repository without losing your local changes. If you have made any changes that create a conflict, you will obviously have to resolve those surpassing you can well-constructed the merge.</p> <pre><code>$ git merge upstream/master Updating a422352..5fdff0f Fast-forward .... </code></pre></li> <li><p>At this point your local workshop is synced to the original repositories master branch. If you want to update the Github repository, you need to push your changes.</p> <pre><code>$ git push origin master </code></pre></li> </ol> <h2 id="wrap-up">Wrap-Up</h2> <p>To summarize, with the 5 commands unelevated you can sync your forked repository with the original repository and push the changes to your Github repository.</p> <pre><code class="language-shell">$ git remote add upstream https://github.com/[Original Owner Username]/[Original Repository].git $ git fetch upstream $ git checkout master $ git merge upstream/master $ git push </code></pre> Do Not Swallow The Exceptions https://digitaldrummerj.me/dont-swallow-the-exceptions/ Mon, 05 Oct 2015 00:00:00 +0000 https://digitaldrummerj.me/dont-swallow-the-exceptions/ <p>Throwing yonder exceptions in your lawmaking is just a bad practice and makes it harder to support your application. It may make it easier for you as a developer to get something working but in the long run it forfeit way increasingly money to do the maintenance and troubleshooting then if you had just put in proper exception handling to start with.</p> <p>I have worked on several codebases recently where methods returned false if either a merchantry rule failed or an unexpected exception occurred with no logging of the error anywhere. This made it extremely difficult to icon out what the issue was. In several cases, plane when you hooked up a debugger there was no way to get at the exception details since the exception was not passed into the reservation block.</p> <h2 id="examples-of-issue">Examples of Issue</h2> <p>Here are a couple of examples of what I am talking well-nigh when I say swallowing the exception.</p> <p><strong>Example 1: Totally ThrowingYonderException</strong></p> <p>In this example, the lawmaking does nothing with the exception and does not plane tell the caller that something failed. I have spent many hours troubleshooting projects with this word-for-word try/catch woodcut and wondering why something that I thought should have worked was not, just to discover that deep lanugo in the undeniability stack it was swallowing the exception. Since the reservation woodcut is empty, there is no way to put a breakpoint in the reservation woodcut but plane if you could, there is no way to get at the exception in the reservation woodcut since it was not passed into it. You would need to make a temp lawmaking transpiration to add an exception parameter to the reservation woodcut and a pseudo line in the reservation woodcut to be worldly-wise to get at the exception.</p> <pre><code>public void SomeMethod() { try { //SomeLawmakingThat Errors } reservation { } } </code></pre> <p><strong>Example 2: At Least Tells You Something Went Wrong</strong></p> <p>In this example, the lawmaking at least returns false when from the method so you can seem that something didn&rsquo;t go right but you don&rsquo;t know if it was an exception or if it was merchantry logic that failed. This example is moreover not logging any information well-nigh the exception and there is no way in a debugger to get the exception details. You can at least put a breakpoint in the reservation block, but you would need to make a lawmaking transpiration to add pass the exception into the reservation block.</p> <pre><code>public bool SomeMethod() { try { //Some lawmaking if (&quot;Business Logic Failed&quot;) { return false; } //everything passed return true; } reservation { return false; } } </code></pre> <h2 id="fixing-this-issue">Fixing This Issue</h2> <p>Now that you understand the issue, lets examine how to fix it. The fix is really simple. There are two options that I use:</p> <ol> <li>Pass the exception variable into the reservation woodcut and log the information somewhere.</li> <li>Let the exception rainbow up the undeniability stack and handle it at a higher level.<br /></li> </ol> <p><strong>Fix Example #1: Logging The Exception</strong></p> <p>In this example, the exception withal with all of the inner exceptions are logged and the merchantry rules are checked. You can moreover put a breakpoint inside the reservation woodcut to get details on the exception. This lawmaking still returns a false though if something went wrong which doesn&rsquo;t make it obvious if it was an exception or merchantry logic that didn&rsquo;t pass without looking at the logs.</p> <pre><code>public bool SomeMethod() { try { //Some lawmaking if (&quot;Business Logic Failed&quot;) { throw new ApplicationException(&quot;Business Logic Failed...Give details on what failed&quot;); } return true; } reservation (Exception ex) { //Logs StackTrace, Message, and all InnerException Message/StackTrace LogMessage(ex); return false; } } </code></pre> <p><strong>Fix Example #2: Bubbling Exception UpUndeniabilityStack</strong></p> <p>This example lets the full exception go up the undeniability stack with a custom exception so that the calling method can icon out how it wants to handle the exception. You should handle this exception at some point. It is bad practice to let it wilt an unhandled exception and crash your application.</p> <p>The reason for using a custom exception is to be worldly-wise to reservation your merchantry logic errors versus an unexpected exception.</p> <pre><code>public void SomeMethod() { //SomeLawmakingif (&quot;Business Logic Failed&quot;) { //Let ExceptionRainbowUp theUndeniabilityStack with a custom exception //Can moreover use ApplicationException but harder to reservation specific exceptions without examining the exception message throw new MyCustomException(&quot;Business Logic Failed...Give details on what failed&quot;); } } </code></pre> <p><strong>Fix Example #3:Worthinessto Put in a Breakpoint</strong></p> <p>Yes I know I said there is 2 ways to fix it but you can moreover do it this way. However this is my least favorite way to not swallow exception as you are still technically swallowing the error but you can at least vaccinate up the debugger, put a breakpoint on the return statement, and get at the exception details. This only is of value in your minutiae machine but it is at least largest than nothing.</p> <pre><code>public void SomeMethod() { try { //SomeLawmaking} reservation (Exception ex) { return; } } </code></pre> <h2 id="wrap-up">Wrap-Up</h2> <p>As you can see it does not take much increasingly work to be worldly-wise to do something with the exception. It will save you hours of troubleshooting work just by handling the exception and not throwing it away. Don&rsquo;t take the easy way out by swallowing exceptions. Be nice to your fellow developers and don&rsquo;t throw yonder the exceptions.</p> Vagrant - Fixing Opentable Basebox looking for Windows Plugin https://digitaldrummerj.me/vagrant-fixing-opentable-basebox/ Sun, 04 Oct 2015 00:00:00 +0000 https://digitaldrummerj.me/vagrant-fixing-opentable-basebox/ <h2 id="overview">Overview</h2> <p>As part of my <a href="https://github.com/digitaldrummerj/VagrantTalk/tree/master/ExampleVagrantFiles/WindowsWithChocolatey">demo</a> during my Vagrant talk, I use the <a href="https://atlas.hashicorp.com/opentable/boxes/win-8.1-enterprise-amd64-nocm">opentable/win-8.1-enterprise-amd64-nocm</a> vagrant wiring box with the virtualbox provider. This vagrant wiring box unfortunately has an issue with the vagrantfile that is included with it looking for the old/unneeded vagrant windows plugin to be installed and trying to port forward the WinRM and RDP ports without detecting if the port is once in use.</p> <p>Luckily, it is really easy to fix the included vagrantfile so that you can create vagrant machines but you have to do some prework surpassing running a vagrant up using this wiring box.</p> <h2 id="downloading-the-box">Downloading the Box</h2> <p>Normally with vagrant you do not need to download the vagrant box surpassing running vagrant up but in this specimen you do need to download the <a href="https://atlas.hashicorp.com/opentable/boxes/win-8.1-enterprise-amd64-nocm">opentable/win-8.1-enterprise-amd64-nocm</a> box first. We can download the box by running the pursuit writ from the writ line.</p> <pre><code>$ vagrant box add opentable/win-8.1-enterprise-amd64-nocm </code></pre> <p>It will take a bit to download the vagrant box as it is several gigs in size.</p> <h2 id="fix-for-unneeded-check-for-vagrant-windows-plugin">Fix for UnneededTrammelsfor Vagrant Windows Plugin</h2> <p>Once the box is downloaded, you need to go to the .vagrant.d directory that contains the box you just downloaded. On Windows this directory is located at %userprofile%.vagrant.d\boxes\opentable-VAGRANTSLASH-win-8.1-enterprise-amd64-nocm\1.0.0\virtualbox</p> <p>This directory contained the Vagrantfile that we need to update. You can unshut this file in any text editor.</p> <p>When you unshut up the file you will see this section of code.</p> <pre><code>if !Vagrant.has_plugin?('vagrant-windows') puts &quot;vagrant-windows missing, please install the vagrant-windows plugin!&quot; puts &quot;Run this writ in your terminal:&quot; puts &quot;vagrant plugin install vagrant-windows&quot; exit 1 end </code></pre> <p>This section is no longer need and can be deleted. The vagrant-windows plugins is how Vagrant used to supported the Windows OS surpassing it was supported out of the box.</p> <h2 id="fix-for-port-forwarding-auto-correct">Fix for Port ForwardingWheelsCorrect</h2> <p>We are going to edit the same Vagrantfile as the previous section.Thenthis file is located at %userprofile%.vagrant.d\boxes\opentable-VAGRANTSLASH-win-8.1-enterprise-amd64-nocm\1.0.0\virtualbox</p> <p>Open up the Vagrantfile in any text editor.</p> <p>When you unshut up the file you will see this section of code.</p> <pre><code>config.vm.network :forwarded_port, guest: 3389, host: 3389 config.vm.network :forwarded_port, guest: 5985, host: 5985 </code></pre> <p>The problem with this section is that if ports 3389 or 5985 are once in use on your host machine, then the writ will fail.</p> <p>To correct this we need to add the auto_correct parameter to each of the port forwarding commands so that Vagrant will automatically pick an unused port if it detects either 3389 or 5985 are in use on your host machine.</p> <pre><code>config.vm.network :forwarded_port, guest: 3389, host: 3389, auto_correct: true config.vm.network :forwarded_port, guest: 5985, host: 5985, auto_correct: true </code></pre> <h2 id="wrap-up">Wrap-up</h2> <p>Now you can use the <a href="https://atlas.hashicorp.com/opentable/boxes/win-8.1-enterprise-amd64-nocm">opentable/win-8.1-enterprise-amd64-nocm</a> vagrant wiring box with the vagrant up writ to create a new virtual machine.</p> <p>Not all vagrant wiring boxes have this issue but if you do run wideness one you know how to fix it.</p> Sync your Git Fork to the Original Repo https://digitaldrummerj.me/git-syncing-fork-with-original-repo/ Mon, 28 Sep 2015 00:00:00 +0000 https://digitaldrummerj.me/git-syncing-fork-with-original-repo/ <p>Syncing your forked repository to the original repository is an important step surpassing submitting any pull request to the original repository for the changes in your forked repository.Planeif you are not going to submit a pull request to the original repository, there are times that you want the spare features and/or bug fixes that have been washed-up since you forked the original repository.</p> <p>You could do a pull request but this adds an spare commit into your forked repository instead of making your forked repository match the original repository. In order to sync the forked repository without subtracting any spare commits as part of the process you need to configure the original repository as an upstream remote, merge in the changes from the original repository and then push the merged version when to Github.</p> <h2 id="adding-original-repo-as-an-upstream-repo">Adding Original Repo As an Upstream Repo</h2> <p>In order to pull the changes from the original repository into your forked version, you need to add the original git repo as an upstream repository.</p> <ol> <li>Open aWritPrompt (Windows) or Terminal (Mac or Linux)</li> <li>Navigate to the directory that contains your forked repository</li> <li><p>Run the pursuit writ to list the currently configured remote repositories</p> <pre><code class="language-shell">$ git remote -v origin https://github.com/[Your UserName]/[Your Fork].git (fetch) origin https://github.com/[Your UserName]/[Your Fork].git (push) </code></pre></li> <li><p>Add the original repository as an upstream repository</p> <pre><code class="language-shell">$ git remote add upstream https://github.com/[Original Owner Username]/[Original Repository].git </code></pre></li> <li><p>If you run the git remote writ again, you will now see both origin and upstream are configured</p> <pre><code class="language-shell">$ git remote -v origin https://github.com/[Your UserName]/[Your Fork].git (fetch) origin https://github.com/[Your UserName]/[Your Fork].git (push) upstream https://github.com/[Original Owner UserName]/[Original Repository].git (fetch) upstream https://github.com/[Original Owner UserName]/[Original Repository].git (push) </code></pre> <p>You are now ready to pull the changes from the original repository to the your forked repository.</p></li> </ol> <h2 id="merging-original-repo-into-your-fork">Merging Original Repo Into Your Fork</h2> <ol> <li>Open aWritPrompt (Windows) or Terminal (Mac or Linux)</li> <li>Navigate to the directory that contains your forked repository that you configured with the upstream repository</li> <li><p>The first thing is to fetch all of the changes from the original repository. Note that commits to the original repository will be stored in a local workshop called, upstream/master</p> <pre><code>$ git fetch upstream remote: Counting objects: 75, done. remote: Compressing objects: 100% (53/53), done. remote: Total 62 (delta 27), reused 44 (delta 9) Unpacking objects: 100% (62/62), done. From https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY * [new branch] master -&gt; upstream/master </code></pre></li> <li><p>Make sure that you are on your fork&rsquo;s master branch</p> <pre><code>$ git checkout master Switched to workshop 'master' </code></pre></li> <li><p>Merge the changes from the upstream/master into your local master branch. This will bring your fork&rsquo;s master workshop into sync with the upstream repository without losing your local changes. If you have made any changes that create a conflict, you will obviously have to resolve those surpassing you can well-constructed the merge.</p> <pre><code>$ git merge upstream/master Updating a422352..5fdff0f Fast-forward .... </code></pre></li> <li><p>At this point your local workshop is synced to the original repositories master branch. If you want to update the Github repository, you need to push your changes.</p> <pre><code>$ git push origin master </code></pre></li> </ol> <h2 id="wrap-up">Wrap-Up</h2> <p>To summarize, with the 5 commands unelevated you can sync your forked repository with the original repository and push the changes to your Github repository.</p> <pre><code class="language-shell">$ git remote add upstream https://github.com/[Original Owner Username]/[Original Repository].git $ git fetch upstream $ git checkout master $ git merge upstream/master $ git push </code></pre> Getting Visual Studio Cordova Tooling Working with the Ionic Framework https://digitaldrummerj.me/visual-studio-2015-cordova-tools-and-ionic-framework/ Thu, 17 Sep 2015 00:00:00 +0000 https://digitaldrummerj.me/visual-studio-2015-cordova-tools-and-ionic-framework/ <p>I am doing an <a href="http://www.ionicframework.com">Ionic Framework</a> presentation and I wanted to use the Visual Studio 2015 Cordova Tooling.</p> <p>I have washed-up this presentation twice in the past couple of months using my Intel Nuc machine with the Visual Studio 2015 RTM Cordova tooling but it is kind of pain to do this since the Nuc is a desktop machine and doesn&rsquo;t have a monitor so I have to squint at the projector screen or stuff a palmtop to use as well. Setting up 2 machines in 15 minutes as well is a pain and hoping that the remoting from the palmtop to the Nuc is stable just asking for trouble plane with a travel router that I have.</p> <p>So I decided I would just get my palmtop working with my demos since I once had Visual Studio 2015 installed and had everything I needed for Ionic once working.</p> <p>I thought this shouldn&rsquo;t take that long but unfortunately I ran into a tuft of issues. Luckily I have managed to fix all of the issue and can move on with the prep work for my presentation.</p> <h3 id="software-installed-on-laptop">Software Installed on Laptop</h3> <ul> <li>Windows 8.1 Enterprise</li> <li>Visual Studio 2015 with Cordova Tooling Update 2</li> <li>Node 4.1.0 tried both 32bit and 64bit versions. Note that the Intel NUC machine had 0.12.4 when I last presented.</li> <li>Npm 2.14.3 (version that comes with Node 4.1.0)</li> <li>Npm Global Modules: gulp, bower, Ionic, Cordova, and pjup</li> </ul> <h3 id="steps-to-create-visual-studio-ionic-project-that-caused-issue">Steps to Create Visual Studio Ionic Project that caused issue</h3> <p>To create the project I first created the Ionic project using the Ionic CLI and then created a Cordova project in Visual Studio based on the Ionic CLI project that was created.</p> <ol> <li>OpenWritLine</li> <li>Navigate to c:\projects</li> <li>Run ionic start Demo blank</li> <li>cd into c:\projects\Demo</li> <li>open up the package.json file and removed the gulp-sass line. This version doesn&rsquo;t work with Node 4.1.0.</li> <li>Run npm install gulp-sass --save</li> <li>Run npm install</li> <li>Open Visual Studio</li> <li>Go File -&gt; New -&gt; Project From Existing Code</li> <li>Select Cordova as the project type and click Next</li> <li>Click the scan button, navigate to the c:\projects\Demo folder, and click the Select Folder button</li> <li>Name the project Demo</li> <li>Click the Finish button</li> </ol> <p>Now the fun begins.UnelevatedI have documented the variegated issues that I ran into.</p> <h3 id="issue-1-opening-cordova-project-took-100-cpu">Issue 1: Opening Cordova project took 100% CPU</h3> <p><strong>Error</strong></p> <p>When I would unshut up a Cordova project it would try to parse the Npm global packages and it would goof everytime on the cordova dependency, graceful-fs. When I opened up Task Manager, I would see Visual Studio and Node taking all of the CPU. I would moreover see anywhere between 2-15 node processes that Visual Studio had started.</p> <p>I wondered what node processes were doing so I used Process Explorer and I found that they were all running npm config ls -g.</p> <p>My only guess is that Visual Studio didn&rsquo;t like something well-nigh my npm global packages.</p> <p><strong>Fix</strong></p> <p>Since Visual Studio and Node were taking all of the CPU, I had to unshut up the Task Manager and skiver all of the node processes in order to get Visual Studio to tropical so that the CPU went when to a normal level.</p> <ol> <li>Open Visual Studio without a project open</li> <li>Under the Tools Menu -&gt; Options -&gt; Projects and Solutions -&gt; External Web Tools, I reset it to the defaults which has the Visual Studio path higher than the System Path.</li> <li>Open the Demo project from c:\projects\Demo</li> </ol> <p>The CPU this time should stay at a normal level</p> <h3 id="issue-2-node-sass-would-fail-due-to-not-having-the-32-bit-version-installed">Issue 2: node-sass would goof due to not having the 32 bit version installed</h3> <p><strong>Error</strong></p> <p>This was caused by running npm install from the writ line outside of Visual Studio and moreover not having a version of gulp-sass in the package.json that worked with Node 4.1.0.</p> <p><strong>Fix</strong></p> <p>2 steps to get virtually this issue:</p> <ol> <li>From the writ line in c:\projects\Demo, run the pjup writ to update the npm package vesion in package.json to the latest versions.<br /> <ul> <li>Warning: Make sure that you have the loglevel for npm set to the default of warn. You can reset your custom loglevel with npm config delete loglevel.</li> </ul></li> <li>Delete the node_modules directory from your project directory and do the package restore from within Visual Studio. You may need to do a rm -rf node_modules from the writ line.</li> <li>Open the Demo project from c:\projects\Demo in Visual Studio</li> <li>In the Solution Explorer, right-click on the Dependencies folder and select Restore Packages</li> <li>After a few minutes the package restore should be completed. <ul> <li>Now the Task Runner Explorer should moreover be working</li> </ul></li> </ol> <h3 id="issue-3-typescript-error-on-visual-studio-build">Issue 3: Typescript error on Visual Studio build</h3> <p><strong>Error</strong> This issue unquestionably had nothing to do with Visual Studio itself but with the weedy bower packages.</p> <p>It turns out that the angular-ui-router bower package that is installed as part of the ionic install when you do a bower install, has the typescript api file included in the package but the other weedy packages do not have their typescript files included, so typescript doesn&rsquo;t know what some of the types are that are referenced in the angular-ui-router typescript api file.</p> <p><strong>Fix</strong></p> <p>I just deleted the angular-ui-router\api folder.</p> <h3 id="issue-4-cordova-error-on-visual-studio-build">Issue 4: Cordova error on Visual Studio build</h3> <p><strong>Error</strong></p> <p>Cordova CLI is set to 5.1.1 when you create the project.</p> <p>When you build the project in Visual Studio, it generates the pursuit error due to stuff set to Cordova 5.1.1. I had moreover seen this issue on my Intel NUC machine and had to waif the npm global Cordova version when to 5.0.0 but they have since stock-still this issue with Cordova.</p> <pre><code> 1&gt; ------Subtractingplatform: android 1&gt; No version supplied. Retrieving version from config.xml... 1&gt; _http_client.js:51 1&gt; throw new TypeError('Request path contains unescaped characters.'); 1&gt; ^ 1&gt; 1&gt; TypeError: Request path contains unescaped characters. 1&gt; at new ClientRequest (_http_client.js:51:11) 1&gt; at TunnelingAgent.exports.request (http.js:31:10) 1&gt; at TunnelingAgent.createSocket (C:\Users\jpjames\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:117:25) 1&gt; at TunnelingAgent.createSecureSocket [as createSocket] (C:\Users\jpjames\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:184:41) 1&gt; at TunnelingAgent.addRequest (C:\Users\jpjames\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\node_modules\tunnel-agent\index.js:80:8) 1&gt; at new ClientRequest (_http_client.js:133:16) 1&gt; at Object.exports.request (http.js:31:10) 1&gt; at Object.exports.request (https.js:163:15) 1&gt; at Request.start (C:\Users\[UserName]\AppData\Roaming\npm\node_modules\vs-tac\node_modules\cordova\5.1.1\node_modules\cordova\node_modules\cordova-lib\node_modules\npm\node_modules\request\index.js:594:30) 1&gt;MSBUILD : cordova-build error BLD104: Error : BLD00104 : There was an error installing a component from NPM, most likely considering this device is overdue a proxy or firewall. Please see the pursuit link for possible solutions: http://go.microsoft.com/fwlink/?LinkID=623434 </code></pre> <p>I believe that this error has nothing to do with the firewall since I can restore npm and bower packages without an issue and I have the http_proxy and https_proxy set as system environment variables.</p> <p><strong>Fix</strong></p> <ol> <li>Open the taco.json file</li> <li>Change the Cordova version to 5.3.1</li> <li>Rebuild the solution and the build should be well-constructed successfully</li> </ol> <h3 id="issue-5-visual-studio-seems-to-randomly-decide-to-use-my-node-4-1-0-install">Issue 5: Visual Studio seems to randomly decide to use my node 4.1.0 install</h3> <p>It towards that Visual Studio sometimes wants to use its version of node and other times uses my 4.1.0 install.</p> <p><strong>Visual Studio Version</strong></p> <ul> <li>npm package restore <ul> <li>I see lines like this in the output window: npm WARN engine get-stdin@5.0.0: wanted: {&ldquo;node&rdquo;:&ldquo;&gt;=0.12.0&rdquo;} (current: {&ldquo;node&rdquo;:&ldquo;v0.10.31&rdquo;,&ldquo;npm&rdquo;:&ldquo;1.4.9&rdquo;})</li> </ul></li> <li>task runner explorer <ul> <li>I seem on this one since it complained well-nigh the gulp-sass package in Visual Studio but worked fine from the writ line with node 4.1.0.</li> </ul></li> </ul> <p><strong>4.1.0 Install</strong></p> <ul> <li>Cordova build <ul> <li>I see that at the start of the output windows for the build: Your environment has been set up for using Node.js 4.1.0 (ia32) and npm. <br /></li> </ul></li> </ul> <h3 id="issue-6-visual-studio-seem-to-have-a-bunch-of-updates-that-were-needed-as-well">Issue 6: Visual Studio seem to have a tuft of updates that were needed as well</h3> <p>Here is a list of variegated installed/re-installs/uninstalls that I did:</p> <ul> <li>Cordova tooling from RTM to update 1 (update 2 wasn&rsquo;t out yet)</li> <li>Due to the CPU issues with #1, I uninstall Visual Studio Cordova tooling and re-installed it, selecting update 1</li> <li>Updated Cordova tooling from update 1 to update 2. It came out during all of this troubleshooting</li> <li>Tried out npm 3.x. Didn&rsquo;t see any changes.</li> <li>Tried install the npm taco package to see if it would help and it didn&rsquo;t. Uninstall it from the node 4.1.0 npm global.</li> <li>At once point I plane managed to unravel the Cordova tools and I uninstalled and re-installed them with update 2.</li> <li>Uninstalled Node 4.1.0 64 bit and installed the 32 bit version</li> <li>Tried out the NodeJSTools for Visual Studio latest RC release. Didn&rsquo;t see any changes so uninstalled it</li> <li>Uninstall all of the NodeJsTools for Visual Studio</li> <li>Upgraded TypeScript for Visual Studio since the Visual Studio installer said there was a new version out</li> </ul> <h3 id="working-steps">Working Steps</h3> <p>To create the project I first created the Ionic project using the Ionic CLI and then created a Cordova project in Visual Studio based on the Ionic CLI project that was created.</p> <ol> <li>OpenWritLine</li> <li>Navigate to c:\projects</li> <li>Run ionic start Demo blank</li> <li>cd into c:\projects\Demo</li> <li>run npm config delete loglevel</li> <li>run pjup to update all of the npm package. Say Y to everything except the run npm install</li> <li>run ionic setup sass</li> <li>run rm -rf node_modules</li> <li>Open Visual Studio</li> <li>Go File -&gt; New -&gt; Project From Existing Code</li> <li>Select Cordova as the project type and click Next</li> <li>Click the scan button, navigate to the c:\projects\Demo folder, and click the Select Folder button</li> <li>Name the project Demo</li> <li>Click the Finish button</li> <li>Let Visual Studio do an npm package restore</li> <li>Ignore the gulp-sass error popup as this appears to be task runner explorer related and will go yonder without the npm package restore</li> <li>Run the gulp default task to generate the sass file using the Task Runner Explorer</li> <li>Open the taco.json file and update the version to 5.3.1</li> <li>Delete the www\lib\angular-ui-router\api directory</li> <li>Build the Visual Studio project</li> <li>Deploy it to a Device/Emulator</li> </ol> <h3 id="conclusion">Conclusion</h3> <p>After all of this Visual Studio is now performing like I expected it to and like it does on my Intel NUC machine. The CPU is operating at normal levels. I am worldly-wise to build everything in Visual Studio and deploy to either the Visual Studio Android Emulator or an very Android device.</p> <p>With all of the fixes in place, I have been worldly-wise to run through creating my Ionic project, then creating a Visual Studio project from it, and finally deploying it to the Emulator/Device.</p> <p>I am very happy I got this all working since I am a huge fan of Visual Studio and wanted to show people all of the goodness in Visual Studio like the package restore, task runner explorer, and debugging.</p> Jekyll Part 13: Creating anVendibleSeries https://digitaldrummerj.me/blogging-on-github-part-13-creating-an-article-series/ Tue, 15 Sep 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-13-creating-an-article-series/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to go through how to create the series listing like you see for this blog series.</p> <h3 id="overview">Overview</h3> <p>Sometimes a blog post gets too big and you need to split it into multiple wares or you want to do a series like this one that builds upon each other but you don&rsquo;t want to have to manage a listing of all of the post in the series. Instead you can hands create a liquid template that does all of the work for you.</p> <h3 id="section-1-creating-the-template">Section 1: Creating the Template</h3> <p>In this section we are going to create the html template that will get the series listings for you.</p> <p>Note: I seem that you have alrady cloned your jekyll repo to your machine. This tutorial is based off the jekyll repo at <a href="https://github.com/digitaldrummerj/jekyllforblogseries">https://github.com/digitaldrummerj/jekyllforblogseries</a>.</p> <ol> <li>In the _includes directory create a new file tabbed series.html</li> <li><p>The first thing we are going to do is add an if statement to make sure that the it is a series surpassing trying to output the listing. Without this, it would output every page if the post didnt have a series and you included the series.html</p> <pre><code>{% if page.series %} {% endif %} </code></pre></li> <li><p>All of the lawmaking for the rest of this section will go in between the if and endif statements</p></li> <li><p>Next we are going to icon out how many post are part of the series and which vendible number in the series this post is.</p> <ul> <li>Total count will store in the count variable</li> <li>The vendible number for this post in the idx variable.<br /></li> <li><p>We will loop through the post and increment the count if the Front Matter series tag match the current page&rsquo;s series tag.</p> <pre><code>{% assign count = '0' %} {% assign idx = '0' %} {% for post in site.posts reversed %} {% if post.series == page.series %} {% capture count %}{{ count | plus: '1' }}{% endcapture %} {% if post.url == page.url %} {% capture idx %}{{count}}{% endcapture %} {% endif %} {% endif %} {% endfor %} </code></pre></li> </ul></li> <li><p>Now we need to output the very html code.</p> <ul> <li>Note: We are using the panel css from bootstrap. If you have bootstrap you are good, if not we will add just the panel css in the next section.</li> <li>First, we output a header for the series that says which part # this post is and how many total parts there are for the series.</li> <li><p>Second, we loop through the post and increment the count if the Front Matter series tag match the current page&rsquo;s series tag so that we can suspend Part # onto each post title. If the url for the post in the series matches the current page&rsquo;s url, then it outputs &ldquo;This Article&rdquo; instead of the very title.</p> <pre><code>&lt;div class=&quot;panel seriesNote&quot;&gt; &lt;p&gt; This vendible is &lt;strong&gt;Part {{ idx }}&lt;/strong&gt; in a &lt;strong&gt;{{ count }}-Part&lt;/strong&gt; Series. &lt;/p&gt; &lt;ul&gt; {% assign count = '0' %} {% for post in site.posts reversed %} {% if post.series == page.series %} {% capture count %}{{ count | plus: '1' }}{% endcapture %} &lt;li&gt;Part {{ count }} - {% if page.url == post.url %} ThisVendible{% else %} &lt;a href=&quot;{{post.url}}&quot;&gt;{{post.title}}&lt;/a&gt; {% endif %} &lt;/li&gt; {% endif %} {% endfor %} &lt;/ul&gt; &lt;/div&gt; </code></pre></li> </ul></li> <li><p>In the next section, we will add the series listing onto a couple of post so you can see them in action</p></li> </ol> <h3 id="section-2-add-series-tag-to-post">Section 2: Add Series Tag to Post</h3> <ol> <li>The first thing we need to do is create 2 new blog post vendible so that we can add the series to them.<br /></li> <li><p>In both articles, add a front matter tag tabbed series and make the value &ldquo;Intro to Series&rdquo;.</p> <pre><code>--- layout: post title: You're up and running! published: true series: &quot;Intro to Series&quot; --- </code></pre></li> <li><p>In both article, include the series.html at the point in the html that you want the series listing to show.</p> <pre><code>{% include series.html %} </code></pre></li> <li><p>Now run jekyll serve and view one of the new blog post.</p></li> </ol> <p>If you do not have the bootstrap css include in your blog, then you will notice that the series listing does not stand out at all.</p> <p><img src="/images/BloggingOnGitHub/ScreenshotOfSeriesWithNoCss.png" alt="Series Listing with No Css" /></p> <p>In the next section we will add the missing panel css to make it squint increasingly like this.</p> <p><img src="/images/BloggingOnGitHub/ScreenshotOfSeriesWithCss.png" alt="Series Listing with Css" /></p> <h3 id="section-3-adding-css">Section 3:SubtractingCSS</h3> <p>In this section we will add in the css to make the series listing stand out and squint like it is a section that goes together instead of just some text on the page.</p> <ol> <li>Open the css\style.scss file</li> <li><p>At the marrow of the file paste in the pursuit CSS. This css is directly from the bootstrap css. I didn&rsquo;t want to include all of the bootstrap framework just for the panel css.</p> <pre><code>.panel { padding: 15px; margin-bottom: 20px; background-color: #fff; border: 1px solid #ddd; border-radius: 4px; -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.05); box-shadow: 0 1px 1px rgba(0,0,0,0.05) } .panel-heading { padding: 10px 15px; margin: -15px -15px 15px; background-color: #f5f5f5; border-bottom: 1px solid #ddd; border-top-right-radius: 3px; border-top-left-radius: 3px } .panel-title { margin-top: 0; margin-bottom: 0; font-size: 17.5px; font-weight: 500 } .panel-footer { padding: 10px 15px; margin: 15px -15px -15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px } .panel-primary { border-color: #428bca } .panel-primary .panel-heading { color: #fff; background-color: #428bca; border-color: #428bca } .panel-success { border-color: #d6e9c6 } .panel-success .panel-heading { color: #468847; background-color: #dff0d8; border-color: #d6e9c6 } .panel-warning { border-color: #fbeed5 } .panel-warning .panel-heading { color: #c09853; background-color: #fcf8e3; border-color: #fbeed5 } .panel-danger { border-color: #eed3d7 } .panel-danger .panel-heading { color: #b94a48; background-color: #f2dede; border-color: #eed3d7 } .panel-info { border-color: #bce8f1 } .panel-info .panel-heading { color: #3a87ad; background-color: #d9edf7; border-color: #bce8f1 } </code></pre></li> <li><p>Save the file</p></li> <li><p>Run jekyll serve and view one of the new blog post. If should squint like this:</p> <p><img src="/images/BloggingOnGitHub/ScreenshotOfSeriesWithCss.png" alt="Series Listing with Css" /></p></li> </ol> <h3 id="conclusion">Conclusion</h3> <p>Now if you do an vendible series, you can hands have a professional looking series listing and it requires very little to get it working.</p> <p>In the next lesson, I will show you how to get the lawmaking highlighting working when your lawmaking includes liquid syntax such as we did in the lawmaking examples in this article.</p> Jekyll Part 12: Editing Locally https://digitaldrummerj.me/blogging-on-github-part-12-editing-locally/ Fri, 11 Sep 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-12-editing-locally/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to set it up so that we can do typhoon posts that we can trammels into our repo but not have them show up on the production site.</p> <h2 id="overview">Overview</h2> <p>In the last couple of articles, we installed jekyll locally but we didn&rsquo;t talk well-nigh editing existing blog post or subtracting in new ones. There will be times where you will start a blog post but not have time to finish it all in one sitting. You could just create all of the files in the post directory and set the publish flag to false but over time it will wilt harder and harder to tell which wares have unquestionably been published.</p> <p>Thankfully, jekyll supports having typhoon posts that by default don&rsquo;t show plane if the publish flag is set to true unless you tell jekyll to run with drafts. On Github, jekyll runs without the drafts flag so you don&rsquo;t have to worry well-nigh drafts unwittingly showing up.</p> <h2 id="section-1-creating-a-draft">Section 1: Creating a draft</h2> <ol> <li>In your blog repo, create a folder tabbed _drafts</li> <li>Create a new blog post in there tabbed DraftsTest.md</li> <li><p>Add the pursuit to the DraftsTest.md file</p> <pre><code>--- published: true layout: post title: 'Drafts Test' categories: ['How-To'] date: 2015-09-11 06:00 --- </code></pre></li> <li><p>If you run the jekyll serve command, you will not see this post showing up.</p> <pre><code>jekyll serve --config _config.yml,_configdev.yml </code></pre></li> </ol> <h2 id="section-2-running-with-drafts">Section 2: Running with Drafts</h2> <p>To run jekyll with drafts, you just need to pass in the --drafts treatise to the serve command</p> <pre><code>jekyll serve --config _config.yml,_configdev.yml --drafts </code></pre> <p>Now if you view your site in your web browser, you will see your typhoon post.</p> <p>With the drafts argument, it does respect the publish front matter, so if you don&rsquo;t want a typhoon to show up plane with the --drafts argument, just set the published to false for that article.</p> <h2 id="conclusion">Conclusion</h2> <p>Now you can do all of your editing locally and trammels the drafts into your git repo without having to fear they will unwittingly get published surpassing they are ready.</p> <p>In our next lesson, I will show you how to create the series listing like you see unelevated and how to be worldly-wise to hands create a blog vendible series</p> Jekyll Part 11: Installing Jekyll On OSx https://digitaldrummerj.me/blogging-on-github-part-11-installing-jekyll-osx/ Wed, 09 Sep 2015 03:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-11-installing-jekyll-osx/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to setup your MAC (OSx) computer to be worldly-wise to edit your blog on your computer.</p> <h2 id="overview">Overview</h2> <p>Up to this point we have been using the Github web site to edit all of our files but the downside to this is that any chances you want to make show up live in your blog surpassing you have had a endangerment to test them.</p> <p>Instead, it is largest if you can test out all of your changes and review your blog post surpassing letting the world see them. It will moreover let you have typhoon post where you can see them locally but on github they will not be visible.</p> <h2 id="section-1-installing-software">Section 1: Installing Software</h2> <p>We need to install XCode writ line tools, nodejs and python pip.</p> <h3 id="section-1-1-installing-nodejs">Section 1.1: Installing NodeJs</h3> <p>Head over to <a href="https://nodejs.org">nodejs.org</a> and download the NodeJs Installer and run it. Take all of the defaults.</p> <h3 id="section-1-2-installing-xcode-command-line-tools">Section 1.2: Installing XCodeWritLine Tools</h3> <p>Unfortunately to get the XCode writ line tools, you first need to install XCode.</p> <ol> <li>Go the App Store</li> <li>Search for XCode</li> <li>Hit the Install Button</li> </ol> <p>Once XCode is installed, unshut up a terminal windows (Application -&gt; Other -&gt; Terminal) and run the pursuit command:</p> <pre><code>xcode-select --install </code></pre> <p>This will bring up a windows asking you to install the writ line tools package that we need and just click the Install button.</p> <h3 id="section-1-3-installing-pygments-code-highlighter">Section 1.3: Installing PygmentsLawmakingHighlighter</h3> <pre><code>pip install Pygments </code></pre> <h3 id="section-1-4-install-ruby-gems">Section 1.4: Install Ruby Gems</h3> <pre><code>sudo gem update --system sudo gem install bundler </code></pre> <h2 id="section-2-getting-your-blog-onto-your-computer">Section 2: Getting your Blog onto your computer</h2> <p>In this section, you will clone the blog repo from github and install jekyll.</p> <ol> <li>Open a terminal</li> <li><p>Create the directory ~/projects</p> <pre><code>mkdir ~/projects </code></pre></li> <li><p>cd into c:\projects</p> <pre><code>cd ~/projects </code></pre></li> <li><p>Clone your github blog repo to your local machine with the &ldquo;git clone [Repo Name]&rdquo; command.Unelevatedis the example if you were to clone the jekyll repo for this blog series.</p> <pre><code>git clone https://github.com/digitaldrummerj/jekyllforblogseries.git </code></pre></li> <li><p>cd into the repo that you just cloned</p> <pre><code>cd jekyllforblogseries </code></pre></li> <li><p>Make sure that you have a GemFile with no file extension in the root of your repo with the pursuit contents. Warning that Github Pages supports very few jekyll plugins. The jekyll-redirect-from is one of them.</p> <pre><code>source 'https://rubygems.org' gem 'github-pages' gem 'jekyll-redirect-from' </code></pre></li> <li><p>From the jekyllforblogseries directory or your blogs directory, run the pursuit writ to install gems listed in the Gemfile.</p> <pre><code>bundle install </code></pre></li> </ol> <p>Now we have jekyll installed. Time to test it out</p> <h2 id="section-3-testing-your-blog-works-on-your-computer">Section 3: Testing Your Blog Works on Your Computer</h2> <p>Now that we have everything installed for jekyll it is time to test it out.</p> <ol> <li><p>From a writ prompt in your blog repo directory run the pursuit writ to tell jekyll to build and run the web site locally</p> <pre><code>jekyll serve </code></pre></li> <li><p>If it build successfully you will see something like this</p> <p><img src="/images/BloggingOnGitHub/jekyllserve.png" alt="Jekyll Serve Success" /></p></li> <li><p>Now if you unshut up your browser and navigate to <a href="http://localhost:4000">http://localhost:4000</a> you will see you blog.</p></li> </ol> <p>However, by default your _config.yml file will be set for production which will rationalization any place that you have referenced the site.url to not working on your local machine. You don&rsquo;t want to transpiration your _config.yml file though for minutiae since you will unwittingly trammels it in at some point and unravel your blog. Instead we can tell jekyll to use multiple configuration files. When you load multiple files it will load them in order and then override any settings from a previously loaded config.</p> <ol> <li>Create a new file in the root of your repo tabbed _configdev.yml</li> <li><p>In the _configdev.yml add the pursuit lines to set the url, turn off disqus/google analytics and google search.</p> <pre><code># then add this to the url as well &quot;/repository-name&quot; url: http://localhost:4000 disqus: disquscommentcount: google_analytics: google_search: </code></pre></li> <li><p>If your jekyll serve is still running do a ctrl+c to stop it.</p></li> <li><p>Now run the pursuit writ to tell jekyll the config yml files to load</p> <pre><code>jekyll serve --config _config.yml,_configdev.yml </code></pre></li> <li><p>If it build successfully you will see something like this</p> <p><img src="/images/BloggingOnGitHub/jekyllserve_multipleconfigs.png" alt="Jekyll Serve Success" /></p></li> <li><p>Now if you unshut up your browser and navigate to <a href="http://localhost:4000">http://localhost:4000</a> you will see you blog and any place that reference site.url will be working.</p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>Now you are ready to do all of your editing locally and test it out surpassing the world gets to see it.</p> <p>In our next lesson, I will show you how to create typhoon blog post that will only show on your local machine so that you don&rsquo;t have to either scramble up your post directory with drafts or worry well-nigh unwittingly publishing an unfinished article.</p> Jekyll Part 10: Installing Jekyll On Linux https://digitaldrummerj.me/blogging-on-github-part-10-installing-jekyll-on-linux/ Wed, 09 Sep 2015 02:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-10-installing-jekyll-on-linux/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to setup your Ubuntu Linux computer to be worldly-wise to edit your blog on your computer.</p> <h2 id="overview">Overview</h2> <p>Up to this point we have been using the Github web site to edit all of our files but the downside to this is that any chances you want to make show up live in your blog surpassing you have had a endangerment to test them.</p> <p>Instead, it is largest if you can test out all of your changes and review your blog post surpassing letting the world see them. It will moreover let you have typhoon post where you can see them locally but on github they will not be visible.</p> <h2 id="section-1-installing-software">Section 1: installing Software</h2> <p>We need to install nodejs, ruby 2.x, python pip, and git.</p> <h3 id="section-1-1-installing-nodejs">Section 1.1: Installing NodeJs</h3> <p>First we are going to install NodeJS using the writ below</p> <pre><code># Note the new setup script name for Node.js v0.12 flourish -sL https://deb.nodesource.com/setup_0.12 | sudo whack - # Then install with: sudo apt-get install -y nodejs node -v </code></pre> <h3 id="section-1-2-installing-ruby">Section 1.2: Installing Ruby</h3> <p>Ubuntu Trusty 14.04 unfortunately comes with Ruby 1.9.x and we need 2.x. There is moreover a bug in the ubuntu packages where the Ruby 2.0 install is unquestionably the 1.9.3 branch.</p> <ol> <li><p>We are going to use <a href="https://github.com/postmodern/ruby-install">ruby-install</a> to get the latest version of Ruby installed</p> <pre><code>wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz tar -xzvf ruby-install-0.5.0.tar.gz cd ruby-install-0.5.0/ sudo make install sudo ruby-install --system ruby </code></pre></li> <li><p>We need to install chruby to transpiration the ruby version to the one that we just installed</p> <pre><code>wget -O chruby-0.3.9.tar.gz https://github.com/postmodern/chruby/archive/v0.3.9.tar.gz tar -xzvf chruby-0.3.9.tar.gz cd chruby-0.3.9/ sudo make install </code></pre></li> <li><p>To make chruby wheels run we need to add the pursuit lines to our ~/.bashrc or ~/.bash_profile script</p> <pre><code>source /usr/local/share/chruby/chruby.sh source /usr/local/share/chruby/auto.sh </code></pre></li> <li><p>In order to it to take effect run replace .bashrc with .bash_profile if you are using that instead</p> <pre><code>source ~/.bashrc </code></pre></li> <li><p>Verify your ruby version reverted with</p> <pre><code>ruby -v </code></pre></li> <li><p>Make sure that the Ruby Gems are updated and then install the bundler GEM</p> <pre><code>sudo gem update --system sudo gem install bundler </code></pre></li> </ol> <h3 id="section-1-3-python">Section 1.3: Python</h3> <p>In order to use the Pygments lawmaking syntax highlighter, we need to install python pip</p> <pre><code>sudo apt-get install python-pip -y </code></pre> <h3 id="section-1-4-installing-git">Section 1.4: Installing Git</h3> <pre><code>sudo apt-get install git -y </code></pre> <h2 id="section-2-getting-your-blog-onto-your-computer">Section 2: Getting your Blog onto your computer</h2> <p>In this section, you will clone the blog repo from github and install jekyll.</p> <ol> <li>Open a terminal</li> <li><p>Create the directory ~/projects</p> <pre><code>mkdir ~/projects </code></pre></li> <li><p>cd into c:\projects</p> <pre><code>cd ~/projects </code></pre></li> <li><p>Clone your github blog repo to your local machine with the &ldquo;git clone [Repo Name]&rdquo; command.Unelevatedis the example if you were to clone the jekyll repo for this blog series.</p> <pre><code>git clone https://github.com/digitaldrummerj/jekyllforblogseries.git </code></pre></li> <li><p>cd into the repo that you just cloned</p> <pre><code>cd jekyllforblogseries </code></pre></li> <li><p>Make sure that you have a GemFile with no file extension in the root of your repo with the pursuit contents</p> <pre><code>source 'https://rubygems.org' gem 'github-pages' gem 'jekyll-redirect-from' </code></pre></li> <li><p>Run the writ to install the github-pages gem which has all of the required modules to make jekyll work and the jekyll redirect from plugin. It is one of the few plugins that Github pages supports and allows you to move pages virtually and have them automatically redirect so that people with bookmarks can still find a moved page.</p> <pre><code>bundle install </code></pre></li> </ol> <p>Now we have jekyll installed. Time to test it out</p> <h2 id="section-3-testing-your-blog-works-on-your-computer">Section 3: Testing Your Blog Works on Your Computer</h2> <p>Now that we have everything installed for jekyll it is time to test it out.</p> <ol> <li><p>From a writ prompt in your blog repo directory run the pursuit writ to tell jekyll to build and run the web site locally</p> <pre><code>jekyll serve </code></pre></li> <li><p>If it build successfully you will see something like this</p> <p><img src="/images/BloggingOnGitHub/jekyllserve.png" alt="Jekyll Serve Success" /></p></li> <li><p>Now if you unshut up your browser and navigate to <a href="http://localhost:4000">http://localhost:4000</a> you will see you blog.</p></li> </ol> <p>However, by default your _config.yml file will be set for production which will rationalization any place that you have referenced the site.url to not working on your local machine. You don&rsquo;t want to transpiration your _config.yml file though for minutiae since you will unwittingly trammels it in at some point and unravel your blog. Instead we can tell jekyll to use multiple configuration files. When you load multiple files it will load them in order and then override any settings from a previously loaded config.</p> <ol> <li>Create a new file in the root of your repo tabbed _configdev.yml</li> <li><p>In the _configdev.yml add the pursuit lines to set the url, turn off disqus/google analytics and google search.</p> <pre><code># then add this to the url as well &quot;/repository-name&quot; url: http://localhost:4000 disqus: disquscommentcount: google_analytics: google_search: </code></pre></li> <li><p>If your jekyll serve is still running do a ctrl+c to stop it.</p></li> <li><p>Now run the pursuit writ to tell jekyll the config yml files to load</p> <pre><code>jekyll serve --config _config.yml,_configdev.yml </code></pre></li> <li><p>If it build successfully you will see something like this</p> <p><img src="/images/BloggingOnGitHub/jekyllserve_multipleconfigs.png" alt="Jekyll Serve Success" /></p></li> <li><p>Now if you unshut up your browser and navigate to <a href="http://localhost:4000">http://localhost:4000</a> you will see you blog and any place that reference site.url will be working.</p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>Now you are ready to do all of your editing locally and test it out surpassing the world gets to see it.</p> <p>In our next lesson, I will show you how to install jekyll on OSx. Then you will learn how to create typhoon blog post that will only show on your local machine so that you don&rsquo;t have to either scramble up your post directory with drafts or worry well-nigh unwittingly publishing an unfinished article.</p> Jekyll Part 09: Installing Jekyll On Windows https://digitaldrummerj.me/blogging-on-github-part-9-installing-jekyll-on-windows/ Wed, 09 Sep 2015 01:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-9-installing-jekyll-on-windows/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to setup your Windows computer to be worldly-wise to edit your blog on your computer.</p> <h2 id="overview">Overview</h2> <p>Up to this point we have been using the Github web site to edit all of our files but the downside to this is that any chances you want to make show up live in your blog surpassing you have had a endangerment to test them.</p> <p>Instead, it is largest if you can test out all of your changes and review your blog post surpassing letting the world see them. It will moreover let you have typhoon post where you can see them locally but on github they will not be visible.</p> <p>Note that Jekyll is not officially supported on Windows but it does work and I have not had any issues with it.</p> <h2 id="section-1-installing-software">Section 1: installing Software</h2> <p>I am a big fan of Chocolatey and luckily a good majority of the software that we need had a chocolatey package so I wrote a gist file that we will install using Boxstarter.</p> <h3 id="section-1-1-installing-chocolatey">Section 1.1: Installing Chocolatey</h3> <p>If you are not familiar with Chocolatey, trammels it out at <a href="http://chocolatey.org">http://chocolatey.org</a>.</p> <ol> <li>Open a writ prompt</li> <li><p>Run the pursuit writ to install Chocolatey</p> <pre><code>@powershell -NoProfile -ExecutionPolicyShirk-Command &quot;iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))&quot; &amp;&amp; SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin </code></pre></li> <li><p>Close the writ prompt and re-open it so that we can get the Chocolatey environment variables</p></li> </ol> <p>Next we are going to install Boxstarter.</p> <h3 id="section-1-2-installing-boxstarer">Section 1.2: Installing Boxstarer</h3> <p>Boxstarter gives you the worthiness to zillion install Chocolatey packages plus several helper functions for Windows configuration options.</p> <p>When you zillion install using Boxstarter, it will snift any reboots that are triggered by MSI installers, reboot the machine and then run the Boxstarter script again.</p> <p>The Windows configuration helper functions that Boxstarter provides to enable or disable Windows features include items such as:</p> <ul> <li>Remote desktop.</li> <li>Microsoft update.</li> <li>User wangle tenancy (UAC).</li> <li>Set taskbar options like size, postion, and lock the size.</li> <li>Set Windows explorer options like showing subconscious files, protected OS files, and file extensions.</li> </ul> <p>Run the pursuit commands to install Boxstarter</p> <pre><code>chocolatey full-length enable -n=allowGlobalConfirmation choco install BoxStarter chocolatey full-length disable -n=allowGlobalConfirmation </code></pre> <h3 id="section-1-3-installing-the-rest-of-the-software">Section 1.3: Installing the rest of the software</h3> <p>We are going to be installing Ruby, Ruby DevKit, and Python using Chocolatey and Boxstarter.</p> <p>Now that you have Boxstarter installed, you will notice on your desktop a new icon tabbed Boxstarter Shell.</p> <p><img src="/images/BloggingOnGitHub/BoxStarterShellIcon.png" alt="Boxstarter Shell Icon" /></p> <ol> <li>Run the Boxstarter Shell</li> <li><p>Run the pursuit writ to install the gist file commands. You can view the contents of the gist file <a href="https://gist.githubusercontent.com/digitaldrummerj/f290a11d16e98beabd8b/raw/de3d6d551a0f881e0e66cf6c8ec2cc49c35525e0/jekyll">here</a></p> <pre><code>Install-BoxStarterPackage -PackageName https://gist.githubusercontent.com/digitaldrummerj/f290a11d16e98beabd8b/raw/de3d6d551a0f881e0e66cf6c8ec2cc49c35525e0/jekyll </code></pre></li> <li><p>If there were no errors, you are now ready to install jekyll.</p></li> </ol> <h2 id="section-2-getting-your-blog-onto-your-computer">Section 2: Getting your Blog onto your computer</h2> <p>In this section, you will clone the blog repo from github and install jekyll.</p> <ol> <li>Open a writ prompt</li> <li><p>Create the directory c:\projects</p> <pre><code>c: mkdir \projects </code></pre></li> <li><p>cd into c:\projects</p> <pre><code>c: cd \projects </code></pre></li> <li><p>Clone your github blog repo to your local machine with the &ldquo;git clone [Repo Name]&rdquo; command.Unelevatedis the example if you were to clone the jekyll repo for this blog series.</p> <pre><code>git clone https://github.com/digitaldrummerj/jekyllforblogseries.git </code></pre></li> <li><p>cd into the repo that you just cloned</p> <pre><code>cd jekyllforblogseries </code></pre></li> <li><p>Make sure that you have a GemFile with no file extension in the root of your repo with the pursuit contents</p> <pre><code>source 'https://rubygems.org' gem 'github-pages' gem 'jekyll-redirect-from' gem 'wdm', '~&gt; 0.1.0' if Gem.win_platform? </code></pre></li> <li><p>Run the writ to install the github-pages gem which has all of the required modules to make jekyll work and the jekyll redirect from plugin. It is one of the few plugins that Github pages supports and allows you to move pages virtually and have them automatically redirect so that people with bookmarks can still find a moved page.</p> <pre><code>bundle install </code></pre></li> <li><p>The last thing we need to do is update the github-pages dependencies to be worldly-wise to use the latest pygments.rb gem as the version included with the github-pages gem is not uniform with Windows</p> <pre><code>bundle update github-pages </code></pre></li> </ol> <p>Now we have jekyll installed. Time to test it out</p> <h2 id="section-3-testing-your-blog-works-on-your-computer">Section 3: Testing Your Blog Works on Your Computer</h2> <p>Now that we have everything installed for jekyll it is time to test it out.</p> <ol> <li><p>From a writ prompt in your blog repo directory run the pursuit writ to tell jekyll to build and run the web site locally</p> <pre><code>jekyll serve </code></pre></li> <li><p>If it build successfully you will see something like this</p> <p><img src="/images/BloggingOnGitHub/jekyllserve.png" alt="Jekyll Serve Success" /></p></li> <li><p>Now if you unshut up your browser and navigate to <a href="http://localhost:4000">http://localhost:4000</a> you will see you blog.</p></li> </ol> <h2 id="section-3-1-setting-up-dev-config-yml">Section 3.1: Setting Up Dev _config.yml</h2> <p>However, by default your _config.yml file will be set for production which will rationalization any place that you have referenced the site.url to not working on your local machine. You don&rsquo;t want to transpiration your _config.yml file though for minutiae since you will unwittingly trammels it in at some point and unravel your blog. Instead we can tell jekyll to use multiple configuration files. When you load multiple files it will load them in order and then override any settings from a previously loaded config.</p> <ol> <li>Create a new file in the root of your repo tabbed _configdev.yml</li> <li><p>In the _configdev.yml add the pursuit lines to set the url, turn off disqus/google analytics and google search.</p> <pre><code># then add this to the url as well &quot;/repository-name&quot; url: http://localhost:4000 disqus: disquscommentcount: google_analytics: google_search: </code></pre></li> <li><p>If your jekyll serve is still running do a ctrl+c to stop it.</p></li> <li><p>Now run the pursuit writ to tell jekyll the config yml files to load</p> <pre><code>jekyll serve --config _config.yml,_configdev.yml </code></pre></li> <li><p>If it build successfully you will see something like this</p> <p><img src="/images/BloggingOnGitHub/jekyllserve_multipleconfigs.png" alt="Jekyll Serve Success" /></p></li> <li><p>Now if you unshut up your browser and navigate to <a href="http://localhost:4000">http://localhost:4000</a> you will see you blog and any place that reference site.url will be working.</p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>Now you are ready to do all of your editing locally and test it out surpassing the world gets to see it.</p> <p>In our next lesson, I will show you how to install jekyll on OSx and Linux. Then you will learn how to create typhoon blog post that will only show on your local machine so that you don&rsquo;t have to either scramble up your post directory with drafts or worry well-nigh unwittingly publishing an unfinished article.</p> Camtasia 8.5 - How to Record to Mono https://digitaldrummerj.me/camtasia-8.5-record-to-mono/ Tue, 25 Aug 2015 00:00:00 +0000 https://digitaldrummerj.me/camtasia-8.5-record-to-mono/ <p>Today I upgraded from Camtasia 8.3 to Camtasia 8.5 and ran into an issue with my audio settings only recording to the left speaker. I know that my microphone only records in mono so this was not surprising.</p> <p>What was surprising is that the audio settings for the Camtasia Recorder were greyed out when using the TREC format.</p> <p>In Camtasia 8.3 I could tell the Camtasia Recorder to record in mono so that it would be in both left and right speakers.</p> <p>After a little bit of searching I came wideness this <a href="https://feedback.techsmith.com/techsmith/topics/audio_settings_greyed_out_disabled">forum post</a> that had the wordplay at the bottom.</p> <p>When you are in Camtasia Studio, click on your clip, select audio options and trammels the mix to mono option.</p> <p><img src="/images/Camtasia8_5_MixToMono.png" alt="Camtasia Mix To Mono" /></p> <p>Note: You may have to separate the audio from the video by right clicking on the prune and selecting the separate video and audio. Then click on the audio track and follow the steps above.</p> <p>Problem solved and I can go when to finishing my video.</p> Visual Studio 2015 - External Web Tools https://digitaldrummerj.me/visual-studio-2015-external-web-tools/ Thu, 20 Aug 2015 00:00:00 +0000 https://digitaldrummerj.me/visual-studio-2015-external-web-tools/ <p>I ran into an issue with an npm package mis-behaving in Visual Studio 2015 but working just fine from the writ line.</p> <p>After scratching my throne for awhile trying to icon out what was going on, I discovered that Visual Studio was pointing to its own version of npm and node and not that ones that were misogynist in my path that the writ line was using. Visual Studio 2015 ships with:</p> <ul> <li>Node</li> <li>npm</li> <li>git</li> </ul> <p>All of these tools are installed as part of Visual Studio but they are installed into the Visual Studio install directory and are not used by the writ line.</p> <p>If you have manually installed any of these tools like I had, then most likely you have a difference in versions between what the writ line is using versus Visual Studio.</p> <p>Luckily you can hands tell Visual Studio which versions to use.</p> <p>The settings in Visual Studio are under Tools -&gt; Options -&gt; Projects and Solutions -&gt; External Web Tools</p> <p>By default the system path is set to be looked at without the Visual Studio versions ($(DevEnvDir)\Extensions\Microsoft\Web Tools\External).</p> <p><img src="/images/VisualStudio/VisualStudio2015-ExternalWebTools.png" alt="Visual Studio External Web Tools Options" /></p> <p>To use the system PATH environment variable instead, click on the $(PATH) and use the arrows at the top-right to move it up.</p> <p><img src="/images/VisualStudio/VisualStudio2015-ExternalWebTools_PathHigher.png" alt="Visual Studio External Web Tools Path Moved Higher" /></p> <p>This will ensure that the version of the tools used matches what the writ line is using.</p> Visual StudioLawmakingSnippets https://digitaldrummerj.me/visual-studio-code-snippets/ Tue, 18 Aug 2015 00:00:00 +0000 https://digitaldrummerj.me/visual-studio-code-snippets/ <p>There are a tuft of seated Visual Studio lawmaking snippets that will generate lawmaking for you with a short keyword and then a tab key press. These shortcuts will make you increasingly efficient when writing lawmaking such as creating properties, loops, exceptions, etc.</p> <p>Below I have listed the lawmaking snippets that I most wontedly use and what the output from them looks like.</p> <p>To use these snippets type they keyword and then printing the tab key.</p> <h2 id="loops">Loops</h2> <ul> <li><p>do</p> <pre><code>do { } while (b); </code></pre></li> <li><p>while</p> <pre><code>while (true) { } </code></pre></li> <li><p>for</p> <pre><code>for (int i = 0; i &lt; UPPER; i++) { } </code></pre></li> <li><p>foreach</p> <pre><code>foreach (var VARIABLE in COLLECTION) { } </code></pre></li> </ul> <h2 id="conditionals">Conditionals</h2> <ul> <li><p>if</p> <pre><code>if (b) { } </code></pre></li> <li><p>else</p> <pre><code>else { } </code></pre></li> <li><p>switch</p> <pre><code>switch (@enum) { } </code></pre></li> </ul> <h2 id="error-trapping">Error Trapping</h2> <ul> <li><p>try</p> <pre><code>try { } reservation (Exception) { throw; } </code></pre></li> <li><p>tryf</p> <pre><code>try { } finally { } </code></pre></li> <li><p>exception</p> <pre><code>[Serializable] public matriculation MyException : Exception { // // For guidelines regarding the megacosm of new exception types, see // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp // and // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp public MyException() { } public MyException(string message) : base(message) { } public MyException(string message, Exception inner) : base(message, inner) { } protected MyException( SerializationInfo info, StreamingContext context) : base(info, context) { } } </code></pre></li> </ul> <h2 id="properties">Properties</h2> <ul> <li><p>prop</p> <pre><code>public TYPE Type { get; set; } </code></pre></li> <li><p>propfull</p> <pre><code>private int myVar; public int MyProperty { get { return myVar; } set { myVar = value; } } </code></pre></li> <li><p>propg</p> <pre><code>public int I { get; private set; } </code></pre></li> </ul> <h2 id="misc">Misc</h2> <ul> <li><p>ctor</p> <pre><code>public matriculation Misc { public Misc() { } } </code></pre></li> <li><p>enum</p> <pre><code>enum MyEnum { } </code></pre></li> <li><p>struct</p> <pre><code>struct MyStruct { } </code></pre></li> <li><p>&num;region</p> <pre><code>#region MyRegion #endregion </code></pre></li> </ul> <p>There are several increasingly lawmaking snippets that are misogynist at <a href="http://tinyurl.com/vscodesnippets">http://tinyurl.com/vscodesnippets</a>.</p> <p>With these few lawmaking snippets you will be amazed at how much less lawmaking you end up writing by hand.Overlylittle bit helps to make you increasingly productive and efficient as a developer.</p> <p>Let me know what you favorite snippets are or ones that you have created.</p> Favorite Visual Studio Shortcuts https://digitaldrummerj.me/visual-studio-shortcuts/ Thu, 13 Aug 2015 00:00:00 +0000 https://digitaldrummerj.me/visual-studio-shortcuts/ <p>Here is a list of Visual StudioPolityEdition shortcuts that I use.</p> <h2 id="building-solution">Building Solution</h2> <table class="exampleTable"> <tr> <th>Name</th> <th>Shortcut</th> </tr> <tr> <td>Build Solution</td> <td>Ctrl+Shift+B</td> </tr> <tr class="alt"> <td>RunLawmakingAnalysis on Solution</td> <td>Alt+F11</td> </tr> </table> <h2 id="building-current-project">Building Current Project</h2> <p>There is no default shortcut for towers the current project or running lawmaking wringer on it. You can go under the Build menu and select to build just the current project but this is a transmission step that requires you to navigate through the menus.</p> <p>To succeed this, I set the keyboard shortcut Ctrl + \ .</p> <ol> <li>Tools -&gt; Options -&gt; Keyboard or Ctrl + Q, type Keyboard, and hit Enter</li> <li>Set shortcut for Build.BuildSelection.</li> <li>Open a file and Ctrl+\ should now build that project<br /></li> </ol> <p><strong>RunLawmakingAnalysis on Current Project</strong></p> <p>You can moreover run lawmaking wringer on the current project like you can on the whole solution.</p> <p>To succeed this, I set the keyboard shortcut Ctrl+Alt+</p> <ol> <li>Tools -&gt; Options -&gt; Keyboard or Ctrl + Q, type Keyboard, and hit Enter</li> <li>Set shortcut for Build.RunCodeAnalysisonSelection.<br /></li> <li>Open a file and Ctrl+Alt+\ to run the the lawmaking wringer for the project</li> </ol> <h2 id="debugging">Debugging</h2> <table class="exampleTable"> <tr> <th>Name</th> <th>Shortcut</th> </tr> <tr> <td>Start Debugging</td> <td>F5</td> </tr> <tr class="alt"> <td>Start without Debugging</td> <td>Ctrl+F5</td> </tr> <tr> <td>Toggle Breakpoint On/Off for line</td> <td>F9</td> </tr> <tr class="alt"> <td>Run to Cursor and then stop like there is a breakpoint on that line</td> <td>Ctrl+F10</td> </tr> <tr> <td>Step Through theLawmakingLine by Line</td> <td>F11</td> </tr> <tr class="alt"> <td>Modify what the debugger displays for an object</td> <td><a href="http://tinyurl.com/vsdebugattrib">http://tinyurl.com/vsdebugattrib</a></td> </tr> </table> <h2 id="searching">Searching</h2> <table class="exampleTable"> <tr> <th>Name</th> <th>Shortcut</th> </tr> <tr> <td>Quick Search</td> <td>Ctrl+Q</td> </tr> <tr class="alt"> <td>Find in Files</td> <td>Ctrl+Shift+F</td> </tr> <tr> <td>Next Search Result</td> <td>F8</td> </tr> <tr class="alt"> <td>Previous Search Result</td> <td>Shift+F8</td> </tr> </table> <h2 id="navigation">Navigation</h2> <table class="exampleTable"> <tr> <th>Name</th> <th>Shortcut</th> </tr> <tr > <td>Go To Definition</td> <td>F12 <br />Ctrl+Click with <a href="http://tinyurl.com/vsprodpower">Productivity Power Tools</a></td> </tr> <tr class="alt"> <td>Close All Documents</td> <td>Alt+W,L</td> </tr> </table> <h2 id="visual-studio-windows-layout">Visual Studio Windows Layout</h2> <p>In Visual Studio 2015, you can now save the Windows Layout and transpiration them with a shortcut key.</p> <ol> <li>To Save: In Visual Studio 2015, under the Windows menu, click the Save Windows Layout</li> <li>ToWieldLayout: In Visual Studio 2015, under the Windows menu, select theWieldWindows layout popout and pick the layout to apply. There is moreover a shortcut key for each of the saved Windows layouts. By default it is Ctrl+Alt+# (e.g. Ctrl+Alt+1 for the 1st saved layout)</li> </ol> <p>If you have Visual Studio 2013 and below, you can use use the Visual Studio extension, <a href="http://tinyurl.com/vslayout">Layouts O Rama</a></p> <h2 id="resharper-searching-navigation">Resharper Searching/Navigation</h2> <p>If you have Resharper there are several spare options that you get for searching.</p> <p>Note: Assumes Visual Studio keyboard layout for Resharper</p> <table class="exampleTable"> <tr> <th>Name</th> <th>Shortcut</th> </tr> <tr> <td>Go to Everything</td> <td>Ctrl + T</td> </tr> <tr class="alt"> <td>Go to File</td> <td>Ctrl + Shift + T</td> </tr> <tr> <td>Go to Member in File</td> <td>Alt + \</td> </tr> <tr class="alt"> <td>Find Current File In Solution Explorer</td> <td>Alt + Shift + L</td> </tr> </table> <h2 id="format-document">Format Document</h2> <table class="exampleTable"> <tr> <th>Name</th> <th>Shortcut</th> </tr> <tr> <td>Format Document</td> <td>Ctrl+K,D</td> </tr> <tr class="alt"> <td>Resharper Format Document</td> <td>Ctrl+E,F <br />Note: Assumes Visual Studio keyboard layout </td> </tr> </table> <h2 id="additional-shortcuts">Additional Shortcuts</h2> <p>There are a lot increasingly shortcuts that are set in Visual Studio. I have only covered the ones that I use the most. To see the full list, visit <a href="http://visualstudioshortcuts.com">http://visualstudioshortcuts.com</a>.</p> Favorite Visual Studio Extensions https://digitaldrummerj.me/favorite-visual-studio-extensions/ Tue, 11 Aug 2015 00:00:00 +0000 https://digitaldrummerj.me/favorite-visual-studio-extensions/ <p>In the Visual Studio Extension Gallery there are hundreds of extensions that are available. The extensions add spare functionality to Visual Studio.Unelevatedare the extensions that I typically have installed.</p> <h2 id="web-essentials">Web Essentials</h2> <p>Big pile of superstitious for web developers. If you are doing web minutiae you need to have this installed.</p> <p><a href="http://vswebessentials.com/">http://vswebessentials.com/</a></p> <p>Features:</p> <ul> <li>Enhanced browser link</li> <li>Markdown Editor/Preview</li> <li>Minification of javascript files</li> <li>JSHint / CSSHint integration</li> <li>TypeScript preview of compiled ts file</li> <li>Plus much much more</li> </ul> <h2 id="ghostdoc">GhostDoc</h2> <p>Auto generate Xml doc comments based on your method/parameter names, exceptions through and return types.</p> <p><a href="http://tinyurl.com/ghostdoc">http://tinyurl.com/ghostdoc</a></p> <p>Default shortcut: ctrl+shift+d</p> <h2 id="i-hate-regions">I Hate Regions</h2> <p>Regions is one of those features that you either love or hate. If you are not a fan of regions then this extension is for you. No longer will you plane superintendency that a file has a region in it.</p> <p><a href="http://tinyurl.com/regionssuck">http://tinyurl.com/regionssuck</a></p> <p>Features:</p> <ul> <li>Auto expand regions when file opens</li> <li>Make the region text smaller and tousle increasingly into preliminaries so that it stays out of the way</li> <li>Can be configure to not indulge shrinking of the regions</li> </ul> <h2 id="productiviy-power-tools">Productiviy Power Tools</h2> <p>This extension is written by Microsoft adds a lot of productivity enhancements to Visual Studio that you just wish came out of the box.</p> <p><a href="http://tinyurl.com/vsprodpower">http://tinyurl.com/vsprodpower</a></p> <p>Features:</p> <ul> <li>Collapse projects to folders</li> <li>Copy and paste references between projects</li> <li>Copy and paste project as a reference</li> <li>Fix mixed tabs and spaces</li> <li>Peek definition</li> <li>Open containing folder for project</li> <li>Open writ line<br /></li> <li>Solution error visualizer</li> <li>Sort using statements</li> <li>Remove unused using statements <br /></li> </ul> <h2 id="vs-commands">VS Commands</h2> <p>Another productivity tool for Visual Studio. Unfortunately, there is not yet a Visual Studio 2015 version.</p> <p><a href="http://tinyurl.com/vscommands13">http://tinyurl.com/vscommands13</a></p> <p>Features:</p> <ul> <li>Cancel build on first error</li> <li>Keep documents unshut when reloading project</li> <li>Start new instance without debugging</li> <li>Start new instance with debugging</li> <li>Sync zoom levels between pages <br /> <br /></li> </ul> <h2 id="switch-startup-project">Switch Startup Project</h2> <p>Easily configure variegated startup project configurations and be worldly-wise to switch between them or a select single project to start up.</p> <p><a href="http://tinyurl.com/vsswitchstart">http://tinyurl.com/vsswitchstart</a></p> <h2 id="layout-o-rama">Layout O Rama</h2> <p>Store Visual Studio windows layout and be worldly-wise to quickly transpiration to a new layout. This is really useful when moving to variegated monitor setups/resolution.</p> <p><strong>Note:</strong> In Visual Studio 2015 this is backed into Visual Studio. You can save layouts under the Windows menu in Visual Studio and quickly wield those saved layouts with a shortcut key or under the Windows -&gt;WieldLayout menu.</p> <p><a href="http://tinyurl.com/vslayout">http://tinyurl.com/vslayout</a></p> <h2 id="task-runner-explorer">Task Runner Explorer</h2> <p>Run Grunt or Gulp task directly in Visual Studio.</p> <p>Can vaccinate Grunt/Gulp task up to the Visual Studio build system (before/after build, on wipe or solution open)</p> <p><strong>Note:</strong> In Visual Studio 2015, this is included out of the box.</p> <p><a href="http://tinyurl.com/vstaskrunner">http://tinyurl.com/vstaskrunner</a></p> <h2 id="file-nesting">File Nesting</h2> <p>Easily group files by name and be worldly-wise to swoon the group.</p> <p><a href="http://tinyurl.com/vsfilenest">http://tinyurl.com/vsfilenest</a></p> <h2 id="add-new-file">Add New File</h2> <p>Fast and easy way to add new files to any project including files that start with a dart.</p> <p><a href="https://visualstudiogallery.msdn.microsoft.com/3f820e99-6c0d-41db-aa74-a18d9623b1f3">https://visualstudiogallery.msdn.microsoft.com/3f820e99-6c0d-41db-aa74-a18d9623b1f3</a></p> <h2 id="package-intellisense">Package Intellisense</h2> <p>NPM and Bower package intellisense directly in the Visual Studio JSON editor.</p> <p><a href="https://visualstudiogallery.msdn.microsoft.com/65748cdb-4087-497e-a394-2e3449c8e61e">https://visualstudiogallery.msdn.microsoft.com/65748cdb-4087-497e-a394-2e3449c8e61e</a></p> <h2 id="bundler-minifier">Bundler &amp; Minifier</h2> <p>Bundle and minify JS, CSSS, and Html files. Can be wired into the build system in Visual Studio.</p> <p><a href="https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40">https://visualstudiogallery.msdn.microsoft.com/9ec27da7-e24b-4d56-8064-fd7e88ac1c40</a></p> <h2 id="open-command-line">OpenWritLine</h2> <p>Open a writ line at the root of the project. Supports all consoles: CMD, Powershell, Bash, etc.</p> <p><strong>Note:</strong> A similar full-length is moreover misogynist as part of the Productivity Power Tools.</p> <p><a href="https://visualstudiogallery.msdn.microsoft.com/4e84e2cf-2d6b-472a-b1e2-b84932511379">https://visualstudiogallery.msdn.microsoft.com/4e84e2cf-2d6b-472a-b1e2-b84932511379</a></p> <h2 id="stop-on-first-build-error">Stop on First build Error</h2> <p>Stops a solution build immediately without a project has a failed to build error.</p> <p><a href="https://visualstudiogallery.msdn.microsoft.com/91aaa139-5d3c-43a7-b39f-369196a84fa5">https://visualstudiogallery.msdn.microsoft.com/91aaa139-5d3c-43a7-b39f-369196a84fa5</a></p> <h2 id="resharper">Resharper</h2> <p>This is the one extension that I cannot live without. It makes Visual Studio a much largest IDE. Once you start using it, you will wonder how you overly lived without it. I could hands do several blog post on the features of Resharper.UnelevatedI picked out some of my favorite features.</p> <p><a href="http://jetbrains.com/resharper">http://jetbrains.com/resharper</a></p> <h2 id="features">Features:</h2> <p><strong>Navigation</strong></p> <ul> <li>Go to Everything / Type - quick navigation to all possible destinations (types, symbols or files).<br /></li> <li>Go to file - quickly navigate to any file within your solution.<br /></li> <li>Go to File member - quickly navigate to a particular method or field in the current file.</li> </ul> <p>Docs: <a href="https://www.jetbrains.com/resharper/features/navigation_search.html">https://www.jetbrains.com/resharper/features/navigation_search.html</a></p> <p><strong>Code Generation</strong></p> <ul> <li>Create from usage</li> <li>Generate Type members</li> <li>Implement/Override Methods</li> <li>Generate formatting or equality members</li> </ul> <p>Docs: <a href="https://www.jetbrains.com/resharper/features/code_generation.html">https://www.jetbrains.com/resharper/features/code_generation.html</a></p> <p><strong>CodeWringer/ Refactoring /LawmakingTemplates</strong></p> <ul> <li>Continuous lawmaking quality analysis</li> <li>Detect errors and lawmaking smells</li> <li>Quick fixes</li> <li>Code Templates (snippets, surround with, and file)</li> <li>Lots of refactoring options: <a href="https://www.jetbrains.com/resharper/features/code_refactoring.html">https://www.jetbrains.com/resharper/features/code_refactoring.html</a></li> </ul> <p><strong>Code Cleanup</strong></p> <ul> <li>Code formatting</li> <li>Optimize namespace declarations</li> <li>Remove lawmaking redundancies</li> <li>File and type layout</li> <li>Code style configuration and sharing</li> </ul> <p><strong>Camelhumps</strong></p> <p>This is not so much a full-length but an option that you can turn on. I like it so much though that I consider it a feature.</p> <p>When turned on it allows you to wheels filter intellisense and any search dialogs by typing the first letter of each capitalized word in what you are looking for. For example, if you have a matriculation tabbed MyClassExample you would search for it by typing MCE.</p> <p><font color="red">Warning:</font> Camelhumps changes the policies of Ctrl+Backspace to now only delete the previous word instead of the whole declaration. For example, MyClassExample would only delete Example and leave MyClass.</p> <p><strong>Unit Test Runner</strong></p> <ul> <li>Run and debug test</li> <li>Can run multiple unit test sessions simultaneously and independently of each other</li> <li>Docs: <a href="https://www.jetbrains.com/resharper/features/unit_testing.html">https://www.jetbrains.com/resharper/features/unit_testing.html</a></li> </ul> <p>Complete full-length list at <a href="https://www.jetbrains.com/resharper/features/">https://www.jetbrains.com/resharper/features/</a></p> Favorite Windows Shortcuts https://digitaldrummerj.me/windows-shortcuts/ Thu, 06 Aug 2015 00:00:00 +0000 https://digitaldrummerj.me/windows-shortcuts/ <p>So many times I watch Windows users spending lots of time doing task that should just take a few seconds but instead are taking several minutes considering they are taking the long way virtually to get the task completed.</p> <p>Here are some examples that I see people doing and unelevated I will show you how to get them washed-up the easiest way possible.</p> <ol> <li>Getting 2 programs side by side half screened</li> <li>Navigating in Windows Explorer to find the Visual Studio solution or project directory</li> <li>Open programs as an administrator</li> <li>Just opening up task manager.<br /> <br /></li> </ol> <p><strong>Note:</strong> All of these shortcuts are built directly into Windows.</p> <h2 id="moving-program-between-half-screen-full-screen-and-monitors">Moving Program between half screen, full screen and monitors</h2> <ul> <li>Move program to half screen on the left side: Windows Key + Left Arrow</li> <li>Move Program to half screen on the right side: Windows Key + Right Arrow</li> <li>Move to next monitor in same position: Add Shift key to commands</li> <li>Minimze Program: Windows Key +LanugoArrow</li> <li>Maximize Program: Windows Key + Up Arrow</li> </ul> <h2 id="start-program-as-administrator">Start Program as Administrator</h2> <p>Windows 8:</p> <ol> <li>Windows Key</li> <li>Start typing program name to bring up search bar</li> <li>Find the program that you want to unshut as admin in the results list</li> <li>Either Ctrl + Shift + Left Mouse Click or Ctrl + Shift + Enter</li> <li>When prompted to unshut as adminstrative, click the yes button</li> </ol> <h2 id="quickly-opening-up-visual-studio-solutions">Quickly Opening up Visual Studio Solutions</h2> <p>Windows has a full-length tabbed Jump List that allows you to pick items to an icon in the taskbar that are misogynist when you right-click on the icons.</p> <p>Example:</p> <ol> <li>Pin Visual Studio icon to taskbar</li> <li>Open a Visual Studio Solution</li> <li>Right-click on Visual Studio icon in taskbar</li> <li>Find the project that you just opened and click the pin icon next to it</li> <li>Now instead of having to unshut Visual Studio and navigating to the solution file, you can right-click on the Visual Studio icon and select the solution from the pinned item.</li> </ol> <h2 id="quickly-opening-task-manager">Quickly Opening Task Manager</h2> <p>Ctrl+Shift+Esc</p> <h2 id="windows-explorer-favorites">Windows Explorer Favorites</h2> <p>Windows explorer has the favorites links section that you can stilt folders onto.</p> <p>This is a unconfined place to put wontedly used folders such as the folders for current project that you are working on.</p> <p><strong>Note:</strong> That subtracting or removing folders from the Favorites list does not have any stupefy on the very folder, it only removes it from the Favorites list.</p> Favorite Windows Programs https://digitaldrummerj.me/favorite-windows-software/ Tue, 28 Jul 2015 08:00:00 +0000 https://digitaldrummerj.me/favorite-windows-software/ <p>Developer productivity is not just well-nigh maximizing your speed in editor. It moreover includes spare software to help you be increasingly productive.Unelevatedis some of my favorite Windows software that I use.</p> <h2 id="password-management">Password Management</h2> <ul> <li><a href="http://lastpass.com">LastPass</a> - Password Manager. Remembers passwords so you don&rsquo;t have to.Wheelslog you into web sites, store secure notes, wifi passwords, etc. Web interface and desktop is free. Mobile device using is premium version at $12 per year.</li> </ul> <h2 id="readers">Readers</h2> <ul> <li><a href="http://getpocket.com">Pocket</a> - Save web pages/rss feed wares for later and view when ready including offline. Way largest than keeping a ton of bookmarks virtually that you never get when to.<br /></li> <li><a href="http://feedly.com">Feedly</a> - RSS Feed Reader with Pocket integration.</li> </ul> <h2 id="editors">Editors</h2> <ul> <li><a href="http://linqpad.net">Linqpad</a> - Scratchpad for .NET. Rich formatted output. Intellisense. If you are a .NET program this is a much have application. Well worth the small value of money to get the license to use the Intellisense.</li> <li><a href="https://code.visualstudio.com/">Visual Studio Code</a> - unconfined all virtually text editor and minutiae environment. Focused on lawmaking first.</li> </ul> <h2 id="planning">Planning</h2> <ul> <li><a href="http://kanbanflow.com">KanbanSpritz/ Pomodoro</a> - I used KanbanSpritzto plan my week and use the Pomodoro technique to work on my tasks. I use the setup that John Sonmez talks well-nigh at <a href="https://www.youtube.com/watch?v=W9k0OhJkjQ0">https://www.youtube.com/watch?v=W9k0OhJkjQ0</a></li> <li><a href="https://todoist.com">Todoist</a> - Todo Tasks list. Quick and easy way to add tasks from Chrome or mobile device. Ultimately I import move these into KanbanSpritzbut it is much quicker on a mobile device to use Todoist.<br /></li> </ul> <h2 id="utilities">Utilities</h2> <ul> <li><a href="http://chocolatey.org">Chocolatey</a> - Install Windows software the easy way. Take the guess work out of where to download software and how to get it installed.</li> <li><a href="http://dropbox.com">Dropbox</a> - sync directories and files between machines. Can either sync all or selectively sync file.<br /></li> <li><a href="http://getgreenshot.org">Greenshot</a> - self-ruling utility to take and edit screenshots. has a vital seated editor, can reprinting to clipboard or unshut an office product (Word, Excel, PowerPoint, outlook) if installed.<br /></li> <li><a href="http://www.launchy.net">Launchy</a> - Forget well-nigh the start menu. Launch programs with a few keystrokes. Setup shortcuts for worldwide web sites you use.</li> <li><a href="http://vagrantup.com">Vagrant</a> -Handscreate lightweight and reproducible virtual machines. If you are using virtual machines on your Windows machine, let Vagrant manage the configurations of it. No longer will it only work on your machine. I have a blog series on using Vagrant and Chocolatey together at <a href="{{ &quot;/vagrant-overview&quot; | prepend: site.baseurl | prepend: site.url }}">{{ &ldquo;/vagrant-overview&rdquo; | prepend: site.baseurl | prepend: site.url }}</a><br /></li> </ul> Presentation Environment Setup https://digitaldrummerj.me/presentation-setup/ Thu, 09 Jul 2015 00:00:00 +0000 https://digitaldrummerj.me/presentation-setup/ <p>One of the first things that you learn when giving presentations is that fonts and font size matters just as much as the content.Unelevatedis a listing of the various font settings that I have found to be constructive and how to set them in the programs that I use.</p> <p>If you have other programs that you use, finger self-ruling to leave a scuttlebutt on the font settings that you use.</p> <h2 id="notepad">Notepad</h2> <ol> <li>Format -&gt; Fonts <ul> <li>Font: Lucida Console</li> <li>Font Style: Regular</li> <li>Size: 18-22</li> </ul></li> </ol> <h2 id="notepad-1">Notepad++</h2> <ol> <li>Settings -&gt; Style Configurator &hellip; <ul> <li>Select Theme: Default (stylers.xml)</li> <li>Language: Default Styles</li> <li>Style: Global Override</li> <li>Font Name: Lucida Console</li> <li>Font Size: 18</li> <li>Bold: sometimes checked depending on the day <br /> <br /></li> </ul></li> </ol> <h2 id="command-prompt">Command Prompt</h2> <ol> <li>Open cmd</li> <li>Click on menu and select Defaults</li> <li><strong>Font</strong> <ul> <li>Font: Lucida Console</li> <li>Size: 14pt-18pt</li> <li>Check &ldquo;Bold fonts&rdquo;</li> </ul></li> <li><strong>Colors</strong> <ul> <li>Screen Text: Lime (KermitUntriedor Green: 255, Red: 0, Blue: 9)</li> <li>Screen Background: Black</li> </ul></li> </ol> <h2 id="powershell-and-azure-powershell-command-prompt">Powershell andUltramarinePowershellWritPrompt</h2> <ol> <li>For Win 8.1 On Start find PowerShell orUltramarinePowershell</li> <li>Open file location.</li> <li>Open shortcut Properties (right click menu).</li> <li>Security tab -&gt; Edit your permissions to Modify.</li> <li>Select Font tab. (skip errors - nothing is set hence problem)</li> <li>Select Font Tab <ul> <li>Font: Lucida Console</li> <li>Size: 20</li> <li>Bold Fonts: Checked</li> </ul></li> <li>Select Colors Tag <ul> <li>Screen Text: Gray / Red: 238, Green: 237, Blue: 240</li> <li>Screen background: undecorous / Red: 1, Green: 36, Blue: 86</li> </ul></li> <li>Select Layout Tab <ul> <li>Windows Size Width: 80 (match screen buffer size)</li> <li>Window Size Height: 27 (various depending on resolution)</li> <li>Let system position window: checked</li> </ul></li> <li>ClickWieldButton</li> <li>Security tab Edit permissions remove modify.</li> <li>Click Ok</li> </ol> <p>Remember to unchangingly launch powershell from the start menu. For some reason this does not seem to stupefy the fonts if you do win+r.</p> <p>Don&rsquo;t forget to pin to start menu or task bar if going to be using for demo.</p> <h2 id="powershell-ise">Powershell ISE</h2> <p>Powershell ISE: C:\Windows\System32\WindowsPowerShell\v1.0</p> <ol> <li>For Win 8.1, on start find powershell_ise.exe</li> <li>Tools -&gt; Options -&gt; Colors and Fonts <ul> <li>Click &ldquo;Manage Themse&hellip;&rdquo;</li> <li>Select Presentation</li> </ul></li> </ol> <p>Don&rsquo;t forget to pin to start menu or task bar if going to be using for demo.</p> <h2 id="visual-studio-code">Visual Studio Code</h2> <ol> <li><p>File -&gt; Preferences -&gt; User Settings</p> <pre><code>{ // Wrap based on screen size &quot;editor.wrappingColumn&quot;: 0, // Version: 1.03 //Controls the indentation of wrapped lines. Can be one of 'none', 'same' or 'indent'. //&quot;editor.wrappingIndent&quot;: &quot;indent&quot;, &quot;editor.tabSize&quot;: &quot;2&quot;, // Controls the font family. &quot;editor.fontFamily&quot;: &quot;Consolas&quot;, // Controls the font size. &quot;editor.fontSize&quot;: 22, // Version: 1.0.3 //&quot;editor.formatOnType&quot;: true } </code></pre></li> </ol> <h2 id="visual-studio-community-ultimate-enterprise">Visual StudioPolity/ Ultimate / Enterprise</h2> <ol> <li>Go to <strong>Tools -&gt; Options</strong></li> <li><strong>Environment -&gt; General</strong> <ul> <li>Change the verisimilitude theme when to &ldquo;Blue&rdquo; if you reverted it. You verisimilitude scheme might be tomfool but it will distract attendees.</li> </ul></li> <li>Go to <strong>Environment -&gt; Fonts and Colors</strong> <ul> <li>Under the <strong>Show Settings For</strong> waif lanugo make the pursuit changes: <ul> <li>Text Editor: Arial 14</li> <li>Editor Tooltip: Calibri 14</li> <li>Statement Completion: Calibri 14,</li> <li>All Text Tool Windows: Tahoma 13</li> <li>Watch, Locals, and Autos Tool Windows: Tahoma 14</li> <li>Environment Font: Calibri 14</li> <li>Package Manager Console: ??? (if using it for demos)</li> </ul></li> </ul></li> <li>Go to <strong>Environment -&gt; Start up</strong> <ul> <li>Change At startup dropdown to &ldquo;Show Empty Environment&rdquo;</li> <li>Uncheck Download content every</li> </ul></li> <li>Go to <strong>Environment -&gt; Synchronized Settings</strong> <ul> <li>Uncheck &ldquo;Synchronize settings wideness devices when signed into Visual Studio&rdquo;</li> <li>Note: This is washed-up so that your presentation settings do stupefy any other machines</li> </ul></li> <li>Go to <strong>Environment -&gt; Keyboard</strong> <ul> <li>Build.BuildSelection -&gt; Ctrl + <br /></li> </ul></li> <li>Go To <strong>Projects and Solutions</strong> <ul> <li>Check &ldquo;TrackZippyItem in Solution Explorer&rdquo;</li> <li>Check &ldquo;Always Show Solution&rdquo;</li> <li>Check &ldquo;Always show Error List if build finishes with errors&rdquo;</li> <li>Check &ldquo;Show Output windows when build starts&rdquo;</li> </ul></li> <li>Go To <strong>Text Editor</strong> <ul> <li>** All Languages** <ul> <li>Check &ldquo;Word Wrap&rdquo;</li> <li>Check &ldquo;Line Numbers&rdquo;</li> <li>Check &ldquo;Navigation Bar&rdquo;</li> <li>Check &ldquo;Auto Brace Completion&rdquo;</li> </ul></li> <li>Go To <strong>All Languages -&gt; Tabs</strong> <ul> <li>Set &ldquo;Indenting&rdquo; to Smart</li> <li>Set &ldquo;Tab size&rdquo; to 2</li> <li>Set &ldquo;Indent size&rdquo; to 2</li> <li>Check &ldquo;Keep tabs&rdquo;</li> </ul></li> </ul></li> </ol> <h2 id="sources-used">Sources Used</h2> <p>Here are some various sources that I got information from.</p> <ul> <li><a href="http://blogs.msdn.com/b/saraford/archive/2008/06/09/did-you-know-how-to-increase-your-visual-studio-environment-fonts-for-presentations-233.aspx">http://blogs.msdn.com/b/saraford/archive/2008/06/09/did-you-know-how-to-increase-your-visual-studio-environment-fonts-for-presentations-233.aspx</a></li> <li><a href="http://www.hanselman.com/blog/PresentationTipsForPeopleRunningVirtualPCOrVMWare.aspx">http://www.hanselman.com/blog/PresentationTipsForPeopleRunningVirtualPCOrVMWare.aspx</a></li> <li><a href="http://www.hanselman.com/blog/11TopTipsForASuccessfulTechnicalPresentation.aspx">http://www.hanselman.com/blog/11TopTipsForASuccessfulTechnicalPresentation.aspx</a></li> </ul> Vagrant Part 6 -OverdueA Proxy Server https://digitaldrummerj.me/vagrant-behind-proxy-server/ Mon, 06 Jul 2015 06:00:00 +0000 https://digitaldrummerj.me/vagrant-behind-proxy-server/ <h2 id="overview">Overview</h2> <p>If you are working overdue a proxy server you will need to configure both the host computer and the Vagrant virtual machines to communicate through the proxy server. It is easy to configure the proxy settings but finding the documentation is a variegated story.Unelevatedwe will go through how to configure the proxy for the vagrant commands (up, status, box add, etc) and then how to configure the virtual machine proxy settings.</p> <h2 id="vagrant-commands">Vagrant Commands</h2> <p>In order for the Vagrant commands that talk out to the internet to work there are several environment variables that need to be set.</p> <p>The typical proxy environment variables are http_proxy and https_proxy. You can either permanently set them so they are unchangingly misogynist or you can set them only for the current unshut writ prompt/terminal.</p> <h2 id="on-windows">On Windows</h2> <h3 id="current-open-command-prompt">CurrentUnshutCommand Prompt</h3> <pre><code>set http_proxy=http://yourproxyserver:port set https_proxy=https://yourproxyserver:port </code></pre> <h3 id="permantly-set">Permantly Set</h3> <pre><code>setx http_proxy=http://yourproxyserver:port setx https_proxy=https://yourproxyserver:port </code></pre> <h3 id="view-proxy-settings">View Proxy Settings</h3> <p>If the commands unelevated just reverberate out the text instead of the very proxy server, it ways that the proxy server is not set.</p> <pre><code>echo %http_proxy% reverberate %https_proxy% </code></pre> <h3 id="removing-proxy-setting">Removing Proxy Setting</h3> <p>Unfortunately there is no way to remove the proxy settings from the writ line without issuing a reg delete. For whatever reason, Microsoft only allows you to zippo out an environment variable with setx but not remove it. Luckily, this does make it so that Vagrant will not use a proxy to connect to the internet.</p> <h2 id="vagrant-boxes-virtual-machines">Vagrant Boxes (Virtual Machines)</h2> <p><div class="panel"> <span style="color: red">WARNING: </span>As of September 13, 2015, the vagrant-proxyconf appears to no longer work on Windows machines. It has been throwing powershell errors on vagrant up. It still works on Linux vagrant machines. </div> In order to configure the vagrant virtual machines to use a proxy server, you need to install the vagrant-proxyconf plugin.</p> <pre><code>vagrant plugin install vagrant-proxyconf </code></pre> <p>The vagrant-proxyconf can configure the proxy settings for Generic Proxy environment variables, Chef, Apt, Docker, Git, npm, PEAR, Subversion, Yum, and Windows.</p> <p>Below we will walk through the nuts of using the vagrant-proxyconf plugin. You can read the full documentation at <a href="https://github.com/tmatilai/vagrant-proxyconf">https://github.com/tmatilai/vagrant-proxyconf</a>.</p> <h3 id="ensuring-the-plugin-is-installed">Ensuring the plugin is installed</h3> <p>There is no seated vagrant writ to make sure that a plugin is installed but since the Vagrantfile is a Ruby file, it is very easy to write a little bit of Ruby lawmaking to ensure that the plugin is installed.</p> <p>In the Vagrantfile surpassing the <strong>Vagrant.configure(2) do |config|</strong> line widow the pursuit lawmaking snippet:</p> <pre><code>if !Vagrant.has_plugin?(&quot;vagrant-proxyconf&quot;) system('vagrant plugin install vagrant-proxyconf') raise(&quot;vagrant-proxyconf installed. Run writ again.&quot;); end </code></pre> <h3 id="generic-proxy-settings">Generic Proxy Settings</h3> <p>You can either configure the Vagrant proxy settings on a per Vagrant virtual machine understructure or globally.</p> <p>To configure on a per machine basis, add the lawmaking snippet unelevated to the the machines VagrantFile.</p> <p>To configure global add the lawmaking snippet unelevated to VagrantFile at .vagrant.d/Vagrantfile. You may need to create this file. To learn increasingly well-nigh a global VagrantFile and the order that the VagrantFile&rsquo;s are read see <a href="http://docs.vagrantup.com/v2/vagrantfile/">http://docs.vagrantup.com/v2/vagrantfile/</a>.</p> <pre><code>Vagrant.configure(&quot;2&quot;) do |config| if Vagrant.has_plugin?(&quot;vagrant-proxyconf&quot;) config.proxy.http = &quot;http://192.168.0.2:3128/&quot; config.proxy.https = &quot;http://192.168.0.2:3128/&quot; config.proxy.no_proxy = &quot;localhost,127.0.0.1,.example.com&quot; end # ... rest of the configurations end </code></pre> <h2 id="next-steps">Next Steps</h2> <p>Now you have everything you need to configure Vagrant to work from overdue a proxy server. In the next lesson we will imbricate the variegated networking options for Vagrant.</p> Vagrant Part 5 - Installing Your Software https://digitaldrummerj.me/vagrant-installing-your-software/ Thu, 18 Jun 2015 05:00:00 +0000 https://digitaldrummerj.me/vagrant-installing-your-software/ <p>Welcome to the Vagrant lesson on how to use Boxstarter to configure Windows and install software as part of the Vagrant provisioning process.</p> <h2 id="overview">Overview</h2> <p>We have all of the needed software in place to start configuring and installing software onto our virtual machine.</p> <p>In this lesson, we will create an file with all of the install and configuration commands that will be executed with Boxstarter.</p> <h2 id="can-i-only-install-chocolatey-packages">Can I only install Chocolatey Packages?</h2> <p>Even though Boxstarter is a Chocolatey package, you can install and configure increasingly than just Chocolatey packages. At the end of the day it is running a Powershell script, so anything that you can do with Powershell you can put into your file to execute through Boxstarter.</p> <h2 id="example-file">Example File</h2> <ol> <li>In the shell directory for MyFirstMachine, create a file tabbed BoxStarterGist.txt.</li> <li>In the shell directory for MyFirstMachine, create a 2nd file tabbed RunBoxStarterGist.bat.</li> <li><p>Open the RunBoxStarterGist.bat file and add the pursuit writ to reprinting the file to the temp directory and execute it with Boxstarter.</p> <ul> <li><p>The reason to reprinting the BoxStarterGist.txt file to a temp directory is that sometimes when Boxstarter reboots, the vagrant synced folder for Virtualbox is not mounted until without Boxstarter tries to protract executing the bat file, so it then fails.</p> <pre><code>copy &quot;%systemdrive%\vagrant\shell\BoxStarterGist.txt&quot; &quot;%temp%\BoxStarterGist.txt&quot; @powershell -NoProfile -ExecutionPolicyShirk-Command &quot;Install-BoxStarterPackage -PackageName %temp%\\BoxstarterGist.txt&quot; </code></pre></li> </ul></li> </ol> <h2 id="populating-the-boxstartergist-txt-file">Populating the BoxstarterGist.txt file</h2> <p>We are going to do several things in the BoxstarterGist.txt file:</p> <ul> <li>Set some Windows configurations such as taskbar size, Windows explorer show extensions/protected OS file/hidden files, and enable rdp.</li> <li>Install some Chocolatey packages such as Visual Studio Code, nodejs, git, and Google Chrome.</li> <li>Install some npm packages such as Ionic and Cordova</li> <li>Run a git clone to pull lanugo source lawmaking for a project</li> </ul> <p>These are all examples of things that you can do. At the end of the day it is just a Powershell script so that options are nearly limitless. I encourage you to read up on Boxstarter at <a href="http://boxstarter.org">http://boxstarter.org</a> to see all of options that you have.</p> <p>Open up the BoxstarterGist.txt file in your favorite text editor and proceed to the configuration sections. I have the sections in the order that I like to install/configure but you can have them in any order in the BoxstarterGist.txt file.</p> <h3 id="windows-configurations">Windows Configurations</h3> <p>This section is the Windows configuration options that we want to set. The full Windows configuration documentation for Boxstarter is misogynist at <a href="http://boxstarter.org/WinConfig">http://boxstarter.org/WinConfig</a>.</p> <ol> <li><p>Enable Remote Desktop</p> <pre><code>Enable-RemoteDesktop </code></pre></li> <li><p>Tell Windows that you want to use Powershell instead of a writ prompt when you use the corner navigation.</p> <pre><code>Set-CornerNavigationOptions -EnableUsePowerShellOnWinX </code></pre></li> <li><p>In Windows exploer turn on subconscious files, protected operating system files, show file extensions, and show the full path in the title bar.</p> <pre><code>Set-ExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitlebar </code></pre></li> <li><p>Set the taskbar size to small and lock it in place.</p> <pre><code>Set-TaskbarOptions -Size Small -Lock </code></pre></li> </ol> <h3 id="chocolatey-installs">Chocolatey Installs</h3> <p>Now it is time to install all of our Chocolatey Packages.</p> <p>The first step is to turn off the prompting from Chocolatey asking if you are sure you want to install this package. Don&rsquo;t worry will turn it when on in a few lines without the Chocolatey package installs are completed.</p> <pre><code>chocolatey full-length enable -n=allowGlobalConfirmation </code></pre> <p>Next we are going to install the Chocolatey packages that you want. I picked a few but go to the Chocolatey gallery at <a href="http://chocolatey.org">http://chocolatey.org</a> and find the packages that meet your needs.</p> <pre><code>choco install git choco install nodejs choco install visualstudiocode choco install GoogleChrome </code></pre> <p>Now that we are washed-up installing Chocolatey packages we are going to turn when on the prompting for confirmation that you wanted to install the packages.</p> <pre><code>chocolatey full-length disable -n=allowGlobalConfirmation </code></pre> <p>Last thing we are going to do is pin a couple of items that we installs to the taskbar using a seated helper from Chocolatey tabbed Install-ChocolateyPinnedTaskBarItem.</p> <pre><code>Install-ChocolateyPinnedTaskBarItem &quot;${env:UserProfile}\Desktop\code.lnk&quot; Install-ChocolateyPinnedTaskBarItem &quot;${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe&quot; </code></pre> <h3 id="npm-installs">npm installs</h3> <p>I play virtually with npm a lot and don&rsquo;t like the spinner when running an npm command, so I turn that off and set the log level that I like. I then install the Ionic framework and Cordova npm packages.</p> <pre><code>npm config set loglevel http npm config set spin false npm install -g ionic npm install -g cordova </code></pre> <h3 id="git-clone-repositories">git clone repositories</h3> <p>The last thing that I do as part of the BoxStarterGist.txt file is to create c:\projects which is where I store my project source lawmaking at and pull it lanugo from Github.</p> <pre><code>$projectDir = &quot;${env:systemdrive}\projects&quot; If (!(Test-Path $projectDir)) { New-Item -Path $projectDir -ItemType Directory } cd $projectDir git clone https://github.com/digitaldrummerj/VagrantTalk </code></pre> <h2 id="how-to-install-your-software-part-of-vagrant-provision">How to install your software part of Vagrant provision?</h2> <p>Now that we have the BoxStarterGist.txt file configured the way that we want it, we need to tell Vagrant what to do with it.</p> <p>For this one we are using the file provision which copies the files to the virutal machine but does not execute it. The reason for this is that when Boxstarter reboots the machine, Vagrant thinks the script is washed-up and proceeds to the next provision undeniability which sometimes interfers with the Boxstarter run. So instead I put it on the desktop and manually login to the machine and execute the RunBoxStarterGist.bat file.</p> <pre><code> config.vm.provision &quot;file&quot;, source: &quot;shell/RunBoxStarterGist.bat&quot;, destination: &quot;desktop\\RunBoxStarterGist.bat&quot; </code></pre> <h2 id="running-the-runboxstartergist-bat-file">Running the RunBoxStarterGist.bat file</h2> <p>After you do vagrant up and all of the provisioners runs, you will see the RunBoxstarterGist.bat on the desktop for the vagrant user. You will just need to manually execute this file. Once you kick it off you can walk yonder and let it do all of the installs.</p> <h2 id="next-steps">Next Steps</h2> <p>The next lesson will imbricate the variegated networking options that vagrant supports. By default Vagrant sets up the virtual machine with a NAT network so that you can only get to the machine from the host. You an however setup both a public and private network. We will swoop into how to do this.</p> Vagrant Part 4 - Install Boxstarter https://digitaldrummerj.me/vagrant-installing-boxstarter/ Thu, 18 Jun 2015 03:00:00 +0000 https://digitaldrummerj.me/vagrant-installing-boxstarter/ <p>Welcome to the Vagrant lesson on installing Boxstarter as part of the Vagrant provisioning process.</p> <h2 id="what-does-boxstarter-give-you">What does Boxstarter requite you?</h2> <p>Boxstarter gives you the worthiness to zillion install Chocolatey packages plus several helper functions for Windows configuration options.</p> <p>When you zillion install using Boxstarter, it will snift any reboots that are triggered by MSI installers, reboot the machine and then run the Boxstarter script again.</p> <p>The Windows configuration helper functions that Boxstarter provides to enable or disable Windows features include items such as:</p> <ul> <li>Remote desktop.</li> <li>Microsoft update.</li> <li>User wangle tenancy (UAC).</li> <li>Set taskbar options like size, postion, and lock the size.</li> <li>Set Windows explorer options like showing subconscious files, protected OS files, and file extensions.</li> </ul> <h2 id="how-to-install-boxstarter-part-of-vagrant-provision">How to install Boxstarter part of Vagrant provision?</h2> <p>Since we once have Chocolatey installed as part of the previous lesson, installing Boxstarter just requires use to undeniability the choco install Boxstarter command.</p> <p>However, there are a few things we need to do in order for this to work without user interaction.</p> <ul> <li>You have to run the install writ as separate shell provision writ in Vagrant instead of the main.cmd that we used to install Chocolatey. The reason for this is due to the environment path updates that are part of the Chocolatey install are not picked up until you unshut a new writ prompt.</li> <li>You have to turn off the Chocolatey confirmation prompts that ask you if you want to install this package or not.<br /></li> </ul> <h2 id="creating-the-provisioning-scripts">Creating the Provisioning Scripts</h2> <ol> <li>Navigate to the shell directory in the MyFirstMachine directory that we created in previous lessons.</li> <li>Create a new file tabbed InstallBoxStarter.bat</li> <li><p>Add the pursuit contents to the InstallBoxStarter.bat file:</p> <pre><code>chocolatey full-length enable -n=allowGlobalConfirmation choco install BoxStarter chocolatey full-length disable -n=allowGlobalConfirmation </code></pre></li> <li><p>In the MyFirstMachine folder, unshut the VagrantFile in a text editor and add the pursuit provision writ without the provision writ that is running the main.cmd file in the previous lesson.</p> <pre><code>config.vm.provision :shell, path: &quot;shell/InstallBoxStarter.bat&quot; </code></pre></li> </ol> <h2 id="next-steps">Next Steps</h2> <p>So far in the provisioning process, we have had Vagrant install both Chocolatey and Boxstarter. In the next lesson, we will use Boxstarter to zillion install our software and configure Windows.</p> Vagrant Part 3 - Provisioning With Chocolatey https://digitaldrummerj.me/vagrant-provisioning-with-chocolatey/ Thu, 18 Jun 2015 02:00:00 +0000 https://digitaldrummerj.me/vagrant-provisioning-with-chocolatey/ <p>Welcome to the Vagrant lesson on installing Chocolatey as part of the Vagrant provisioning process.</p> <h2 id="overview">Overview</h2> <p>The first thing we are going to do as part our provisioning is to install Chocolatey onto the virtual machine.</p> <p>As we saw in the <a href="{{&quot;/vagrant-overview&quot; | prepend: site.baseurl | prepend: site.url }}">Easy Virtual Machine Management</a> post, having Chocolatey on a machine allows you to hands install all of our software in an streamlined and repeatable fashion.</p> <h2 id="how-to-install-as-part-of-vagrant-provision">How to install as part of Vagrant provision?</h2> <ol> <li>Open Windows Explorer and navigate to the MyFirstMachine directory that we created in the <a href="{{ &quot;/vagrant-overview&quot; | prepend: site.baseurl | prepend: site.url }}">Easy Virtual Machine Management</a> post.</li> <li>Create a directory tabbed shell</li> <li>In the shell directory, create a file tabbed main.cmd</li> <li><p>Open the main.cmd in your text editor and add the pursuit line:</p> <ul> <li><p>This will tell powershell to run the file c:\vagrant\shell\InstallChocolatey.ps1 and set the execution policy to shirk so that the powershell script can be run.</p> <pre><code>@powershell -NoProfile -ExecutionPolicyShirk-File &quot;%systemdrive%\vagrant\shell\InstallChocolatey.ps1&quot; </code></pre></li> </ul></li> <li><p>In the shell directory, create a file tabbed InstallChocolatey.ps1</p> <ul> <li><p>The file will trammels to see if Chocolatey is installed and if not, it will install it.</p> <pre><code>$ChocoInstallPath = &quot;$env:SystemDrive\ProgramData\Chocolatey\bin&quot; if (!(Test-Path $ChocoInstallPath)) { iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) } </code></pre></li> </ul></li> <li><p>The last step is to tell VagrantFile to run the main.cmd file as part of the provisioning.</p> <pre><code>config.vm.provision :shell, path: &quot;shell/main.cmd&quot; </code></pre></li> </ol> <h2 id="next-steps">Next Steps</h2> <p>We now have Chocolatey installed on the virtual machine and are ready to start installing software. The next lesson will install Boxstarter and then you will zillion install all of our software.</p> Vagrant Part 2 - Provisioning Introduction https://digitaldrummerj.me/vagrant-provisioning-intro/ Thu, 18 Jun 2015 01:00:00 +0000 https://digitaldrummerj.me/vagrant-provisioning-intro/ <p>Welcome to the Vagrant lesson on what Vagrant provisioning is.</p> <h2 id="what-is-vagrant-provisioning">What is Vagrant Provisioning?</h2> <p>Provisioners indulge you to automatically install software and yo-yo configurations during the Vagrant up process.</p> <p>This is useful since boxes typically aren&rsquo;t built perfectly for your use case. Granted you could just login to the box and install all of the software by hand. However, by using the provisioning it automates the process, make it repeatable, and requires no human interaction.</p> <p>This ways that you can run vagrant destory, then vagrant up and have a fully configured environment. This makes provisioning super powerful.</p> <p>Vagrant gives you multiple options for provisioning the machine, from simple writ line scripts to increasingly ramified configuration management systems such as doughboy and puppet.</p> <h2 id="when-does-vagrant-provisioning-happens">When Does Vagrant Provisioning Happens?</h2> <p>Provisioning happens at unrepealable points during the lifetime of your Vagrant environment:</p> <ul> <li>On the first vagrant up that creates the environment, provisioning is run.</li> <li>When vagrant provision is used on a running environment.</li> <li>When vagrant reload --provision is called. The --provision flag must be present to gravity provisioning.</li> </ul> <p>You can moreover bring up your environment and explicitly not run provisioners by specifying --no-provision. You would typically only do this if you need to test out something in your vagrant configuration.</p> <h2 id="vagrant-provisioning-providers">Vagrant Provisioning Providers</h2> <p>For this tutorial, we are going to use the shell and file providers as they are the simpliest to get started with.</p> <p><strong>Shell Provider</strong></p> <p>The shell provider will run either batch files or powershell scripts depending on the file extension. The script needs to be worldly-wise to run without user interaction.</p> <p><strong>File Provider</strong></p> <p>The file provider, copies a file from your machine to the virtual machine but does not run the script. This is useful for scripts that need user interaction or configuration files that need to be put into place on the virtual machine.</p> <h2 id="next-steps">Next Steps</h2> <p>Now that we understand what provisioning is, in the next couple of lessons we are going to expand on the provisioning to have it install Chocolatey, Boxstarter, and then all of our software using Chocolatey/BoxStarter.</p> Vagrant Part 1 - Easy Virtual Machine Management https://digitaldrummerj.me/vagrant-overview/ Tue, 16 Jun 2015 00:00:00 +0000 https://digitaldrummerj.me/vagrant-overview/ <p>Welcome to an overview of Vagrant and creating of your first Vagrant machine.</p> <h2 id="what-is-vagrant">What is Vagrant?</h2> <p>Vagrant allows you to create and manage lightweight reproducible virtual machines.</p> <p>Essentially, all of the configurations to create and configure a virtual machine are kept separate from the virtual machine. This allows you to delete the virtual machine and then re-create it with all of the same configurations at any point.</p> <p>No longer do you have to be wrung to delete a virtual machine for a project that isn&rsquo;t active. You can moreover requite the Vagrant configuration to a co-worker or move it to flipside machine and be unpreventable that everything will get setup correctly when you create the virtual machine on the new machine.</p> <p>Before, we can see Vagrant in action, we first need to install a little bit of software onto your machine.</p> <h2 id="getting-started">Getting Started</h2> <p>In this section, we will install all of the software needed to be worldly-wise to Vagrant.</p> <p>There are 3 pieces of software that we need:</p> <ol> <li>Chocolatey</li> <li>Virtualbox</li> <li>Vagrant</li> </ol> <h2 id="chocolatey">Chocolatey</h2> <p>Chocolatey is a Windows software install manager. It solves several worldwide issues with software installed:</p> <ul> <li>Where do I find the installer for software?</li> <li>How do I find the 64 bit vs 32 bit version?</li> <li>What default options should I select?</li> <li>Where should I install the software to?</li> <li>etc</li> <li>etc</li> </ul> <p>To install Chocolatey, unshut an legalistic writ prompt and run the writ unelevated or get the writ right on the home for Chocolatey at <a href="http://chocolatey.org">http://chocolatey.org</a> .</p> <pre><code>@powershell -NoProfile -ExecutionPolicyShirk-Command &quot;iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))&quot; &amp;&amp; SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin </code></pre> <p>Go superiority and tropical the writ prompt that you used to install Chocolatey. This is needed so that all of the environment variables get refresh that are part of the Chocolatey installer.</p> <p>Now that we have Chocolatey installed, we can start installing software or as Chocolatey calls them, packages.</p> <p>To install a package, you would run the command:</p> <pre><code>choco install [package name] </code></pre> <p>You can find the package names on the Chocolatey Gallery at <a href="http://chocolatey.org">http://chocolatey.org</a>.</p> <p>Next we are going to install Virtualbox using Chocolatey.</p> <h2 id="virtualbox">Virtualbox</h2> <p>For this tutorial, I am using Virtualbox as the virtual machine provider. You could moreover use Hyper-V (free) or VMWare (paid). If you are using Hyper-V already, you can not use Virtualbox at the same as they mismatch with each other.</p> <p>If you once have Virtualbox installed, you can skip this step.</p> <p>Open an legalistic writ prompt and run the pursuit Chocolatey command.</p> <pre><code>choco install virtualbox.extensionpack </code></pre> <p>The writ whilom will moreover instal Virtualbox as it is listed as a dependency for the virtualbox.extensionpack package.</p> <h2 id="vagrant">Vagrant</h2> <p>To install Vagrant, from the legalistic writ prompt, run the pursuit Chocolatey command.</p> <pre><code>choco install vagrant </code></pre> <p>We are now ready to create our first virtual machine using Vagrant.</p> <h2 id="your-first-machine">Your First Machine</h2> <p>Vagrant create a file tabbed VagrantFile for each virtual machine, The VagrantFile contains the information well-nigh the box the virtual machine is based off of, how to setup the network, the virtualization provider (virtualbox, vmare, hyper-v, azure, etc), and any provisioning scripts to run (shell , puppet, chef, etc) .</p> <p>Vagrant starts with a wiring box which nothing increasingly than the a portable skelton for towers virtual machine. There are 2 types of boxes for Vagrant.</p> <ol> <li><strong>Pre-Build:</strong> meaning that everything that you need is installed on the box. You just create the vagrant machine and are ready to start developing.</li> <li><strong>Base OS:</strong> just the OS is installed and as part of the megacosm of the vagrant machine, you install all of the needed software.</li> </ol> <p>For this tutorial, we are going to use theWiringOS box and build out the box with all of the software we need.</p> <h2 id="creating-vagrantfile">Creating VagrantFile</h2> <p>The first step is to create a directory to hold the VagrantFile. I use c:\VagrantBoxes to hold all of the my Vagrant machines configurations.</p> <ol> <li><p>Within c:\VagrantBoxes, create a directory tabbed MyFirstMachine.</p></li> <li><p>Open up a writ prompt and navigate to the MyFirstMachine directory that you just created.</p></li> <li><p>To initalize the Vagrant box, you need to run the vagrant init command. This writ will initialize the directory to hold Vagrant information and creates the VagrantFile.</p></li> <li><p>For this tutorial, we are going to use the box &ldquo;opentable/win-8.1-enterprise-amd64-nocm&rdquo;. The writ unelevated will initalize the MyFirstMachine directory.</p> <p>vagrant init &ldquo;opentable/win-8.1-enterprise-amd64-nocm&rdquo;</p></li> </ol> <p>Additional boxes can be from the deject at <a href="https://atlas.hashicorp.com/boxes/search">https://atlas.hashicorp.com/boxes/search</a></p> <h2 id="configuring-the-vagrantfile">Configuring the VagrantFile</h2> <p>In the MyFirstMachine directory there is now a file tabbed VagrantFile.Unshutthis file up in your favorite text editor.</p> <p>Within the VagrantFile, there is a vital configuration once setup and a lot of very useful comments that explain the variegated possible configurations.</p> <h3 id="vagrant-general-configurations">Vagrant unstipulated configurations</h3> <ol> <li><p>config.vm.box is the name of the Vagrant wiring box to use to start up the machine with. If this wiring box does not once exist on your machine it will struggle to download it from the Vagrant cloud.</p> <pre><code>config.vm.box = &quot;opentable/win-8.1-enterprise-amd64-nocm&quot; </code></pre></li> <li><p>Configure the very machine name of the virtual machine</p> <pre><code>config.vm.hostname = &quot;MyFirstMachine&quot; </code></pre></li> <li><p>How long Vagrant will alimony trying to connect to the virtual machine surpassing it seem something went wrong and times out.</p> <pre><code>config.vm.boot_timeout = 600 </code></pre></li> <li><p>How to commumicate with the machine. The two options are SSH and WinRM. Typically SSH is used for Linux and WinRM for Windows machines.</p> <pre><code>config.vm.communicator = &quot;winrm&quot; </code></pre></li> </ol> <h3 id="virtualbox-configurations">Virtualbox Configurations</h3> <p>In the configuration below, it will configure the virtual machine with:</p> <ul> <li>4 gigs of RAM</li> <li>Set it to use 2 CPUs</li> <li>Make the video ram 128 megs</li> <li>Set the clipboard as bidirectional so you can reprinting and paste from the host machine to virtual machine as well as from the virtual machine to host machine.</li> <li><p>Name the machine in the Virtualbox Manager UI.</p> <pre><code>config.vm.provider &quot;virtualbox&quot; do |vb| vb.memory = &quot;4096&quot; vb.cpus = 2 vb.customize [&quot;modifyvm&quot;, :id, &quot;--vram&quot;, &quot;128&quot;] vb.customize [&quot;modifyvm&quot;, :id, &quot;--clipboard&quot;, &quot;bidirectional&quot;] vb.name = &quot;My First Machine&quot; end </code></pre></li> </ul> <p>Now we are ready to start up the machine and start using it.</p> <ol> <li>Open a writ prompt.</li> <li>Navigate to the MyFirstMachine folder.</li> <li>Run vagrant up to start up the machine. <ul> <li>The first time you run this writ using a new wiring box, it will take a bit as it has to download the box from the cloud.<br /></li> </ul></li> </ol> <p>Now that the machine is started up, there are some spare Vagrant commands that you will need to know to be worldly-wise to hibernate, reboot, shutdown, and delete the virtual machine</p> <h2 id="vagrant-commands">Vagrant Commands</h2> <p>The commands unelevated all need to run from the writ line from within the MyFirstMachine folder.</p> <p><strong>See Status of Machine</strong></p> <pre><code>vagrant status </code></pre> <p><strong>Hibernate Machine</strong></p> <pre><code>vagrant suspend </code></pre> <p><strong>Reboot Machine</strong></p> <pre><code>vagrant reload </code></pre> <p><strong>Shutdown Machine</strong></p> <pre><code>vagrant shutdown </code></pre> <p><strong>Remove Virtual Machine</strong></p> <pre><code>vagrant destroy </code></pre> <p><strong>Re-Create Machine without Destroying it</strong></p> <pre><code>vagrant up </code></pre> <h2 id="next-steps">Next Steps</h2> <p>You have just create and started up your first Vagrant managed Virtual machine. This is only the whence of what you can do with Vagrant. In future lessons in this series we will install software and configure the OS as part of the vagrant up command, we will create multiple machine with a single vagrant command, create ultramarine virtual machines, and create own own wiring boxes.</p> <p>The next lesson, will imbricate the start of provisioning. We will install Chocolatey as part of the vagrant up command.</p> Add GitWorkshopName toWhackPrompt https://digitaldrummerj.me/add-git-branch-to-bash-shell/ Thu, 11 Jun 2015 00:00:00 +0000 https://digitaldrummerj.me/add-git-branch-to-bash-shell/ <p>When I am working on a git repository and using the git writ line, one of the things that I often end up checking it which git workshop I am on and if there are any pending changes. How superstitious would it be if the whack shell prompt, told you the workshop name if the directory is part of a git repository and if there are any changes. Well, thankfully someone has washed-up this work once and with a little bit of configuration on your part, you can implement the changes.</p> <ol> <li>mkdir ~/.bash</li> <li>cd ~/.bash</li> <li>git clone git://github.com/jimeh/git-aware-prompt.git</li> <li>edit your whack profile (~/.bashrc or ~/.bash_profile)</li> <li><p>At the top of your whack profile, add the pursuit 2 lines.</p> <pre><code>export GITAWAREPROMPT=~/.bash/git-aware-prompt source $GITAWAREPROMPT/main.sh </code></pre></li> <li><p>At the end of your whack profile, update the prompt with the pursuit line.</p> <pre><code>export PS1=&quot;\${debian_chroot:+(\$debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ &quot; </code></pre></li> <li><p>If you are in a git repository directory like I am in the ~blog directory, your prompt will now squint like this:</p> <ul> <li><p>No Uncommited changes</p> <pre><code>vagrant@vagrant-ubuntu-trustry-64:~/blog (master) $[] </code></pre></li> <li><p>Changes that have not been committed. Notice the star without the word master</p> <pre><code>vagrant@vagrant-ubuntu-trustry-64:~/blog (master)* $[] </code></pre></li> </ul></li> <li><p>If you are in a non-git repository directory such as the ~/ directory, your prompt will now squint like this:</p> <pre><code>vagrant@vagrant-ubuntu-trustry-64:~/ $ </code></pre></li> </ol> Windows 8.1 - Powershell Script to Uninstall Default Programs https://digitaldrummerj.me/windows8-script-uninstall-default-programs/ Wed, 27 May 2015 00:00:00 +0000 https://digitaldrummerj.me/windows8-script-uninstall-default-programs/ <p>When I am provisioning a new minutiae virtual machine with vagrant, I do not need all of the Windows 8 modern applications such as bing maps, finance, skype, etc to be installed onto the virtual machine. These applications are nice on a non-virtualized machine but on a virtual machine it just uses uneaten resources that aren&rsquo;t needed.</p> <p>The wiring install of Windows has all of these programs installed with live tiles turned on that I don&rsquo;t need. This is a huge value of clutter.</p> <p><img src="/images/vagrant/Vagrant-Pre-RemoveDefaultProgramsProvisioning.png" alt="&quot;Windows surpassing removing start menu default programs" /></p> <p>Luckily unbearable Ben Hunter, wrote a powershell script that we will be going through and setting up as part of the vagrant provisioning process. <a href="http://blogs.technet.com/b/deploymentguys/archive/2013/10/21/removing-windows-8-1-built-in-applications.aspx">View Original Script</a>.</p> <p>We will be going through 3 steps:</p> <ol> <li>Figure out which applications that you want to remove.<br /></li> <li>Update the script with the list of applications to remove.<br /></li> <li>Add the vagrant provisioning configuration to run the script when you initially run vagrant up<br /></li> </ol> <h2 id="getting-a-list-of-possible-applications-to-remove">Getting a List of Possible Applications to Remove</h2> <p>The first step is to get the list of possible using to remove. We are going to get this list by running the Get-AppxPackage powershell function, saving output to a file named ModernApps.txt that will be saved to the Windows temp directory and unshut it in notepad.</p> <ol> <li><p>Open up a powershell writ prompt.</p> <ul> <li>Use Windows Key + R, type powershell and printing enter <br /></li> </ul></li> <li><p>Run the pursuit writ to get the list of applications, save the output to a file and unshut it in notepad.</p> <pre><code>Get-AppxPackage | Format-Wide -Property Name -Column 1 | Out-File &quot;${env:temp}\ModernApps.txt&quot; | notepad &quot;${env:temp}\ModernApps.txt&quot; </code></pre></li> <li><p>In the script in the next section, modify the $AppsList variable with the programs that you wish to uninstall.</p></li> </ol> <h2 id="powershell-script-to-remove-specified-applications">Powershell Script to Remove Specified Applications</h2> <p>The second step is to create the script to remove the specific applications. The script unelevated takes a list of using and calls the Remove-AppxPackage writ to uninstall the application. The list of applications to remove is stored in the $AppsList variable within the script.</p> <p>Some applications such as camera and photos are not programs that you can be uninstall and may still be pinned to your start menu without this script has run. Unfortunately, starting with Windows 8.1 Microsoft removed the worthiness to programmatically pin and unpin applications from the start menu, so you will have to manually unpin them. Having to manually unpin a couple of using is much largest than having to manually uninstall 19 applications.</p> <p>Note: If you are testing out the script unelevated by running it from the Powershell ISE, you will get a warning that the environment does not support Transcripts. This warning will not happen when run from the powershell writ line.</p> <pre><code class="language-powershell">#********************* # Purpose: Remove built in apps specified in list # Pre-Reqs: Windows 8.1 #********************* #------------------------ # Main Routine #------------------------ # Get log path. # Will log to Task Sequence log folder if the script is running in a Task Sequence # Otherwise log to \windows\temp try { $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment $logPath = $tsenv.Value(&quot;LogPath&quot;) } reservation { Write-Host &quot;This script is not running in a task sequence&quot; $logPath = $env:windir + &quot;\temp&quot; } $logFile = &quot;$logPath\$($myInvocation.MyCommand).log&quot; # Start logging Start-Transcript $logFile Write-Host &quot;Logging to $logFile&quot; # ********************* # Update the List of Applications to be removed with your own #********************* $AppsList = &quot;microsoft.windowscommunicationsapps&quot;, &quot;Microsoft.BingFinance&quot;, &quot;Microsoft.BingMaps&quot;,` &quot;Microsoft.BingWeather&quot;, &quot;Microsoft.ZuneVideo&quot;, &quot;Microsoft.ZuneMusic&quot;, &quot;Microsoft.Media.PlayReadyClient.2&quot;,` &quot;Microsoft.XboxLIVEGames&quot;, &quot;Microsoft.HelpAndTips&quot;, &quot;Microsoft.BingSports&quot;,` &quot;Microsoft.BingNews&quot;, &quot;Microsoft.BingFoodAndDrink&quot;, &quot;Microsoft.BingTravel&quot;, &quot;Microsoft.WindowsReadingList&quot;,` &quot;Microsoft.BingHealthAndFitness&quot;, &quot;Microsoft.WindowsAlarms&quot;, &quot;Microsoft.WindowsScan&quot;, &quot;Microsoft.WindowsSoundRecorder&quot;, &quot;Microsoft.SkypeApp&quot; ForEach ($App in $AppsList) { $Packages = Get-AppxPackage | Where-Object {$_.Name -eq $App} if ($Packages -ne $null) { Write-Host &quot;Removing Appx Package: $App&quot; foreach ($Package in $Packages) { Remove-AppxPackage -package $Package.PackageFullName } } else { Write-Host &quot;Unable to find package: $App&quot; } $ProvisionedPackage = Get-AppxProvisionedPackage -online | Where-Object {$_.displayName -eq $App} if ($ProvisionedPackage -ne $null) { Write-Host &quot;Removing Appx Provisioned Package: $App&quot; Remove-AppxProvisionedPackage -online -packagename $ProvisionedPackage.PackageName } else { Write-Host &quot;Unable to find provisioned package: $App&quot; } } # Stop logging Stop-Transcript </code></pre> <p>##Executing Powershell Script as Part of Vagrant Provisioning</p> <p>The last step is to add the running of the script to the vagrant provisioning process.</p> <ol> <li>In the directory where you have your VagrantFile, create a directory tabbed shell.</li> <li>Create a new file tabbed RemoveDefaultPrograms.ps1 int the shell folder.</li> <li>In the shell directory, create a file tabbed main.cmd.</li> <li><p>Add the pursuit contents to the main.cmd file.</p> <pre><code>echo 'Removing Default Windows Programs' @powershell -NoProfile -ExecutionPolicyShirk-File &quot;%systemdrive%\vagrant\shell\RemoveDefaultPrograms.ps1&quot; </code></pre></li> <li><p>Open up your VagrantFile in a text editor of your choice.</p></li> <li><p>Add the pursuit line in the zone where you have your provisioning setup.</p> <pre><code>config.vm.provision :shell, path: &quot;shell/main.cmd&quot; </code></pre></li> <li><p>When you run vagrant up, the last step it will run is the provisioning scripts.</p></li> <li><p>If you once have a machine controlled by vagrant up and running, you can run vagrant provision to rerun the provisioning scripts.</p></li> </ol> <p><strong>Sample Output from the vagrant provisioning</strong></p> <pre><code>==&gt; default: C:\Windows\system32&gt;echo 'Removing Default Windows Programs' ==&gt; default: ==&gt; default: 'Removing Default Windows Programs' ==&gt; default: This script is not running in a task sequence ==&gt; default: Transcript started, output file is C:\Windows\temp\RemoveDefaultPrograms.ps1.log ==&gt; default: ==&gt; default: Logging to C:\Windows\temp\RemoveDefaultPrograms.ps1.log ==&gt; default: Unable to find package: microsoft.windowscommunicationsapps ==&gt; default: Removing Appx Provisioned Package: microsoft.windowscommunicationsapps ==&gt; default: ==&gt; default: Path : ==&gt; default: Online : True ==&gt; default: Restart Needed : False ==&gt; default: ==&gt; default: ==&gt; default: Unable to find package: Microsoft.BingFinance ==&gt; default: Removing Appx Provisioned Package: Microsoft.BingFinance ==&gt; default: Path : ...... ==&gt; default: ==&gt; default: Transcript stopped, output file is C:\Windows\temp\RemoveDefaultPrograms.ps1.log </code></pre> <p>After we have run the script, if you used the using list that I had in the script, the start menu will squint like this.</p> <p><img src="/images/vagrant/Vagrant-Post-RemoveDefaultProgramsProvisioning.png" alt="Windows start menu without removing default programs" /></p> <h2 id="conclusion">Conclusion</h2> <p>Now the start menu is mine then tenancy then and I can unquestionably make it useful. No longer is the first 30 minutes of creating a new virtual machine nothing increasingly than uninstall the default programs and messing with the start menu.</p> Javascript Debugging Made Easier with Sourcemaps https://digitaldrummerj.me/javascript-sourcemaps/ Sun, 17 May 2015 00:00:00 +0000 https://digitaldrummerj.me/javascript-sourcemaps/ <p>Updated: Add wipe task that uses rimraf to delete the bundle.min.js file if it once exist. Without this it would just suspend to the existing bundle.min.js file.</p> <p>When you release your web site to production, you should minify and concatenate your javascript files. You will have much largest performance by doing this but unfortunately debugging becomes difficult with the minified lawmaking as it shortens all of the variable and method names. Luckily there is a simple solution to tell the browser developer tools to use the original javascript files when debugging the code, tabbed source maps.</p> <p>Sourcemaps bacically are a way to map the combined/minified file when to the original file. As part of the minification process you generate a source map which holds the information well-nigh your original files. The developer tools will then parse the source map and make it towards as though you&rsquo;re running unminified and uncombined files.</p> <p>##Creating Sourcemaps</p> <p>To generate the sourcemaps we are going to gulp with the gulp-concat, gulp-uglify, and gulp-sourcemaps modules. If you are not familiar with gulp, it is basically a javascript build system that allows you to write lawmaking to automate tasks.</p> <ol> <li>Install <a href="http://nodejs.org">node.js</a> if you don&rsquo;t have it installed already.</li> <li><p>Install Gulp and the Gulp modules that we need.</p> <pre><code>$ npm install --save gulp $ npm install --save gulp-concat $ npm install --save-dev gulp-uglify $ npm install --save-dev gulp-sourcemaps $ npm install --save-dev rimraf </code></pre></li> <li><p>Create a file tabbed gulpfile.js if you don&rsquo;t once have one.</p></li> <li><p>Add the required gulp modules to the gulpfile.js.</p> <pre><code>var gulp = require('gulp'); var gutil = require('gulp-util'); var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var sourcemaps = require('gulp-sourcemaps'); var rimraf = require('rimraf'); </code></pre></li> <li><p>Create the input paths variable to hold what files we should minify/concatenate. I alimony my files in the www folder. The ! in the 2nd input path ways to exclude this path. I typically alimony my vendor skips like angular, ionic, jquery, etc in the lib folder, so I don&rsquo;t want to minify those scripts again.</p> <pre><code> var inputPaths = { javascript: ['./www/**/*.js', '!./www/lib/**'] }; </code></pre></li> <li><p>Create the output path variable to tell gulp where to output the minified file.</p> <pre><code> var outputPaths = { 'javascript': './www/js' }; </code></pre></li> <li><p>Now we need to create the very gulp task that does the minification and source map creation. This tasks takes the inputPaths.javscript files, combines them, minifies them, creates the source maps and save it all as a file tabbed bundle.min.js. By default the gulp.dest undeniability will suspend the minified text to the bundle.min.js instead of overwriting it. Instead we need to undeniability the wipe task task first which will delete the minified file if it once exist.</p> <pre><code> var minifiedJsFileName = 'bundle.min.js'; gulp.task('build-js', ['clean'], function() { return gulp.src(inputPaths.javascript) .pipe(sourcemaps.init()) .pipe(concat(minifiedJsFileName)) .pipe(uglify()) .pipe(sourcemaps.write()) .pipe(gulp.dest(outputPaths.javascript)); }); </code></pre></li> <li><p>Create the wipe task</p> <pre><code> gulp.task(&quot;clean&quot;, function (cb) { rimraf(outputPaths.javascript + '/' + minifiedJsFileName, cb); }); </code></pre></li> <li><p>Once the task is created, we want to setup a gulp watch to regenerate the file when any of the javascript changes.</p> <pre><code>gulp.task('watch', function() { gulp.watch(inputPaths.javascript, ['build-js']); }); </code></pre></li> <li><p>Finally, we are going to create a default task to run the build-js task we created. The default task will typically what you want to run unendingly you start up the web server.</p> <pre><code>gulp.task('default', ['build-js']); </code></pre></li> </ol> <p>##Running Task</p> <ol> <li>Open a writ prompt or terminal.</li> <li>Navigate to the directory that contain the gulpfile.js we created.</li> <li><p>Run the pursuit command:</p> <pre><code>$ gulp build-js </code></pre></li> <li><p>If it worked successfully, you should have a minified file in your www/js folder.</p></li> <li><p>To use the file, unshut up the index.html file and remove all of your javascript script tags that reference your js files in the www folder and replace it with a single script tag that references the www/js/bundle.min.js file. Make sure to leave any vendor script tags.</p></li> </ol> <p>##Enabling Sourcemaps in Chrome Developer Tools</p> <p>Now that we have the source maps generated, we have to tell the Chrome Developer Tools to enable the source maps.</p> <ol> <li>Open Google Chrome.</li> <li><p>Open the Developer Tools.</p> <p><img src="/images/ChromeDevTools/ChromeDevTools-Open.png" alt="Open Chrome Developer Tools" /></p></li> <li><p>Click on the Setting Cog.</p> <p><img src="/images/ChromeDevTools/ChromeDevTools-SettingsCog.png" alt="Open Settings" /></p></li> <li><p>Scroll lanugo in theUnstipulatedSettings under you see the Sources section and ensure that the &ldquo;Enable JavaScript source maps&rdquo; is checked.</p> <p><img src="/images/ChromeDevTools/ChromeDevTools-JavascriptSourcemapsEnabled.png" alt="Enable Javascript Source Maps" /></p></li> <li><p>Click on the X in the upper right of the Settings windows to tropical it.</p></li> <li><p>Now view your web site in the browser to make sure everything is still working.</p> <ul> <li>Note: If you are using Angular, you have to make sure that you use the minification unscratched syntax for the dependency injection. See the next section for examples.</li> <li>Note 2: If you are using the Ionic Framework, the default templates (blank, tabs, sidemenu) do not use theWeedyminification unscratched syntax. You will need to modify the template without you generate your application. <br /></li> </ul></li> </ol> <p>##Angular MinificationUnscratchedSyntax</p> <p>If you are using the AngularJs framework it does a lot of dependency injection. Out of the box, if you just pass in your arguments to the variegated functions, it is not minification safe. There are a couple of easy ways to make it minification unscratched with a minimal value of lawmaking changes.</p> <p>Option 1: $inject method <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">//Controllers var myController = function(anyVariableName, $http) { }; myController.$inject = [&#39;$scope&#39;, &#39;$http&#39;];</code></pre></div></p> <p>Option 2: &#91;&#93; syntax. You start the 2nd parameter with a &#91;, put your list of dependencies as string, your function to run and then the latter &#93;.</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text"> //Modules var myApp = angular.module(&#39;myApp&#39;, [ //Dependencies go here.] ); //Services myApp.service(&#39;serviceName&#39;, [&#39;$http&#39;, &#39;$location&#39;, function($http, $location) { } ] ); //Directives myApp.directive(&#39;directiveName&#39;, [&#39;$http&#39;, &#39;$location&#39;, function($http, $location) { } ] ); //Factories myApp.factory(&#39;factoryName&#39;, [&#39;$http&#39;, &#39;$location&#39;, function($http, $location) { } ] );</code></pre></div> Chrome DevTools - Hiding Vendor Scripts https://digitaldrummerj.me/chrome-devtools-black-boxing/ Fri, 15 May 2015 00:00:00 +0000 https://digitaldrummerj.me/chrome-devtools-black-boxing/ <p>The Chrome Developer tools are an wondrous set of tools for debugging and trobuleshooting web sites. If you are a web developer and have not tried out these tools, you have been missing out. As wondrous as the developer tools are, one of the most worrying features to me was not stuff worldly-wise to skip over vendor javascript like jquery or angular. Getting stuck in a minified version of a weedy or jquery takes you lanugo a deep rabbit slum that you never wanted to go lanugo and is a worrying to climb out of.</p> <p>Luckily, there is a super simple solution that I learned from <a href="http://twitter.com/jaredthenerd">Jared Farris</a> during his Chrome Developer Tools talk at the <a href="http://www.codepalousa.com">Codepalousa Conference</a> tabbedWoebegoneBoxing.Woebegoneboxing allows you to tell the javascript debugger to skip over the file when stepping through the code.</p> <p>So how do you turn on woebegone boxing for a file?</p> <ol> <li>Open Chrome</li> <li>Navigate to the web site that you want to troubleshoot</li> <li><p>Open the Chrome Developer Tools</p> <p><img src="/images/ChromeDevTools/ChromeDevTools-Open.png" alt="Open Chrome Dev Tools Screenshot" /></p></li> <li><p>Navigate to the Source tab</p></li> <li><p>Right-click on your javascript file you want to woebegone box</p></li> <li><p>Select Blackbox script from the menu</p> <p><img src="/images/ChromeDevTools/ChromeDevTools-BlackBoxing.png" alt="Black Box Script Screenshot" /></p></li> </ol> <p>Now you are ready to set a breakpoint in your code, refresh your page and debug your javascript code.</p> <p>Check out the Javascript Debugging documentation for all of the features of the debugger, <a href="https://developer.chrome.com/devtools/docs/javascript-debugging">https://developer.chrome.com/devtools/docs/javascript-debugging</a>.</p> Removing the NPM spinner https://digitaldrummerj.me/remove-npm-spinner/ Thu, 07 May 2015 00:00:00 +0000 https://digitaldrummerj.me/remove-npm-spinner/ <p>One of the most worrying features of npm for me is the spinner. Many times it runs long unbearable that I am wondering if it is still working or hung. Thankfully you can hands transpiration this with the .npmrc file.</p> <ol> <li>On Linux/OSx, create the file ~/.npmrc</li> <li>On Windows, create the file %USERPROFILE%/.npmrc</li> <li><p>Add the 2 lines unelevated to the file</p> <pre><code>spin=false loglevel=http </code></pre></li> <li><p>Save the file</p></li> <li><p>Close your writ prompt/terminal and reopen it.</p></li> <li><p>Run an npm install writ and you will see log messages instead of the spinner.</p></li> </ol> Nuget - Incrementing VersionSurpassingBuilding https://digitaldrummerj.me/nuget-auto-incrementing-version/ Mon, 04 May 2015 00:00:00 +0000 https://digitaldrummerj.me/nuget-auto-incrementing-version/ <p>When you are towers nuget packages that are not directly using the AssemblyInfo.cs for the version number, you need to make sure to increment the nuget version number surpassing towers the package. Inevitable though you will forget to increment the version number and have to build the package a 2nd time. Wouldn&rsquo;t it be unconfined if you could automatically increment the version number surpassing calling nuget pack. Well I have written a powershell script to do just this.Unelevatedare the details out the script.</p> <ol> <li>In your project directory, create a file tabbed IncrementNugetVersionNumber.ps1</li> <li>Add the pursuit parameters to the top of the file to take in the nuget spec file location and any version parameters.</li> </ol> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">param</span>($NuSpecFile = $(<span style="color:#66d9ef">throw</span> <span style="color:#e6db74">&#34;Mandatory parameter -NuSpecFile not supplied&#34;</span>), $MajorVersion, $MinorVersion, $RevisionVersion)</code></pre></div> <p>Next we are going to add a tuft of helper functions right under the param lawmaking from above. These helper functions will make it easier to deal with the xml queries of the nuget spec document.</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> AssignVersionValue( <span style="color:#66d9ef">[string]</span>$oldValue, <span style="color:#66d9ef">[string]</span>$newValue) { <span style="color:#66d9ef">if</span> ($newValue <span style="color:#f92672">-eq</span> $null <span style="color:#f92672">-or</span> $newValue <span style="color:#f92672">-eq</span> <span style="color:#e6db74">&#34;&#34;</span>) { $oldValue } <span style="color:#66d9ef">else</span> { $newValue } }</code></pre></div> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> Get-XmlNamespaceManager( <span style="color:#66d9ef">[xml]</span>$XmlDocument, <span style="color:#66d9ef">[string]</span>$NamespaceURI = <span style="color:#e6db74">&#34;&#34;</span>) { <span style="color:#66d9ef">if</span> (<span style="color:#66d9ef">[string]</span>::IsNullOrEmpty($NamespaceURI)) { $NamespaceURI = $XmlDocument.DocumentElement.NamespaceURI } <span style="color:#66d9ef">[System.Xml.XmlNamespaceManager]</span>$xmlNsManager = New-Object System.Xml.XmlNamespaceManager($XmlDocument.NameTable) $xmlNsManager.AddNamespace(<span style="color:#e6db74">&#34;ns&#34;</span>, $NamespaceURI) <span style="color:#66d9ef">return</span> ,$xmlNsManager }</code></pre></div> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> Get-FullyQualifiedXmlNodePath( <span style="color:#66d9ef">[string]</span>$NodePath, <span style="color:#66d9ef">[string]</span>$NodeSeparatorCharacter = <span style="color:#e6db74">&#39;.&#39;</span>) { <span style="color:#66d9ef">return</span> <span style="color:#e6db74">&#34;/ns:</span>$($NodePath.Replace($($NodeSeparatorCharacter), <span style="color:#e6db74">&#39;/ns:&#39;</span>))<span style="color:#e6db74">&#34;</span> }</code></pre></div> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> Get-XmlNode( <span style="color:#66d9ef">[xml]</span>$XmlDocument, <span style="color:#66d9ef">[string]</span>$NodePath, <span style="color:#66d9ef">[string]</span>$NamespaceURI = <span style="color:#e6db74">&#34;&#34;</span>, <span style="color:#66d9ef">[string]</span>$NodeSeparatorCharacter = <span style="color:#e6db74">&#39;.&#39;</span>) { $xmlNsManager = Get-XmlNamespaceManager -XmlDocument $XmlDocument -NamespaceURI $NamespaceURI <span style="color:#66d9ef">[string]</span>$fullyQualifiedNodePath = Get-FullyQualifiedXmlNodePath -NodePath $NodePath -NodeSeparatorCharacter $NodeSeparatorCharacter $node = $XmlDocument.SelectSingleNode($fullyQualifiedNodePath, $xmlNsManager) <span style="color:#66d9ef">return</span> $node }</code></pre></div> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> Get-XmlNodes( <span style="color:#66d9ef">[xml]</span>$XmlDocument, <span style="color:#66d9ef">[string]</span>$NodePath, <span style="color:#66d9ef">[string]</span>$NamespaceURI = <span style="color:#e6db74">&#34;&#34;</span>, <span style="color:#66d9ef">[string]</span>$NodeSeparatorCharacter = <span style="color:#e6db74">&#39;.&#39;</span>) { $xmlNsManager = Get-XmlNamespaceManager -XmlDocument $XmlDocument -NamespaceURI $NamespaceURI <span style="color:#66d9ef">[string]</span>$fullyQualifiedNodePath = Get-FullyQualifiedXmlNodePath -NodePath $NodePath -NodeSeparatorCharacter $NodeSeparatorCharacter $nodes = $XmlDocument.SelectNodes($fullyQualifiedNodePath, $xmlNsManager) <span style="color:#66d9ef">return</span> $nodes }</code></pre></div> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> Get-XmlElementsTextValue( <span style="color:#66d9ef">[xml]</span>$XmlDocument, <span style="color:#66d9ef">[string]</span>$ElementPath, <span style="color:#66d9ef">[string]</span>$NamespaceURI = <span style="color:#e6db74">&#34;&#34;</span>, <span style="color:#66d9ef">[string]</span>$NodeSeparatorCharacter = <span style="color:#e6db74">&#39;.&#39;</span>) { $node = Get-XmlNode -XmlDocument $XmlDocument -NodePath $ElementPath -NamespaceURI $NamespaceURI -NodeSeparatorCharacter $NodeSeparatorCharacter <span style="color:#66d9ef">if</span> ($node) { <span style="color:#66d9ef">return</span> $node.InnerText } <span style="color:#66d9ef">else</span> { <span style="color:#66d9ef">return</span> $null } }</code></pre></div> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-powershell" data-lang="powershell"><span style="color:#66d9ef">function</span> Set-XmlElementsTextValue( <span style="color:#66d9ef">[xml]</span>$XmlDocument, <span style="color:#66d9ef">[string]</span>$ElementPath, <span style="color:#66d9ef">[string]</span>$TextValue, <span style="color:#66d9ef">[string]</span>$NamespaceURI = <span style="color:#e6db74">&#34;&#34;</span>, <span style="color:#66d9ef">[string]</span>$NodeSeparatorCharacter = <span style="color:#e6db74">&#39;.&#39;</span>) { $node = Get-XmlNode -XmlDocument $XmlDocument -NodePath $ElementPath -NamespaceURI $NamespaceURI -NodeSeparatorCharacter $NodeSeparatorCharacter <span style="color:#66d9ef">if</span> ($node) { $node.InnerText = $TextValue } <span style="color:#66d9ef">else</span> { $elementName = $ElementPath.Substring($ElementPath.LastIndexOf($NodeSeparatorCharacter) + 1) $element = $XmlDocument.CreateElement($elementName, $XmlDocument.DocumentElement.NamespaceURI) $textNode = $XmlDocument.CreateTextNode($TextValue) $element.AppendChild($textNode) &gt; $null $parentNodePath = $ElementPath.Substring(0, $ElementPath.LastIndexOf($NodeSeparatorCharacter)) $parentNode = Get-XmlNode -XmlDocument $XmlDocument -NodePath $parentNodePath -NamespaceURI $NamespaceURI -NodeSeparatorCharacter $NodeSeparatorCharacter <span style="color:#66d9ef">if</span> ($parentNode) { $parentNode.AppendChild($element) &gt; $null } <span style="color:#66d9ef">else</span> { <span style="color:#66d9ef">throw</span> <span style="color:#e6db74">&#34;$parentNodePath does not exist in the xml.&#34;</span> } } }</code></pre></div> <p>Now that the helper functions are added, it is time to create the meat of the script where you will update the version number and write it when to the file.</p> <ol> <li><p>Get the Full Path of the Nuget spec file from parameter $NuSpecFile</p> <pre><code>$NuSpecFile = Resolve-Path $NuSpecFile </code></pre></li> <li><p>Once we have the full path, we need to get the contents of the files as an Xml document so that we can run xpath queries on it.</p> <pre><code>[ xml ]$fileContents = Get-Content -Path $NuSpecFile </code></pre></li> <li><p>Then we need to get the current version number</p> <pre><code>$originalVersion = Get-XmlElementsTextValue -XmlDocument $fileContents -ElementPath &quot;package.metadata.version&quot; </code></pre></li> <li><p>Set a default version number</p> <pre><code>$newVersion = &quot;1.0.0&quot; </code></pre></li> <li><p>If there is an existing version number, then we can update it. If not, then use the default version number. This bit of lawmaking will unravel untied the version number into individual segments that we can then update.</p> <pre><code>if ($originalVersion -ne $null) { $segments=$originalVersion.Split(&quot;.&quot;) $v1=&quot;1&quot; $v2=&quot;0&quot; $v3=&quot;0&quot; if ($segments.Length -gt 0) { $v1=$segments[0] } if ($segments.Length -gt 1) { $v2=$segments[1] } if ($segments.Length -eq 3) { $v3=$segments[2] } $v1 = AssignVersionValue $v1 $MajorVersion $v2 = AssignVersionValue $v2 $MinorVersion $v3 = AssignVersionValue $v3 $RevisionVersion if ($v1 -eq $null) { $v1 = 1 } if ($v2 -eq $null) { $v2 = 0 } if ($v3 -eq $null) { $v3 = 0 } $newVersion = &quot;$v1.$v2&quot; #Write-Host &quot;REV: $RevisionVersion&quot; if ($v3 -ne $null -and ($RevisionVersion -eq $null -or $RevisionVersion -eq &quot;&quot;)) { $v3 = ($v3 -as [int]) + 1 } $newVersion = &quot;$newVersion.$v3&quot; } </code></pre></li> <li><p>Lastly, we need to set the new version number and save the file.</p> <pre><code>write-host &quot;Setting Version to $newVersion&quot; Set-XmlElementsTextValue -XmlDocument $fileContents -ElementPath &quot;package.metadata.version&quot; -TextValue $newVersion $fileContents.Save($NuSpecFile) </code></pre></li> </ol> <p>Now that we have the powershell script built to increment the version number, the next piece is to create the batch file that calls the script and nuget pack.</p> <p>For the batch file you can pass in /major, /minor, /revision, and /outputdir. If any of these are not passed in, it will use the existing values from the nuget spec and output into the current directory.</p> <ol> <li>Create a file tabbed build.cmd</li> <li><p>Setup the parameters</p> <pre><code>@echo off SET OUTPUTDIR=&quot;&quot; SET REVISION=&quot;&quot; SET MAJOR=&quot;&quot; SET MINOR=&quot;&quot; </code></pre></li> <li><p>Next we need to trammels the parameters and set each of the individual values.</p> <pre><code>:checkparameters :: REM Grab the first variable supplied as a whole. Ex. /action:start set SWITCHPARSE=%1 :: REMTrammelsto see if there are no increasingly switches, if so goto end of :: parsing, prevents uncounted loop IF [%SWITCHPARSE%] == [] goto end :: REM Reset variables as wipe up. set SWITCH= set VALUE= :: In the SWITCHPARSE variable, grab the two tokens separated :: by a : and assign the first to SWITCH and the second to VALUE for /F &quot;tokens=1,2 delims=:&quot; %%a IN (&quot;%SWITCHPARSE%&quot;) DO ( SET SWITCH=%%a set VALUE=%%b ) ::Trammelswhich whoopee to perform based on the switch IF [%SWITCH%] == [/revision] goto setrevision IF [%SWITCH%] == [/major] goto setmajorversion IF [%SWITCH%] == [/minor] goto setminorversion IF [%SWITCH%] == [/outputdir] goto setoutputdir :: Perform the whoopee by setting the variable for later use and :: shift the writ line parameters so the next in line is :: ready to be processed goto end :setrevision set REVISION=%VALUE% SHIFT goto checkparameters :setmajorversion set MAJOR=%VALUE% SHIFT goto checkparameters :setminorversion set MINOR=%VALUE% SHIFT goto checkparameters :setoutputdir set OUTPUTDIR=%VALUE% SHIFT goto checkparameters </code></pre></li> <li><p>Finally we need to undeniability the powershell script we created whilom and increment the version number in the nuget spec.</p> <pre><code>:end echo. reverberate PowerShell -NoProfile -ExecutionPolicyShirk-File &quot;..\IncrementNugetVersionNumber.ps1&quot; -NuspecFile &quot;log4net.blank.config.nuspec&quot; -RevisionVersion %REVISION% -MajorVersion %MAJOR% -MinorVersion %MINOR% PowerShell -NoProfile -ExecutionPolicyShirk-File &quot;..\IncrementNugetVersionNumber.ps1&quot; -NuspecFile &quot;log4net.appender.console.nuspec&quot; -RevisionVersion %REVISION% -MajorVersion %MAJOR% -MinorVersion %MINOR% </code></pre></li> <li><p>Finally, we need to undeniability nuget pack to build the nuget package</p> <pre><code>echo. reverberate nuget pack -OUTPUTDIR &quot;%OUTPUTDIR%&quot; nuget pack -OUTPUTDIR %OUTPUTDIR% </code></pre></li> </ol> <p>Now unendingly that you need to build the nuget package, you just have to undeniability build.cmd and it will spit out an new package with an incremented version number.</p> <p>I know this post was a lot of code. Both of the files that we create can be downloaded at:</p> <p><a href="{{&quot;/Downloads/2015-05-03-Nuget-Auto-Incrementing-Version/IncrementNugetVersionNumber.ps1&quot; | prepend: site.baseurl}}">IncrementNugetVersionNumber.ps1</a></p> <p><a href="{{&quot;/Downloads/2015-05-03-Nuget-Auto-Incrementing-Version/build.cmd&quot; | prepend: site.baseurl }}">build.cmd</a></p> PurchasingMerchantryCards https://digitaldrummerj.me/business-cards/ Mon, 04 May 2015 00:00:00 +0000 https://digitaldrummerj.me/business-cards/ <p>If you are planning on going to any professional networking events, user groups, or speaking at events, you should have merchantry cards with you. Many times people think, I only need to have merchantry cards if I am looking for a job. This is far from the truth. You should have merchantry cards so that you can connect with the people that you have met. People tend to meet lots of people at events and without a merchantry card, it is difficult for people to remember who you are. It is moreover a good way for people to be worldly-wise to follow up with you.</p> <p>You may be tempted to make your own merchantry cards and print them off on your home printer but please don&rsquo;t. At first this sounds like a unconfined idea but scrutinizingly never works out right. If you don&rsquo;t get the right vellum stock they will finger cheap. If you don&rsquo;t get them exactly aligned when printing, they will squint unprofessional. When wearing the cards then need to be straight wipe cuts which is not easy to do.</p> <p>Instead you need to purchase professionally printed cards. You might be thinking, having to purchase merchantry cards is going to be expensive but this is no longer the case. You can hands get 100 merchantry cards and a holder for under $30.</p> <p>I purchased my merchantry cards from <a href="http://www.moo.com/share/8fybwg">http://www.moo.com</a> (affiliate link) and was very happy with their cards and service. It was very simple for me to diamond my cards. There was lots of variegated designs to select from and I was worldly-wise to upload custom images to use. They moreover offer a pdf export of the cards so that you can send them to other to review them or print off one to see how it would look.</p> <p>For my cards, I went with the MiniCards. I liked that the cards were unique in size without stuff too unique. Plus with the MiniCard Holder, I was worldly-wise to have up to 12 cards on my keychain at any given time. This meant that I never had to remember to bring cards with me and unchangingly had them if the need came about.</p> Automatically Add JS/CSS Files to Your Ionic Projects https://digitaldrummerj.me/gulp-inject/ Thu, 30 Apr 2015 00:00:00 +0000 https://digitaldrummerj.me/gulp-inject/ <p>As you work on an Ionic based project or for that matter any web projects that have javascript or css file, you will at some point forget to add your new javascript or css file to the page and wonder why the page is broken. This is really worrying when it happens as many times you spend quite a bit of time troubleshooting surpassing you realize that you just forgot to add the script or css tag. You can fix this problem using gulp and the gulp inject module to automatically add the script and css tags onto the page.</p> <h2 id="installing-gulp">Installing Gulp</h2> <p>You should once have NodeJS installed. To install Gulp:</p> <ol> <li>Open writ prompt</li> <li><p>On Windows, run the command:</p> <pre><code>$ npm install gulp -g </code></pre></li> <li><p>On OSx, run the command:</p> <pre><code>$ sudo npm install gulp -g </code></pre></li> </ol> <h2 id="installing-gulp-inject">Installing Gulp-Inject</h2> <ol> <li><p>To add the gulp-inject module to the package.json file as a minutiae dependency you need to install gulp-inject with the --save-dev argument. From your Ionic project directory run the command:</p> <pre><code>$ npm install gulp-inject --save-dev </code></pre></li> </ol> <h2 id="adding-inject-task-to-gulpfile-js">Adding Inject Task to gulpfile.js</h2> <ol> <li>Open the gulpfile.js</li> <li><p>Add gulp-inject as a required module. Name the variable used inject.</p> <pre><code>var inject = require('gulp-inject'); </code></pre></li> <li><p>Next you need to add to the paths where to squint for changes to javascript and css files. Note taht the ! in front of the file/path ways to exclude that file/path from stuff injected.</p> <pre><code>var paths = { sass: ['./scss/**/*.scss'], javascript: [ './www/**/*.js', '!./www/js/app.js', '!./www/lib/**' ], css: [ './www/**/*.css', '!./www/css/ionic.app*.css', '!./www/lib/**' ] }; </code></pre></li> <li><p>Next we need to add a new gulp task tabbed alphabetize (could be tabbed anything).</p> <pre><code>gulp.task('index', function(){ return gulp.src('./www/index.html') .pipe(inject( gulp.src(paths.javascript, {read: false}), {relative: true})) .pipe(gulp.dest('./www')) .pipe(inject( gulp.src(paths.css, {read: false}), {relative: true})) .pipe(gulp.dest('./www')); }); </code></pre></li> <li><p>Next add the alphabetize task to the gulp default task</p> <pre><code>gulp.task('default', ['sass', 'index']); </code></pre></li> <li><p>Finally, add the javascript and css paths to the gulp watch task and have it undeniability the alphabetize task when a transpiration is detected.</p> <pre><code>gulp.task('watch', function() { gulp.watch(paths.sass, ['sass']); gulp.watch([ paths.javascript, paths.css ], ['index']); }); </code></pre></li> </ol> <h2 id="setting-up-index-html-to-accept-inject">Setting up index.html toWinnowInject</h2> <ol> <li>Open up the index.html file</li> <li><p>In the throne tag, replace all of the script tags for your controllers and services with the inject:js scuttlebutt below. Make sure to leaveLeave the app.js script tag.</p> <pre><code>&lt;!-- inject:js --&gt; &lt;!-- endinject --&gt; </code></pre></li> <li><p>Replace the css tag for the style.css with the inject:css writ below</p> <pre><code>&lt;!-- inject:css --&gt; &lt;!-- endinject --&gt; </code></pre></li> </ol> <h2 id="manually-running-it">Manually Running It</h2> <ol> <li><p>Run the gulp task alphabetize and then squint at the index.html page. You should see all of the javascript and css files widow when in.</p> <pre><code>gulp alphabetize </code></pre></li> </ol> <h2 id="running-it-with-ionic-serve">Running it with Ionic serve</h2> <ol> <li><p>Open the ionic.project file and add the gulp alphabetize task to the gulpStartUpTasks. If you don&rsquo;t have a gulpStartupTasks section, go superiority and add it without the sass task.</p> <pre><code>&quot;gulpStartupTasks&quot;: [ &quot;index&quot;, &quot;watch&quot;, &quot;sass&quot; ], </code></pre></li> <li><p>In the index.html page, remove the javascript and css tags again. Then run the ionic serve command. You should that the gulp alphabetize task was run and all of the javascript and css files were widow when in.</p></li> </ol> <h2 id="section-12-5-further-reading">Section 12.5:RemoterReading</h2> <p>There is a lot of variegated options for the gulp-inject package. If you want to read well-nigh all of the variegated options and see examples, the documentation is misogynist at <a href="https://www.npmjs.com/package/gulp-inject">https://www.npmjs.com/package/gulp-inject</a></p> <h2 id="wrap-up">Wrap-up</h2> <p>With just a little bit of code, you no longer will you have to wonder why a full-length is not working, just to realize that it is considering you forgot to include a javascript file. There is all of kinds of spare functionality that you can perform with gulp such as minifying of css and javascript files, running npm/bower commands, or running sass compile commands. The gulp-inject is just one module. I encourage you to add gulp into your normal workflow and automate the mundane tasks.</p> Jekyll Part 08: Using a Custom Domain https://digitaldrummerj.me/blogging-on-github-part-8-using-a-custom-domain/ Tue, 10 Mar 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-8-using-a-custom-domain/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to setup a custom domain for your blog.</p> <h2 id="overview">Overview</h2> <p>Part of having a blog is making it your own and giving it personality. One of the easiest ways to do this is to use a custom domain name that fits the blog. So far we have been using http://[username].github.io to get to your blog, but now we will go through the process of setting up a custom domain name like <a href="http://digitaldrummerj.me">http://digitaldrummerj.me</a>. At first it might seem like this is going to be complicated but it is unquestionably very easy to set this up.</p> <h2 id="section-1-purchasing-a-domain-name">Section 1: Purchasing a Domain Name</h2> <p><strong>Note:</strong> If you once have a domain name that you want to use for your Github blog purchased and are using DNSimple for your DNS provider. You can skip this section and move onto Section 2.</p> <p>The first step in this process is to get a domain name. The easiest way to do this is to purchase the domain name from the dns provider. For this tutorial we are going to use <a href="http://dnsimple.com">dnsimple</a>. You can use any DNS provider but I am only providing instructions for using <a href="http://dnsimple.com">dnsimple</a>.</p> <ol> <li>Go to <a href="http://dnsimple.com">dnsimple</a></li> <li><p>Click the &ldquo;Get Started with DNSimple Today&rdquo; button</p> <p><img src="/images/BloggingOnGitHub/github_part_8_get_started_dnsimple.png" alt="Getting Started with DNSimple Today button" /></p></li> <li><p>Click the &ldquo;Add Domain&rdquo; button</p> <p><img src="/images/BloggingOnGitHub/github_part_8_add_domain_button.png" alt="Add Domain button" /></p></li> <li><p>Fill in the domain name that you want or if you are transferring the domain to DNSimple fill in the domain name that you want to transfer.</p></li> <li><p>Check the &ldquo;Register or transfer this domain&rdquo; box</p></li> <li><p>If you want you registration information private, trammels the &ldquo;Enable WHOIS Privacy Protection&rdquo;</p></li> <li><p>If you want the domain to wheels renew each year, trammels the &ldquo;EnableWheelsRenewal&rdquo;</p></li> <li><p>Click the &ldquo;Add Domain&rdquo; button</p> <p><img src="/images/BloggingOnGitHub/github_part_8_add_domain_button.png" alt="Add Domain button" /></p></li> <li><p>Fill in your contact information</p></li> <li><p>Click the &ldquo;Register Domain&rdquo; button</p> <p><img src="/images/BloggingOnGitHub/github_part_8_register_domain.png" alt="Register Domain button" /></p></li> <li><p>You now have a domain name registered and are ready to well-constructed the DNS setup in the next section.</p></li> </ol> <h2 id="section-2-setting-up-dns">Section 2: Setting up DNS</h2> <p><strong>Note 1:</strong> If you are transferring a domain to DNSimple that process may take several days to be completed and you may not be worldly-wise to well-constructed this setup until the transfer process is completed.</p> <p><strong>Note 2:</strong> If you just purchased your domain name from DNSimple, you will be worldly-wise to well-constructed this section.</p> <ol> <li>Click the &ldquo;Services&rdquo; sawed-off next to your domain name under the DNSimple domain list for your account.</li> <li><p>Scroll lanugo until you see the &ldquo;Github Pages&rdquo; service</p> <p><img src="/images/BloggingOnGitHub/github_part_8_dnsimple_github_service.png" alt="Github Pages Service" /></p></li> <li><p>Click the Add Button</p> <p><img src="/images/BloggingOnGitHub/github_part_8_dnsimple_github_service_add_button.png" alt="Github Page Service Add Button" /></p></li> <li><p>Fill in your Github username</p> <p><img src="/images/BloggingOnGitHub/github_part_8_dnsimple_github_service_setup.png" alt="Github Pages Name" /></p></li> <li><p>Click the &ldquo;Complete Github Pages Setup&rdquo; button</p> <p><img src="/images/BloggingOnGitHub/github_part_8_dnsimple_github_service_setup_complete.png" alt="Github Pages Service" /></p></li> <li><p>You now have DNSimple configured to point your domain name correctly to your Github blog at http://[username].github.io</p></li> </ol> <h2 id="section-3-configure-blog-with-domain-name">Section 3: Configure Blog with Domain Name</h2> <p><strong>Note 1:</strong> If you are transferring a domain to DNSimple, that process need to be completed surpassing you can well-constructed this section.</p> <p><strong>Note 2:</strong> If you just purchased your domain name from DNSimple, you will be worldly-wise to well-constructed this section.</p> <ol> <li><p>Click on the + sawed-off to add a new file</p> <p><img src="/images/BloggingOnGitHub/github_add_button.png" alt="Github Plus Button" /></p></li> <li><p>Name the file CNAME with no extension</p> <p><img src="/images/BloggingOnGitHub/github_part_8_add_cname_file.png" alt="Github Name the New File CNAME" /></p></li> <li><p>At the very top of the file add your domain name</p> <p><img src="/images/BloggingOnGitHub/github_part_8_cname_domain_name.png" alt="Add Domain Name at top of CNAME file" /></p></li> <li><p>Scroll to the &ldquo;Commit changes&rdquo; section on the Github Editor, put in your commit scuttlebutt and click &ldquo;Commit changes&rdquo;</p> <p><img src="/images/BloggingOnGitHub/github_part_8_cname_commit.png" alt="Commit CNAME Changes" /></p></li> <li><p>It will take a few minutes for Github to update surpassing you will be worldly-wise to scan to your Github blog with your domain name. Once your domain is working, plane the old http://[username].github.io url will redirect to your domain name.</p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>Now users will be worldly-wise to get to your blog with the domain name that you just configure.Planeif the user tries to go to the http://[username].github.io it will redirect them to your domain name.</p> <p>In our next lesson, I will show you how to install jekyll so that you can edit your blog post and files locally instead of using the Github web site. This will indulge you to make changes without having to publish them to the world just to test them.</p> Jekyll Part 07:Subtractinga custom Google search https://digitaldrummerj.me/blogging-on-github-part-7-adding-a-custom-google-search/ Sat, 21 Feb 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-7-adding-a-custom-google-search/ <p>Welcome the standing series on using Jekyll. In this tutorial we are going to add the worthiness to search your blog using google.</p> <h2 id="overview">Overview</h2> <p>As your blog grows, you want to make it easy for your readers to find the content that they need on your blog. Out of the box, Jekyll does not have any type of search engine built-in. Thankfully, with Google you can hands tell Google to alphabetize your blog and then add a search box on the blog.</p> <h2 id="section-1-adding-the-search-page">Section 1:Subtractingthe Search Page</h2> <p>If you have been pursuit withal with the other lessons in the series, this should be familiar to you.</p> <ol> <li><p>Open a web browser and navigate to your [username].github.io repository.</p></li> <li><p>Click on the + sawed-off to add a new file</p> <p><img src="/images/BloggingOnGitHub/github_add_button.png" alt="Github Plus Button" /></p></li> <li><p>Name the file search.html</p> <p><img src="/images/BloggingOnGitHub/github_part_7_add_search_html_file.png" alt="Github Name New File search.html" /></p></li> <li><p>Add the pursuit front matter</p> <pre><code>--- layout: page title: Search permalink: /search/ sitemap: false --- </code></pre></li> <li><p>Add the pursuit html to the page</p> <pre><code>&lt;div id=&quot;home-search&quot; class=&quot;home&quot;&gt; &lt;script&gt; (function() { var cx = '[Your CSE Search ID]'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); &lt;/script&gt; &lt;gcse:search queryParameterName=&quot;searchString&quot;&gt;&lt;/gcse:search&gt; &lt;/div&gt; </code></pre></li> </ol> <h2 id="section-2-adding-search-box">Section 2:SubtractingSearch Box</h2> <ol> <li><p>We need to get when to the main directory of our repository. To do this click on one of the [yourname].github.io links.</p></li> <li><p>Then click on _layouts directory to go into it.</p></li> <li><p>Click on the default.html file to unshut it.</p></li> <li><p>Click on the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github_edit_button.png" /> icon to edit the file.</p></li> <li><p>Before the &lt;div id=&ldquo;archives&rdquo;&gt; tag that we widow previously, add the pursuit html snippet.</p> <pre><code>&lt;div id=&quot;search&quot;&gt; &lt;form role=&quot;search&quot; method=&quot;get&quot; action=&quot;{{ site.baseurl }}//search/&quot;&gt; &lt;input id=&quot;searchString&quot; name=&quot;searchString&quot; placeholder=&quot;Be aLargestDeveloper, etc.&quot; type=&quot;text&quot;&gt; &lt;input id=&quot;searchButton&quot; name=&quot;googleSearchName&quot; type=&quot;submit&quot; value=&quot;Search&quot;&gt; &lt;/form&gt; &lt;/div&gt; </code></pre></li> <li><p>Replace the &lt;div class=&ldquo;container&rdquo;&gt; whilom the search div with the following</p> <pre><code>&lt;div class=&quot;grid&quot; id=&quot;searchBar&quot;&gt; &lt;div&gt; </code></pre></li> <li><p>After the &lt;div id=&ldquo;archives&rdquo;&gt; section add flipside &lt;/div&gt; tag.</p></li> <li><p>The whole section for the header should squint like this</p> <pre><code>&lt;div class=&quot;grid&quot; id=&quot;searchBar&quot;&gt; &lt;div&gt; &lt;div id=&quot;search&quot;&gt; &lt;form role=&quot;search&quot; method=&quot;get&quot; action=&quot;{{ site.baseurl }}//search/&quot;&gt; &lt;input id=&quot;searchString&quot; name=&quot;searchString&quot; placeholder=&quot;Learn Ionic, Be aLargestDeveloper, etc.&quot; type=&quot;text&quot;&gt; &lt;input id=&quot;searchButton&quot; name=&quot;googleSearchName&quot; type=&quot;button&quot; value=&quot;Search&quot;&gt; &lt;/form&gt; &lt;/div&gt; &lt;div id=&quot;archives&quot;&gt; scan by &lt;a title=&quot;The well-constructed gazetteer of {{ site.name }}'s Blog by category&quot; href=&quot;{{ site.baseurl }}//categoryview&quot;&gt;category&lt;/a&gt; or &lt;a title=&quot;The well-constructed gazetteer of {{ site.name }}'s Blog by month&quot; href=&quot;{{ site.baseurl }}//monthview&quot;&gt;date&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre></li> <li><p>Scroll lanugo to the bottom, add the commit comment, and click on the commit transpiration button.</p> <p><img src="/images/BloggingOnGitHub/github_part_7_commit_search_html.png" alt="Commit default.html changes" /></p></li> <li><p>Next we need to update the theme so that the search box shows up in the correct spot on the page.</p></li> </ol> <h2 id="section-3-updating-the-stylesheet">Section 3: Updating the Stylesheet</h2> <ol> <li><p>We need to get when to the main directory of our repository. To do this click on one of the [yourname].github.io links.</p></li> <li><p>Click on the style.scss file to unshut it.</p></li> <li><p>Click on the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github_edit_button.png" /> icon to edit the file.</p></li> <li><p>Add the pursuit to the marrow of the file surpassing the two @import statements.</p> <pre><code>#searchBar { font-size: 80%; padding: 0.43em 0 0.57em; #search { float: right; #searchString { width: 283px; border: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) inset; padding: 0.3em 0.6em; background-color: #f6f5ea; margin-right: 0; } #searchButton { paddign: 0.3em 0.6em; background-color: #0B5485; border: 1px solid #f6f5ea; margin-left: 0; color: $white; -webkit-appearance: none; border-radius: 0; } #archives { line-height: 2; float: left; color: $black; text-wrap: avoid; } } } </code></pre></li> <li><p>Scroll lanugo to the bottom, add the commit comment, and click on the commit transpiration button.</p> <p><img src="/images/BloggingOnGitHub/github_part_7_commit_style.png" alt="Commit default.html changes" /></p></li> <li><p>Now go view your blog&rsquo;s home page at http://[username].github.io/. You should now see the search box in the header withal with the &ldquo;browse by category or date&rdquo; links.</p> <p><img src="/images/BloggingOnGitHub/github_part_7_browse_search_in_header.png" alt="Blog's Home Page with Search andScanBy Category orStageLink in Header" /></p></li> <li><p>Now that the search box and search pages are done, we need to setup Google to unquestionably search our blog.</p></li> </ol> <h2 id="section-4-configuring-google">Section 4: Configuring Google</h2> <ol> <li>Navigate to <a href="https://www.google.com/cse/all">https://www.google.com/cse/</a></li> <li>If you do not have a Google account, you will need to create one.</li> <li><p>If you once have a Google account, please login to it now.</p> <p><img src="/images/BloggingOnGitHub/github_part_7_signin_to_cse.png" alt="Signin to Google Custom Search" /></p></li> <li><p>Once signed in, click the Add button</p> <p><img src="/images/BloggingOnGitHub/github_part_7_add_cse_button.png" alt="Add Button" /></p></li> <li><p>Fill in your web site url. Should be http://[username].github.io/*</p> <p><img src="/images/BloggingOnGitHub/github_part_7_add_cse_url.png" alt="Url to Search Textbox" /></p></li> <li><p>Give the search a name that you will remember.</p> <p><img src="/images/BloggingOnGitHub/github_part_7_add_cse_name.png" alt="Name of the Search" /></p></li> <li><p>Click the create button</p> <p><img src="/images/BloggingOnGitHub/github_part_7_add_cse_create.png" alt="Create Button" /></p></li> <li><p>You search should now be created</p> <p><img src="/images/BloggingOnGitHub/github_part_7_add_cse_done.png" alt="Search Created" /></p></li> <li><p>Click the GetLawmakingbutton</p> <p><img src="/images/BloggingOnGitHub/github_part_7_get_cse_code.png" alt="Click GetLawmakingButton" /></p></li> <li><p>Copy the var cx = line</p> <p><img src="/images/BloggingOnGitHub/github_part_7_cse_code.png" alt="Copy the code" /></p></li> <li><p>Go when to github and edit the search.html page. Replace the var cx = line with the line that you just copied.</p></li> <li><p>Commit the changes to Github for the search.html page.</p></li> <li><p>Now we are ready to test the search</p></li> </ol> <h2 id="section-5-testing-the-search">Section 5: Testing the Search</h2> <ol> <li><p>Open a web browser and navigate to http://[username].github.io</p></li> <li><p>Type some text into the search box and click Search</p> <p><img src="/images/BloggingOnGitHub/github_part_7_search_term.png" alt="Type in Search text and click search button" /></p></li> <li><p>It should take you to your search page and then do a Google search</p> <p><img src="/images/BloggingOnGitHub/github_part_7_search_in_browser.png" alt="Search View" /></p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>You now have the worthiness for Google to alphabetize and search your blog. This will make it much easier for your reader to find older posts that they may be interested in and hopefully alimony them on your blog longer.</p> <p>In our next lesson, I will show you how to host your http://[username].github.io blog with a custom domain name like I am doing with <a href="http://digitaldrummerj.me">http://digitaldrummerj.me</a></p> Jekyll Part 06:SubtractingPost byStagePage https://digitaldrummerj.me/blogging-on-github-part-6-adding-post-by-date/ Tue, 17 Feb 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-6-adding-post-by-date/ <p>Welcome the standing series on using Jekyll. In this tutorial we will go through creating a page to show blog post by date.</p> <h2 id="overview">Overview</h2> <p>A typical blog has a way for your readers to view posts by either category or date, so that they can squint at your archives without having to go through the blog post one by one and page by page. In the last lesson, we widow the post by category page. In this lesson we will add the post by stage page.</p> <h2 id="section-1-creating-the-post-by-date-page">Section 1: Creating the Post byStagePage</h2> <p>If you have been pursuit withal with the other lessons in the series, this should be familiar to you.</p> <ol> <li><p>Open a web browser and navigate to your [username].github.io repository.</p></li> <li><p>Click on the + sawed-off to add a new file</p> <p><img src="/images/BloggingOnGitHub/github_add_button.png" alt="Github Plus Button" /></p></li> <li><p>Name the file archivebydate.md</p> <p><img src="/images/BloggingOnGitHub/github_part_6_archivebydate_file_name.png" alt="Github Name the New File archivebydate.md" /></p></li> </ol> <h2 id="section-2-adding-the-metadata">Section 2:Subtractingthe Metadata</h2> <p>Add the pursuit front matter to the top of the archivebycategory.md file.</p> <pre><code>--- layout: page title: Post byStagepermalink: /monthview/ sitemap: false --- </code></pre> <h2 id="section-3-html-to-display-post">Section 3: Html toExhibitPost</h2> <p>After the front matter, add the pursuit lawmaking to exhibit the post by Year and Month.</p> <pre><code>&lt;div id=&quot;index&quot;&gt; {% for post in site.posts %} {% unless post.next %} &lt;h2&gt;{{ post.date | date: '%Y' }}&lt;/h2&gt; {% else %} {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %} {% if year != nyear %} {% if forloop.index != 1 %}&lt;/ul&gt;{% endif %} &lt;h2&gt;{{ post.date | date: '%Y' }}&lt;/h2&gt; {% endif %} {% endunless %} {% capture month %}{{ post.date | date: '%m%Y' }}{% endcapture %} {% capture nmonth %}{{ post.next.date | date: '%m%Y' }}{% endcapture %} {% if month != nmonth %} {% if forloop.index != 1 %}&lt;/ul&gt;{% endif %} &lt;h2&gt;{{ post.date | date: '%B %Y' }}&lt;/h2&gt;&lt;ul&gt; {% endif %} {% if post.link %} &lt;h3 class=&quot;link-post&quot;&gt; &lt;a href=&quot;{{ site.baseurl }}{{ post.url }}&quot; title=&quot;{{ post.title }}&quot;&gt;{{ post.title }}&lt;/a&gt; &lt;a href=&quot;{{ post.link }}&quot; target=&quot;_blank&quot; title=&quot;{{ post.title }}&quot;&gt;&lt;i class=&quot;fa fa-link&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/h3&gt; {% else %} &lt;h3&gt;&lt;a href=&quot;{{ site.baseurl }}{{ post.url }}&quot; title=&quot;{{ post.title }}&quot;&gt;{{ post.title }}&lt;p class=&quot;date&quot;&gt;{{ post.date | date: &quot;%B %e, %Y&quot; }}&lt;/p&gt;&lt;/a&gt;&lt;/h3&gt; &lt;p&gt;{{ post.excerpt | strip_html | truncate: 160 }}&lt;/p&gt; {% endif %} {% endfor %} &lt;/div&gt; </code></pre> <h2 id="section-4-viewing-the-post-by-date-page">Section 4: Viewing the Post byStagePage</h2> <ol> <li><p>After you have widow the whilom text, scroll to the marrow of the page, add your commit note, and click the commit button.</p> <p><img src="/images/BloggingOnGitHub/github_part_6_commit_archivebydate.png" alt="Github Commit archivebydate.md" /></p></li> <li><p>To view the category page, navigate to http://[username].github.io/monthview</p></li> <li><p>Your page should squint like the pursuit but with your avatar, site name and unravelment in the header of the page.</p> <p><img src="/images/BloggingOnGitHub/github_part_6_archivebydate_in_browser.png" alt="month view screenshot" /></p></li> <li><p>Right now the page is published but not linked to from anywhere. In the next section we will add it to the header section of the page.</p></li> </ol> <h2 id="section-5-adding-browse-by-date-into-header">Section 5:Subtractingbrowse by stage into Header</h2> <p>We are going to add the &ldquo;show by date&rdquo; link into the header section next to the link to view by category that we widow in the <a href="{{ &quot;blogging-on-github-part-5-adding-a-category-page&quot; | prepend: site.baseurl | prepend: site.url}}">previous lesson</a>.</p> <ol> <li><p>Go into the _layouts directory by clicking on _layouts</p></li> <li><p>Click on the default.html file to unshut it.</p></li> <li><p>Click on the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github_edit_button.png" /> icon to edit the file.</p></li> <li><p>In the &lt;div id=&ldquo;archives&rdquo;&gt; tag that we widow previously, add the pursuit html snippet without the category view link.</p> <pre><code>or &lt;a title=&quot;The well-constructed gazetteer of {{ site.name }}'s Blog by month&quot; href=&quot;{{ site.url}}{{ site.baseurl }}//monthview&quot;&gt;date&lt;/a&gt; </code></pre> <p><img src="/images/BloggingOnGitHub/github_part_6_browse_by_category_in_header_html.png" alt="GitHub Header Add Html" /></p></li> <li><p>Scroll lanugo to the bottom, add the commit comment, and click on the commit transpiration button.</p> <p><img src="/images/BloggingOnGitHub/github_part_6_commit_default.png" alt="Commit default.html changes" /></p></li> <li><p>Now go view your blog&rsquo;s home page at http://[username].github.io/. You should now see the &ldquo;browse by category or date&rdquo; link in the header.</p> <p><img src="/images/BloggingOnGitHub/github_part_6_browse_by_category_and_date_in_header.png" alt="Blog's Home Page withScanBy Category orStageLink in Header" /></p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>With just a few simple steps, you were worldly-wise to add the post by month page and put it in the header. In the next lesson we will discuss how the blog theme works and how to modify it.</p> Jekyll Part 05:SubtractingCategory Page https://digitaldrummerj.me/blogging-on-github-part-5-adding-a-category-page/ Sun, 15 Feb 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-5-adding-a-category-page/ <p>Welcome the standing series on using Jekyll. In this tutorial we will go through creating a page to show blog post by category.</p> <h2 id="overview">Overview</h2> <p>A typical blog has a way for your readers to view posts by either category or date, so that they can squint at your archives without having to go through the blog post one by one. Unfortunately, the Jekyll-Now repository that we cloned your blog from, does not have these pages. Luckily, these pages are really easy to create.</p> <h2 id="section-1-creating-the-category-page">Section 1: Creating the Category Page</h2> <p>If you have been pursuit withal with the other lessons in the series, this should be familiar to you.</p> <ol> <li><p>Open a web browser and navigate to your [username].github.io repository.</p></li> <li><p>Click on the + sawed-off to add a new file</p> <p><img src="/images/BloggingOnGitHub/github_add_button.png" alt="Github Plus Button" /></p></li> <li><p>Name the file archivebycategory.md</p> <p><img src="/images/BloggingOnGitHub/github_part_5_archivebycategory_file_name.png" alt="Github Name the New File archivebycategory.md" /></p></li> </ol> <h2 id="section-2-adding-the-metadata">Section 2:Subtractingthe Metadata</h2> <p>Add the pursuit front matter to the top of the archivebycategory.md file.</p> <pre><code> --- layout: page title: Post by Category permalink: /categoryview/ sitemap: false --- </code></pre> <h2 id="section-3-category-list">Section 3: Category List</h2> <p>After the front matter, add the pursuit lawmaking to exhibit the categories and the number of post per category. Each category will link to remoter lanugo in the page where is will show the post for that category.</p> <pre><code>&lt;div&gt; {% assign categories = site.categories | sort %} {% for category in categories %} &lt;span class=&quot;site-tag&quot;&gt; &lt;a href=&quot;#{{ category | first | slugify }}&quot;&gt; {{ category[0] | replace:'-', ' ' }} ({{ category | last | size }}) &lt;/a&gt; &lt;/span&gt; {% endfor %} &lt;/div&gt; </code></pre> <h2 id="section-4-blog-post-by-category">Section 4: Blog Post by Category</h2> <p>Next you need to add the lawmaking to exhibit the list of blog post by category and sorted by title</p> <pre><code>&lt;div id=&quot;index&quot;&gt; {% for category in categories %} &lt;a name=&quot;{{ category[0] }}&quot;&gt;&lt;/a&gt; &lt;h2&gt;{{ category[0] | replace:'-', ' ' }} ({{ category | last | size }})&lt;/h2&gt; {% assign sorted_posts = site.posts | sort: 'title' %} {% for post in sorted_posts %} {%if post.categories contains category[0]%} &lt;h3&gt;&lt;a href=&quot;{{ site.url }}{{ site.baseurl }}{{ post.url }}&quot; title=&quot;{{ post.title }}&quot;&gt;{{ post.title }} &lt;p class=&quot;date&quot;&gt;{{ post.date | date: &quot;%B %e, %Y&quot; }}&lt;/p&gt;&lt;/a&gt;&lt;/h3&gt; &lt;p&gt;{{ post.excerpt | strip_html | truncate: 160 }}&lt;/p&gt; {%endif%} {% endfor %} {% endfor %} &lt;/div&gt; </code></pre> <h2 id="section-5-viewing-the-category-page">Section 5: Viewing the Category Page</h2> <ol> <li><p>After you have widow the whilom text, scroll to the marrow of the page, add your commit note, and click the commit button.</p> <p><img src="/images/BloggingOnGitHub/github_part_5_commit_archivebycategory.png" alt="Github Commit archivebycategory.md" /></p></li> <li><p>To view the category page, navigate to http://[username].github.io/categoryview</p></li> <li><p>Your page should squint like the pursuit but with your avatar, site name and unravelment in the header of the page.</p> <p><img src="/images/BloggingOnGitHub/github_part_5_archivebycategory_in_browser.png" alt="category view screenshot" /></p></li> <li><p>You will notice that the &ldquo;You&rsquo;re up and running&rdquo; post does not show up on the categories page. This is considering there is no categories front matter tag for that blog post. Go superiority and unshut 2014-3-3-Hello-World.md and add the categories front matter tag.</p> <pre><code>categories: ['welcome'] </code></pre></li> <li><p>Right now the page is published but not linked to from anywhere. In the next section we will add it to the header section of the page.</p></li> </ol> <h2 id="section-6-adding-category-view-into-header">Section 6:SubtractingCategory View into Header</h2> <p>Unlike the portfolio page that we created in the last lesson, this time we are not going to add the category page into the menu. Instead we are going to create a row unelevated the header with a link to the page.</p> <ol> <li><p>Go into the _layouts directory by clicking on _layouts</p></li> <li><p>Click on the default.html file to unshut it.</p></li> <li><p>Click on the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github_edit_button.png" /> icon to edit the file.</p></li> <li><p>Right without the &lt;/header&gt; tag, add the pursuit html snippet</p> <pre><code>&lt;div class=&quot;container&quot; &gt; &lt;div id=&quot;archives&quot;&gt; scan by &lt;a title=&quot;The well-constructed gazetteer of {{ site.name }}'s Blog by category&quot; href=&quot;{{ site.url}}{{ site.baseurl }}/categoryview&quot;&gt;category&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; </code></pre></li> <li><p>Scroll lanugo to the bottom, add the commit comment, and click on the commit transpiration button.</p> <p><img src="/images/BloggingOnGitHub/github_part_5_commit_default.png" alt="Commit default.html changes" /></p></li> <li><p>Now go view your blog&rsquo;s home page at http://[username].github.io/. You should now see the &ldquo;browse by category&rdquo; link in the header.</p> <p><img src="/images/BloggingOnGitHub/github_part_5_browse_by_category_in_header.png" alt="Blog's Home Page withScanBy Category Link in Header" /></p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>With just a few simple steps, you were widow the post by category page and put it in the header. In the next lesson we will add in a new page for browsing blog post by year and month.</p> Jekyll Part 04:SubtractingAdditional Pages https://digitaldrummerj.me/blogging-on-github-part-4-creating-additional-pages/ Wed, 11 Feb 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-4-creating-additional-pages/ <p>Welcome the standing series on using Jekyll. In this tutorial we will go through how to add an spare page such as the <a href="/speaking">speaking</a> page on this blog.</p> <h2 id="overview">Overview</h2> <p>As your blog grows you are going to want to add spare information besides just blog post. If you start speaking at events or want to show off your portfolio or blog post by category/date, you are going to want these as separate pages. These pages most likely will have there own squint and finger as well.</p> <h2 id="section-1-creating-the-file-for-the-page">Section 1: Creating the file for the page</h2> <p>If you have been pursuit withal with the other part in this series, the step should be familiar to you.</p> <ol> <li><p>Open a web browser and navigate to your [username].github.io reporepository.</p></li> <li><p>Click on the + sawed-off to add a new file</p> <p><img src="/images/BloggingOnGitHub/github_add_button.png" alt="Github Plus Button" /></p></li> <li><p>Name the file portfolio.md</p> <p><img src="/images/BloggingOnGitHub/github_name_file_portfolio.png" alt="Github Name the New File portfolio.md" /></p></li> <li><p>Go to the next section to decide on the layout for the page</p></li> </ol> <h2 id="section-2-choosing-a-layout">Section 2: Choosing a layout</h2> <p>To tell the jekyll engine what the layout of the page should be, you need to add the front matter layout tag.</p> <p>From <a href="/blogging-on-github-part-2-your-first-post"> Part 2 Creating your first blog post</a>, you will remember that the front matter is the metadata well-nigh blog post but it is used in jekyll for any page as well. All of the front matter tags are the same as a blog post.</p> <p>To transpiration the layout from stuff a blog post to a page, you will transpiration the layout front matter tag to page instead of post.</p> <p>By default jekyll adds files to the sitemap that search engines use to find pages on your site. Setting it to false will stop this page from stuff added. We will remove the sitemap tag once we are ready to share the page.</p> <p>In order for the page to misogynist at [username].github.io/portfolio, you need to set the front matter permalink to /portfolio/ .</p> <h3 id="front-matter-tags">front matter tags</h3> <pre><code>--- title: My Portfolio permalink: /portfolio/ layout: page sitemap: false --- </code></pre> <h2 id="section-3-adding-content">Section 3:Subtractingcontent</h2> <p>The content is written in markdown just like blog post are. In <a href="/blogging-on-github-part-2-your-first-post"> Part 2 Creating your first blog post</a>, we covered the worldwide markdown tags.</p> <p>For now just add some simple markdown like below:</p> <pre><code>This is a placeholder page for my portfolio. </code></pre> <p>Your page should now squint like this in the editor</p> <p><img src="/images/BloggingOnGitHub/github_part4_portfolio_page_markdown.png" alt="Github Editor for Portfolio.md" /></p> <p>After you have widow the whilom text, scroll to the marrow of the page, add your commit note, and click the commit button.</p> <p><img src="/images/BloggingOnGitHub/github_part4_portfolio_page_commit_change.png" alt="Github Commit Portfolio.md" /></p> <h2 id="section4-previewing-page">Section4: Previewing page</h2> <p>To view the page navigate to http://[username].github.io/portfolio</p> <p>Your page should squint like the pursuit but with your avatar, site name and unravelment in the header of the page.</p> <p><img src="/images/BloggingOnGitHub/github_part4_portfolio_view_in_browser.png" alt="first page" /></p> <p>Right now the page is published but not linked to from anywhere.</p> <h2 id="section-5-adding-page-to-menu">Section 5:Subtractingpage to menu</h2> <p>Once you are ready to share the page with your readers, you will want to add it to your main menu and have it indexed by search engines.</p> <p>To tell search engines to alphabetize the page, we need to remove the front matter tag, sitemap:false.</p> <p>To add it to the menu:</p> <ol> <li><p>Navigate to the _layout directory in the repository by clicking on the repository title to get when to the main directory of the repository</p> <p><img src="/images/BloggingOnGitHub/github_part4_navigate_to_top.png" alt="Github Click on Repository Title" /></p></li> <li><p>Click on _layouts directory</p> <p><img src="/images/BloggingOnGitHub/github_part4_click_layout.png" alt="Github Click on Layout" /></p></li> <li><p>Click on the default.html page.</p> <p><img src="/images/BloggingOnGitHub/github_part4_click_default.png" alt="Github Click on Default.html" /></p></li> <li><p>Click on the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github_edit_button.png" /> icon to edit the file.</p></li> <li><p>Find the main menu. You can search for home or well-nigh to find the section</p> <p><img src="/images/BloggingOnGitHub/github_part4_menu_html.png" alt="Github Main Menu Html" /></p></li> <li><p>Add the pursuit line in the menu at the position you want the portfolio page link to be displayed.</p> <pre><code>&lt;a href=&quot;/portfolio&quot;&gt;Portfolio&lt;/a&gt; </code></pre> <p><img src="/images/BloggingOnGitHub/github_part4_menu_with_portfolio.png" alt="Github Menu with Portfolio Html" /></p></li> <li><p>We need to commit the file to the repository by scrolling to the marrow of the page, subtracting the commit comment, and clicking on the commit button.</p> <p><img src="/images/BloggingOnGitHub/github_part4_default_commit_changes.png" alt="Github Default.html Commit changes" /></p></li> <li><p>Now navigate to your blog and the page link should show in the main menu. Click on the portfolio menu item and make sure it takes you to the portfolio page.</p> <p><img src="/images/BloggingOnGitHub/github_part4_menu_with_portfolio_in_browser.png" alt="Github menu includes portfolio link" /></p></li> </ol> <h2 id="conclusion">Conclusion</h2> <p>With just a few steps, you were worldly-wise to add a new page into your blog&rsquo;s web site. You can either protract to build out the portfolio page with the markdown needed to show off your portfolio or you can remove it from the menu until you are ready to do build it out.</p> <p>In the next lesson we will build on this lesson by subtracting in a page to show the blog post by category.</p> Jekyll Part 03:SubtractingCommenting to Post https://digitaldrummerj.me/blogging-on-github-part-3-adding-comments/ Sat, 07 Feb 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-3-adding-comments/ <p>Welcome the standing series on using Jekyll. In this tutorial you will learn how to add the worthiness for users to scuttlebutt on your blog post.</p> <h2 id="overview">Overview</h2> <p>You may be thinking that commenting isn&rsquo;t really that important but it is a key full-length for you to be worldly-wise to interact with your readers. Users want to have conversations well-nigh your blog post with you and to finger unfluctuating to you. It is moreover a good way for you to learn from them as well.</p> <p>Unfortunately, out of the box Jekyll does not have this ability. Luckily, it is really easy to add this ability, thanks to a wonderful tool tabbed Disqus. Disqus is self-ruling but still full featured.</p> <p>We will go through the process of getting a Disqus account, configuring the account, configuring your blog and testing it all out.</p> <h2 id="section-1-configuring-disqus">Section 1: Configuring Disqus</h2> <ol> <li><p>Open flipside browser window and navigate to <a href="https://disqus.com/admin/signup/?utm_source=New-Site">https://disqus.com/admin/signup/?utm_source=New-Site</a></p></li> <li><p>Fill out the information request and click the Finish button. Note: That you can not transpiration the short name value once it is created. You can have multiple sites under the same worth though with variegated short name values.</p> <p><img src="/images/BloggingOnGitHub/DisqusRegisterSite.png" alt="DisqusRegisterSite.png" /></p></li> <li><p>You will be greeted with a &ldquo;Choose Your Platform&rdquo; screen like the follow. Don&rsquo;t worry well-nigh any of these options as we are not going to use them.</p> <p><img src="/images/BloggingOnGitHub/DisqusChooseAPlatform.png" alt="DisqusChooseAPlatform.png" /></p></li> <li><p>Click on theUnstipulatedlink on the left side of the links whilom the &ldquo;Choose Your Platform&rdquo; title.</p> <p><img src="/images/BloggingOnGitHub/DisqusGeneralSettingMenuHighlight.png" alt="DisqusGeneralSettingMenuHighlight.png" />)</p></li> <li><p>Scroll lanugo to the Site Identity and make sure that the values are correct. The WebSite Name will towards on your blog when the comments show, so make sure it is what you want it to say. Take note of your shortname as you will need it in the next section when we config your blog to show Disqus.</p> <p><img src="/images/BloggingOnGitHub/DisqusGeneralSettingSiteIdentity.png" alt="DisqusGeneralSettingSiteIdentity.png" /></p></li> <li><p>Scroll lanugo to the next section which should bePolityRules and match the settings to the image below. To prevent scuttlebutt spam I unchangingly set comments to have to be tried surpassing showing on the site. The volume on the site will be low unbearable for now that you will be worldly-wise to hands manage approving the comments.</p> <p><img src="/images/BloggingOnGitHub/DisqusGeneralSettingCommunityRules.png" alt="DisqusGeneralSettingCommunityRules.png" /></p></li> <li><p>Scroll lanugo to the next section which should be Social Platform Intergration and add your twitter worth if you have one. This will ensure that when people share comments on your blog that it includes you in the post.</p> <p><img src="/images/BloggingOnGitHub/DisqusGeneralSettingSocialIntegration.png" alt="DisqusGeneralSettingSocialIntegration.png" /></p></li> <li><p>Click the Save Button</p></li> </ol> <h2 id="section-2-configuring-your-blog">Section 2: Configuring Your Blog</h2> <ol> <li>Open a web browser and navigate to your [username].github.io repository.</li> <li>Click on the _config.yml file to navigate to it</li> <li>Click on the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github_edit_button.png" /> icon to edit the file</li> <li><p>Look for the text disqus: and put in your disqus shortname name like below.</p> <p>disqus: digitaldrummerj</p></li> <li><p>Scroll to the marrow of the screen and click on the commit button. You should put in a scuttlebutt as well so that you know what reverted with the file.</p></li> </ol> <p><img src="/images/BloggingOnGitHub/Github_Save_Changes.png" alt="Github_Save_Changes.png" /></p> <h2 id="section-3-testing-it-out">Section 3: Testing it out</h2> <p>Open up a web browser and navigate to your blog and click on the title for the blog post that we published in our last lesson.</p> <p>Scroll to the marrow of the post and you should see a section to add a scuttlebutt like this:</p> <p><img src="/images/BloggingOnGitHub/DisqusCommentInBlog.png" alt="DisqusCommentInBlog.png" /></p> <h2 id="conclusion">Conclusion</h2> <p>Having comments is an essential part of any blog to unshut up the liaison with your readers. As you can see Disqus is very easy to add to your blog.</p> <p>In the next lesson, where you will learn how to create spare pages that are not blog post such as portfolio or well-nigh pages.</p> Jekyll Part 02: Your First Post https://digitaldrummerj.me/blogging-on-github-part-2-your-first-post/ Thu, 05 Feb 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-2-your-first-post/ <p>Welcome the standing series on using Jekyll. In this tutorial we will go through making your first blog post.</p> <h2 id="overview">Overview</h2> <p>We will go through all of the steps to create a new post, add metadata such as title/categories/tags/date, and then make it live on the site.</p> <h2 id="section-1-creating-the-file">Section 1: Creating the file</h2> <p>Thr first step is to create a new file to hold the content of the blog post. In Jekyll all of the blog post are markdown files and are stored in the _post directory. When you commit this file to Github, it will be compiled into a static html page.</p> <p>The filename is in the format of year-month-day-title-separated-by-dashes.md.</p> <pre><code>2015-02-17-my-first-post.md </code></pre> <p>Go superiority and create your file now.</p> <ol> <li>To create a file unshut a web browser and navigate to your [username.github.io repository.</li> <li>Go into the _post directory and click the + icon to add a new file.</li> <li>Name the file yyyy-mm-dd-my-first-post.md where yyyy = 4digit year, mm = 2 digit month, and dd = 2 digit day of montmonth.</li> <li>Head to the next section and fill out the metadata well-nigh the post (ie: title, date, is published, categories, etc)</li> </ol> <h2 id="section-2-creating-metadata">Section 2: Creating metadata</h2> <p>Now we need to pinpoint some information well-nigh our blog post. All of the information such as title, is published, categories, publish date, etc are stored at the top of the file in what is tabbed Front Matter.</p> <p>To pinpoint the front matter section you have a line with 3 dashes in it and then repeat this same line to signal the end of the front matter section.</p> <p>Below are worldwide metadata you will want to fill out.</p> <ul> <li>layout: is the name of the layout from the _layouts directory. If followed part 1 and cloned the jekyll-now repository, then the name is post.</li> <li>title: the title of the blog post that will showbon the site. Should be in quotes to stave mismatch with front matter parameter.</li> <li>published: true or false. Determines if the post shows on the website or not.</li> <li>date: stage of the post. this is optional and if not specified will use stage in filename.</li> <li>categories: list of categories. comma delimited. put in quotes for multi word categories. optional but recommended.</li> <li>tags: list of tags that would be used to build a tag cloud. optional but recommended.</li> </ul> <h3 id="sample-front-matter">Sample Front Matter</h3> <pre><code>--- layout: post title: Your First Post published: false date: 2015-02-01 categories: [blogging] tags: [blogging] --- </code></pre> <p>Now on to creating very content in your post.</p> <h2 id="section-3-creating-content">Section 3: Creating content</h2> <p>The content of the post will be written in markdown and will be directly unelevated the front matter section .</p> <p>Below are worldwide markdown tags that you will want to use. headers, lists, bold, bullets, links and lawmaking highlighting.</p> <h3 id="common-markdown-tags">Common Markdown Tags</h3> <h4 id="headers">Headers</h4> <p>A &lsquo;#&rsquo; starting a line indicates to makebitba header and the number &lsquo;#&rsquo; indicates the size of the header tag.</p> <pre><code># = h1 ## = h2 and so on up the an h6 </code></pre> <p>Examples:</p> <h1 id="h1">h1</h1> <h2 id="h2">h2</h2> <h2 id="h3">h3</h2> <h3 id="h4">h4</h3> <h4 id="h5">h5</h4> <h4 id="h6">h6</h4> <h4 id="numbered-list-or-bullets">Numbered list or Bullets</h4> <p>For bullets: start a line with a * or -.</p> <pre><code>* sample list * next bullet </code></pre> <ul> <li>sample list</li> <li>next bullet</li> </ul> <p>For numbered list start with a 1 or the number you want to start with.</p> <pre><code>1. sample ordered list 2. number 2 </code></pre> <ol> <li>sample ordered list</li> <li>number 2</li> </ol> <h4 id="bold">Bold</h4> <p>surround the text you to build with 2 ** and then put 2 increasingly without the text to end the bold.</p> <pre><code>**sample bold** </code></pre> <p><strong>sample bold</strong></p> <h4 id="links">Links</h4> <p>link to other pages:</p> <pre><code>[link name display](http://myurl.com) </code></pre> <p><a href="http://myurl.com">link name display</a></p> <h3 id="code-highlighting">Code Highlighting</h3> <p>There are 2 ways: tab the line in and it will group the text like the examples above. or use the highlighter markup</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-text" data-lang="text">{% highlight csharp %} // some c# lawmaking var a = &#34;bad variable name&#34; {% endhighlight %}</code></pre></div> <h2 id="highlighting-text-without-the-code-highlighting">Highlighting text without the lawmaking highlighting</h2> <p>Start the line with a tab and it will automatically do it for you.</p> <pre><code>you will get text like this if you start the line with a tab. </code></pre> <h2 id="further-reading-on-markdown">Further Reading on Markdown</h2> <p>Github documentation on their markdown: <a href="https://help.github.com/articles/github-flavored-markdown/">https://help.github.com/articles/github-flavored-markdown/</a>.</p> <h2 id="section-4-saving-as-draft">Section 4: Saving as draft</h2> <p>Most of the time you are not going to write and publish the blog post in one sitting but you need to save your work without it showing up in the website. This is tabbed saving a typhoon and it is super simple to do. By setting the front matter published tag to false it will tell jekyll to not publish it.</p> <pre><code>--- other front matter tags published: false --- </code></pre> <p>You can moreover create a drafts folder and save the file in the but if you do that then you will need to move the file to the _post folder when you are ready to publish.</p> <h2 id="section-5-publishing-post">Section 5: Publishing post</h2> <p>Publishing a post is as simple as waffly the front matter published to true and committing the transpiration to the github repository.</p> <pre><code>--- other front matter tags published: true --- </code></pre> <p>Github will take superintendency of the conversion from markdown to an html page. This should happen automatically within a minute and show up on the blog home page at the top.</p> <p>If it doesn&rsquo;t show up then trammels your email that you registered on github with to see if there was a jekyll compile error email.</p> <h2 id="conclusion">Conclusion</h2> <p>This lesson is one of the key lessons as you need to kow how to create new blog post. Creating new blog post is really easy with Jekyll and a little bit of markdown. Once you learn the variegated markdown tags, you will be writing blog post in no time at all.</p> <p>See you in the next lesson, where we will discuss how to add the worthiness to scuttlebutt on blog post.</p> IIS Express - Turning on WindowsHallmarkhttps://digitaldrummerj.me/iis-express-windows-authentication/ Wed, 04 Feb 2015 20:45:35 +0000 https://digitaldrummerj.me/iis-express-windows-authentication/ <p>So I brought up a new machine and tried to run my ASP.NET web site in IIS Express that uses WindowsHallmarkand was greeted with the pursuit error:</p> <p><strong>Error</strong></p> <p>The requested page cannot be accessed considering the related configuration data for the page is invalid.</p> <p><strong>Details:</strong></p> <p>This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=&ldquo;Deny&rdquo;), or set explicitly by a location tag with overrideMode=&ldquo;Deny&rdquo; or the legacy allowOverride=&ldquo;false&rdquo;.</p> <h2 id="solution">Solution</h2> <p>Every time I bring up a new machine I unchangingly forget to update the IIS Express setting to fix this error and have to do a google search to icon out where the IIS Express configuration is stored. So I figured I should finally document the fix for it.</p> <p>The error is caused by this section in the web.config</p> <pre><code>&lt;system.webServer&gt; &lt;security&gt; &lt;authentication&gt; &lt;windowsAuthentication enabled=&quot;true&quot; /&gt; &lt;anonymousAuthentication enabled=&quot;false&quot; /&gt; &lt;/authentication&gt; &lt;/security&gt; &lt;/system.webServer&gt; </code></pre> <p>To fix this unshut up the IIS Express applicationhost.config. This file is stored at C:\Users[your user name]\Documents\IISExpress\config\applicationhost.config</p> <p>Update for VS2015+: config file location is $(solutionDir).vs\config\applicationhost.config</p> <p>Look for the pursuit lines</p> <pre><code>&lt;section name=&quot;windowsAuthentication&quot; overrideModeDefault=&quot;Deny&quot; /&gt; &lt;section name=&quot;anonymousAuthentication&quot; overrideModeDefault=&quot;Deny&quot; /&gt; &lt;add name=&quot;WindowsAuthenticationModule&quot; lockItem=&quot;true&quot; /&gt; &lt;add name=&quot;AnonymousAuthenticationModule&quot; lockItem=&quot;true&quot; /&gt; </code></pre> <p>Change those lines to</p> <pre><code>&lt;section name=&quot;windowsAuthentication&quot; overrideModeDefault=&quot;Allow&quot; /&gt; &lt;section name=&quot;anonymousAuthentication&quot; overrideModeDefault=&quot;Allow&quot; /&gt; &lt;add name=&quot;WindowsAuthenticationModule&quot; lockItem=&quot;false&quot; /&gt; &lt;add name=&quot;AnonymousAuthenticationModule&quot; lockItem=&quot;false&quot; /&gt; </code></pre> <p>Save the file and refresh your asp.net web page. It may take a moment to load as it load the new configurations into IIS Express.</p> Jekyll Part 01: Getting Started https://digitaldrummerj.me/blogging-on-github-part-1-getting-started/ Fri, 30 Jan 2015 00:00:00 +0000 https://digitaldrummerj.me/blogging-on-github-part-1-getting-started/ <p>Welcome to the first tutorial of a multi part series on blogging using Jekyll on Github. Github has an superstitious self-ruling option for hosting a blog for you and you can get a blog up and running in 10 minutes or less. This series will imbricate everything that you to know to host, manage and customized a Jekyll blog that is hosted on Github.</p> <h2 id="section-1-overview">Section 1: Overview</h2> <p>Github uses the Jekyll engine which turns markdown into static Html pages. The wholesomeness of this is that performance is largest since you are just serving up html and you don&rsquo;t have to worry well-nigh hosting a database somewhere .</p> <p>The quickest and easiest way to get started with Jekyll is fork an existing Jekyll repository. Forking in Git ways creating a reprinting of the repository into your account.</p> <p>The repository that I used and recommend to fork is the &ldquo;Jekyll Now&rdquo; repository at <a href="https://github.com/barryclark/jekyll-now">https://github.com/barryclark/jekyll-now</a>. The Jekyll based repository includes a lot of very useful features for a blog out of the box for you such as: a nice looking theme, lawmaking syntax highlighter, social buttons (twitter, Facebook, Github, etc), Disqus blog commenting api, and Google analytics.</p> <h2 id="section-2-forking-the-repository">Section 2: Forking the Repository</h2> <p>Forking a repository in Github is extremely simple. Go to <a href="https://github.com/barryclark/jekyll-now">https://github.com/barryclark/jekyll-now</a> and click the <img src="/images/BloggingOnGitHub/github_fork_button.png" alt="github fork button" /> button. Github will now create a fork of the repository for you into your account.</p> <h2 id="section-3-renaming-the-repository">Section 3: Renaming the Repository</h2> <p>Once you fork the repository, you will need to go into the settings for your new repository and rename it to [username].github.io. Your blog will now be live within a few minutes at http://[username].github.io. However, surpassing you go squint at the blog, you need to take a minute to configure a few items in the configuration file _config.yml.</p> <h3 id="getting-to-settings">Getting to settings</h3> <p><img src="/images/BloggingOnGitHub/github_settings_button.png" alt="github settings" /></p> <h3 id="renaming">Renaming</h3> <p>Finding the settings:</p> <p><img src="/images/BloggingOnGitHub/github_repo_rename.png" alt="github repo rename" /></p> <p>Update the name and click the Rename button</p> <p><img src="/images/BloggingOnGitHub/github_repo_rename_done.png" alt="github repo rename done" /></p> <h2 id="section-4-configuring-the-repository">Section 4: Configuring the Repository</h2> <p>There is only 3 values that you are going to want to change:</p> <ul> <li>name - this is the blog title</li> <li>description - this is the tag line</li> <li>url - this is the url of the blog, will be [username].github.io.</li> </ul> <p>Optionally, you can moreover configure your social networks that show up in the footer of the site by filling in the various worth names in the &ldquo;footer-links&rdquo; section of the _config.yml file.</p> <p>You can edit the _config.yml directly in Github. Click on the file and then click the <img src="/images/BloggingOnGitHub/github_edit_button.png" alt="github edit file button" /> icon. Once you have completed your edits, click the untried commit sawed-off at the marrow of the screen.</p> <h2 id="section-5-viewing-the-blog">Section 5: Viewing the Blog</h2> <p>Now you are ready to view your new blog.Unshuta browser and navigate to http://[username].github.io, replacing [username] with your very username.</p> <h2 id="conclusion">Conclusion</h2> <p>In just a few simple steps, you were worldly-wise to get your blog up and running. Through out the series of lessons, you will learn how to manage your blog, create new pages, customize the theme, and host it with a custom domain name.</p> <p>In the next lesson, where we create your first blog post.</p> Ionic - Using overdue a proxy server https://digitaldrummerj.me/ionic-behind-a-proxy/ Tue, 20 Jan 2015 20:45:35 +0000 https://digitaldrummerj.me/ionic-behind-a-proxy/ <p>I ran into an issue today on the vagrant IonicBox when I tried to create a new Ionic project at work overdue the firewall/proxy plane with all of the configurations for npm, git, bower, and whack setup for the proxy as detailed at <a href="/proxy-configurations/">proxy-configurations</a>.</p> <p>Luckily, Ionic had a fix for this already.</p> <p><strong>Linux</strong></p> <p>All I had to do was put PROXY=<a href="http://myserver:myport">http://myserver:myport</a> in front of the ionic start command.</p> <pre><code> PROXY=http://myserver:myport ionic start todo zippo </code></pre> <p><strong>Windows</strong></p> <p>All I had to do was set the http_proxy environment variable and then run the ionic start writ as I normally would.</p> <pre><code>ionic start todo zippo </code></pre> Ionic - The Ionicbox and How To Use It https://digitaldrummerj.me/ionicbox-notes/ Sat, 17 Jan 2015 20:45:35 +0000 https://digitaldrummerj.me/ionicbox-notes/ <p>If you have looked at setting up the <a href="http://www.ionicframework.com">Ionic Framework</a> or have it washed-up it before, you know on much of a pain it can be, expressly when something doesn&rsquo;t work. Luckily, Ionic offers a self-ruling virtual machine tabbed <a href="https://github.com/driftyco/ionic-box">Ionicbox</a> that is once configured with all of the software that you need.</p> <h2 id="prerequisites">Prerequisites:</h2> <p>Before you can use <a href="https://github.com/driftyco/ionic-box">Ionicbox</a> you need to install <a href="http://www.virtualbox.org">VirtualBox</a> and <a href="http://www.vagrantup.com">Vagrant</a>. If you are on Windows and using <a href="http://www.chocolatey.org">Chocolatey</a>, you can install both using cinst virtualbox and cinst vagrant.</p> <p><a href="http://www.virtualbox.org">VirtalBox</a> is a self-ruling virtual machine program. A virtual machine is a well-constructed computer and operating system run from within your current operating system. It makes it possible to run Linux on a Windows Machine, Windows on a Mac, etc.</p> <p><a href="http://www.vagrantup.com">Vagrant</a> is an easy way to manage virtual machines. A full explaination is out of telescopic for this article.</p> <h2 id="ionic-box">Ionic Box</h2> <p>Make sure that you installed VirtualBox and Vagrant surpassing proceeding.</p> <h2 id="installing">Installing</h2> <ol> <li><p>Open Windows Explorer and create a directory where you want to hold all of your Vagrant configuration files</p></li> <li><p>Instead the directory created in step 1, create a directory tabbed IonicBox</p></li> <li><p>In Windows Explorer, create the directory under the c momentum tabbed projects (i.e. c:\projects)</p></li> <li><p>In Windows Explorer, do a shift+right click on the IonicBox directory and selectUnshutCommand Prompt</p></li> <li><p>Run: vagrant init drifty/ionic-android</p></li> <li><p>Open notepad</p></li> <li><p>In notepad, unshut the VagrantFile created in the IonicBox directory.</p></li> <li><p>select all of the text in the VagrantFile and remove it</p></li> <li><p>Copy the pursuit text into the VagrantFile</p></li> </ol> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-ruby" data-lang="ruby"><span style="color:#75715e"># -*- mode: ruby -*-</span> <span style="color:#75715e"># vi: set ft=ruby :</span> <span style="color:#66d9ef">Vagrant</span><span style="color:#f92672">.</span>configure(<span style="color:#ae81ff">2</span><span style="color:#f92672"></span>) <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>config<span style="color:#f92672">|</span> config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>box <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;drifty/ionic-android&#34;</span> config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>hostname <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;[Replace with what you want your Host Name to be]&#34;</span> <span style="color:#75715e"># No Spaced Allowed</span> config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>boot_timeout <span style="color:#f92672">=</span> <span style="color:#ae81ff">600</span> <span style="color:#f92672"></span>config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>network <span style="color:#e6db74">:forwarded_port</span>, <span style="color:#e6db74">host</span>: <span style="color:#ae81ff">8100</span><span style="color:#f92672"></span>, <span style="color:#e6db74">guest</span>: <span style="color:#ae81ff">8100</span> <span style="color:#f92672"></span>config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>network <span style="color:#e6db74">:forwarded_port</span>, <span style="color:#e6db74">host</span>: <span style="color:#ae81ff">35729</span><span style="color:#f92672"></span>, <span style="color:#e6db74">guest</span>: <span style="color:#ae81ff">35729</span> <span style="color:#f92672"></span>config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>synced_folder <span style="color:#e6db74">&#34;c:</span><span style="color:#ae81ff">\\</span><span style="color:#e6db74">projects&#34;</span>, <span style="color:#e6db74">&#34;/home/vagrant/vagrant_projects&#34;</span> config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>provider <span style="color:#e6db74">&#34;virtualbox&#34;</span> <span style="color:#66d9ef">do</span> <span style="color:#f92672">|</span>vb<span style="color:#f92672">|</span> vb<span style="color:#f92672">.</span>gui <span style="color:#f92672">=</span> <span style="color:#66d9ef">true</span> vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;modifyvm&#34;</span>, <span style="color:#e6db74">:id</span>, <span style="color:#e6db74">&#34;--vram&#34;</span>, <span style="color:#e6db74">&#34;128&#34;</span><span style="color:#f92672">]</span> vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;modifyvm&#34;</span>, <span style="color:#e6db74">:id</span>, <span style="color:#e6db74">&#34;--usb&#34;</span>, <span style="color:#e6db74">&#34;on&#34;</span><span style="color:#f92672">]</span> vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;usbfilter&#34;</span>, <span style="color:#e6db74">&#34;add&#34;</span>, <span style="color:#e6db74">&#34;0&#34;</span>, <span style="color:#e6db74">&#34;--target&#34;</span>, <span style="color:#e6db74">:id</span>, <span style="color:#e6db74">&#34;--name&#34;</span>, <span style="color:#e6db74">&#34;android&#34;</span>, <span style="color:#e6db74">&#34;--vendorid&#34;</span>, <span style="color:#e6db74">&#34;0x18d1&#34;</span><span style="color:#f92672">]</span> vb<span style="color:#f92672">.</span>memory <span style="color:#f92672">=</span> <span style="color:#ae81ff">2048</span> <span style="color:#f92672"></span>vb<span style="color:#f92672">.</span>cpus <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span> <span style="color:#f92672"></span>vb<span style="color:#f92672">.</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;IonicBox&#34;</span> <span style="color:#75715e"># Need This If On Windows</span> vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;setextradata&#34;</span>, <span style="color:#e6db74">:id</span>, <span style="color:#e6db74">&#34;VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root&#34;</span>, <span style="color:#e6db74">&#34;1&#34;</span><span style="color:#f92672">]</span> <span style="color:#66d9ef">end</span> <span style="color:#66d9ef">end</span></code></pre></div> <h2 id="so-what-do-all-of-those-options-in-the-vagrantfile-mean">So what do all of those options in the VagrantFile mean?</h2> <p>In the configuration we configure the video and physical memory of the virtual machine. Since IonicBox is just a shell without a GUI, it doesn&rsquo;t need a lot of resources, so we only requite it 2 gigs of memory. Now if your host system doesn&rsquo;t have a lot of memory, you will need to dial this down.</p> <p>Ionic uses port 8100 for the web site and the live reload function use port 35729. We forwarded these ports from IonicBox to the host machine so we can wangle the web server. The pursuit two lines do the port forwarding</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>network <span style="color:#960050;background-color:#1e0010">:</span>forwarded_port<span style="color:#f92672">,</span> host<span style="color:#960050;background-color:#1e0010">:</span> <span style="color:#ae81ff">8100</span><span style="color:#f92672">,</span> guest<span style="color:#960050;background-color:#1e0010">:</span> <span style="color:#ae81ff">8100</span> config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>network <span style="color:#960050;background-color:#1e0010">:</span>forwarded_port<span style="color:#f92672">,</span> host<span style="color:#960050;background-color:#1e0010">:</span> <span style="color:#ae81ff">35729</span><span style="color:#f92672">,</span> guest<span style="color:#960050;background-color:#1e0010">:</span> <span style="color:#ae81ff">35729</span></code></pre></div> <p>The IonicBox is just a Linux shell with no GUI so you will want to use a full-length in VirtualBox tabbed Shared Folders to be worldly-wise to edit the files from your host machine. In our specimen we are using c:\projects on the host machine which is linked to ~/vagrant_projects on the IonicBox</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">config<span style="color:#f92672">.</span>vm<span style="color:#f92672">.</span>synced_folder <span style="color:#e6db74">&#34;c:\\projects&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;/home/vagrant/projects&#34;</span></code></pre></div> <p>Next we set up the VirtualBox options</p> <ul> <li>We don&rsquo;t need the VirtualBox GUI since we are going to SSH into the machine so we can turn it off with. Set this to true the first time, just so you can see it</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>gui <span style="color:#f92672">=</span> <span style="color:#66d9ef">false</span></code></pre></div> <ul> <li>We set the Video Ram to 128 megs</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;modifyvm&#34;</span><span style="color:#f92672">,</span> <span style="color:#960050;background-color:#1e0010">:</span>id<span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;--vram&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;128&#34;</span><span style="color:#f92672">]</span></code></pre></div> <ul> <li>Turn on the USB drivers so that we can connect an Android device</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;modifyvm&#34;</span><span style="color:#f92672">,</span> <span style="color:#960050;background-color:#1e0010">:</span>id<span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;--usb&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;on&#34;</span><span style="color:#f92672">]</span></code></pre></div> <ul> <li>Add a usb device filter for a Android Device</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;usbfilter&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;add&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;0&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;--target&#34;</span><span style="color:#f92672">,</span> <span style="color:#960050;background-color:#1e0010">:</span>id<span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;--name&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;android&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;--vendorid&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;0x18d1&#34;</span><span style="color:#f92672">]</span></code></pre></div> <ul> <li>On Windows, You need to turn on Symlinks to the synced_folders. This is needed if your Host Operating System is Windows in order node/npm to work correctly. Remember you have to run your writ prompt as an zookeeper for this writ to work.<br /></li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>customize <span style="color:#f92672">[</span><span style="color:#e6db74">&#34;setextradata&#34;</span><span style="color:#f92672">,</span> <span style="color:#960050;background-color:#1e0010">:</span>id<span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root&#34;</span><span style="color:#f92672">,</span> <span style="color:#e6db74">&#34;1&#34;</span><span style="color:#f92672">]</span></code></pre></div> <ul> <li>Set the system memory for the virtual machine. If you host machine is low on memory you can reduce this down. You must have this much memory self-ruling when the virtual machine starts up</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>memory <span style="color:#f92672">=</span> <span style="color:#ae81ff">2048</span></code></pre></div> <ul> <li>Number of Physical CPUs to allocate. My machine only has 2 physical CPUs. You can intrust increasingly or take it lanugo to 1</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>cpus <span style="color:#f92672">=</span> <span style="color:#ae81ff">2</span></code></pre></div> <ul> <li>The name to use for the virtual machine in the VirtualBox Manager UI</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vb<span style="color:#f92672">.</span>name <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;IonicBox&#34;</span></code></pre></div> <h2 id="starting-up-the-ionicbox-and-getting-logged-in">Starting up the IonicBox and Getting logged in</h2> <ol> <li><p>Open a writ prompt and navigate to the IonicBox folder that contains the VagrantFile.</p> <ul> <li><font color="red">If on Windows, unshut the writ prompt as an Administrator.</font></li> <li>To unshut the writ prompt as an zookeeper in Windows 8 go to the Start Menu Screen, type cmd, then ctrl+shift+click or ctrl+shift+enter<br /> <br /></li> </ul></li> <li><p>Run writ below. This writ will take a while the first time you run it since it has to download the vagrant box container which is well-nigh 1 gig in size.</p></li> </ol> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vagrant up</code></pre></div> <p>If you have the vb.gui = true in your VagrantFile, the first thing you will notice when you marching up the IonicBox is that it just comes to a writ prompt and it leaves you wondering now what. Luckily, this is exactly what we want and it is very easy to manage it. The IonicBox basically just replaces the writ prompt that we would normally use for all of the Ionic commands with a linux machine.</p> <ul> <li>To login to the machine, use the same writ prompt as previous step and run</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vagrant ssh</code></pre></div> <ul> <li>if everything went successful you should be logged in</li> </ul> <h2 id="testing-the-ionicbox">Testing the IonicBox</h2> <p>Now lets create our first Ionic project.</p> <p>On the IonicBox ssh connection:</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">cd projects ionic start firstApp tabs <span style="color:#f92672">&amp;&amp;</span> cd firstApp ionic serve</code></pre></div> <p>You now have a Ionic project in a directory tabbed firstApp and the web server is running.</p> <p>Open up your web browser and navigate to <a href="http://localhost:8100">http://localhost:8100</a></p> <p>You can view all of the files that make up this project on your host machine under c:\projects\firstApp</p> <p>If you are NOT using Windows as your host operating system that we are washed-up with configurations. Unfortunately, if you are using Windows as your host operating system, we have one increasingly step to get npm working correctly, so that you can download all of the dependencies for Ionic.</p> <p><font color="red">WARNING: Unless you have npm 3.0+. This may not fix the issue with node and long file names on Windows with npm.</font></p> <p>We need to setup a symbolic link for the node modules folder since windows has a length limitation when using shared folders. A symbolic link is basically a point from one directory to another. Windows has a directory name length limitation that we encounter when host our files through a shared folder. Since our npm dependencies (node modules) folder doesn&rsquo;t need to be checked into source control, we can move it to a directory on the IonicBox and just point to that from within our Ionic projects.</p> <p>On the IonicBox from the firstApp folder run the pursuit commands:</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">mkdir <span style="color:#960050;background-color:#1e0010">~</span><span style="color:#f92672">/</span>node_modules_<span style="color:#f92672">[</span>Your Project<span style="color:#f92672">]</span> ln <span style="color:#f92672">-</span>s <span style="color:#960050;background-color:#1e0010">~</span><span style="color:#f92672">/</span>node_modules_<span style="color:#f92672">[</span>Your Project<span style="color:#f92672">]</span> node_modules npm install</code></pre></div> <p><strong><font color="red">Remember:</font></strong> If on Windows, you need to run the vagrant up writ from an legalistic writ prompt.</p> <p>You may moreover need to manually install bower</p> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">sudo npm install bower <span style="color:#f92672">-</span>g</code></pre></div> <h2 id="i-am-done-with-ionicbox-now-what">I am washed-up with IonicBox, now what?</h2> <ul> <li><p>To exit vagrant ssh session, just type exit from the writ prompt that is logged into the IonicBox. This will put you when into the original writ prompt.</p></li> <li><p>Hibernate: from the IonicBox directory with the VagrantFile run</p></li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vagrant suspend</code></pre></div> <ul> <li>Shutdown and Turn Off: from the IonicBox directory with the VagrantFile run</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io">vagrant halt</code></pre></div> <ul> <li>Delete the whole IonicBox Virtual Machine: from the IonicBox directory with the VagrantFile run</li> </ul> <div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-io" data-lang="io"> vagrant destroy</code></pre></div> <ul> <li>Note that sometimes this leaves overdue the directory that contained the Virtual Machine.Surpassingyou can run vagrant up again, you will need to manually delete this directory.</li> </ul> <h2 id="conclusion">Conclusion</h2> <p>This is a nice easy way to get started with ionic without having to install much onto your current machine.</p> <p>However, if you are going to spend a lot of time developing ionic applications, it won&rsquo;t be long surpassing you go lanugo the route of installing everything onto your machine to do the minutiae work.</p> <p>Check out my installation guides to help you out:</p> <p><a href="{{ &quot;ionic-setup-osx&quot; | prepend: site.baseurl | prepend: site.url }}">Mac Installation</a></p> <p><a href="{{ &quot;Ionic-Setup-Windows&quot; | prepend: site.baseurl | prepend: site.url }}">Windows Installation</a></p> Npm, Bower, Git, andWhackProxy Configurations https://digitaldrummerj.me/proxy-configurations/ Fri, 16 Jan 2015 20:00:00 +0000 https://digitaldrummerj.me/proxy-configurations/ <p>When you are using npm, bower, and git overdue a proxy server you have to do a little bit of configuration. Luckily it is super easy to do these configurations.Scrutinizinglyall of the programs have writ line commands to set and unset the proxy server.</p> <h2 id="updates">Updates:</h2> <ul> <li><strong>Updated 2015-Feb-01</strong>:Widowrunning source writ forWhackand Ruby Gems section</li> <li><strong>Updated 2015-May-07</strong>:Widowthe Ionic Start command</li> <li><strong>Updated 2015-May-08</strong>:Widowthe Android SDK</li> <li><strong>Updated 2015-Aug-03</strong>:Widowcommand lines to set proxy</li> <li><strong>Updated 2015-Oct-20</strong>:WidowGradle</li> </ul> <h2 id="windows-command-prompt">WindowsWritPrompt</h2> <h3 id="current-command-prompt-only">CurrentWritPrompt Only</h3> <pre><code>set http_proxy=[Your Proxy]:[Proxy Port] set https_proxy=[Your Proxy]:[Proxy Port] </code></pre> <h3 id="unset-current-session">Unset Current Session</h3> <pre><code>set http_proxy= set https_proxy= </code></pre> <h3 id="globally-as-a-system-environment-variable">Globally as a System Environment Variable</h3> <p>Run from an legalistic writ prompt</p> <pre><code>setx http_proxy=[Your Proxy]:[Proxy Port] /M setx https_proxy=[Your Proxy]:[Proxy Port] /M </code></pre> <p>You will need to tropical and re-open writ prompt for settings to take effect</p> <h3 id="globally-as-a-user-environment-variable">Globally as a User Environment Variable</h3> <p>Run from a non-administrative writ prompt</p> <pre><code>setx http_proxy=[Your Proxy]:[Proxy Port] setx https_proxy=[Your Proxy]:[Proxy Port] </code></pre> <p>You will need to tropical and re-open writ prompt for settings to take effect</p> <h3 id="unset-globally-system-environment-variable">Unset Globally System Environment Variable</h3> <p>Run from an legalistic writ prompt</p> <pre><code>setx http_proxy=&quot;&quot; /M setx https_proxy=&quot;&quot; /M </code></pre> <p>Need to tropical and re-open writ prompt for settings to take effect</p> <h3 id="unset-globally-user-environment-variable">Unset Globally User Environment Variable</h3> <p>Run from a non-administrative writ prompt</p> <pre><code>setx http_proxy=&quot;&quot; setx https_proxy=&quot;&quot; </code></pre> <p>Need to tropical and re-open writ prompt for settings to take effect</p> <h3 id="view-proxy-settings">View Proxy Settings</h3> <p>If the commands unelevated just reverberate out the text instead of the very proxy server, it ways that the proxy server is not set.</p> <pre><code>echo %http_proxy% reverberate %https_proxy% </code></pre> <hr /> <h2 id="bash-shell">Bash Shell</h2> <p>File Name: .bash_profile or .bashrc</p> <pre><code>export http_proxy=[Your Proxy]:[Proxy Port] export https_proxy=[Your Proxy]:[Proxy Port] export npm_config_proxy=[Your Proxy]:[Proxy Port] export npm_config_https_proxy=[Your Proxy]:[Proxy Port] </code></pre> <p>Note:Withoutupdated the .bash_profile or .bashrc, you should run one of the pursuit commands to make the configuration zippy for the current session.</p> <pre><code>source ~/.bashrc or source ~/.bash_profile </code></pre> <hr /> <h2 id="bower">Bower</h2> <p>There is no writ line that I found for configuring bower. Instead you need to create a .bowerrc file in the users home directory.</p> <p>On Windows: %userprofile% directory.</p> <p>On Linux: ~/</p> <h3 id="creating-bowerrc-file-on-windows">Creating .bowerrc file on Windows</h3> <p>Windows Explorer unfortunately does not indulge you to create files without extensions but using notepad you can create a file without an extension.</p> <ol> <li>Open Notepad</li> <li>Ctrl + S to save the file</li> <li>Navigate to the %UserProfile% directory</li> <li>Change the &ldquo;Save as Type&rdquo; to &ldquo;All Files (<em>.</em>)</li> <li>Name the file .bowerrc</li> <li>Click the Save button</li> <li>Now you can edit the file in your text editor of nomination <br /></li> </ol> <h3 id="proxy-setting-in-bowerrc">Proxy Setting in .bowerrc.</h3> <pre><code>{ &quot;proxy&quot;:&quot;http://[Your Proxy]:[Proxy Port]&quot;, &quot;https-proxy&quot;:&quot;http://[Your Proxy]:[Proxy Port]&quot; } </code></pre> <hr /> <h2 id="git">Git</h2> <p>You can moreover set the proxy settings unelevated to be system wide with the --system switch.</p> <h3 id="set-proxy">Set Proxy:</h3> <pre><code>git config --add http.proxy http://[Your Proxy]:[Proxy Port] git config --add https.proxy http://[Your Proxy]:[Proxy Port] </code></pre> <h3 id="unset-proxy">Unset Proxy:</h3> <pre><code>git config --unset http.proxy git config --unset https.proxy </code></pre> <h3 id="view-configuration">View Configuration</h3> <p><strong>Just Proxy Configs</strong></p> <pre><code>git config --get http.proxy git config --get https.proxy </code></pre> <p><strong>All Configs</strong></p> <pre><code>git config --list </code></pre> <h3 id="manually-update-gitconfig-not-recommended">Manually Update .gitconfig (not recommended)</h3> <pre><code>[http] proxy = http://[Your Proxy]:[Proxy Port] [https] proxy = http://[Your Proxy]:[Proxy Port] </code></pre> <hr /> <h2 id="npm">NPM</h2> <h3 id="set-proxy-1">Set Proxy:</h3> <pre><code>npm config set https-proxy http://[Your Proxy]:[Proxy Port] npm config set proxy http://[Your Proxy]:[Proxy Port] </code></pre> <h3 id="unset-proxy-1">Unset Proxy:</h3> <pre><code>npm config delete https-proxy npm config delete proxy </code></pre> <h3 id="view-proxy-configurations">View Proxy Configurations:</h3> <pre><code>npm config get https-proxy npm config get proxy </code></pre> <h3 id="manually-update-npmrc-not-recommended">Manually Update .npmrc (not recommended)</h3> <pre><code>proxy=http://[Your Proxy]:[Proxy Port] https-proxy=http://[Your Proxy]:[Proxy Port] </code></pre> <hr /> <h2 id="ruby-gem-install">Ruby Gem Install</h2> <p>If you have set the proxy in the .bash_profile or .bashrc, then Ruby should pick it up.</p> <p>If you need to manually set it</p> <h3 id="linux">Linux</h3> <p>export http_proxy=[Your Proxy]:[Proxy Port] sudo gem install [your gem name]</p> <h3 id="windows">Windows</h3> <pre><code>setx http_proxy &quot;[Your Proxy Server]:[Proxy Port]&quot; /M gem install [your gem name] </code></pre> <hr /> <h2 id="ionic-start-command">Ionic Start Command</h2> <p>In order to run the ionic start writ overdue a proxy, you need start the writ out with the Proxy information.</p> <h3 id="linux-1">Linux</h3> <pre><code>PROXY=http://[Your Proxy]:[Proxy Port] ionic start [App Name] [Template Name] </code></pre> <h3 id="windows-1">Windows</h3> <pre><code>setx http_proxy &quot;[Your Proxy Server]:[Proxy Port]&quot; /M ionic start [App Name] [Template Name] </code></pre> <hr /> <h2 id="android-sdk">Android SDK</h2> <p>The android SDK uses ~/.android/androidtool.cfg file to pinpoint the proxy information. If the file does not exist, go superiority and create it.</p> <pre><code>http.proxyHost=[Your Proxy] http.proxyPort=[Proxy Port] </code></pre> <hr /> <h2 id="gradle">Gradle</h2> <p>When trying to build an Android project that uses Gradle, you may need to configure the proxy for it.</p> <p>On Windows: %userprofile%/.gradle.properties</p> <pre><code>systemProp.http.proxyHost=[Your Proxy] systemProp.http.proxyPort=[Proxy Port] systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost systemProp.https.proxyHost=[Your Https Proxy] systemProp.https.proxyPort=[Https Proxy Port] systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost </code></pre> GitWritNotes https://digitaldrummerj.me/git-command-notes/ Wed, 14 Jan 2015 20:45:35 +0000 https://digitaldrummerj.me/git-command-notes/ <p>I am finally making myself learn the git writ line instead of just using a UI so that I can unquestionably understand what git is really doing. Plus I have started playing a lot with the IonicBox and running a Ubuntu vagrant controlled VM for this blog and both of those are just linux shell writ prompt only machines.</p> <p>Below are my notes on various commands so that I can stop having to Google each time I forgot one of them.</p> <h2 id="caching-credentials">Caching Credentials</h2> <p><strong>To enshroud credentials for 1 hour. The timeout is in seconds.</strong></p> <pre><code>git config --global credential.helper 'cache --timeout 3600' </code></pre> <h2 id="basic-commands">Basic Commands</h2> <p><strong>Getting lawmaking to local machine</strong></p> <p>In Git terms, this is tabbed cloning a repository and the writ to use is git clone.</p> <p><strong>Directory name will match repository name</strong></p> <pre><code>git clone [Remote Repository Url] </code></pre> <p><strong>Use this writ if you want to name the directory variegated than the repository name</strong></p> <pre><code>git clone [Remote Repository Url] [Directory to Clone into] </code></pre> <p><strong>Where did the local repository come from?</strong></p> <pre><code>git remote -v </code></pre> <p><strong>Change the Remote Origin Url</strong></p> <pre><code>git remote set-url origin [https or ssh url] </code></pre> <p><strong>Get Latest Changes but don&rsquo;t merge</strong></p> <pre><code>git fetch </code></pre> <p><strong>Get Latest Changes and Merge</strong></p> <pre><code>git pull </code></pre> <p><strong>Generate SSH Keys</strong></p> <p><strong>Adding Key</strong></p> <pre><code>ls -al ~/.ssh ssh-keygen -t rsa -C &quot;your_email@example.com&quot; ssh-agent -s or eval(ssh-agent) or eval $(ssh-agent) ssh-add ~/.ssh/id_rsa prune &lt; ~/.ssh/id_rsa.pub Go to github settings for your worth Click on SSH Keys Click Add KeyRequiteit a name and paste in the key Put in your github password Click personize </code></pre> <p><strong>To test</strong></p> <pre><code>ssh -T git@github.com </code></pre> <p>Should get a response like: Hi username! You&rsquo;ve successfully authenticated, but GitHub does not provide shell access.</p> <p>Full details at <a href="https://help.github.com/articles/generating-ssh-keys/">https://help.github.com/articles/generating-ssh-keys/</a></p> <p><strong>See what files have changed</strong></p> <pre><code>Long Form: git status Short Form: git status -s Show Files: git status -u or to unchangingly show git config status.showuntrackedfile=yes </code></pre> <p><strong>Turning a directory into a repository on the local machine</strong></p> <pre><code>git init </code></pre> <p><strong>Adding files to the repository</strong></p> <pre><code>git add [file name] </code></pre> <p><strong>Adding all files in a directory except the ones in the .gitignore file</strong></p> <pre><code>git add . </code></pre> <p><strong>Reverting a file that has changes not been widow or staged</strong></p> <pre><code>git checkout [file name] </code></pre> <p><strong>Unadding a file that has been widow and not single-minded but leave file</strong></p> <pre><code>git reset </code></pre> <p><strong>Unadding a file that has been widow and not single-minded but delete file</strong></p> <pre><code>git reset --hard </code></pre> <p><strong>Ignoring files</strong></p> <ul> <li>create .gitignore file</li> <li>starter files misogynist at <a href="https://github.com/github/gitignore">https://github.com/github/gitignore</a></li> <li>Create a .gitignore file for any number of languages at <a href="http://gitignore.io">http://gitignore.io</a> <br /></li> </ul> <p><strong>Committing files to the local repository</strong></p> <pre><code>git commit -m &quot;Your Message&quot; </code></pre> <p><strong>Removing Files</strong></p> <pre><code>git rm [File Name] </code></pre> <p><strong>Moving Files</strong></p> <pre><code>git mv [Old File Name] [New File Name] </code></pre> <p><strong>Publishing files to the remote repository</strong></p> <pre><code>git push </code></pre> <h2 id="merge">Merge</h2> <h4 id="storing-work-that-you-want-to-keep-but-not-commit">Storing work that you want to alimony but not commit</h4> <p><strong>Storing the work</strong></p> <pre><code>git stash </code></pre> <p><strong>Seeing what work is stored</strong></p> <pre><code>git stash list </code></pre> <p><strong>Applying the last stash to the current code</strong></p> <pre><code>git stash wield </code></pre> <p><strong>Applying a variegated stash then the last one to the current code</strong></p> <pre><code>git stash wield stash@{[Number for stash from git stash list command]} </code></pre> <h2 id="branching">Branching</h2> <p><strong>See AvailableWorkshopIncluding Remote Branches</strong></p> <pre><code>git workshop -v </code></pre> <p><strong>Creating a Branch</strong></p> <pre><code>git workshop [Branch Name] </code></pre> <p><strong>Switch to a branch</strong></p> <pre><code>git checkout [Branch Name] </code></pre> <p><strong>Switch to last workshop you were on</strong></p> <pre><code>git checkout - </code></pre> <p><strong>Merging a workshop into the master (HEAD)</strong></p> <pre><code>First make sure you are on the master branch: git checkout master Then issue the merge command: git merge [branch name] </code></pre> <p><strong>List the branches for the repository</strong></p> <pre><code>git workshop </code></pre> <ul> <li>Note: the * in the results indicates the workshop currently checked out. <br /> <br /></li> </ul> <p><strong>See last commit of each branch</strong></p> <pre><code>git workshop -v </code></pre> <p><strong>See branches once merged</strong></p> <pre><code>git workshop --merged </code></pre> <p><strong>See branches NOT once merged</strong></p> <pre><code>git workshop --no-merged </code></pre> <p><strong>Push workshop to remote repository</strong></p> <pre><code>git push origin [branch name] </code></pre> <p><strong>Delete a Local branch</strong></p> <pre><code>git workshop -d [branch name] </code></pre> <p><strong>Deleting Remote Branch</strong></p> <pre><code>git push origin --delete [branch name] </code></pre> <h2 id="proxy-settings">Proxy Settings</h2> <p>See Post on <a href="{{&quot;/proxy-configurations&quot; | prepend: site.baseurl | prepend: site.url }}">Proxy Configurations</a> for configuring your proxy settings with Git</p> <h2 id="configurations">Configurations</h2> <p><strong>Listing of Configurations:</strong></p> <pre><code>git config -l git config -l --global git config -l --system git config -l --local </code></pre> <p><strong>Set Configuration</strong></p> <pre><code>git config --add [variable name] [value] </code></pre> <p><strong>Unset Configuration</strong></p> <pre><code>git config --unset [variable name] </code></pre> Ionic - How to setup on Windows https://digitaldrummerj.me/ionic-setup-windows/ Sun, 11 Jan 2015 20:45:35 +0000 https://digitaldrummerj.me/ionic-setup-windows/ <p>Updates:</p> <ul> <li>2016-08-13:WidowGradle and VSLawmakingto software installed.Revertedfrom JDK7 to JDK8. Removed Ant.WidowAndroid SDK Apis install to Chocolatey script. Switched suggested emulator to Visual Studio Emulator for Android.</li> </ul> <p>If you are like me and just starting to work with the <a href="http://www.ionicframework.com">Ionic Framework</a> and don&rsquo;t once have a machine setup to do Android, iOS, Node, etc minutiae then many of the guides out there leave out a number of steps that you need to do in order to get everything working.</p> <p>It is really easy to get everything working though once you know the steps. Since I am a Windows user and love to automate work that is hands repeatable, I used <a href="http://www.chocolatey.org">Chocolatey</a> and <a href="http://www.boxstarter.org">Boxstarter</a> to automate the setup for the Ionic Framework.</p> <p>On Windows, you will only be worldly-wise to setup Android development.Worldrequires a Mac in order to do iOS development.</p> <h2 id="software-to-be-installed">Software to be installed</h2> <ul> <li><a href="https://chocolatey.org/packages/nodejs.install">NodeJS</a></li> <li><a href="https://chocolatey.org/packages/git">Git</a></li> <li><a href="https://chocolatey.org/packages/gradle">Gradle</a></li> <li><a href="https://chocolatey.org/packages/jdk8">JDK8</a></li> <li><a href="https://chocolatey.org/packages/android-sdk">Android SDK</a></li> <li><a href="https://chocolatey.org/packages/AndroidStudio">Android Studio</a></li> <li><a href="https://chocolatey.org/packages/GoogleChrome">Google Chrome</a></li> <li>Npm Modules: <ul> <li><a href="https://www.npmjs.com/package/cordova">cordova</a></li> <li><a href="https://www.npmjs.com/package/gulp-cli">gulp cli</a></li> <li><a href="https://www.npmjs.com/package/bower">bower</a></li> <li><a href="https://www.npmjs.com/package/ionic">ionic</a></li> </ul></li> <li><a href="https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx">Visual Studio Emulator for Android (Hyper-V Based)</a></li> <li><a href="https://code.visualstudio.com/">VS Code</a></li> </ul> <h2 id="how-to-install-software">How to install software</h2> <ol> <li><p>Install Chocolatey from <a href="http://www.chocolatey.org">http://www.chocolatey.org</a>.Writis on the front-page of the site or below.Unshutan legalistic writ prompt to run the command. To unshut an legalistic writ prompt on Windows 8, go to the start menu, type cmd and then ctrl+shift+click on the cmd search result.</p> <pre><code>Command Prompt: @powershell -NoProfile -ExecutionPolicy unrestricted -Command &quot;iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))&quot; &amp;&amp; SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin </code></pre></li> <li><p>Install the <a href="http://boxstarter.org">BoxStarter</a> Chocolatey package</p> <pre><code>choco install -y BoxStarter </code></pre></li> <li><p>Close the writ prompt that you opened to install Chocolatey and BoxStarter</p></li> <li><p>On the desktop there should be a BoxStarter Shell icon, double-click on that to run it. If the icon is not on the desktop, then unshut up a writ prompt and type BoxStarterShell.</p></li> <li><p>I have setup a gist file that has all of the Chocolatey commands to run to install the rest of the software and configure it. Run the gist file from the Boxstarter Shell:</p> <pre><code>Install-BoxStarterPackage -PackageName https://gist.githubusercontent.com/digitaldrummerj/3fe2eb057004b6742b89/raw/3da48d349c313684077d7103547dfe79f7052617/IonicSetup -DisableReboots </code></pre></li> </ol> <ul> <li><strong>NOTE:</strong> If you want to install any of the optional software you will need to fork the gist file and remove the # in front of the line for the package you want to install. <br /></li> </ul> <h2 id="post-install-steps">Post Install Steps</h2> <h3 id="configure-visual-studio-emulator-for-android">Configure Visual Studio Emulator for Android</h3> <ul> <li>Open up the Visual Studio Emulator for Android application</li> <li>Find the devices that you want to download. Any device will do. I normally pick one of the latest ones as a starting point (Marshmellow 6.0 at the time of this writing)<br /></li> </ul> <h2 id="verify-that-everything-works">Verify that everything works</h2> <ol> <li>Open a writ prompt</li> <li>Navigate the directory where you store you minutiae projects (I use c:\projects)</li> <li>From c:\projects type: ionic start todo tabs</li> <li>cd into c:\projects\todo (directory was created by the ionic start command)</li> </ol> <p>The first test that we are going to run is to make sure that we can test the todo app that we generated in the web browser by running:</p> <pre><code> ionic serve --lab </code></pre> <p>This will start up a node based web server and the --lab will tell it to launch a page that shows what the app would squint like on an iOS and Android phone. Granted the node based serve is well-nigh 80% well-judged but good unbearable to do a majority of our testing. Ultimately you should test on a device surpassing releasing into the app stores.</p> <p>Next we are going to test our Android device setup. The first thing we need to do is tell ionic that we want to add the Android platform to our todo app by running:</p> <pre><code>ionic platform add android </code></pre> <p>This sets up the todo app to be worldly-wise to be build and deployed to an Android device. To validate that we can build for Android, run the following:</p> <pre><code>ionic build android </code></pre> <p>The last thing we need to verify is that we can deploy the todo app to the Visual Studio Emulator for Android.Surpassingwe can deploy the application, we need to start up the emulator.</p> <ol> <li>Open up the Visual Studio Emulator for Android</li> <li>Find the device that we downloaded</li> <li>Click the untried thunderstroke to start it up<br /></li> <li><p>Once the emulator is started, you can deploy to it by running:</p> <pre><code>ionic run android </code></pre></li> </ol> <p>You are now ready to go create your ionic applications.</p> Ionic - Setup on OSx https://digitaldrummerj.me/ionic-setup-osx/ Sun, 11 Jan 2015 20:45:35 +0000 https://digitaldrummerj.me/ionic-setup-osx/ <p>Updates:</p> <ul> <li>2016-08-13:WidowGradle and VS Code.Revertedfrom JDK7 to JDK8. Removed Ant.<br /></li> </ul> <p>If you are like me and just starting to work with the Ionic Framework and don’t once have a machine setup to do Android, iOS, Node, etc minutiae then many of the guides out there leave out a number of steps that you need to do in order to get everything working.</p> <p>Even stuff a Windows user I was worldly-wise to pretty hands get Ionic working on a Mac. The only difference between the Windows setup and the OSx setup is that you can build for an iOS device on a Mac.</p> <h2 id="software-to-be-installed">Software to be installed</h2> <ul> <li><a href="https://nodejs.org">NodeJS</a></li> <li><a href="https://docs.gradle.org/current/userguide/installation.html">Gradle</a></li> <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">JDK8</a></li> <li><a href="http://developer.android.com/sdk/index.html#Other">Android SDK</a></li> <li><a href="http://developer.android.com/sdk/index.html#Other">Android Studio</a></li> <li><a href="https://www.google.com/chrome/browser/desktop/">Google Chrome</a></li> <li>Global Npm Modules: <ul> <li><a href="https://www.npmjs.com/package/cordova">cordova</a></li> <li><a href="https://www.npmjs.com/package/gulp-cli">gulp cli</a></li> <li><a href="https://www.npmjs.com/package/bower">bower</a></li> <li><a href="https://www.npmjs.com/package/ionic">ionic</a></li> <li><a href="https://www.npmjs.com/package/ios-sim">ios-sim</a><br /></li> </ul></li> <li><a href="https://www.genymotion.com/">Genymotion</a> (Android emulator replacement) `- XCode</li> <li>XCodeWritLine Tools</li> </ul> <h2 id="general-install-steps">General Install Steps</h2> <h3 id="google-chrome">Google Chrome</h3> <p>We need Google Chrome in order to debug our using when it is running on a device. The device emulation and developer tools are moreover extremely useful to have.</p> <p>Download from <a href="https://www.google.com/chrome/browser/desktop/">https://www.google.com/chrome/browser/desktop/</a></p> <h3 id="node">Node</h3> <ol> <li>Install the LTS version of node from <a href="https://www.nodejs.org">https://www.nodejs.org</a></li> </ol> <h3 id="npm-packages">Npm Packages</h3> <ol> <li><p>Open a terminal and run the pursuit commands to install the Global NPM packages that we need:</p> <pre><code>sudo npm install -g cordova sudo npm install -g ionic sudo npm install -g gulp sudo npm install -g Bower </code></pre></li> </ol> <p>At this point, we can create ionic projects and test them in a web browser. To make sure that functionality is working:</p> <h3 id="verifying-general-install">VerifyingUnstipulatedInstall</h3> <ol> <li>In your unshut terminal, navigate to the directory where you store your minutiae projects (I use ~/projects)</li> <li><p>From ~/projects run:</p> <p>ionic start todo blank</p></li> <li><p>cd into todo (directory was created by the ionic start command)</p></li> <li><p>Run the pursuit writ to run the todo app we generated in a web browser</p> <p>ionic serve --lab</p></li> </ol> <p>In the next section, we will install everything needed to deploy to an Android device.</p> <h2 id="android-setup-steps">Android Setup Steps</h2> <p>In order to deploy to an Android device you need to install the Java JDK, Android Studio, and Android SDK. We will walk through installing all of the required software setup.</p> <h3 id="jdk-8">JDK 8</h3> <p>Download from <a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html</a></p> <p>After the install, launch a terminal and create a ~/.bash_profile if it doesn&rsquo;t once exist. You can use touch ~/.bash_profile to create the file. -Unshutup either vi or nano and add the pursuit line:</p> <p>export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_72.jdk/Contents/Home</p> <h3 id="android-studio">Android Studio</h3> <p>Download from <a href="http://developer.android.com/sdk/index.html#Other">http://developer.android.com/sdk/index.html#Other</a></p> <h3 id="android-sdk">Android SDK</h3> <p>Download the Android SDK from [<a href="http://developer.android.com/sdk/index.html#Other](http://developer.android.com/sdk/index.html#Other_">http://developer.android.com/sdk/index.html#Other](http://developer.android.com/sdk/index.html#Other_</a></p> <p>Unzip the downloaded SDK to to ~/Development</p> <p>Open ~/.bash_profile and add the pursuit line:</p> <pre><code>export PATH=${PATH}:/users/[Your UserName]/Development/android-sdk-macosx/tools:/users/[Your Username]/Development/android-sdk-macosx/platform-tools </code></pre> <p>In the terminal type source ~/.bash_profile to load the ~/.bash_profile changes.</p> <p>Now we need to download the Android APIs versions that we superintendency about. In this case, we are only going to install the API 23 Android SDK Tools and Android SDK Build-Tools</p> <p>In the terminal window, type android to launch the Android SDK Manager.</p> <p>Install the the following</p> <ul> <li>Tools -&gt; Android SDK Tools</li> <li>Tools -&gt; Android SDK Build-Tools</li> <li>Tools -&gt; Android Platform-Tools</li> <li>API 23 -&gt; SDK Platform</li> </ul> <h3 id="genymotion-setup">Genymotion Setup</h3> <p>Download Genymotion from <a href="https://www.genymotion.com/">https://www.genymotion.com/</a>.</p> <blockquote> <p>The Genymotion installer will moreover install VirtualBox if it is not once installed.</p> </blockquote> <p>Once Genymotion is installed, we need to download a device.</p> <ul> <li>Open up the Genymotion UI and click on the Add Button.</li> <li>Then click the Sign in sawed-off and follow the login instructions to login with the worth that you create as part of the Genymotion download.</li> <li>After you are logged in, select from the Android Version waif lanugo 4.4.4</li> <li>From the Device model waif lanugo select a device type</li> <li>Then select a device from the misogynist list</li> <li>Click the Next button.</li> <li>Click the Next sawed-off and wait for the device to download</li> <li>Click the Finish button.</li> </ul> <h3 id="verify-the-android-setup">Verify the Android Setup</h3> <ol> <li>Open terminal</li> <li>Navigate to the todo app that we create as part of the unstipulated install verification. (I used ~/projects/todo)</li> <li><p>If you need to ceate the todo app run the pursuit from ~/projects:</p> <p>ionic start todo blank</p></li> <li><p>cd into todo (directory was created by the ionic start command)</p></li> <li><p>The todo app is now setup to be worldly-wise to deploy to an Android device. To validate that we can build for Android, run the following:</p> <pre><code>ionic platform add android </code></pre></li> <li><p>The todo app is now setup to be worldly-wise to deploy to an Android device. To validate that we can build for Android, run the following:</p> <pre><code>ionic build android </code></pre></li> <li><p>The last thing we need to verify is that we can deploy the todo app to the Genymotion Emulator.Surpassingwe can deploy the application, we need to start up the emulator.</p></li> <li><p>Start the Genymotion device you downloaded and run:</p> <p>ionic run android</p></li> </ol> <p>You are now ready to go create ionic applications that you deploy to an Android device.</p> <h2 id="ios-setup-steps">iOS Setup Steps</h2> <h3 id="xcode-setup">XCode Setup</h3> <ol> <li>Install Xcode from app store. This will take awhile since it is ~2 gigs in size. <ul> <li>Once install is completed, unshut xcode and winnow the license</li> </ul></li> <li><p>Install the iOS Simulator that Ionic will use.</p> <p>npm install -g iOS-sim</p> <blockquote> <p>Note that if you just install NodeJs without using HomeBrew, you may have to add sudo in front of the npm install commands.</p> </blockquote></li> </ol> <h3 id="verify-the-ios-setup">Verify the iOS Setup</h3> <ol> <li>Open terminal</li> <li>Navigate the directory where you store you minutiae projects (I use ~/projects)</li> <li><p>If you need to generate the todo app, run the pursuit writ from the ~/projects directory</p> <p>ionic start todo tabs</p></li> <li><p>cd into todo (directory was created by the ionic start command)</p></li> <li><p>We need to do is tell ionic that we want to add the iOS platform to our todo app by running:</p> <pre><code>ionic platform add iOS </code></pre></li> <li><p>The todo app is now setup to be worldly-wise to deploy to an iOS device. To validate that we can build for iOS, run the following:</p> <pre><code>ionic build iOS </code></pre></li> <li><p>The last thing we need to verify is that we can deploy the todo app to the iOS Simulator by running:</p> <p>ionic run iOS</p></li> </ol> <p>You are now ready to go create your ionic applications.</p> Ionic - Using Android x86 Virtual Machine Instead of Emulator https://digitaldrummerj.me/android-x86-virtual-machine-instead-of-emulator/ Sun, 11 Jan 2015 20:45:35 +0000 https://digitaldrummerj.me/android-x86-virtual-machine-instead-of-emulator/ <p>The Android emulator is super super slow and I could never get it working on my minutiae virtual machine. I thought no problem I will just use Genymotion but due to a video vellum suburbanite issue on my palmtop (not Genymotion&rsquo;s fault), I couldn&rsquo;t use it either. I was thinking ok I will just have to use a real device and unchangingly have it on me when I do Android minutiae work. This wouldn&rsquo;t have been platonic though since Android minutiae work is just a side project and who wants to siphon an uneaten device just in specimen you get a few minutes to work on the project.</p> <p>Well then I ran wideness someone that mentioned that Android x86 project. This project allows you to run Android on a pc and virtualbox machine. So I follow the guide at <a href="http://www.android-x86.org/documents/virtualboxhowto">Android x86 virtualbox install</a> and was up and running in no time.</p> <p>Once I was up and running, the next step was to icon out how to deploy my applications to the machine just like I would with the emulator or a real device. Turns out this is pretty easy to do with the Android Debugging Bridge (adb)</p> <p>Following the <a href="http://www.android-x86.org/documents/debug-howto">Debug How To</a> guide I was worldly-wise to get it working pretty quickly.</p> <p>As the vendible says, it was easiest to get it working with a bridged adapter.ConsideringI was using a virtualbox machine for both minutiae and android x86, this made using NAT way increasingly complicated then if just the Android x86 was the virtual machine.</p> <p><strong>BridgedConnectorSetup:</strong></p> <ol> <li>Get Android Virtual Machine IP <ul> <li>Open Terminal (alt + F1)</li> <li>type netcfg</li> </ul></li> <li>On the host machine (development machine) <ul> <li>Open writ prompt</li> <li>type adb kill-server</li> <li>type adb tcpip 5555 <ul> <li>type adb connect [Android Virtual Machine IP]:5555</li> </ul></li> </ul></li> </ol>