<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">



  
  

<title type="text">MY NOTEPAD</title>
<generator uri="https://github.com/mojombo/jekyll">Jekyll</generator>
<link rel="self" type="application/atom+xml" href="http:/notepad/feed.xml" />
<link rel="alternate" type="text/html" href="http:/notepad/" />
<updated>2015-01-11T00:18:10+11:00</updated>
<id>http:/notepad/</id>
<author>
  <name>Katie Ball</name>
  <uri>http:/notepad/</uri>
  <email>katie@roachhd.com</email>
</author>


<entry>
  <title type="html"><![CDATA[Develop For Chrome Cast]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/app%20development/developing-for-chromecast"/>
  <id>http:/notepad/app%20development/developing-for-chromecast</id>
  <published>2015-01-10T00:00:00+11:00</published>
  <updated>2015-01-10T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#chromecast" term="chromecast" /><category scheme="http:/notepad/tags/#app" term="app" /><category scheme="http:/notepad/tags/#dev" term="dev" />
  <content type="html">
  
    &lt;h2 id=&quot;whats-this&quot;&gt;What’s This?&lt;/h2&gt;

&lt;p&gt;Yesterday I set out on a mission to start writing my first Chromecast app. What I found was a woefully incomplete amount&lt;br /&gt;
of &lt;a href=&quot;https://developers.google.com/cast/&quot;&gt;documentation&lt;/a&gt; via Google and several disaparate little projects that other&lt;br /&gt;
developers had worked on. While the task was not insurmountable because of this, I thought why not just write up a simple&lt;br /&gt;
Hello World with commentary to make any would be Chromecast Dev’s life easier. So, that’s what this is: a barebones&lt;br /&gt;
sender and receiver to help you understand how this all fits together. For now, I only have a Chrome sender. Soon I’ll probably work on the equivalent for Android. But, let’s get started!&lt;/p&gt;

&lt;h2 id=&quot;get-yourself-whitelisted&quot;&gt;Get Yourself Whitelisted&lt;/h2&gt;

&lt;p&gt;I’m not going to go into too much detail with this, because Google did a pretty good job of outlining this process. You can go &lt;a href=&quot;https://developers.google.com/cast/whitelisting&quot;&gt;here&lt;/a&gt; and just follow the instructions. It took me about 12 hours to hear a response. One thing to mention is that to start Chromecast development you’re going to need to host your receiver app somewhere. Github has free pages hosting, but in the long run that would be a little limited. So, look into your options and make the decision that works best for you right now.&lt;/p&gt;

&lt;p&gt;An important note: The URL you give Google has to be the &lt;em&gt;exact&lt;/em&gt; location of your receiver app’s index.html. If you were to clone this repo and upload it to your server &lt;code&gt;http://mydomain.com&lt;/code&gt; then the receiver would be located at &lt;code&gt;http://mydomain.com/receiver&lt;/code&gt;. You would have to specify that as your URL when whitelisting. Alternatively, if you just dumped the receiver app at the root directory of your domain, meaning it would found at &lt;code&gt;http://mydomain.com&lt;/code&gt;, then you would supply that URL. The way the process works now does not have any support for subdirectories. So you have to make sure you’re specific. Also, if you rename the receiver app from &lt;code&gt;index.html&lt;/code&gt; to anything else, you’ll have to specify that in the URL e.g. &lt;code&gt;http://mydomain.com/receiver/sweetapp.html&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also, while you’re waiting for this you might as well follow the second set of steps on that page and whitelist &lt;code&gt;localhost&lt;/code&gt; in the Chromecast extension.&lt;/p&gt;

&lt;h2 id=&quot;im-whitelistednow-what&quot;&gt;I’m Whitelisted…now What?&lt;/h2&gt;

&lt;p&gt;Now the fun part! These apps aren’t particularly difficult once you get the hang of it, so don’t sweat it if you were a little confused from Google’s documentation. Right now, it’s not very good!&lt;/p&gt;

&lt;p&gt;To start off with, we’re going to go ahead and create our receiver app.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;the-receiver&quot;&gt;The Receiver&lt;/h3&gt;

&lt;p&gt;For both the receiver and the sender app I use a little bit of &lt;a href=&quot;http://jquery.com/&quot;&gt;jQuery&lt;/a&gt;. I’m just going on the assumption that you understand it, as well as basic HTML, CSS, and Javascript. If not, you may want to start researching and learning those first. Having that base knowledge is important for being able to create useful Chromecast apps.&lt;/p&gt;

&lt;p&gt;So, one thing to remember is that all Receiver applications are written in HTML5/CSS/Javascript. For some, this might seem awesome, and for others it might seem limited. Just remember what Chromecast is supposed to be: a media digester. You can still do a lot within these confines, though, so don’t get discouraged if you have big ideas.&lt;/p&gt;

&lt;p&gt;Since our receiver is so tiny I’m just going to go ahead and show you the whole source and then make comments:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;    &amp;lt;html&amp;gt;
        &amp;lt;head&amp;gt;
            &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../css/receiver.css&quot; /&amp;gt;
        &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div class=&quot;messages&quot;&amp;gt;
            &amp;lt;h1&amp;gt;Waiting for Messages...&amp;lt;/h1&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
    &amp;lt;script src=&quot;http://code.jquery.com/jquery-2.0.3.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;https://www.gstatic.com/cast/js/receiver/1.0/cast_receiver.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script src=&quot;messageTypes.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script&amp;gt;
        $(function() {
            var receiver = new cast.receiver.Receiver(&#39;*** YOUR APP ID ****&#39;, [&#39;*** YOUR NAMESPACE ***&#39;]),
                channelHandler = new cast.receiver.ChannelHandler(&#39;*** YOUR NAMESPACE ***&#39;),
                $messages = $(&#39;.messages&#39;);
    		
            channelHandler.addChannelFactory(
                receiver.createChannelFactory(&#39;*** YOUR NAMESPACE ***&#39;));
                
            receiver.start();
            
            channelHandler.addEventListener(cast.receiver.Channel.EventType.MESSAGE, onMessage.bind(this));
            
            function onMessage(event) {
                $messages.html(event.message.type);
            }
        });
    &amp;lt;/script&amp;gt;
    &amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Not so bad, right? Let’s break it down. The HTML chunk should be pretty familiar to you:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  &amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../css/receiver.css&quot; /&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;div class=&quot;messages&quot;&amp;gt;
            &amp;lt;h1&amp;gt;Waiting for Messages...&amp;lt;/h1&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This just sets up where we’re going to actually be displaying our content. I did some simple css too. You can look at the finished code on Github if you’re interested.&lt;/p&gt;

&lt;p&gt;Next comes the scripts. The first just gets us jQuery. The second is what actually gets us access to the Receiver API, so make sure you don’t leave it out! Otherwise, your app isn’t going to work at all.&lt;/p&gt;

&lt;p&gt;And then we have our script. Right away you start to see some garbage that mentions &lt;code&gt;cast&lt;/code&gt;. As you might have guessed, this is our first Receiver API call:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;    var receiver = new cast.receiver.Receiver(&#39;*** YOUR APP ID ****&#39;, [&#39;*** YOUR NAMESPACE ***&#39;]),
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This creates a new &lt;code&gt;Receiver&lt;/code&gt; object. This is what we’ll be using to facilitate ways of communicating with the client and device.&lt;/p&gt;

&lt;p&gt;Oh, and remember when we whitelisted our device? The e-mail you got should have contained your Application ID. That needs to replace &lt;code&gt;*** YOUR APP ID ***&lt;/code&gt;. As for your namespace, it can be anything you want, but should probably be related to the application you’re creating. For this tutorial we can use something like &lt;code&gt;HelloWorld&lt;/code&gt;. Make sure it doesn’t clash with other namespaces, though, as this is how your Receiver will know what type of messages to listen to and how your Sender will know what type of messages to send. More on that later…or right now:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    channelHandler = new cast.receiver.ChannelHandler(&#39;*** YOUR NAMESPACE ***&#39;),
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This little guy, as you might have guessed, is what handles our &lt;code&gt;Channels&lt;/code&gt;. A &lt;code&gt;Channel&lt;/code&gt; in this context is used to send and receive simple JSON messages to and from the Sender application. The &lt;code&gt;ChannelHandler&lt;/code&gt; allows us to hook into the events that occur on the various &lt;code&gt;Channels&lt;/code&gt; that get created as the application is being used. It also delegates to a &lt;code&gt;ChannelFactory&lt;/code&gt; (which you’ll see a little later) to create new &lt;code&gt;Channels&lt;/code&gt;. Again,  note the namespace. Make sure you use the same one that you defined earlier on in the &lt;code&gt;Receiver&lt;/code&gt;. This tells our &lt;code&gt;ChannelHandler&lt;/code&gt; to only worry about messages coming from that namespace.&lt;/p&gt;

&lt;p&gt;The next line is just there to keep track of our messages div so we can swap out the text later. Following that we create our &lt;code&gt;ChannelFactory&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;channelHandler.addChannelFactory(
    receiver.createChannelFactory(&#39;*** YOUR NAMESPACE ***&#39;));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That namespace again! Just fill it in like before. Here we’re adding to our &lt;code&gt;ChannelHandler&lt;/code&gt; a &lt;code&gt;ChannelFactory&lt;/code&gt;. Like I said earlier, this is how &lt;code&gt;Channels&lt;/code&gt; actually get created. We use the &lt;code&gt;Receiver&lt;/code&gt; to create the &lt;code&gt;ChannelFactory&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Great! We’ve got our &lt;code&gt;Receiver&lt;/code&gt; and our &lt;code&gt;ChannelHandler&lt;/code&gt; all set up! Does it work yet? Just a little bit more! First we need to tell the receiver to start listening to the world:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;receiver.start();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then we make sure our &lt;code&gt;ChannelHandler&lt;/code&gt; is listening for &lt;code&gt;MesssageEvents&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;channelHandler.addEventListener(cast.receiver.Channel.EventType.MESSAGE, onMessage.bind(this));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The second parameter, as you should know from your Javascript training, just delegates the &lt;code&gt;onMessage&lt;/code&gt; function as our callback when we hear a &lt;code&gt;MessageEvent&lt;/code&gt; and binds &lt;code&gt;this&lt;/code&gt; as our context. &lt;code&gt;Channels&lt;/code&gt; do have other types of events. We can also listen for when the &lt;code&gt;Channel&lt;/code&gt; is opened, closed, or when it has an error. For this tutorial we’ll just stick with messages, though.&lt;/p&gt;

&lt;p&gt;Last, we actually do something with the &lt;code&gt;MessageEvent&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function onMessage(event) {
    $messages.html(event.message.type);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;These &lt;code&gt;MessageEvents&lt;/code&gt; have several parameters, but the thing that actually gets sent from the Sender application is the &lt;code&gt;message&lt;/code&gt; object, which is generally going to be represented as JSON. You’ll see in the next section that we basically define that JSON to look however we want. So there you go. Your first Receiver app! Now let’s make a Sender to do something with it!&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;sender&quot;&gt;Sender&lt;/h3&gt;

&lt;p&gt;Before we get started writing the sender app, it’d be good to mention that you’ll probably want some way of running a web server on your local machine. Without it you can’t really test this. For pretty much any platform, I suggest &lt;a href=&quot;https://code.google.com/p/mongoose/&quot;&gt;Mongoose&lt;/a&gt;. It’s a stupid easy web server. You just drop the executable into any directory you want to host, and launch it. You’ll be able to access the folder from &lt;code&gt;localhost:8080&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now let’s whip up a Sender so our Receiver can actually do something! This one is a little longer, so I won’t paste in the whole source. See my Github page for that.&lt;/p&gt;

&lt;p&gt;First we have our HTML portion:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;html data-cast-api-enabled=&quot;true&quot;&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Hello World Chrome Sender&amp;lt;/title&amp;gt;
    &amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;../css/sender.css&quot; /&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;div class=&quot;receiver-div&quot;&amp;gt;
        &amp;lt;h3&amp;gt;Choose A Receiver&amp;lt;/h3&amp;gt;
        &amp;lt;ul class=&quot;receiver-list&quot;&amp;gt;
            &amp;lt;li&amp;gt;Looking for receivers...&amp;lt;/li&amp;gt;
        &amp;lt;/ul&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;button class=&quot;kill&quot; disabled&amp;gt;Kill the Connection&amp;lt;/button&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;script src=&quot;http://code.jquery.com/jquery-2.0.3.min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script src=&quot;http://underscorejs.org/underscore-min.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Something you might notice is that we aren’t importing any scripts for the Sender API. That’s because this is handled by two things. You should remember way back when we were whitelisting our receiver that we also whitelisted &lt;code&gt;localhost&lt;/code&gt; in the Chromecast Extension for Chrome. This basically tells the extension that on the &lt;code&gt;localhost&lt;/code&gt; domain we are allowing the extension to inject the Sender API into any page. However, it won’t just inject it all willy nilly. Our sender pages require this line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;html data-cast-api-enabled=&quot;true&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to tell the extension that we want the API injected on this page. Make sure you don’t forget it!&lt;/p&gt;

&lt;p&gt;Everything else in the HTML section should be pretty clear. We have a container which will list out all the receivers that get found and a button to disconnect from the receiver. We import jQuery and &lt;a href=&quot;http://underscorejs.org&quot;&gt;Underscore&lt;/a&gt;…sorry I snuck that one in there. If you don’t know about Underscore, you should check it out. It’s a really great little
‘functional’ library for Javascript. I only use it for one thing here and I’ll describe what’s happening when we get there.&lt;/p&gt;

&lt;p&gt;I’ve also done a little styling for this page, which you can look at on the Github. Moving right along, we’ll jump into our&lt;br /&gt;
script. We declare our variables and then add some odd looking listener to our &lt;code&gt;window&lt;/code&gt; object:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var cast_api,
    cv_activity,
    receiverList,
    $killSwitch = $(&#39;.kill&#39;);
    
    window.addEventListener(&#39;message&#39;, function(event) {
        if (event.source === window &amp;amp;&amp;amp; event.data &amp;amp;&amp;amp;
                event.data.source === &#39;CastApi&#39; &amp;amp;&amp;amp;
                event.data.event === &#39;Hello&#39;) {
            initializeApi();
        }
    });
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The event listener isn’t too crazy. One of the consequences of the way the Sender API gets injected into our pages is that&lt;br /&gt;
we don’t really have any control over when it happens. But, the Google Devs were smart and gave us a way of finding out&lt;br /&gt;
exactly when we can start interacting with it. After the Sender API is loaded, it emits a &lt;code&gt;MessageEvent&lt;/code&gt; to tell us so.&lt;br /&gt;
So, we listen for this event. The if block checks to make sure the contents of the &lt;code&gt;MessageEvent&lt;/code&gt; match what we’re looking&lt;br /&gt;
for. As per Google’s docs, this event looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    source: &#39;CastApi&#39;,
    event: &#39;Hello&#39;,
    api_version: [x, y]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The version number basically lets our Sender decide if it’s compatible with this version of the API. Besides that, we&lt;br /&gt;
just make sure that the data in the &lt;code&gt;MessageEvent&lt;/code&gt; matches the source and event described. Then we initialize our API:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;initializeApi = function() {
    if (!cast_api) {
        cast_api = new cast.Api();
        cast_api.addReceiverListener(&#39;*** YOUR APP ID ****&#39;, onReceiverList);
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I’ve added a check in here which makes sure we aren’t calling this if we all ready have an API. So, we create a new &lt;code&gt;CastApi&lt;/code&gt;&lt;br /&gt;
object and attach a &lt;code&gt;ReceiverListener&lt;/code&gt; to it. This will simply tell the &lt;code&gt;CastApi&lt;/code&gt; that there are receivers which are listening&lt;br /&gt;
for our…what’s that? Oh our App Id!&lt;/p&gt;

&lt;p&gt;Bet you were wondering when that’d show up. In case you hadn’t figured it out by now, the way this whole App Id business &lt;br /&gt;
works is Google registers your device to listen for your App Id when you whitelist it. That App Id is tied to &lt;br /&gt;
a particular website (the one you supplied when you whitelisted your device). This is how the Receiver knows &lt;br /&gt;
which URL to hit when it gets a launch request…but now we’re getting ahead of ourselves.&lt;/p&gt;

&lt;p&gt;The second parameter to &lt;code&gt;addReceiverListener&lt;/code&gt; is what callback to use when we get a list of valid receivers. Which brings&lt;br /&gt;
us to…&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;onReceiverList = function(list) {
    if (list.length &amp;gt; 0) {
        receiverList = list;
        $(&#39;.receiver-list&#39;).empty();
        receiverList.forEach(function(receiver) {
            $listItem = $(&#39;&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#&quot; data-id=&quot;&#39; + receiver.id + &#39;&quot;&amp;gt;&#39; + receiver.name + &#39;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#39;);
            $listItem.on(&#39;click&#39;, receiverClicked);
            $(&#39;.receiver-list&#39;).append($listItem);
        });
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;According to Google’s documentation the &lt;code&gt;ReceiverListener&lt;/code&gt; fires at least once, regardless of if it’s found anything, once&lt;br /&gt;
you register it. So, we start with a check to make sure we actually have receivers. Then we just take that list and&lt;br /&gt;
dump it out in our receiver list element. We store the id of the receiver in a data attribute on the anchor tag so we can&lt;br /&gt;
reference it later. Then we attach click handlers to the list items:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;receiverClicked = function(e) {
    e.preventDefault();
    
    var $target = $(e.target),
        receiver = _.find(receiverList, function(receiver) {
            return receiver.id === $target.data(&#39;id&#39;);
        });
    
    doLaunch(receiver);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This isn’t too out there…all standard Javascript/jQuery. This is where I end up using Underscore: &lt;code&gt;_.find(receiverList...&lt;/code&gt;.&lt;br /&gt;
It should be pretty easy to figure out what’s going on there. Underscore has a find function that takes two parameters:&lt;br /&gt;
the list you want to try to find something in, and a function to execute on each item in the list. &lt;code&gt;find&lt;/code&gt; works by looping&lt;br /&gt;
through the list until the supplied function returns true. In our case, this is when we have found the receiver whose&lt;br /&gt;
id matches that of the link we clicked. Simple enough. After we’ve found the right receiver, we launch our application&lt;br /&gt;
on it:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;doLaunch = function(receiver) {
    if (!cv_activity) {
        var request = new cast.LaunchRequest(&#39;*** YOUR APP ID ***&#39;, receiver);
        
        $killSwitch.prop(&#39;disabled&#39;, false);
        
        cast_api.launch(request, onLaunch);
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;First we check to make sure we don’t already have an &lt;code&gt;Activity&lt;/code&gt; launched on the receiver. While nothing bad would happen if&lt;br /&gt;
we tried to launch another activity before closing out the first, I figured I’d put that check in there. As long&lt;br /&gt;
as that passes, we use the Cast API and create a &lt;code&gt;LaunchRequest&lt;/code&gt;. There’s that App Id again. Like I said&lt;br /&gt;
before, this is how your receiver knows which URL to launch. We also pass in which receiver the &lt;code&gt;LaunchRequest&lt;/code&gt; should&lt;br /&gt;
go to. We then enable our kill switch and finally send our &lt;code&gt;LaunchRequest&lt;/code&gt; to the receiver. The second parameter of the
&lt;code&gt;launch&lt;/code&gt; function is the callback function for when the launch is succesful.&lt;/p&gt;

&lt;p&gt;At this point if you just added an empty &lt;code&gt;onLaunch&lt;/code&gt; function, had your receiver hosted, and were running a server on your&lt;br /&gt;
local machine, you’d be able to open up this page in your browser, click on the link to your receiver, and your app should&lt;br /&gt;
launch. Exciting, right? We’ll just add a couple more things to show off some other interactions with the receiver. First,&lt;br /&gt;
that &lt;code&gt;onLaunch&lt;/code&gt; function:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;onLaunch = function(activity) {
    if (activity.status === &#39;running&#39;) {
        cv_activity = activity;
        
        cast_api.sendMessage(cv_activity.activityId, &#39;*** YOUR NAMESPACE ***&#39;, {type: &#39;HelloWorld&#39;});
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once our application gets launched on the receiver, why don’t we say something to it? First we check the &lt;code&gt;ActivityStatus&lt;/code&gt;&lt;br /&gt;
that we got back from the &lt;code&gt;launch&lt;/code&gt; function from before is in the running state. You can think of the &lt;code&gt;ActivityStatus&lt;/code&gt;&lt;br /&gt;
as representing what our connection to the receiver is doing. It also contains the &lt;code&gt;id&lt;/code&gt; of the &lt;code&gt;Activity&lt;/code&gt;, which we use&lt;br /&gt;
to communicate with the recevier, as you can see in the next line.&lt;/p&gt;

&lt;p&gt;Here we use the &lt;code&gt;Cast API&lt;/code&gt; to send a message to our receiver. This function is one of two types of interactions you&lt;br /&gt;
can have with your receiver, and as far as I can tell, it isn’t even documented! The other deals with &lt;code&gt;MediaRequests&lt;/code&gt;,&lt;br /&gt;
but that’s getting out of scope of this tutorial.&lt;/p&gt;

&lt;p&gt;The first parameter to the &lt;code&gt;sendMessage&lt;/code&gt;, again, is that &lt;code&gt;Activity&lt;/code&gt; id. The second parameter is your namespace. If you&lt;br /&gt;
think way back to the receiver section of the tutorial, you’ll remember that this is how the receiver knows which&lt;br /&gt;
messages to actually listen to. If you defined your namespace as &lt;code&gt;HelloWorld&lt;/code&gt; use that here. Otherwise, just use&lt;br /&gt;
whatever you had before. Last we actually have the object which represents our message. You can literally put&lt;br /&gt;
whatever you want in here; it’s just a freeform JSON object. For now we’ll just include a &lt;code&gt;type&lt;/code&gt; attribute and &lt;br /&gt;
say this is a &lt;code&gt;HelloWorld&lt;/code&gt; type message.&lt;/p&gt;

&lt;p&gt;So, now if you reloaded your sender application and clicked on your receiver link you should see the placeholder text
‘Waiting for messages…’ change to ‘HelloWorld’ on your TV. Hey! Look at that! We made our TV do something!&lt;/p&gt;

&lt;p&gt;Just one more thing to do and then the tutorial is over. Hooray! Let’s add a click handler that will actually end&lt;br /&gt;
our session with the receiver:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$killSwitch.on(&#39;click&#39;, function() {
    cast_api.stopActivity(cv_activity.activityId, function(){
        cv_activity = null;
    
        $killSwitch.prop(&#39;disabled&#39;, true);
    });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This one is pretty straight forward. When we click on the kill switch, we call &lt;code&gt;stopActivity&lt;/code&gt; on the &lt;code&gt;Cast API&lt;/code&gt;. This does&lt;br /&gt;
exactly what it sounds like. We pass it the &lt;code&gt;Activity&lt;/code&gt; id from our active activity and it tells the receiver we’re done.&lt;br /&gt;
The second parameter is just a callback function for when the receiver tells us it successfully closed the app. When&lt;br /&gt;
that’s done we null out our activity, so we can start a new one if we want, and disable the kill switch.&lt;/p&gt;

&lt;p&gt;That’s it! If you reload your sender you should now be able to&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Launch your activity on your receiver&lt;/li&gt;
  &lt;li&gt;Observe the text on your TV changing&lt;/li&gt;
  &lt;li&gt;Close out the application&lt;/li&gt;
  &lt;li&gt;Rinse and repeat&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Look at that! Your first end to end Chromecast app! Go forth and be merry and show all your friends that you can control&lt;br /&gt;
your TV with a web browser…but maybe do something a little more interesting with the app first. The sky is the limit now!&lt;/p&gt;

&lt;h2 id=&quot;closing-thoughts&quot;&gt;Closing Thoughts&lt;/h2&gt;

&lt;p&gt;I hope this has been useful for you. But this is only the tip of the iceberg…well maybe not iceberg. This device certainly&lt;br /&gt;
doesn’t do everything, but it isn’t supposed to. Really the depth from this device is going to be in the interesting&lt;br /&gt;
HTML5 apps people make that work with this thing. The interaction with the device itself, as you can see, is pretty simple.&lt;br /&gt;
It’s just figuring out how to use the interaction model to make cool, useful apps.&lt;/p&gt;

&lt;p&gt;However, this tutorial does not cover the other half of development on the Chromecast: media. There is a whole section of &lt;br /&gt;
the API for the sender and receiver which covers media interaction, from playing/pausing to volume control. The same&lt;br /&gt;
principles we’ve talked about here apply, but the functions and objects you use are a little different in some places.&lt;br /&gt;
Perhaps in a future tutorial I’ll cover that stuff. For now you should be able to muddle through the documentation&lt;br /&gt;
Google has provided.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/app%20development/developing-for-chromecast&quot;&gt;Develop For Chrome Cast&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on January 10, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Organize Outlook With Rules]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/declutter/organize-outlook-rules"/>
  <id>http:/notepad/declutter/organize-outlook-rules</id>
  <published>2015-01-01T00:00:00+11:00</published>
  <updated>2015-01-01T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#email" term="email" /><category scheme="http:/notepad/tags/#declutter" term="declutter" /><category scheme="http:/notepad/tags/#outlook" term="outlook" />
  <content type="html">
  
    &lt;p&gt;If you are an Outlook.com user, you may be interested to know that setting up rules to manage your incoming and outgoing emails can make your life a whole lot simpler.&lt;/p&gt;

&lt;h3 id=&quot;what-are-rules&quot;&gt;What are rules?&lt;/h3&gt;

&lt;p&gt;In their simplest form, Outlook rules are actions that your email account will automatically perform based on the guidelines that you have specified. There are two main categories of rules that you can create. These are organizational rules and notification based rules. These rules will are not retroactive, which means that they will only apply to unread messages.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Organize your Emails&lt;/strong&gt; – These rules focus on filing and organizing messages based on senders, subject keywords, and folders in your Outlook account. These are helpful for putting emails into relevant folders or categories.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Keep current&lt;/strong&gt; – These rules will send you notifications based on your incoming messages. These are useful if you want to get notifications of new emails to your mobile devices.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;creating-new-rules-in-outlookcom&quot;&gt;Creating New Rules in Outlook.com&lt;/h3&gt;

&lt;p&gt;Once you are logged into your Outlook.com email account, click on the &lt;code&gt;Settings&lt;/code&gt; button, then on the &lt;code&gt;Manage Rules&lt;/code&gt; option to create a new rule.&lt;/p&gt;

&lt;p&gt;Now, click on the &lt;code&gt;New&lt;/code&gt; button to create your first rule. As you can see, there are two main sections. On the left, you will assign a condition or multiple conditions to identify the emails to which your new rule will apply. The right side is where you will define what action Outlook will take with your emails.&lt;/p&gt;

&lt;p&gt;For this example, we will choose two of the nine conditions that the email must meet, as well as two of the eight actions.&lt;/p&gt;

&lt;h3 id=&quot;conditions---------------------actions&quot;&gt;&lt;strong&gt;CONDITIONS                     ACTIONS&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;We will first click on the conditions link to add a second condition. Let us say that any emails from &lt;code&gt;Sender@emailaddress.com&lt;/code&gt; that have the word &lt;code&gt;apple&lt;/code&gt; in the subject line should be sent to a folder called “Apple Emails” and must be categorized as &lt;code&gt;IMPORTANT!!!&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Do this by editing your rule till the two sections look like the images below.&lt;/p&gt;

&lt;p&gt;Lastly, click on &lt;code&gt;Create Rule&lt;/code&gt; and let it take effect. From now on, any emails from &lt;code&gt;Sender@emailaddress.com&lt;/code&gt; that have the word apple in them will be classified as important and moved to your &lt;code&gt;Apple Emails&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;If you want to edit any of your previously created rules, all you need to do is click on the rule and edit it in the window that pops up. To delete a rule, simply click on the small recycle bin next to the rule.&lt;/p&gt;

&lt;h3 id=&quot;create-rules-from-email-messages&quot;&gt;Create Rules from Email Messages&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;Manage Rules&lt;/code&gt; page is not the only way to create rules for your emails. Alternatively, if you want to create a rule based on an email you received, simply find it in your Inbox and right-click on it. Next, select the “Create Rule” option.&lt;/p&gt;

&lt;p&gt;Alternatively, you can click on the email to open it and create a rule by selecting the option from the “Extended Menu.”&lt;/p&gt;

&lt;p&gt;Once you have done this, you will see a popup window as shown below, in which you can customize the rule as needed.&lt;/p&gt;

&lt;h3 id=&quot;organizing-your-rules&quot;&gt;Organizing your Rules&lt;/h3&gt;

&lt;p&gt;It is important to remember that Outlook.com will automatically select the rules you define and implement them based on the order in which they appear on your list of rules. This is why it is important to organize your rules by their order of importance. Simply click on the up and down arrows next to the rules to put them in order as needed.&lt;/p&gt;

&lt;h3 id=&quot;rule-limits&quot;&gt;Rule Limits&lt;/h3&gt;

&lt;p&gt;Now that you know how to create and organize your rules, you need to know that there are also some limitations to the rules in the Outlook.com Web App. There is a limit on how many rules you can create. For some reason, you are only allotted &lt;code&gt;64 KB&lt;/code&gt; for your Outlook.com rules. There is no definitive answer on how many rules you can create since the size of the rules will vary based on the length of the rule and how many conditions and actions you have defined. Once you have reached your limit, Outlook.com will let you know that you cannot create any more rules. This is when you will need to consolidate rules or delete old rules that are no longer needed.&lt;/p&gt;

&lt;p&gt;In addition to the limit on the amount of rules you are allowed to create, if you also use the Microsoft Outlook desktop application with rules, you may get a warning that your rules conflict with those on the desktop app. You will need to double check to make sure you can disable the conflicting rules or delete them if necessary.&lt;/p&gt;

&lt;p&gt;Congratulations, you now know pretty much everything that you need to know about creating, manipulating, and using rules in the Microsoft Outlook Web App. Have fun managing your digital communication with ease on Outlook.com.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/declutter/organize-outlook-rules&quot;&gt;Organize Outlook With Rules&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on January 01, 2015.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Markdown Styles]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/web%20development/markdown-styles"/>
  <id>http:/notepad/web%20development/markdown-styles</id>
  <published>2014-12-29T00:00:00+11:00</published>
  <updated>2014-12-29T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#markdown" term="markdown" /><category scheme="http:/notepad/tags/#css" term="css" />
  <content type="html">
  
    &lt;h2 id=&quot;features&quot;&gt;Features&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;Ready-made CSS stylesheets for Markdown, just copy the assets folder you want&lt;/li&gt;
  &lt;li&gt;Bundled with &lt;code&gt;generate-md&lt;/code&gt;, a small tool that converts a folder of Markdown documents into a output folder of HTML documents, preserving the directory structure&lt;/li&gt;
  &lt;li&gt;Use your own custom markup and CSS via &lt;code&gt;--layout&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Support for relative paths to the assets folder via &lt;code&gt;and document table of content generation via&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Support for generic metadata via a meta.json file&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;
&lt;p&gt;## Quickstart&lt;/p&gt;

&lt;p&gt;Install &lt;code&gt;generate-md&lt;/code&gt; via npm:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo npm install -g markdown-styles
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Create a markdown file and then convert it to html:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;mkdir input/
echo &quot;# Hello world\n YOLO&quot; &amp;gt; input/index.md
generate-md --layout mixu-gray --input ./input --output ./output
google-chrome ./output/index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Try out different layouts by changing the &lt;code&gt;--layout&lt;/code&gt; parameter; screenshots at the bottom of this page.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/montage.png&quot; alt=&quot;montage&quot; /&gt;&lt;/p&gt;

&lt;p&gt;If you want to make use of the bundled layouts stylesheets as a basis for your own site, copy the ./assets folder and point &lt;code&gt;--layout&lt;/code&gt; to your own layout.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone https://github.com/mixu/markdown-styles.git ./markdown-styles
cp -Rv ./markdown-styles/layouts/mixu-gray ./my-layout
nano ./my-layout/page.html
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now edit the files &lt;code&gt;./my-layout/page.html&lt;/code&gt; and run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generate-md --layout ./my-layout/page.html --input ./input --output ./output
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;whats-new-in-v12x&quot;&gt;What’s new in v1.2.x&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;v1.2.0&lt;/code&gt;: Code syntax highlighting has been reworked so that syntax highlighters have become pluggable. See the relevant section below on how to use the new system.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;v1.2.1&lt;/code&gt;: added the &lt;code&gt;bootstrap3&lt;/code&gt; style, thanks @MrJuliuss!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;v1.2.2&lt;/code&gt;: added the &lt;code&gt;github&lt;/code&gt; style, based on &lt;a href=&quot;https://github.com/sindresorhus/github-markdown-css&quot;&gt;sindresorhus/github-markdown-css&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;just-using-the-stylesheets&quot;&gt;Just using the stylesheets&lt;/h2&gt;

&lt;p&gt;Alternatively, if you just want the stylesheets for your own project, you can just copy the &lt;code&gt;./assets&lt;/code&gt; folder from the layout you want.&lt;/p&gt;

&lt;p&gt;To preview the styles in the browser, clone this repo locally and then open &lt;code&gt;./output/index.html&lt;/code&gt; or run &lt;code&gt;make preview&lt;/code&gt; which opens that page in your default browser.&lt;/p&gt;

&lt;h2 id=&quot;using-generate-md&quot;&gt;Using generate-md&lt;/h2&gt;

&lt;p&gt;This project also includes a small tool for generating HTML files from Markdown files.&lt;/p&gt;

&lt;p&gt;The console tool is &lt;code&gt;generate-md&lt;/code&gt;, e.g.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generate-md --layout jasonm23-foghorn --output ./test/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/zendesk/radar/blob/gh-pages/Makefile&quot;&gt;Here is an example&lt;/a&gt; of how I generated the project docs for &lt;a href=&quot;https://github.com/zendesk/radar&quot;&gt;Radar&lt;/a&gt; using generate-md, a Makefile and a few custom assets.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--input&lt;/code&gt; specifies the input directory (default: &lt;code&gt;./input/&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--output&lt;/code&gt; specifies the output directory (default: &lt;code&gt;./output/&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--layout&lt;/code&gt; specifies the layout to use. This can be either one of built in layouts, or a path to a custom template file with a set of custom assets.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--partials&lt;/code&gt; specifies the &lt;a href=&quot;#partials&quot;&gt;partials&lt;/a&gt; directory. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;--helpers&lt;/code&gt; specifies the &lt;a href=&quot;#helpers&quot;&gt;helpers&lt;/a&gt; directory. &lt;/p&gt;

&lt;p&gt;To override the layout, simply create a directory, such as &lt;code&gt;./my-theme/&lt;/code&gt;, with the following structure:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;├── my-theme
│   ├── assets
│   │   ├── css
│   │   ├── img
│   │   └── js
│   └── page.html

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then, running a command like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  generate-md --input ./input/ --layout ./my-theme/page.html --output ./test/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;will:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;convert all Markdown files in &lt;code&gt;./input&lt;/code&gt; to HTML files under &lt;code&gt;./test&lt;/code&gt;, preserving paths in &lt;code&gt;./input&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;use the template &lt;code&gt;./my-theme/page.html&lt;/code&gt;, replacing values such as &lt;code&gt;, `}` and&lt;/code&gt; (see the layouts for examples on this)&lt;/li&gt;
  &lt;li&gt;(recursively) copy over the assets from &lt;code&gt;./my-theme/assets&lt;/code&gt; to &lt;code&gt;./test/assets&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This means that you could, for example, point a HTTP server at the root of &lt;code&gt;./test/&lt;/code&gt; and be done with it.&lt;/p&gt;

&lt;p&gt;You can also use the current directory as the output (e.g. for Github pages).&lt;/p&gt;

&lt;h2 id=&quot;syntax-highlighting-support-changed-in-v12x&quot;&gt;Syntax highlighting support (changed in v1.2.x)&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;generate-md&lt;/code&gt; supports syntax highlighting during the Markdown-to-HTML conversion process.&lt;/p&gt;

&lt;p&gt;Supported:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;highlight.js via &lt;a href=&quot;https://github.com/mixu/mds-hljs&quot;&gt;mds-hljs&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;csv (using highlight.js css classes) via &lt;a href=&quot;https://github.com/mixu/mds-csv&quot;&gt;mds-csv&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To enable the syntax highlighting support, install the module (e.g. &lt;code&gt;mds-hljs&lt;/code&gt;) and then use &lt;code&gt;--highlight&lt;/code&gt; (e.g. &lt;code&gt;--highlight mds-hljs&lt;/code&gt;) to activate the highlighter.&lt;/p&gt;

&lt;p&gt;For example, to use &lt;code&gt;highlight.js&lt;/code&gt; to highlight all code blocks:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;npm install -g markdown-styles mds-hljs
generate-md --highlight mds-hljs ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You will also need to include &lt;a href=&quot;http://softwaremaniacs.org/media/soft/highlight/test.html&quot;&gt;one of the highlight.js CSS style sheets&lt;/a&gt; in your assets folder/layout file CSS (e.g. by using a custom &lt;code&gt;--layout&lt;/code&gt; file).&lt;/p&gt;

&lt;h3 id=&quot;template-evaluation&quot;&gt;Template Evaluation&lt;/h3&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/wycats/handlebars.js&quot;&gt;handlebars.js&lt;/a&gt; template language is used to evaluate both the template and the markdown. Together with the &lt;code&gt;meta.json&lt;/code&gt;, partials and helpers both template and markdown can be enhanced.&lt;/p&gt;

&lt;h4 id=&quot;metajson&quot;&gt;&lt;code&gt;meta.json&lt;/code&gt;&lt;/h4&gt;
&lt;p&gt;You can add a file named &lt;code&gt;meta.json&lt;/code&gt; to the folder from which you run &lt;code&gt;generate-md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The metadata in that directory will be read and replacements will be made for corresponding `` in the template.&lt;/p&gt;

&lt;p&gt;The metadata is scoped by the top-level directory in &lt;code&gt;./input&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;foo&quot;: {
    &quot;repoUrl&quot;: &quot;https://github.com/mixu/markdown-styles&quot;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;would make the metadata value `` available in the template, for all files that are in the directory &lt;code&gt;./input/foo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Using &lt;a href=&quot;https://github.com/wycats/handlebars.js&quot;&gt;handlebars.js&lt;/a&gt; we can go event farther. For example, you may add a tags array to the meta.json:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;foo&quot;: {
    &quot;tags&quot;: [&quot;handlebars&quot;, &quot;template&quot;]
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;While in the html you may:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;ul&amp;gt;

    &amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;

&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Which will result in &lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;ul&amp;gt;
    &amp;lt;li&amp;gt;handlebars&amp;lt;/li&amp;gt;
    &amp;lt;li&amp;gt;template&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;partials&quot;&gt;Partials&lt;/h4&gt;

&lt;p&gt;Partials are html files that can be included via handlebars &lt;code&gt;style. Usually they are .html files. For example, if `footer.html` resides in the partials directory,&lt;/code&gt; will be replaced with &lt;code&gt;footer.html&lt;/code&gt;’s content. For more advanced topics, see &lt;a href=&quot;https://github.com/wycats/handlebars.js#partials&quot;&gt;handlebars partials documentation&lt;/a&gt;. Don’t use &lt;code&gt;content.html&lt;/code&gt;, it is reserved to the html generated from the markdown.&lt;/p&gt;

&lt;h4 id=&quot;helpers&quot;&gt;Helpers&lt;/h4&gt;

&lt;p&gt;Helpers are functions that you can use throughout the template. See &lt;a href=&quot;https://github.com/wycats/handlebars.js#registering-helpers&quot;&gt;handlebars helpers &lt;/a&gt;.&lt;br /&gt;
For example, add &lt;code&gt;linkTo.js&lt;/code&gt; to the specified helpers directory:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;var Handlebars = require(&#39;handlebars&#39;);
module.exports = function(){
  return new Handlebars.SafeString(&quot;&amp;lt;a href=&#39;&quot; + Handlebars.Utils.escapeExpression(this.url) + &quot;&#39;&amp;gt;&quot; + Handlebars.Utils.escapeExpression(this.body) + &quot;&amp;lt;/a&amp;gt;&quot;);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In your &lt;code&gt;meta.json&lt;/code&gt;
&lt;code&gt;json
{
  &quot;foo&quot;: {
    &quot;links&quot;: [
      {&quot;url&quot;: &quot;/hello&quot;, &quot;body&quot;: &quot;Hello&quot;},
      {&quot;url&quot;: &quot;/world&quot;, &quot;body&quot;: &quot;World!&quot;}
    ]
  }
}
&lt;/code&gt;&lt;br /&gt;
Somewhere in your template:&lt;br /&gt;
```html&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;pre&gt;&lt;code&gt;
The result:
```html
&amp;lt;ul&amp;gt;
  &amp;lt;li&amp;gt;
    &amp;lt;a href=&#39;/hello&#39;&amp;gt;Hello&amp;lt;/a&amp;gt;
  &amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;
    &amp;lt;a href=&#39;/world&#39;&amp;gt;World!&amp;lt;/a&amp;gt;
  &amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;language-specific-syntax-highlighting-and-custom-highlighters&quot;&gt;Language-specific syntax highlighting and custom highlighters&lt;/h3&gt;

&lt;p&gt;You can use &lt;code&gt;--highlight-&amp;lt;language&amp;gt; &amp;lt;module&amp;gt;&lt;/code&gt; to override the syntax highlighter for a specific language. &lt;code&gt;&amp;lt;module&amp;gt;&lt;/code&gt; can also be a path to a file.&lt;/p&gt;

&lt;p&gt;For example, you might use the &lt;code&gt;mds-csv&lt;/code&gt; highlighter for csv code blocks. Input code block with language:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;```csv
&quot;EmployeeID&quot;,&quot;EmployeeName&quot;,&quot;PhoneNumber&quot;,&quot;ZipCode&quot;
&quot;1048&quot;,&quot;Jimmy Adams&quot;,5559876543,12345
```
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generate-md --highlight-csv mds-csv ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can write your own syntax highlighter wrappers. Have a look at &lt;a href=&quot;https://github.com/mixu/mds-hljs&quot;&gt;mds-hljs&lt;/a&gt; and &lt;a href=&quot;https://github.com/mixu/mds-csv&quot;&gt;mds-csv&lt;/a&gt; for examples. These come in two flavors:&lt;/p&gt;

&lt;p&gt;Asynchronous (three parameters):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module.exports = function(code, lang, onDone) {
    return onDone(null, result);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Synchronous (two parameters):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module.exports = function(code, lang) {
    return require(&#39;highlight.js&#39;).highlightAuto(code).value;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;command&quot;&gt;–command&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;--command &amp;lt;cmd&amp;gt;&lt;/code&gt;: Pipe each Markdown file through a shell command and capture the output before converting. Useful for filtering the file, for example.&lt;/p&gt;

&lt;h2 id=&quot;asset-dir&quot;&gt;–asset-dir&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;--asset-dir &amp;lt;path&amp;gt;&lt;/code&gt;: Normally, the asset directory is assumed to be &lt;code&gt;./assets/&lt;/code&gt; in the same folder the &lt;code&gt;--layout&lt;/code&gt; file is. You can override it to a different asset directory explicitly with &lt;code&gt;--asset-dir&lt;/code&gt;, which is useful for builds where several directories use the same layout but different asset directories.&lt;/p&gt;

&lt;h2 id=&quot;acknowledgments&quot;&gt;Acknowledgments&lt;/h2&gt;

&lt;p&gt;I’d like to thank the authors the following CSS stylesheets:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;jasonm23-dark, jasonm23-foghorn, jasonm23-markdown and jasonm23-swiss are based on https://github.com/jasonm23/markdown-css-themes by &lt;a href=&quot;https://github.com/jasonm23&quot;&gt;jasonm23&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;thomasf-solarizedcssdark and thomasf-solarizedcsslight are based on https://github.com/thomasf/solarized-css by &lt;a href=&quot;https://github.com/thomasf&quot;&gt;thomasf&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;markedapp-byword is based on the user-contributed stylesheet at http://bywordapp.com/extras/&lt;/li&gt;
  &lt;li&gt;roryg-ghostwriter is based on https://github.com/roryg/ghostwriter&lt;/li&gt;
  &lt;li&gt;github is based on &lt;a href=&quot;https://github.com/sindresorhus/github-markdown-css&quot;&gt;sindresorhus/github-markdown-css&lt;/a&gt; (sorry, sindresorhus-github is too long to type as a layout name!)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;screenshots-of-the-layouts&quot;&gt;Screenshots of the layouts&lt;/h2&gt;

&lt;p&gt;Note: these screenshots are generate via cutycapt, so they look worse than they do in a real browser.&lt;/p&gt;

&lt;h3 id=&quot;roryg-ghostwriter&quot;&gt;roryg-ghostwriter&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/roryg-ghostwriter.png&quot; alt=&quot;roryg-ghostwriter&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;mixu-bootstrap&quot;&gt;mixu-bootstrap&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/mixu-bootstrap.png&quot; alt=&quot;mixu-bootstrap&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;mixu-bootstrap-2col&quot;&gt;mixu-bootstrap-2col&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/mixu-bootstrap-2col.png&quot; alt=&quot;mixu-bootstrap-2col&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;mixu-gray&quot;&gt;mixu-gray&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/mixu-gray.png&quot; alt=&quot;mixu-gray&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;jasonm23-dark&quot;&gt;jasonm23-dark&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/jasonm23-dark.png&quot; alt=&quot;jasonm23-dark&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;jasonm23-foghorn&quot;&gt;jasonm23-foghorn&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/jasonm23-foghorn.png&quot; alt=&quot;jasonm23-foghorn&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;jasonm23-markdown&quot;&gt;jasonm23-markdown&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/jasonm23-markdown.png&quot; alt=&quot;jasonm23-markdown&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;jasonm23-swiss&quot;&gt;jasonm23-swiss&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/jasonm23-swiss.png&quot; alt=&quot;jasonm23-swiss&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;markedapp-byword&quot;&gt;markedapp-byword&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/markedapp-byword.png&quot; alt=&quot;markedapp-byword&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;mixu-book&quot;&gt;mixu-book&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/mixu-book.png&quot; alt=&quot;mixu-book&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;mixu-page&quot;&gt;mixu-page&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/mixu-page.png&quot; alt=&quot;mixu-page&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;mixu-radar&quot;&gt;mixu-radar&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/mixu-radar.png&quot; alt=&quot;mixu-radar&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;thomasf-solarizedcssdark&quot;&gt;thomasf-solarizedcssdark&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/thomasf-solarizedcssdark.png&quot; alt=&quot;thomasf-solarizedcssdark&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;thomasf-solarizedcsslight&quot;&gt;thomasf-solarizedcsslight&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/thomasf-solarizedcsslight.png&quot; alt=&quot;thomasf-solarizedcsslight&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;bootstrap3&quot;&gt;bootstrap3&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;https://github.com/mixu/markdown-styles/raw/master/screenshots/bootstrap3.png&quot; alt=&quot;bootstrap3&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;adding-new-styles&quot;&gt;Adding new styles&lt;/h2&gt;

&lt;p&gt;Create a new directory under &lt;code&gt;./output/themename&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If a file called &lt;code&gt;./layouts/themename/page.html&lt;/code&gt; exists, it is used, otherwise the default footer and header in &lt;code&gt;./layouts/plain/&lt;/code&gt; are used.&lt;/p&gt;

&lt;p&gt;The switcher is an old school frameset, you need to add a link in &lt;code&gt;./output/menu.html&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To regenerate the pages, you need node:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone git://github.com/mixu/markdown-styles.git
npm install
make build
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To regenerate the screenshots, you need cutycapt (or some other Webkit to image tool) and imagemagic. On Ubuntu / Debian, that’s:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo aptitude install cutycapt imagemagick
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You also need to install the web fonts locally so that cutycapt will find them, run &lt;code&gt;node font-download.js&lt;/code&gt; to get the commands you need to run (basically a series of wget and fc-cache -fv commands).&lt;/p&gt;

&lt;p&gt;Finally, run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;make screenshots
&lt;/code&gt;&lt;/pre&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/web%20development/markdown-styles&quot;&gt;Markdown Styles&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 29, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Quick &amp; Dirty Guide to Vim]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/reference/quick-and-dirty-guide-to-vim"/>
  <id>http:/notepad/reference/quick-and-dirty-guide-to-vim</id>
  <published>2014-12-27T00:00:00+11:00</published>
  <updated>2014-12-27T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#Vim" term="Vim" /><category scheme="http:/notepad/tags/#reference" term="reference" /><category scheme="http:/notepad/tags/#basics" term="basics" />
  <content type="html">
  
    &lt;p&gt;In the world of text editors, there’s a plethora of options out there. If you’ve ever Googled “how to edit HTML sites” or some such, you know what we mean. Allow us, then, to introduce you to VIM, a free website editor that offers many of the same features as Adobe Dreamweaver, and runs on just about every desktop platform. Specifically, it comes by default on the vast majority of Linux distributions, OS X and commercial Unix systems. (It’s available to install on Windows, too.) And did we mention it’s free? That command line UI isn’t necessarily self-explanatory, though, so join us after the break for a quick crash course to help you get started.&lt;/p&gt;

&lt;h5 id=&quot;getting-started&quot;&gt;Getting started&lt;/h5&gt;

&lt;p&gt;If you’re running OS X or Linux, start out by opening a terminal. Now type “vim” et voilÃ : you’re using VIM and you didn’t even install it. Using Windows? Head over &lt;a href=&quot;http://www.vim.org/download.php#pc&quot;&gt;here&lt;/a&gt; and grab the binaries for Windows. Double-click the installer and you’ll have VIM on Windows in no time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s VIM?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VIM is a file editor that supports multiple formats. It’s been around for two decades and is used by millions of programmers, hackers and system administrators. For starters, let’s get the obvious question answered: “Why would I want to use VIM instead of … ?” Put it this way: if you’re a web programmer and love &lt;a href=&quot;http://www.engadget.com/2012/05/07/adobe-creative-suite-6-now-available-creative-cloud-may-11/&quot;&gt;Dreamweaver&lt;/a&gt; and it does everything you need, great. However it’d behoove you to give VIM a shot, because it takes many features offered by Dreamweaver, a $400 product, and offers them for free. As it happens, it’s also easy to use once you get the hang of it. &lt;em&gt;Yes&lt;/em&gt;, that command line interface might seem complex at first blush, but as with any complex piece of software, you can learn to use it and use it well.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimtitle.jpg&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What am I looking at?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;VIM is sometimes referred to as a dual-mode text editor. To put it plainly, VIM has two modes in which you can manipulate files: Edit and GUI mode. Edit mode is the state in which the keys you bang on are actually inserted into your document, whereas the GUI layout allows you to navigate through the document, search and replace text, copy and paste, etc. By default when you open a file, you’re placed in GUI mode.&lt;/p&gt;

&lt;h5 id=&quot;basic-commands&quot;&gt;Basic commands&lt;/h5&gt;

&lt;p&gt;To navigate VIM you use a cursor, but instead of dragging and clicking your mouse, you’ll have to learn to use the arrow buttons as a kind of crude D-pad. Or, depending on where your hands are resting on the keyboard, you can use the “H, K, J and L” keys to move around. Here’s how it breaks down: “H” moves left; “K” moves up; “L” moves right; “J” moves down. You can, of course, use the arrow keys as well. Got it? Good.&lt;/p&gt;

&lt;h5 id=&quot;editing-documents&quot;&gt;Editing documents&lt;/h5&gt;

&lt;p&gt;As we said, VIM launches into the GUI mode by default. To switch to edit mode (also called “insert mode”) you need to give VIM a command to tell it to switch modes. There are two ways to do this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Press “i” to begin inserting text at the current cursor position&lt;/li&gt;
  &lt;li&gt;Press “a” to begin inserting after the current cursor position.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Getting out of editing mode is a bit more intuitive: just hit “escape.”&lt;/p&gt;

&lt;p&gt;Got a handle on those three? Here are some other commands in GUI mode. And remember, these letters are case-sensitive, so take note of those stray capital letters:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;“Y” copies a line of text to the buffer.&lt;/li&gt;
  &lt;li&gt;“P” pastes it to the cursor’s current position.&lt;/li&gt;
  &lt;li&gt;“dd” will delete the whole line of text. This will also effectively “cut” a line of text as well. When you delete a line, it’s placed in the buffer.&lt;/li&gt;
  &lt;li&gt;“yy” copies a whole line of text.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Typing commands in GUI mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So you’ve mastered basic shortcuts in VIM. But what if you want to give the program a more specific command – like, say, copying four lines of text? Here’s what you need to know.&lt;/p&gt;

&lt;p&gt;For starters, move the cursor to the beginning of where you’d like to copy. (Remember that you can use the arrow keys or the “H, K, J and L” buttons.) Press the “:” button to bring up the command line in the bottom of your VIM window. Type “y4” and press “enter.”&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimyank4-1340326574.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;VIM will tell you “4 lines yanked.”&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vim4linesyanked.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Move the cursor to where you want to begin your paste, then press “P”. Basically, that breaks down as “yN” where “N” equals the number of lines you wish to copy. You can do the same thing with the delete command, “d”.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimpaste.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Search and replace&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Moving on, if you want to search and replace from GUI mode, start off by hitting the “:” button once again to bring up that familiar prompt at the bottom of the editor. Then type “%s/&lt;strong&gt;&lt;em&gt;text to search for&lt;/em&gt;&lt;/strong&gt;/&lt;strong&gt;&lt;em&gt;text to replace&lt;/em&gt;&lt;/strong&gt;/g”.&lt;/p&gt;

&lt;p&gt;Let’s replace all instances of “Jack” with “John” in the example below.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimjack.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Type “:%s/Jack/John/g”.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimsearch-and-replaceall.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And that’s it: all instances of “Jack” are now replaced with “John”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Undo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s scrap what we just did and search and replace on one line. You naturally need an “undo” function in a modern-day editor. Don’t worry, VIM has one. To reverse some edit you made, make sure you’re in GUI mode and hit “u”.&lt;/p&gt;

&lt;p&gt;Now, say you only want to replace something on a specific line. You can do that quickly without having to hold down an arrow key to move your cursor. Just bring up the command (using the “:” key, of course) and type the line number you wish to go to. For example: “:15”.&lt;/p&gt;

&lt;p&gt;Now just search and replace without the percent sign. That “%” symbol essentially means you want to search the whole document; when you don’t use it, you are only searching the line your cursor is currently on.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimsearchandreplaceoneline.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;What if you don’t know the exact line number what you want to search for? You can also just search for a specific term. To trawl the document, make sure you’re in GUI mode and type a forward slash. For example, let’s search for someone who is 9 feet 6 inches tall (9’6”) in our data file. To do this, just type “/9’6”” and press Enter.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimregularsearch.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This will automatically move your cursor to the first instance of “9’6”” that it finds. Press Enter again and it’ll move to the next instance.&lt;/p&gt;

&lt;h5 id=&quot;save-your-work&quot;&gt;Save your work&lt;/h5&gt;

&lt;p&gt;To save your work, the most important part of editing files, you’ll need to give VIM the command to do it. From good ol’ GUI mode type “:w” and press enter. File saved. Wanna save and quit VIM at the same time? Typing “:wq” will do the trick.&lt;/p&gt;

&lt;p&gt;What if you want to quit without saving? Type “:q!” And remember to include that exclamation point – it’s required because VIM will let you know you’ve made changes to the file, and doesn’t want you to potentially lose any work. By using the exclamation point you’re insisting to VIM that you know what you’re doing.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimquit.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;h5 id=&quot;syntax-highlighting&quot;&gt;Syntax highlighting&lt;/h5&gt;

&lt;p&gt;You aren’t always going to be editing simple text files – maybe, just maybe you’ll whip up that family website everyone’s been asking for. Naturally, you’re going to want a look that’s a bit easier on the eyes. VIM fully supports colored syntax highlighting for multiple programming languages. There are even different color themes.&lt;/p&gt;

&lt;p&gt;In the below example we’re going to be looking at a Perl script.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimpresyntaxhl.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That plain text is hard to see, especially if you’ve been staring at it for a few hours. From GUI mode, type “:syntax on”.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimpostsyntaxhl.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Much better.&lt;/p&gt;

&lt;p&gt;Don’t like the current color palette? We can change that as well: VIM comes loaded with a handful of different schemes. To pick one from GUI mode, type “:colorscheme” and press the Tab key repeatedly to cycle through the available schemes. Press Enter when you see one that strikes your fancy.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/06/vimchange-scheme.jpg&quot; alt=&quot;DNP VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;h5 id=&quot;editing-files-remotely&quot;&gt;Editing files remotely&lt;/h5&gt;

&lt;p&gt;If you’re working with a remote web server and need to edit a file over FTP, VIM supports this.  &lt;br /&gt;
You can do this via “vim ftp:////”. For example: “vim ftp://172.16.15.73//Users/john/test.pl”. (Note the double “//” in the example.)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/07/vimremoteftp-1.jpeg&quot; alt=&quot;DNP CLEAN  VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;VIM will then prompt you for the username and password for the remote file server.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/07/vimremoteftp-2.jpeg&quot; alt=&quot;DNP CLEAN  VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Magically, you’re editing the remote file.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.blogcdn.com/www.engadget.com/media/2012/07/vimremoteftp-3.jpeg&quot; alt=&quot;DNP CLEAN  VIM A quick and dirty guide&quot; /&gt;&lt;/p&gt;

&lt;h5 id=&quot;how-to-save-your-settings&quot;&gt;How to save your settings&lt;/h5&gt;

&lt;p&gt;So you’ve taken the time to pick your color scheme and turn syntax highlighting on. You’ve saved your file, closed VIM and taken a coffee break. Well, when you come back and load up VIM again, your highlighting is gone and you don’t have your favorite color scheme loaded.&lt;/p&gt;

&lt;p&gt;You’ll need to save your settings in the VIM config file ( _vimrc on Windows; .vimrc on all other platforms). Place this file in your standard home directory. To find out what your home directory is from within VIM, do this:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;From GUI mode type “:echo $home” and press Enter. VIM will then show the full directory path of where you should place your vimrc file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To save your settings in your vimrc file, simply add the commands you used to set up your VIM environment in that file. For example, to keep syntax highlighting on by default and always use the color scheme “delek,” add this to your vimrc file:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;em&gt;:syntax on  &lt;br /&gt;
:colorscheme delek&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Work complete.&lt;/p&gt;

&lt;h5 id=&quot;wrap-up&quot;&gt;Wrap-up&lt;/h5&gt;

&lt;p&gt;This quick-and-dirty guide should get you up and running with VIM. There’s much more to this powerful editor, though. We recommend taking the full VIM tutorial by typing “:help” and reading through the VIM guide. If you have even more time on your hands, there are also tons of scripts (read: plugins) available for VIM in case the stock deployment doesn’t do that odd thing you need. You can browse all 4,000-plus. Happy editing!&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/reference/quick-and-dirty-guide-to-vim&quot;&gt;Quick &amp; Dirty Guide to Vim&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 27, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[GIT Aliases Explained]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/git/tips/git-aliases"/>
  <id>http:/notepad/git/tips/git-aliases</id>
  <published>2014-12-22T00:00:00+11:00</published>
  <updated>2014-12-22T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  
  <content type="html">
  
    &lt;h2 id=&quot;intro-to-git-aliases&quot;&gt;Intro to Git Aliases&lt;/h2&gt;

&lt;p&gt;An alias is simply a way to add a shorthand for a common Git command or set of Git commands. Some are quite simple. For example, here’s a common one:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git config --global alias.co checkout
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This sets &lt;code&gt;co&lt;/code&gt; as an alias for &lt;code&gt;checkout&lt;/code&gt;. If you open up your &lt;code&gt;.gitconfig&lt;/code&gt; file, you can see this in a section named &lt;code&gt;alias&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;[alias]
    co = checkout
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With this alias, you can checkout a branch by using &lt;code&gt;git co some-branch&lt;/code&gt; instead of &lt;code&gt;git checkout some-branch&lt;/code&gt;. Since I often edit aliases by hand, I have one that opens the &lt;code&gt;gitconfig&lt;/code&gt; file with my default editor.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    ec = config --global -e
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;These sort of simple aliases only begin to scratch the surface.&lt;/p&gt;

&lt;h2 id=&quot;github-flow-aliases&quot;&gt;GitHub Flow Aliases&lt;/h2&gt;

&lt;h3 id=&quot;get-my-working-directory-up-to-date&quot;&gt;Get my working directory up to date.&lt;/h3&gt;

&lt;p&gt;When I’m ready to start some work, I always do the work in a new branch. But first, I make sure that my working directory is up to date with the origin before I create that branch. Typically, I’ll want to run the following commands:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git pull --rebase --prune
git submodule update --init --recursive
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first command pulls changes from the remote. If I have any local commits, it’ll rebase them to come after the commits I pulled down. The &lt;code&gt;--prune&lt;/code&gt; option removes remote-tracking branches that no longer exist on the remote.&lt;/p&gt;

&lt;p&gt;This combination is so common, I’ve created an alias &lt;code&gt;up&lt;/code&gt; for this.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    up = !git pull --rebase --prune $@ &amp;amp;&amp;amp; git submodule update --init --recursive
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that I’m combining two git commands together. I can use the &lt;code&gt;!&lt;/code&gt; prefix to execute everything after it in the shell. This is why I needed to use the full git commands. Using the &lt;code&gt;!&lt;/code&gt; prefix allows me to use &lt;em&gt;any&lt;/em&gt; command and not just git commands in the alias.&lt;/p&gt;

&lt;h3 id=&quot;starting-new-work&quot;&gt;Starting new work&lt;/h3&gt;

&lt;p&gt;At this point, I can start some new work. All new work starts in a branch so I would typically use &lt;code&gt;git checkout -b new-branch&lt;/code&gt;. However I alias this to &lt;code&gt;cob&lt;/code&gt; to build upon &lt;code&gt;co&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    cob = checkout -b
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note that this simple alias is expanded in place. So to create a branch named “emoji-completion” I simply type &lt;code&gt;git cob emoji-completion&lt;/code&gt; which expands to &lt;code&gt;git checkout -b emoji-completion&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With this new branch, I can start writing the crazy codes. As I go along, I try and commit regularly with my &lt;code&gt;cm&lt;/code&gt; alias.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    cm = !git add -A &amp;amp;&amp;amp; git commit -m
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For example, &lt;code&gt;git cm &quot;Making stuff work&quot;&lt;/code&gt;. This adds all changes including untracked files to the index and then creates a commit with the message “Making Stuff Work”.&lt;/p&gt;

&lt;p&gt;Sometimes, I just want to save my work in a commit without having to think of a commit message. I could stash it, but I prefer to write a proper commit which I will change later.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git save&lt;/code&gt; or &lt;code&gt;git wip&lt;/code&gt;.  The first one adds all changes including untracked files and creates a commit. The second one only commits tracked changes. I generally use the first one.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    save = !git add -A &amp;amp;&amp;amp; git commit -m &#39;SAVEPOINT&#39;
    wip = !git add -u &amp;amp;&amp;amp; git commit -m &quot;WIP&quot; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When I return to work, I’ll just use &lt;code&gt;git undo&lt;/code&gt; which resets the previous commit, but keeps all the changes from that commit in the working directory.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    undo = reset HEAD~1 --mixed
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or, if I merely need to modify the previous commit, I’ll use &lt;code&gt;git amend&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    amend = commit -a --amend
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;-a&lt;/code&gt; adds any modifications and deletions of existing files to the commit but ignores brand new files. The &lt;code&gt;--amend&lt;/code&gt; launches your default commit editor (Notepad in my case) and lets you change the commit message of the most recent commit.&lt;/p&gt;

&lt;h3 id=&quot;a-proper-reset&quot;&gt;A proper reset&lt;/h3&gt;

&lt;p&gt;There will be times when you explore a promising idea in code and it turns out to be crap. You just want to throw your hands up in disgust and burn all the work in your working directory to the ground and start over.&lt;/p&gt;

&lt;p&gt;In an attempt to be helpful, people might recommend: &lt;code&gt;git reset HEAD --hard&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Slap those people in the face. It’s a bad idea. Don’t do it!&lt;/p&gt;

&lt;p&gt;That’s basically a delete of your current changes without any undo. As soon as you run that command, Murphy’s law dictates you’ll suddenly remember there was that one gem among the refuse you don’t want to rewrite.&lt;/p&gt;

&lt;p&gt;Too bad. If you reset work that you &lt;em&gt;never committed&lt;/em&gt; it is gone for good. Hence, the &lt;code&gt;wipe&lt;/code&gt; alias.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    wipe = !git add -A &amp;amp;&amp;amp; git commit -qm &#39;WIPE SAVEPOINT&#39; &amp;amp;&amp;amp; git reset HEAD~1 --hard
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This commits everything in my working directory and then does a hard reset to remove that commit. The nice thing is, the commit is still there, but it’s just unreachable. Unreachable commits are a bit inconvenient to restore, but at least they are still there. You can run the &lt;code&gt;git reflog&lt;/code&gt; command and find the SHA of the commit if you realize later that you made a mistake with the reset. The commit message will be “WIPE SAVEPOINT” in this case.&lt;/p&gt;

&lt;h3 id=&quot;completing-the-pull-request&quot;&gt;Completing the pull request&lt;/h3&gt;

&lt;p&gt;While working on a branch, I regularly push my changes to GitHub. At some point, I’ll go to github.com and create a pull request, people will review it, and then it’ll get merged. Once it’s merged, I like to &lt;a href=&quot;https://github.com/blog/1335-tidying-up-after-pull-requests&quot;&gt;tidy up and delete the branch via the Web UI&lt;/a&gt;. At this point, I’m done with this topic branch and I want to clean everything up on my local machine. Here’s where I use one of my more powerful aliases, &lt;code&gt;git bdone&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This alias does the following.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Switches to master (though you can specify a different default branch)&lt;/li&gt;
  &lt;li&gt;Runs &lt;code&gt;git up&lt;/code&gt; to bring master up to speed with the origin&lt;/li&gt;
  &lt;li&gt;Deletes all branches already merged into master using another alias, &lt;code&gt;git bclean&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It’s quite powerful and useful and demonstrates some advanced concepts of git aliases. But first, let me show &lt;code&gt;git bclean&lt;/code&gt;. This alias is meant to be run from your master (or default) branch and does the cleanup of merged branches.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;bclean = &quot;!f() { git branch --merged ${1-master} | grep -v &quot; ${1-master}$&quot; | xargs -r git branch -d; }; f&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you’re not used to shell scripts, this looks a bit odd. What it’s doing is defining a function and then calling that function. The general format is &lt;code&gt;!f() { /* git operations */; }; f&lt;/code&gt; We define a function named &lt;code&gt;f&lt;/code&gt; that encapsulates some git operations, and then we invoke the function at the very end.&lt;/p&gt;

&lt;p&gt;What’s cool about this is we can take advantage of arguments to this alias. In fact, we can have optional parameters. For example, the first argument to this alias can be accessed via &lt;code&gt;$1&lt;/code&gt;. But suppose you want a default value for this argument if none is provided. That’s where the curly braces come in. Inside the braces you specify the argument index (&lt;code&gt;$0&lt;/code&gt; returns the whole script) followed by a dash and then the default value.&lt;/p&gt;

&lt;p&gt;Thus when you type &lt;code&gt;git bclean&lt;/code&gt; the expression &lt;code&gt;${1-master}&lt;/code&gt; evaluates to &lt;code&gt;master&lt;/code&gt; because no argument was provided. But if you’re working on a GitHub pages repository, you’ll probably want to call &lt;code&gt;git bclean gh-pages&lt;/code&gt; in which case the expression &lt;code&gt;${1-master}&lt;/code&gt; evaluates to &lt;code&gt;gh-pages&lt;/code&gt; as that’s the first argument to the the alias.&lt;/p&gt;

&lt;p&gt;Let’s break down this alias into pieces to understand it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch --merged ${1-master}&lt;/code&gt; lists all the branches that have been merged into the specify branch (or master if none is specified). This list is then piped into the &lt;code&gt;grep -v &quot;${1-master}&quot;&lt;/code&gt; command. &lt;a href=&quot;http://www.gnu.org/software/grep/manual/grep.html&quot;&gt;Grep&lt;/a&gt; prints out lines matching the pattern. The &lt;code&gt;-v&lt;/code&gt; flag inverts the match. So this will list all merged branches that are not &lt;code&gt;master&lt;/code&gt; itself. Finally this gets piped into &lt;code&gt;xargs&lt;/code&gt; which takes the standard input and executes the &lt;code&gt;git branch -d&lt;/code&gt; line for each line in the standard input which is piped in from the previous command.&lt;/p&gt;

&lt;p&gt;In other words, it deletes every branch that’s been merged into &lt;code&gt;master&lt;/code&gt; except &lt;code&gt;master&lt;/code&gt;. I love how we can compose these commands together.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;bclean&lt;/code&gt; in place, I can compose my git aliases together and write &lt;code&gt;git bdone&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;    bdone = &quot;!f() { git checkout ${1-master} &amp;amp;&amp;amp; git up &amp;amp;&amp;amp; git bclean ${1-master}; }; f&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I use this one all the time when I’m deep in the GitHub flow. And now, you too can be a GitHub flow master.&lt;/p&gt;

&lt;h2 id=&quot;the-list&quot;&gt;The List&lt;/h2&gt;

&lt;p&gt;Here’s a list of all the aliases together for your convenience.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-ini&quot;&gt;[alias]
    co = checkout
    ec = config --global -e
    up = !git pull --rebase --prune $@ &amp;amp;&amp;amp; git submodule update --init --recursive
    cob = checkout -b
    cm = !git add -A &amp;amp;&amp;amp; git commit -m
    save = !git add -A &amp;amp;&amp;amp; git commit -m &#39;SAVEPOINT&#39;
    wip = !git add -u &amp;amp;&amp;amp; git commit -m &quot;WIP&quot; 
	undo = reset HEAD~1 --mixed
    amend = commit -a --amend
    wipe = !git add -A &amp;amp;&amp;amp; git commit -qm &#39;WIPE SAVEPOINT&#39; &amp;amp;&amp;amp; git reset HEAD~1 --hard
    bclean = &quot;!f() { git branch --merged ${1-master} | grep -v &quot; ${1-master}$&quot; | xargs -r git branch -d; }; f&quot;
    bdone = &quot;!f() { git checkout ${1-master} &amp;amp;&amp;amp; git up &amp;amp;&amp;amp; git bclean ${1-master}; }; f&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;credits-and-more-reading&quot;&gt;Credits and more reading&lt;/h2&gt;

&lt;p&gt;It would be impossible to source every git alias I use as many of these are pretty common and I’ve adapted them for my own needs. However, here are a few blog posts that provided helpful information about git aliases that served as my inspiration. I also added a couple posts about how GitHub uses pull requests.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://jondavidjohn.com/git-aliases-parameters/&quot;&gt;Git Aliases Parameters&lt;/a&gt; taught me how to specify a default value for positional parameters.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://stevenharman.net/git-clean-delete-already-merged-branches&quot;&gt;Delete already merged branches&lt;/a&gt; was the inspiration for &lt;code&gt;git bclean&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://git.wiki.kernel.org/index.php/Aliases&quot;&gt;Aliases Git Wiki Page&lt;/a&gt; has a bunch of useful aliases.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/blog/1124-how-we-use-pull-requests-to-build-github&quot;&gt;How GitHub uses Pull Requests&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://zachholman.com/talk/how-github-uses-github-to-build-github/&quot;&gt;How GitHub uses GitHub to build GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/git/tips/git-aliases&quot;&gt;GIT Aliases Explained&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 22, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Vim Cheatsheet]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/vim-cheatsheet"/>
  <id>http:/notepad/vim-cheatsheet</id>
  <published>2014-12-21T00:00:00+11:00</published>
  <updated>2014-12-21T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  
  <content type="html">
  
    &lt;h2 id=&quot;movement&quot;&gt;Movement&lt;/h2&gt;

&lt;h3 id=&quot;by-word&quot;&gt;By “Word”&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;w&lt;/code&gt; forward to beginning of the next word&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;W&lt;/code&gt; forward to beginning of the next word (whitespace separates)&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;e&lt;/code&gt; forward to end of next word&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;E&lt;/code&gt; forward to end of next word (whitespace separates)&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;b&lt;/code&gt; back to beginning of the previous word&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;B&lt;/code&gt; back to beginning of the previous word (whitespace separates)&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;ge&lt;/code&gt; back to end of the next word&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;gE&lt;/code&gt; back to end of the next word (whitespace separates)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;searching&quot;&gt;Searching&lt;/h3&gt;

&lt;h4 id=&quot;on-current-line&quot;&gt;On current line&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;fn&lt;/code&gt; find and move to the next occurrence of &lt;code&gt;n&lt;/code&gt;.  You can follow this with a &lt;code&gt;;&lt;/code&gt; to repeat the find/move.  You can also use &lt;code&gt;,&lt;/code&gt; to go back one match.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;tn&lt;/code&gt; find and move to (un&lt;b&gt;t&lt;/b&gt;il) the character &lt;em&gt;preceding&lt;/em&gt; the next occurrence of &lt;code&gt;n&lt;/code&gt;.  As above, &lt;code&gt;;&lt;/code&gt; repeats, and &lt;code&gt;,&lt;/code&gt; goes back one match.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;Fn&lt;/code&gt; find and move to the previous occurrence of &lt;code&gt;n&lt;/code&gt;.  &lt;code&gt;;&lt;/code&gt; repeats, &lt;code&gt;,&lt;/code&gt; goes back one match.&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;Tn&lt;/code&gt; find and move to (un&lt;b&gt;T&lt;/b&gt;il) the character &lt;em&gt;following&lt;/em&gt; the next occurence of &lt;code&gt;n&lt;/code&gt;.  &lt;code&gt;;&lt;/code&gt; repeats, &lt;code&gt;,&lt;/code&gt; goes back one match.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;in-document&quot;&gt;In document&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;/term&lt;/code&gt; search forwards for &lt;code&gt;term&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;?term&lt;/code&gt; search backwards for &lt;code&gt;term&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;combining-with-other-commands&quot;&gt;Combining with other commands&lt;/h3&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;cfn&lt;/code&gt; - &lt;b&gt;c&lt;/b&gt;hange the text up to where you &lt;b&gt;f&lt;/b&gt;ind the next occurrence of &lt;code&gt;n&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;cFn&lt;/code&gt; - &lt;b&gt;c&lt;/b&gt;hange the text back to where you &lt;b&gt;F&lt;/b&gt;ind the previous occurrence of &lt;code&gt;n&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;by-pagescreen&quot;&gt;By page/screen&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;^f&lt;/code&gt; &lt;b&gt;f&lt;/b&gt;orward a page/screen&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;^b&lt;/code&gt; &lt;b&gt;b&lt;/b&gt;ack a page/screen&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;^u&lt;/code&gt; &lt;b&gt;u&lt;/b&gt;p half a page/screen&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;^d&lt;/code&gt; &lt;b&gt;d&lt;/b&gt;own half a page/screen&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;positioning-within-a-pagescreen&quot;&gt;Positioning within a page/screen&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;H&lt;/code&gt; go to &lt;b&gt;H&lt;/b&gt;ead (top) or “&lt;b&gt;H&lt;/b&gt;igh point” of screen&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;M&lt;/code&gt; go to &lt;b&gt;M&lt;/b&gt;iddle of screen&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;L&lt;/code&gt; go to &lt;b&gt;L&lt;/b&gt;ast line or “&lt;b&gt;L&lt;/b&gt;ow point” of screen&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;positioning-within-a-documentfile&quot;&gt;Positioning within a document/file&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;gg&lt;/code&gt; first line of document&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;G&lt;/code&gt; last line of document&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;500G&lt;/code&gt; line 500&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;*&lt;/code&gt; search forwards for word currently under cursor (use with &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;N&lt;/code&gt;)&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;#&lt;/code&gt; search backward for word currently under cursor (use with &lt;code&gt;N&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; - note that direction is reversed)&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;%&lt;/code&gt; matching bracket, brace, square bracket - &lt;em&gt;see matchit.vim for extended behavior&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;marks&quot;&gt;Marks&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;ma&lt;/code&gt; set position of (book)mark &lt;code&gt;a&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;:marks&lt;/code&gt; list currently defined marks&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;&#39;a&lt;/code&gt; jump to rot for mark &lt;code&gt;a&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;```a&lt;code&gt; jump to row/column for mark &lt;/code&gt;a`&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;editing&quot;&gt;Editing&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;i&lt;/code&gt; insert at cursor&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;I&lt;/code&gt; insert at beginning of line&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;a&lt;/code&gt; append after cursor&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;A&lt;/code&gt; append at end of line&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;r&lt;/code&gt; replace a single character&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;R&lt;/code&gt; replace any number of characters&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;c&amp;lt;motion&amp;gt;&lt;/code&gt; change, e.g. &lt;code&gt;cw&lt;/code&gt; is change word&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;x&lt;/code&gt; delete character under cursor&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;X&lt;/code&gt; delete character before cursor&lt;/li&gt;
  &lt;li&gt;&lt;code&gt;d&amp;lt;motion&amp;gt;&lt;/code&gt; delete, e.g. &lt;code&gt;dw&lt;/code&gt; is delete word, &lt;code&gt;dd&lt;/code&gt; is delete line&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;copycut--paste&quot;&gt;Copy/Cut &amp;amp; Paste&lt;/h2&gt;

&lt;p&gt;See http://vim.wikia.com/wiki/VimTip386 for more detailed info.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;press &lt;code&gt;v&lt;/code&gt; (for visual mode) to start the selection (or &lt;code&gt;V&lt;/code&gt; to select whole lines, or &lt;code&gt;Ctrl-v&lt;/code&gt; for a vertical block)&lt;/li&gt;
  &lt;li&gt;move the cursor to where you want the selection to end&lt;/li&gt;
  &lt;li&gt;press &lt;code&gt;d&lt;/code&gt; for delete (cut) or &lt;code&gt;y&lt;/code&gt; for yank (copy)&lt;/li&gt;
  &lt;li&gt;position the cursor where you want to paste&lt;/li&gt;
  &lt;li&gt;press &lt;code&gt;P&lt;/code&gt; or &lt;code&gt;p&lt;/code&gt; for paste before or after cursor, respectively&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;buffers&quot;&gt;Buffers&lt;/h2&gt;

&lt;p&gt;For an excellent tutorial, see http://reefpoints.dockyard.com/2013/10/22/vim-buffers.html&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;add a buffer: &lt;code&gt;:badd&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;list open buffers: &lt;code&gt;:ls&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to alternate (&lt;code&gt;#&lt;/code&gt;) buffer: &lt;code&gt;CTRL+6&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to previous buffer: &lt;code&gt;:bp&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to next buffer: &lt;code&gt;:bn&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to buffer &lt;em&gt;x&lt;/em&gt; (where &lt;em&gt;x&lt;/em&gt; is an integer): &lt;code&gt;:bx&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;delete (close) current buffer: &lt;code&gt;:bd&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;delete (close) buffers &lt;em&gt;x&lt;/em&gt; and &lt;em&gt;y&lt;/em&gt;: &lt;code&gt;:bd x y&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;windows&quot;&gt;Windows&lt;/h2&gt;

&lt;p&gt;For another excellent tutorial, see http://reefpoints.dockyard.com/2013/11/27/vim-windows.html&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;split current window: &lt;code&gt;CTRL+w s&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;split current window vertically: &lt;code&gt;CTRL+w v&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to window to left: &lt;code&gt;CTRL+w h&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to window to right: &lt;code&gt;CTRL+w l&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to window above: &lt;code&gt;CTRL+w k&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;switch to window below: &lt;code&gt;CTRL+w j&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;rotate windows: &lt;code&gt;CTRL+w r&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;rotate windows (opposite direction): &lt;code&gt;CTRL+w R&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;move current window the far left and use the full height of the screen: &lt;code&gt;CTRL-w H&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;move current window the far bottom and use the full width of the screen: &lt;code&gt;CTRL-w J&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;move current window the far top and full width of the screen: &lt;code&gt;CTRL-w K&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;move current window the far right and full height of the screen: &lt;code&gt;CTRL-w L&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;resize the windows equally : &lt;code&gt;CTRL-w =&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;incrementally increase the window to the right: &lt;code&gt;CTRL-w &amp;gt;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;takes a parameter, e.g. &lt;code&gt;CTRL-w 20 &amp;gt;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;incrementally increase the window to the left: &lt;code&gt;CTRL-w &amp;lt;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;takes a parameter, e.g. &lt;code&gt;CTRL-w 20 &amp;lt;&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;incrementally decrease the window’s height: &lt;code&gt;CTRL-w -&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;takes a parameter, e.g. &lt;code&gt;CTRL-w 10 -&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;incrementally increase the window’s height: &lt;code&gt;CTRL-w +&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;takes a parameter, e.g. &lt;code&gt;CTRL-w 10 +&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/vim-cheatsheet&quot;&gt;Vim Cheatsheet&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 21, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Github Markdown Versus Standard]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/gf-markdown-v-standard"/>
  <id>http:/notepad/gf-markdown-v-standard</id>
  <published>2014-12-20T00:00:00+11:00</published>
  <updated>2014-12-20T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  
  <content type="html">
  
    &lt;h1 id=&quot;markdown&quot;&gt;Markdown&lt;/h1&gt;

&lt;h2 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;#gitlab-flavored-markdown-gfm&quot;&gt;GitLab Flavored Markdown&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#newlines&quot;&gt;Newlines&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#multiple-underscores-in-words&quot;&gt;Multiple underscores in words&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#url-autolinking&quot;&gt;URL autolinking&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#code-and-syntax-highlighting&quot;&gt;Code and Syntax Highlighting&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#emoji&quot;&gt;Emoji&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#special-gitlab-references&quot;&gt;Special GitLab references&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#task-lists&quot;&gt;Task lists&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;#standard-markdown&quot;&gt;Standard Markdown&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;#headers&quot;&gt;Headers&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#emphasis&quot;&gt;Emphasis&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#lists&quot;&gt;Lists&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#links&quot;&gt;Links&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#images&quot;&gt;Images&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#blockquotes&quot;&gt;Blockquotes&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#inline-html&quot;&gt;Inline HTML&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#horizontal-rule&quot;&gt;Horizontal Rule&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#line-breaks&quot;&gt;Line Breaks&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#tables&quot;&gt;Tables&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;#references&quot;&gt;References&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2 id=&quot;gitlab-flavored-markdown-gfm&quot;&gt;GitLab Flavored Markdown (GFM)&lt;/h2&gt;

&lt;p&gt;For GitLab we developed something we call “GitLab Flavored Markdown” (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality.&lt;/p&gt;

&lt;p&gt;You can use GFM in&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;commit messages&lt;/li&gt;
  &lt;li&gt;comments&lt;/li&gt;
  &lt;li&gt;issues&lt;/li&gt;
  &lt;li&gt;merge requests&lt;/li&gt;
  &lt;li&gt;milestones&lt;/li&gt;
  &lt;li&gt;wiki pages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can also use other rich text files in GitLab. You might have to install a depency to do so. Please see the &lt;a href=&quot;https://github.com/gitlabhq/markup#markups&quot;&gt;github-markup gem readme&lt;/a&gt; for more information.&lt;/p&gt;

&lt;h2 id=&quot;newlines&quot;&gt;Newlines&lt;/h2&gt;

&lt;p&gt;GFM honors the markdown specification in how &lt;a href=&quot;http://daringfireball.net/projects/markdown/syntax#p&quot;&gt;paragraphs and line breaks are handled&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines.:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Roses are red
Violets are blue

Sugar is sweet
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Roses are red&lt;br /&gt;
Violets are blue&lt;/p&gt;

&lt;p&gt;Sugar is sweet&lt;/p&gt;

&lt;h2 id=&quot;multiple-underscores-in-words&quot;&gt;Multiple underscores in words&lt;/h2&gt;

&lt;p&gt;It is not reasonable to italicize just &lt;em&gt;part&lt;/em&gt; of a word, especially when you’re dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;perform_complicated_task
do_this_and_do_that_and_another_thing
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;perform_complicated_task&lt;br /&gt;
do_this_and_do_that_and_another_thing&lt;/p&gt;

&lt;h2 id=&quot;url-autolinking&quot;&gt;URL autolinking&lt;/h2&gt;

&lt;p&gt;GFM will autolink standard URLs you copy and paste into your text. So if you want to link to a URL (instead of a textural link), you can simply put the URL in verbatim and it will be turned into a link to that URL.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;http://www.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;http://www.google.com&lt;/p&gt;

&lt;h2 id=&quot;code-and-syntax-highlighting&quot;&gt;Code and Syntax Highlighting&lt;/h2&gt;

&lt;p&gt;Blocks of code are either fenced by lines with three back-ticks &lt;code&gt;```&lt;/code&gt;, or are indented with four spaces. Only the fenced code blocks support syntax highlighting.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;no-highlight
Inline `code` has `back-ticks around` it.
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Inline &lt;code&gt;code&lt;/code&gt; has &lt;code&gt;back-ticks around&lt;/code&gt; it.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;```javascript
var s = &quot;JavaScript syntax highlighting&quot;;
alert(s);
```

```python
def function():
    #indenting works just fine in the fenced code block
    s = &quot;Python syntax highlighting&quot;
    print s
```

```ruby
require &#39;redcarpet&#39;
markdown = Redcarpet.new(&quot;Hello World!&quot;)
puts markdown.to_html
```

```
No language indicated, so no syntax highlighting.
s = &quot;There is no highlighting for this.&quot;
But let&#39;s throw in a &amp;lt;b&amp;gt;tag&amp;lt;/b&amp;gt;.
```
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;becomes:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;var s = &quot;JavaScript syntax highlighting&quot;;
alert(s);
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;def function():
    #indenting works just fine in the fenced code block
    s = &quot;Python syntax highlighting&quot;
    print s
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code class=&quot;language-ruby&quot;&gt;require &#39;redcarpet&#39;
markdown = Redcarpet.new(&quot;Hello World!&quot;)
puts markdown.to_html
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;No language indicated, so no syntax highlighting.
s = &quot;There is no highlighting for this.&quot;
But let&#39;s throw in a &amp;lt;b&amp;gt;tag&amp;lt;/b&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;emoji&quot;&gt;Emoji&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;Sometimes you want to be a :ninja: and add some :glowing_star: to your &amp;lt;img class=&#39;emoji&#39; title=&#39;:speech_balloon:&#39; alt=&#39;:speech_balloon:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/1f4ac.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt;. Well we have a gift for you:

:high_voltage_sign: You can use emoji anywhere GFM is supported. :victory_hand:

You can use it to point out a &amp;lt;img class=&#39;emoji&#39; title=&#39;:bug:&#39; alt=&#39;:bug:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/1f41b.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt; or warn about :speak_no_evil_monkey: patches. And if someone improves your really &amp;lt;img class=&#39;emoji&#39; title=&#39;:snail:&#39; alt=&#39;:snail:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/1f40c.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt; code, send them some &amp;lt;img class=&#39;emoji&#39; title=&#39;:cake:&#39; alt=&#39;:cake:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/1f370.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt;. People will &amp;lt;img class=&#39;emoji&#39; title=&#39;:heart:&#39; alt=&#39;:heart:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/2764.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt; you for that.

If you are new to this, don&#39;t be :fearful_face:. You can easily join the emoji &amp;lt;img class=&#39;emoji&#39; title=&#39;:family:&#39; alt=&#39;:family:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/1f46a.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt;. All you need to do is to look up on the supported codes.

Consult the [Emoji Cheat Sheet](https://www.dropbox.com/s/b9xaqb977s6d8w1/cheat_sheet.pdf) for a list of all supported emoji codes. &amp;lt;img class=&#39;emoji&#39; title=&#39;:thumbsup:&#39; alt=&#39;:thumbsup:&#39; src=&#39;https://assets.github.com/images/icons/emoji/unicode/1f44d.png&#39; height=&#39;20&#39; width=&#39;20&#39; align=&#39;absmiddle&#39; /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Sometimes you want to be a :ninja: and add some :glowing_star: to your &lt;img class=&quot;emoji&quot; title=&quot;:speech_balloon:&quot; alt=&quot;:speech_balloon:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/1f4ac.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt;. Well we have a gift for you:&lt;/p&gt;

&lt;p&gt;:high_voltage_sign: You can use emoji anywhere GFM is supported. :victory_hand:&lt;/p&gt;

&lt;p&gt;You can use it to point out a &lt;img class=&quot;emoji&quot; title=&quot;:bug:&quot; alt=&quot;:bug:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/1f41b.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt; or warn about :speak_no_evil_monkey: patches. And if someone improves your really &lt;img class=&quot;emoji&quot; title=&quot;:snail:&quot; alt=&quot;:snail:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/1f40c.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt; code, send them some &lt;img class=&quot;emoji&quot; title=&quot;:cake:&quot; alt=&quot;:cake:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/1f370.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt;. People will &lt;img class=&quot;emoji&quot; title=&quot;:heart:&quot; alt=&quot;:heart:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/2764.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt; you for that.&lt;/p&gt;

&lt;p&gt;If you are new to this, don’t be :fearful_face:. You can easily join the emoji &lt;img class=&quot;emoji&quot; title=&quot;:family:&quot; alt=&quot;:family:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/1f46a.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt;. All you need to do is to look up on the supported codes.&lt;/p&gt;

&lt;p&gt;Consult the &lt;a href=&quot;https://www.dropbox.com/s/b9xaqb977s6d8w1/cheat_sheet.pdf&quot;&gt;Emoji Cheat Sheet&lt;/a&gt; for a list of all supported emoji codes. &lt;img class=&quot;emoji&quot; title=&quot;:thumbsup:&quot; alt=&quot;:thumbsup:&quot; src=&quot;https://assets.github.com/images/icons/emoji/unicode/1f44d.png&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;special-gitlab-references&quot;&gt;Special GitLab References&lt;/h2&gt;

&lt;p&gt;GFM recognized special references.&lt;/p&gt;

&lt;p&gt;You can easily reference e.g. an issue, a commit, a team member or even the whole team within a project.&lt;/p&gt;

&lt;p&gt;GFM will turn that reference into a link so you can navigate between them easily.&lt;/p&gt;

&lt;p&gt;GFM will recognize the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;@foo : for team members&lt;/li&gt;
  &lt;li&gt;@all : for the whole team&lt;/li&gt;
  &lt;li&gt;
    &lt;h1 id=&quot;for-issues&quot;&gt;123 : for issues&lt;/h1&gt;
  &lt;/li&gt;
  &lt;li&gt;!123 : for merge requests&lt;/li&gt;
  &lt;li&gt;$123 : for snippets&lt;/li&gt;
  &lt;li&gt;1234567 : for commits&lt;/li&gt;
  &lt;li&gt;[file](path/to/file) : for file references&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GFM also recognizes references to commits, issues, and merge requests in other projects:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;namespace/project#123 : for issues&lt;/li&gt;
  &lt;li&gt;namespace/project!123 : for merge requests&lt;/li&gt;
  &lt;li&gt;namespace/project@1234567 : for commits&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;task-lists&quot;&gt;Task Lists&lt;/h2&gt;

&lt;p&gt;You can add task lists to merge request and issue descriptions to keep track of to-do items.  To create a task, add an unordered list to the description in an issue or merge request, formatted like so:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;no-highlight
* [x] Completed task
* [ ] Unfinished task
    * [x] Nested task
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Task lists can only be created in descriptions, not in titles or comments.  Task item state can be managed by editing the description’s Markdown or by clicking the rendered checkboxes.&lt;/p&gt;

&lt;h1 id=&quot;standard-markdown&quot;&gt;Standard Markdown&lt;/h1&gt;

&lt;h2 id=&quot;headers&quot;&gt;Headers&lt;/h2&gt;

&lt;p&gt;```no-highlight&lt;br /&gt;
# H1&lt;br /&gt;
## H2&lt;br /&gt;
### H3&lt;br /&gt;
#### H4&lt;br /&gt;
##### H5&lt;br /&gt;
###### H6&lt;/p&gt;

&lt;p&gt;Alternatively, for H1 and H2, an underline-ish style:&lt;/p&gt;

&lt;h1 id=&quot;alt-h1&quot;&gt;Alt-H1&lt;/h1&gt;

&lt;h2 id=&quot;alt-h2&quot;&gt;Alt-H2&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;
# H1
## H2
### H3
#### H4
##### H5
###### H6

Alternatively, for H1 and H2, an underline-ish style:

Alt-H1
======

Alt-H2
------

### Header IDs and links

All markdown rendered headers automatically get IDs, except for comments.

On hover a link to those IDs becomes visible to make it easier to copy the link to the header to give it to someone else.

The IDs are generated from the content of the header according to the following rules:

1. remove the heading hashes `#` and process the rest of the line as it would be processed if it were not a header
2. from the result, remove all HTML tags, but keep their inner content
3. convert all characters to lowercase
4. convert all characters except `[a-z0-9_-]` into hyphens `-`
5. transform multiple adjacent hyphens into a single hyphen
6. remove trailing and heading hyphens

For example:

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;###### ..Ab_c-d. e &lt;a href=&quot;url&quot;&gt;anchor&lt;/a&gt; &lt;img src=&quot;url&quot; alt=&quot;alt text&quot; /&gt;..&lt;br /&gt;
```&lt;/p&gt;

&lt;p&gt;which renders as:&lt;/p&gt;

&lt;h6 id=&quot;abc-d-e-anchorurl-alt-texturl&quot;&gt;..Ab_c-d. e &lt;a href=&quot;url&quot;&gt;anchor&lt;/a&gt; &lt;img src=&quot;url&quot; alt=&quot;alt text&quot; /&gt;..&lt;/h6&gt;

&lt;p&gt;will first be converted by step 1) into a string like:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;..Ab_c-d. e &amp;amp;lt;a href=&quot;url&quot;&amp;gt;anchor&amp;amp;lt;/a&amp;gt; &amp;amp;lt;img src=&quot;url&quot; alt=&quot;alt text&quot;/&amp;gt;..
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After removing the tags in step 2) we get:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;..Ab_c-d. e anchor ..
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And applying all the other steps gives the id:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ab_c-d-e-anchor
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note in particular how:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;for markdown anchors &lt;code&gt;[text](url)&lt;/code&gt;, only the &lt;code&gt;text&lt;/code&gt; is used&lt;/li&gt;
  &lt;li&gt;markdown images &lt;code&gt;![alt](url)&lt;/code&gt; are completely ignored&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;emphasis&quot;&gt;Emphasis&lt;/h2&gt;

&lt;p&gt;```no-highlight&lt;br /&gt;
Emphasis, aka italics, with &lt;em&gt;asterisks&lt;/em&gt; or &lt;em&gt;underscores&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Strong emphasis, aka bold, with &lt;strong&gt;asterisks&lt;/strong&gt; or &lt;strong&gt;underscores&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Combined emphasis with &lt;strong&gt;asterisks and &lt;em&gt;underscores&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Strikethrough uses two tildes. ~~Scratch this.~~&lt;br /&gt;
```&lt;/p&gt;

&lt;p&gt;Emphasis, aka italics, with &lt;em&gt;asterisks&lt;/em&gt; or &lt;em&gt;underscores&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Strong emphasis, aka bold, with &lt;strong&gt;asterisks&lt;/strong&gt; or &lt;strong&gt;underscores&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Combined emphasis with &lt;strong&gt;asterisks and &lt;em&gt;underscores&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Strikethrough uses two tildes. ~~Scratch this.~~&lt;/p&gt;

&lt;h2 id=&quot;lists&quot;&gt;Lists&lt;/h2&gt;

&lt;p&gt;```no-highlight&lt;br /&gt;
1. First ordered list item&lt;br /&gt;
2. Another item&lt;br /&gt;
  * Unordered sub-list.&lt;br /&gt;
1. Actual numbers don’t matter, just that it’s a number&lt;br /&gt;
  1. Ordered sub-list&lt;br /&gt;
4. And another item.&lt;/p&gt;

&lt;p&gt;Some text that should be aligned with the above item.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Unordered list can use asterisks&lt;/li&gt;
  &lt;li&gt;Or minuses&lt;/li&gt;
  &lt;li&gt;Or pluses&lt;br /&gt;
```&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
  &lt;li&gt;First ordered list item&lt;/li&gt;
  &lt;li&gt;Another item
    &lt;ul&gt;
      &lt;li&gt;Unordered sub-list.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Actual numbers don’t matter, just that it’s a number&lt;/li&gt;
  &lt;li&gt;Ordered sub-list&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;And another item.&lt;/p&gt;

    &lt;p&gt;Some text that should be aligned with the above item.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
  &lt;li&gt;Unordered list can use asterisks&lt;/li&gt;
  &lt;li&gt;Or minuses&lt;/li&gt;
  &lt;li&gt;Or pluses&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;links&quot;&gt;Links&lt;/h2&gt;

&lt;p&gt;There are two ways to create links, inline-style and reference-style.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[I&#39;m an inline-style link](https://www.google.com)

[I&#39;m a reference-style link][Arbitrary case-insensitive reference text]

[I&#39;m a relative reference to a repository file](LICENSE)

[You can use numbers for reference-style link definitions][1]

Or leave it empty and use the [link text itself][]

Some text to show that the reference links can follow later.

[arbitrary case-insensitive reference text]: https://www.mozilla.org
[1]: http://slashdot.org
[link text itself]: http://www.reddit.com
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;https://www.google.com&quot;&gt;I’m an inline-style link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.mozilla.org&quot;&gt;I’m a reference-style link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;LICENSE&quot;&gt;I’m a relative reference to a repository file&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://slashdot.org&quot;&gt;You can use numbers for reference-style link definitions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or leave it empty and use the &lt;a href=&quot;http://www.reddit.com&quot;&gt;link text itself&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some text to show that the reference links can follow later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Relative links do not allow referencing project files in a wiki page or wiki page in a project file. The reason for this is that, in GitLab, wiki is always a separate git repository. For example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;[I&#39;m a reference-style link][style]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;will point the link to &lt;code&gt;wikis/style&lt;/code&gt; when the link is inside of a wiki markdown file.&lt;/p&gt;

&lt;h2 id=&quot;images&quot;&gt;Images&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;Here&#39;s our logo (hover to see the title text):

Inline-style:
![alt text](assets/logo-white.png)

Reference-style:
![alt text1][logo]

[logo]: assets/logo-white.png
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here’s our logo:&lt;/p&gt;

&lt;p&gt;Inline-style:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/logo-white.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Reference-style:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/logo-white.png&quot; alt=&quot;alt text&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;blockquotes&quot;&gt;Blockquotes&lt;/h2&gt;

&lt;p&gt;```no-highlight&lt;br /&gt;
&amp;gt; Blockquotes are very handy in email to emulate reply text.&lt;br /&gt;
&amp;gt; This line is part of the same quote.&lt;/p&gt;

&lt;p&gt;Quote break.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This is a very long line that will still be quoted properly when it wraps. Oh boy let’s keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can &lt;em&gt;put&lt;/em&gt; &lt;strong&gt;Markdown&lt;/strong&gt; into a blockquote.&lt;br /&gt;
```&lt;/p&gt;
&lt;/blockquote&gt;

&lt;blockquote&gt;
  &lt;p&gt;Blockquotes are very handy in email to emulate reply text.&lt;br /&gt;
This line is part of the same quote.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Quote break.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;This is a very long line that will still be quoted properly when it wraps. Oh boy let’s keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can &lt;em&gt;put&lt;/em&gt; &lt;strong&gt;Markdown&lt;/strong&gt; into a blockquote.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;inline-html&quot;&gt;Inline HTML&lt;/h2&gt;

&lt;p&gt;You can also use raw HTML in your Markdown, and it’ll mostly work pretty well.&lt;/p&gt;

&lt;p&gt;```no-highlight&lt;/p&gt;
&lt;dl&gt;
  &lt;dt&gt;Definition list&lt;/dt&gt;
  &lt;dd&gt;Is something people use sometimes.&lt;/dd&gt;

  &lt;dt&gt;Markdown in HTML&lt;/dt&gt;
  &lt;dd&gt;Does *not* work **very** well. Use HTML &lt;em&gt;tags&lt;/em&gt;.&lt;/dd&gt;
&lt;/dl&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;dl&amp;gt;
  &amp;lt;dt&amp;gt;Definition list&amp;lt;/dt&amp;gt;
  &amp;lt;dd&amp;gt;Is something people use sometimes.&amp;lt;/dd&amp;gt;

  &amp;lt;dt&amp;gt;Markdown in HTML&amp;lt;/dt&amp;gt;
  &amp;lt;dd&amp;gt;Does *not* work **very** well. Use HTML &amp;lt;em&amp;gt;tags&amp;lt;/em&amp;gt;.&amp;lt;/dd&amp;gt;
&amp;lt;/dl&amp;gt;

## Horizontal Rule

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Three or more…&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Hyphens&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Asterisks&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Underscores&lt;br /&gt;
```&lt;/p&gt;

&lt;p&gt;Three or more…&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Hyphens&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Asterisks&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Underscores&lt;/p&gt;

&lt;h2 id=&quot;line-breaks&quot;&gt;Line Breaks&lt;/h2&gt;

&lt;p&gt;My basic recommendation for learning how line breaks work is to experiment and discover – hit &amp;lt;Enter&amp;gt; once (i.e., insert one newline), then hit it twice (i.e., insert two newlines), see what happens. You’ll soon learn to get what you want. “Markdown Toggle” is your friend.&lt;/p&gt;

&lt;p&gt;Here are some things to try out:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Here&#39;s a line for us to start with.

This line is separated from the one above by two newlines, so it will be a *separate paragraph*.

This line is also a separate paragraph, but...
This line is only separated by a single newline, so it&#39;s a separate line in the *same paragraph*.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here’s a line for us to start with.&lt;/p&gt;

&lt;p&gt;This line is separated from the one above by two newlines, so it will be a &lt;em&gt;separate paragraph&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;This line is also begins a separate paragraph, but…&lt;br /&gt;
This line is only separated by a single newline, so it’s a separate line in the &lt;em&gt;same paragraph&lt;/em&gt;.&lt;/p&gt;

&lt;h2 id=&quot;tables&quot;&gt;Tables&lt;/h2&gt;

&lt;p&gt;Tables aren’t part of the core Markdown spec, but they are part of GFM and Markdown Here supports them.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;| header 1 | header 2 |
| -------- | -------- |
| cell 1   | cell 2   |
| cell 3   | cell 4   |
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Code above produces next output:&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;header 1&lt;/th&gt;
      &lt;th&gt;header 2&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;cell 1&lt;/td&gt;
      &lt;td&gt;cell 2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;cell 3&lt;/td&gt;
      &lt;td&gt;cell 4&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The row of dashes between the table header and body must have at least three dashes in each column.&lt;/p&gt;

&lt;h2 id=&quot;references&quot;&gt;References&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;This document leveraged heavily from the &lt;a href=&quot;https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet&quot;&gt;Markdown-Cheatsheet&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;The &lt;a href=&quot;http://daringfireball.net/projects/markdown/syntax&quot;&gt;Markdown Syntax Guide&lt;/a&gt; at Daring Fireball is an excellent resource for a detailed explanation of standard markdown.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://dillinger.io&quot;&gt;Dillinger.io&lt;/a&gt; is a handy tool for testing standard markdown.&lt;/li&gt;
&lt;/ul&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/gf-markdown-v-standard&quot;&gt;Github Markdown Versus Standard&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 20, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[SSL Upgrades on Rugy Gems]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/ssl-ruby-gem-upgrade-issues"/>
  <id>http:/notepad/ssl-ruby-gem-upgrade-issues</id>
  <published>2014-12-18T00:00:00+11:00</published>
  <updated>2014-12-18T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  
  <content type="html">
  
    &lt;h1 id=&quot;ssl-upgrades-on-rubygemsorg-and-rubyinstaller-versions&quot;&gt;SSL upgrades on rubygems.org and RubyInstaller versions&lt;/h1&gt;

&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;If you reached this page, means you’ve hit this SSL error when trying to&lt;br /&gt;
pull updates from RubyGems:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This error is produced by changes in rubygems.org infrastructure, please&lt;br /&gt;
keep reading to better understand it.&lt;/p&gt;

&lt;p&gt;If you’re one of those &lt;em&gt;too long, didn’t read&lt;/em&gt; just skip to the guide on how&lt;br /&gt;
to workaround it.&lt;/p&gt;

&lt;h2 id=&quot;background&quot;&gt;Background&lt;/h2&gt;

&lt;p&gt;For those who are not familiar with SSL and certificates, there are many&lt;br /&gt;
parts that make secure serving of content possible.&lt;/p&gt;

&lt;p&gt;SSL certificates are used on the website, which are obtained from a&lt;br /&gt;
certificate authority (CA) and generated from a private key, along with its&lt;br /&gt;
respective signature.&lt;/p&gt;

&lt;p&gt;Normally and up until a few months ago, private key signatures used SHA-1&lt;br /&gt;
as way to provide a digest (or checksum) of the private key without&lt;br /&gt;
distributing the key itself (remember, needs to remain private).&lt;/p&gt;

&lt;p&gt;SHA-1 has been encountered weak and lot of web servers and sites have been&lt;br /&gt;
upgrading towards SHA-2 (specifically SHA256 or higher) in order to prepare&lt;br /&gt;
for the browsers changes.&lt;/p&gt;

&lt;h2 id=&quot;specific-problem-with-rubygems&quot;&gt;Specific problem with RubyGems&lt;/h2&gt;

&lt;p&gt;The particular case of RubyGems (the command line tool) is that it requires&lt;br /&gt;
to bundle inside of its code the trust certificates, which allow RubyGems&lt;br /&gt;
to establish a connection with the servers even when base operating system&lt;br /&gt;
is unable to verify the identity of them.&lt;/p&gt;

&lt;p&gt;Up until a few months ago, this certificate was provided by one CA, but&lt;br /&gt;
newer certificate is provided by a different one.&lt;/p&gt;

&lt;p&gt;Because of this, existing installations of RubyGems would have to been&lt;br /&gt;
updated before the switch of the certificate and give enough time for the&lt;br /&gt;
change to spread (and people to update).&lt;/p&gt;

&lt;p&gt;As what normally happens with software, things might get out of sync and&lt;br /&gt;
coordinate such effort, to the size and usage of rubygems.org is almost&lt;br /&gt;
impossible.&lt;/p&gt;

&lt;p&gt;I’ve described this on &lt;a href=&quot;https://github.com/rubygems/rubygems/issues/1050#issuecomment-61422934&quot;&gt;Issue #1050&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We had discussed also on IRC, and patches and backports were provided to&lt;br /&gt;
all major branches of RubyGems: 1.8, 2.0, 2.2 and 2.4&lt;/p&gt;

&lt;p&gt;You can find the commits associated with these changes here:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rubygems/rubygems/commit/74ee66395c8e1b9ad6a45ba2f292bee8c6ea1a50&quot;&gt;1.8 branch&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rubygems/rubygems/commit/98f5f44c7141881c756003e4256b1a96b200b98e&quot;&gt;2.0 branch&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rubygems/rubygems/commit/17d8922966051864a0c4bf768623e9d0c854de26&quot;&gt;2.2 branch&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rubygems/rubygems/commit/5a31f092d483ea7ccd91adbf08a88593cf0fbbc7&quot;&gt;2.4 branch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Problem is, only RubyGems 2.4.4 got released, leaving Ruby installation with&lt;br /&gt;
1.8, 2.0 and 2.2 in a broken state.&lt;/p&gt;

&lt;p&gt;Specially since RubyGems 2.4 is broken on Windows.&lt;/p&gt;

&lt;p&gt;Please understand this could happen to anyone. Release multiple versions of
&lt;em&gt;any&lt;/em&gt; software in a short span of time and be very time sensitive is highly&lt;br /&gt;
complicated.&lt;/p&gt;

&lt;p&gt;Even if we have official releases of any of the versions that correct the&lt;br /&gt;
issue, it will not be possible install those via RubyGems (chicken-egg&lt;br /&gt;
problem described before).&lt;/p&gt;

&lt;p&gt;Once official releases are out, installation might be simpler. In the&lt;br /&gt;
meantime, please proceed using the instructions described below.&lt;/p&gt;

&lt;h2 id=&quot;manual-solution-to-ssl-issue&quot;&gt;Manual solution to SSL issue&lt;/h2&gt;

&lt;p&gt;If you have read the above detail that describe the issue, thank you.&lt;/p&gt;

&lt;p&gt;Now, you want to manually fix the issue with your installation.&lt;/p&gt;

&lt;p&gt;Steps are simple:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Step 1: Obtain the new trust certificate&lt;/li&gt;
  &lt;li&gt;Step 2: Locate RubyGems certificate directory in your installation&lt;/li&gt;
  &lt;li&gt;Step 3: Copy new trust certificate&lt;/li&gt;
  &lt;li&gt;Step 4: Profit&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;step-1-obtain-the-new-trust-certificate&quot;&gt;Step 1: Obtain the new trust certificate&lt;/h3&gt;

&lt;p&gt;If you’ve read the previous sections, you will know what this means (and&lt;br /&gt;
shame on you if you have not).&lt;/p&gt;

&lt;p&gt;We need to download &lt;a href=&quot;https://raw.githubusercontent.com/rubygems/rubygems/master/lib/rubygems/ssl_certs/AddTrustExternalCARoot-2048.pem&quot;&gt;AddTrustExternalCARoot-2048.pem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Use the above link and place/save this file somewhere you can later find&lt;br /&gt;
easily (eg. your Desktop).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IMPORTANT&lt;/strong&gt;: File must have &lt;code&gt;.pem&lt;/code&gt; as extension. Browsers like Chrome will&lt;br /&gt;
try to save it as plain text file. Ensure you change the filename to have
&lt;code&gt;.pem&lt;/code&gt; in it after you have downloaded it.&lt;/p&gt;

&lt;h3 id=&quot;step-2-locate-rubygems-certificate-directory-in-your-installation&quot;&gt;Step 2: Locate RubyGems certificate directory in your installation&lt;/h3&gt;

&lt;p&gt;In order for us copy this file, we need to know where to put it.&lt;/p&gt;

&lt;p&gt;Depending on where you installed Ruby, the directory will be different.&lt;/p&gt;

&lt;p&gt;Take for example the default installation of Ruby 2.1.5, placed in &lt;code&gt;C:\Ruby21&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Open a Command Prompt and type in:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;C:\&amp;gt;gem which rubygems
C:/Ruby21/lib/ruby/2.1.0/rubygems.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now, let’s locate that directory. From within the same window, enter the path&lt;br /&gt;
part up to the file extension, but using backslashes instead:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;C:\&amp;gt;start C:\Ruby21\lib\ruby\2.1.0\rubygems
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will open a Explorer window inside the directory we indicated.&lt;/p&gt;

&lt;h3 id=&quot;step-3-copy-new-trust-certificate&quot;&gt;Step 3: Copy new trust certificate&lt;/h3&gt;

&lt;p&gt;Now, locate &lt;code&gt;ssl_certs&lt;/code&gt; directory and copy the &lt;code&gt;.pem&lt;/code&gt; file we obtained from&lt;br /&gt;
previous step inside.&lt;/p&gt;

&lt;p&gt;It will be listed with other files like &lt;code&gt;GeoTrustGlobalCA.pem&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;step-4-profit&quot;&gt;Step 4: Profit&lt;/h3&gt;

&lt;p&gt;There is actually no step 4. You should be able to install Ruby gems without&lt;br /&gt;
issues now.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/ssl-ruby-gem-upgrade-issues&quot;&gt;SSL Upgrades on Rugy Gems&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 18, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Robots.txt Please Explain]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/please%20explain/robotstxt-please-explain"/>
  <id>http:/notepad/please%20explain/robotstxt-please-explain</id>
  <published>2014-12-13T00:00:00+11:00</published>
  <updated>2014-12-13T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#dev" term="dev" /><category scheme="http:/notepad/tags/#tools" term="tools" /><category scheme="http:/notepad/tags/#geek" term="geek" /><category scheme="http:/notepad/tags/#tips%20n%20tricks" term="tips n tricks" />
  <content type="html">
  
    &lt;h1 id=&quot;the-web-robots-pages&quot;&gt;The Web Robots Pages&lt;/h1&gt;

&lt;h2 id=&quot;about-robotstxt&quot;&gt;About /robots.txt&lt;/h2&gt;

&lt;h3 id=&quot;in-a-nutshell&quot;&gt;In a nutshell&lt;/h3&gt;

&lt;p&gt;Web site owners use the /robots.txt file to give instructions about their site to web robots; this is called &lt;em&gt;The Robots Exclusion Protocol&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It works likes this: a robot wants to vists a Web site URL, say http://www.example.com/welcome.html. Before it does so, it firsts checks for http://www.example.com/robots.txt, and finds:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The “&lt;code&gt;User-agent: *&lt;/code&gt;” means this section applies to all robots. The “&lt;code&gt;Disallow: /&lt;/code&gt;” tells the robot that it should not visit any pages on the site.&lt;/p&gt;

&lt;p&gt;There are two important considerations when using /robots.txt:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;robots can ignore your /robots.txt. Especially malware robots that scan the web for security vulnerabilities, and email address harvesters used by spammers will pay no attention.&lt;/li&gt;
  &lt;li&gt;the /robots.txt file is a publicly available file. Anyone can see what sections of your server you don’t want robots to use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So don’t try to use /robots.txt to hide information.&lt;/p&gt;

&lt;p&gt;See also:&lt;/p&gt;

&lt;h3 id=&quot;the-details&quot;&gt;The details&lt;/h3&gt;

&lt;p&gt;The /robots.txt is a de-facto standard, and is not owned by any standards body. There are two historical descriptions:&lt;/p&gt;

&lt;p&gt;In addition there are external resources:&lt;/p&gt;

&lt;p&gt;The /robots.txt standard is not actively developed. See &lt;a href=&quot;faq/future.html&quot;&gt;What about further development of /robots.txt?&lt;/a&gt; for more discussion.&lt;/p&gt;

&lt;p&gt;The rest of this page gives an overview of how to use /robots.txt on your server, with some simple recipes. To learn more see also the &lt;a href=&quot;faq.html&quot;&gt;FAQ&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;how-to-create-a-robotstxt-file&quot;&gt;How to create a /robots.txt file&lt;/h3&gt;

&lt;h4 id=&quot;where-to-put-it&quot;&gt;Where to put it&lt;/h4&gt;

&lt;p&gt;The short answer: in the top-level directory of your web server.&lt;/p&gt;

&lt;p&gt;The longer answer:&lt;/p&gt;

&lt;p&gt;When a robot looks for the “/robots.txt” file for URL, it strips the path component from the URL (everything from the first single slash), and puts “/robots.txt” in its place.&lt;/p&gt;

&lt;p&gt;For example, for “&lt;code&gt;http://www.example.com/shop/index.html&lt;/code&gt;, it will remove the “&lt;code&gt;/shop/index.html&lt;/code&gt;”, and replace it with “&lt;code&gt;/robots.txt&lt;/code&gt;”, and will end up with “http://www.example.com/robots.txt”.&lt;/p&gt;

&lt;p&gt;So, as a web site owner you need to put it in the right place on your web server for that resulting URL to work. Usually that is the same place where you put your web site’s main “&lt;code&gt;index.html&lt;/code&gt;” welcome page. Where exactly that is, and how to put the file there, depends on your web server software.&lt;/p&gt;

&lt;p&gt;Remember to use all lower case for the filename: “&lt;code&gt;robots.txt&lt;/code&gt;”, not “&lt;code&gt;Robots.TXT&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;See also:&lt;/p&gt;

&lt;h4 id=&quot;what-to-put-in-it&quot;&gt;What to put in it&lt;/h4&gt;

&lt;p&gt;The “/robots.txt” file is a text file, with one or more records. Usually contains a single record looking like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: /~joe/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In this example, three directories are excluded.&lt;/p&gt;

&lt;p&gt;Note that you need a separate “Disallow” line for every URL prefix you want to exclude – you cannot say “Disallow: /cgi-bin/ /tmp/” on a single line. Also, you may not have blank lines in a record, as they are used to delimit multiple records.&lt;/p&gt;

&lt;p&gt;Note also that globbing and regular expression are &lt;strong&gt;not&lt;/strong&gt; supported in either the User-agent or Disallow lines. The ‘&lt;em&gt;’ in the User-agent field is a special value meaning “any robot”. Specifically, you cannot have lines like “User-agent: *bot&lt;/em&gt;”, “Disallow: /tmp/*” or “Disallow: *.gif”.&lt;/p&gt;

&lt;p&gt;What you want to exclude depends on your server. Everything not explicitly disallowed is considered fair game to retrieve. Here follow some examples:&lt;/p&gt;

&lt;h5 id=&quot;to-exclude-all-robots-from-the-entire-server&quot;&gt;To exclude all robots from the entire server&lt;/h5&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /
&lt;/code&gt;&lt;/pre&gt;

&lt;h5 id=&quot;to-allow-all-robots-complete-access&quot;&gt;To allow all robots complete access&lt;/h5&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow:
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;(or just create an empty “/robots.txt” file, or don’t use one at all)&lt;/p&gt;

&lt;h5 id=&quot;to-exclude-all-robots-from-part-of-the-server&quot;&gt;To exclude all robots from part of the server&lt;/h5&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /cgi-bin/
Disallow: /tmp/
Disallow: /junk/
&lt;/code&gt;&lt;/pre&gt;

&lt;h5 id=&quot;to-exclude-a-single-robot&quot;&gt;To exclude a single robot&lt;/h5&gt;

&lt;pre&gt;&lt;code&gt;User-agent: BadBot
Disallow: /
&lt;/code&gt;&lt;/pre&gt;

&lt;h5 id=&quot;to-allow-a-single-robot&quot;&gt;To allow a single robot&lt;/h5&gt;

&lt;pre&gt;&lt;code&gt;User-agent: Google
Disallow:

User-agent: *
Disallow: /
&lt;/code&gt;&lt;/pre&gt;

&lt;h5 id=&quot;to-exclude-all-files-except-one&quot;&gt;To exclude all files except one&lt;/h5&gt;

&lt;p&gt;This is currently a bit awkward, as there is no “Allow” field. The easy way is to put all files to be disallowed into a separate directory, say “stuff”, and leave the one file in the level above this directory:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /~joe/stuff/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Alternatively you can explicitly disallow all disallowed pages:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;User-agent: *
Disallow: /~joe/junk.html
Disallow: /~joe/foo.html
Disallow: /~joe/bar.html
&lt;/code&gt;&lt;/pre&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;a href=&quot;http://www.robotstxt.org/robotstxt.html&quot; title=&quot;Permalink to The Web Robots Pages&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/please%20explain/robotstxt-please-explain&quot;&gt;Robots.txt Please Explain&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 13, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Build your own Yeoman Generator]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/please%20explain/build-your-own-yeoman-generator"/>
  <id>http:/notepad/please%20explain/build-your-own-yeoman-generator</id>
  <published>2014-12-04T00:00:00+11:00</published>
  <updated>2014-12-04T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#dev" term="dev" /><category scheme="http:/notepad/tags/#tools" term="tools" /><category scheme="http:/notepad/tags/#geek" term="geek" /><category scheme="http:/notepad/tags/#tips%20n%20tricks" term="tips n tricks" />
  <content type="html">
  
    &lt;h1 id=&quot;build-your-own-yeoman-generator&quot;&gt;Build Your Own Yeoman Generator&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;http://yeoman.io/&quot;&gt;Yeoman’s&lt;/a&gt; generators are what give its platform flexibility, allowing you to reuse the same tool for any kind of project you may be working on, JavaScript or otherwise, and that’s before I mention the enormous library of over 400 &lt;a href=&quot;http://yeoman.io/community-generators.html&quot;&gt;community contributed generators&lt;/a&gt;. Sometimes though, you may have some specific setup that you like to employ in your own projects and for situations like this, it makes sense to abstract all the boilerplate into your own generator.&lt;/p&gt;

&lt;p&gt;In this article, we will be building a Yeoman generator that will allow us to build a single page site, one row at a time, it’s a fairly simple example but it will allow us to cover a lot of the more interesting features Yeoman provides.&lt;/p&gt;

&lt;h2 id=&quot;getting-set-up&quot;&gt;Getting Set Up&lt;/h2&gt;

&lt;p&gt;I am going to assume you have &lt;a href=&quot;http://nodejs.org/&quot;&gt;Node.js&lt;/a&gt; setup, if not, you can grab the installation from &lt;a href=&quot;http://nodejs.org/download/&quot;&gt;here&lt;/a&gt;. Besides that, we will need to have Yeoman installed as well as the generator for creating generators. You can accomplish this via the following command to &lt;code&gt;npm&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;npm install -g yo generator-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, we need to create the actual project, so navigate to the folder of your choosing and run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;yo generator
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will start the generator and ask you some questions like the project name and your GitHub account, for this article, I am going to name my generator &lt;code&gt;one page&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;the-file-structure&quot;&gt;The File Structure&lt;/h2&gt;

&lt;p&gt;Don’t be alarmed by the large number of files generated by the command, it will all make sense in just a moment.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://cdn.tutsplus.com/net/uploads/2014/02/yeoman_generator_01.png&quot; alt=&quot;File Tree for Yeoman Generator&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The first couple files are dotfiles for various things like Git and Travis CI, we have a &lt;code&gt;package.json&lt;/code&gt; file for the generator itself, a &lt;code&gt;readme &lt;/code&gt;file and a folder for tests. Besides that, each command in our generator gets a folder with an &lt;code&gt;index.js&lt;/code&gt; file and a folder for templates.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;index.js&lt;/code&gt; file needs to export the actual generator object which will get run by Yeoman. I am going to clear everything inside the actual generator so we can start from scratch, here is what the file should look like after that:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#39;use strict&#39;;
var util = require(&#39;util&#39;);
var path = require(&#39;path&#39;);
var yeoman = require(&#39;yeoman-generator&#39;);
var chalk = require(&#39;chalk&#39;);

var OnepageGenerator = yeoman.generators.Base.extend({

});

module.exports = OnepageGenerator;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A Yeoman Generator can extend from two different pre-built options: the &lt;code&gt;Base&lt;/code&gt; generator, which you can see this one inherits from, or the &lt;code&gt;NamedBase&lt;/code&gt; generator, which is actually the same thing except it adds a single parameter that the user can set when they call your generator. It doesn’t matter too much which one you choose, you can always add parameters manually if you need more.&lt;/p&gt;

&lt;p&gt;All that this code is doing is creating this generator object and exporting it out, Yeoman will actually retrieve the exported object and run it. The way it runs, is by first calling the constructor method to set the object up and then it will go through all the methods you create on this object (in the order you created them) and run them one at a time. This means it doesn’t really matter what you call the functions and it gives you the flexibility to name them things that make sense to you.&lt;/p&gt;

&lt;p&gt;Now, the other thing you should know is that Yeoman has its own functions for dealing with the file system that really help you out with paths. All the functions you would normally use like &lt;code&gt;mkdir&lt;/code&gt;, &lt;code&gt;read&lt;/code&gt;, &lt;code&gt;write&lt;/code&gt;, &lt;code&gt;copy&lt;/code&gt;, etc, have been provided, but Yeoman will use the template directory in this command’s folder as the path for reading data and the folder the user is running your generator as the root path for outputting files. This means you don’t even need to think about the full paths when you work with files, you can merely run copy and yeoman will handle the two different locations for you.&lt;/p&gt;

&lt;h2 id=&quot;getting-input&quot;&gt;Getting Input&lt;/h2&gt;

&lt;p&gt;Yeoman allows you to add questions to your generator so that you can receive input from the user and customize the behavior appropriately. We are going to have two questions in our generator. The first being the name of the project and the second being whether or not to include a dummy section as an example.&lt;/p&gt;

&lt;p&gt;To accomplish this, we will add a function that will prompt the user for these two pieces of info and then store the results on our object itself:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var OnepageGenerator = yeoman.generators.Base.extend({
    promptUser: function() {
        var done = this.async();

        // have Yeoman greet the user
        console.log(this.yeoman);

        var prompts = [{
            name: &#39;appName&#39;,
            message: &#39;What is your app&#39;s name ?&#39;
        },{
            type: &#39;confirm&#39;,
            name: &#39;addDemoSection&#39;,
            message: &#39;Would you like to generate a demo section ?&#39;,
            default: true
        }];

        this.prompt(prompts, function (props) {
            this.appName = props.appName;
            this.addDemoSection = props.addDemoSection;

            done();
        }.bind(this));
    }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first line inside the function sets a &lt;code&gt;done&lt;/code&gt; variable from the object’s &lt;code&gt;async&lt;/code&gt; method. Yeoman tries to run your methods in the order that they are defined, but if you run any async code, the function will exit before the actual work gets completed and Yeoman will start the next function early. To get around this, you can call the &lt;code&gt;async&lt;/code&gt; method, which will return a callback and then Yeoman will wait to go on to the next function until that callback gets executed, which you can see it does at the end, after prompting the user.&lt;/p&gt;

&lt;p&gt;The next line where we just log &lt;code&gt;yeoman&lt;/code&gt;, that’s the Yeoman logo which you saw when we ran the Yeoman generator just before. Next, we defined a list of prompts, each prompt has a type, a name and a message. If no type was specified, it will default to ‘input’ which is for standard text entry. There are a lot of cool input types like lists, check boxes and passwords, you can view the full list &lt;a href=&quot;https://github.com/SBoudrias/Inquirer.js#question&quot;&gt;here&lt;/a&gt;. In our application, we are using one text input and one ‘confirm’ (yes/no) type of input.&lt;/p&gt;

&lt;p&gt;With the array of questions ready, we can pass it to the &lt;code&gt;prompt&lt;/code&gt; method along with a callback function. The first parameter of the callback function is the list of answers received back from the user. We then attach those properties onto our main object and call the &lt;code&gt;done&lt;/code&gt; method to go on to the next function.&lt;/p&gt;

&lt;h2 id=&quot;scaffolding-our-application&quot;&gt;Scaffolding Our Application&lt;/h2&gt;

&lt;p&gt;Our application has the outer skeleton, which will include the header, menu, footer and some CSS, and then we have the inner content which will go in its own directory along with a custom CSS file per section. This will allow you to set global properties in the main file and customize each row by itself.&lt;/p&gt;

&lt;p&gt;Let’s start with the header file, just create a new file in the templates directory called &lt;code&gt;_header.html&lt;/code&gt; with the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.12.0/css/semantic.min.css&quot; rel=&quot;stylesheet&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The file names don’t need to start with an underscore, but it’s a best practice to differentiate the name from the final output name so you can tell which one you are dealing with. Also, you can see that besides for including our main CSS file, I am also including the &lt;a href=&quot;http://semantic-ui.com/&quot;&gt;Semantic UI Library&lt;/a&gt; as a grid for rows and for the menu (not to mention the great styling).&lt;/p&gt;

&lt;p&gt;Another thing you may have noticed, is I used an EJS-styled placeholder for the title and it will get filled in at runtime. Yeoman uses Underscore templates (well lO dash) and as such you can create your files like this and the data will be generated at runtime.&lt;/p&gt;

&lt;p&gt;Next, let’s create the footer (put this in a file named &lt;code&gt;_footer.html&lt;/code&gt; in the templates folder):&lt;/p&gt;

&lt;p&gt;It just closes the HTML document for us, as we won’t be having any JavaScript in our application. The last HTML file required for the outer scaffold is the menu, we are going to generate the actual links at runtime, but we can write the outer container in a template file called &lt;code&gt;_menu.html&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;It’s a plain div with some classes provided by Semantic UI. We will pull in the actual links based on the generated sections later. Next, let’s make the &lt;code&gt;_main.css&lt;/code&gt; file:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;body{
    margin: 0;
    font-family: &quot;Open Sans&quot;, &quot;Helvetica Neue&quot;, &quot;Helvetica&quot;, &quot;Arial&quot;, sans-serif;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Just some code to help with the menu positioning and change the font, but this is where you can put any default styles you want on the entire document. Now we have to make templates for the individual sections and their accompanying CSS files, these are pretty basic files as we will leave them pretty blank for the user to customize, so inside of &lt;code&gt;_section.html&lt;/code&gt; add the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;        &amp;lt;%= content %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Just an outer div with a unique id which we will generate based on the section’s name and a class for the Semantic grid system. Then inside, I just added an &lt;code&gt;H1&lt;/code&gt; tag which again will just contain the section’s name. Next, let’s create the CSS file, so create a file called &lt;code&gt;section.css&lt;/code&gt; with the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#&amp;lt;%= id %&amp;gt;{
    background: #FFFFFF;
    color: #000;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This is more of a placeholder with the same ID as the outer container, but it’s common to change the background of each row to separate the content, so I added that property in for convenience. Now, just for completion’s sake, let’s create a file called &lt;code&gt;_gruntfile.js&lt;/code&gt; but we will populate it later and let’s fill in the &lt;code&gt;_package.json&lt;/code&gt; file that was provided:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
    &quot;name&quot;: &quot;appname&quot;,
    &quot;version&quot;: &quot;0.0.0&quot;,
    &quot;devDependencies&quot;: {
        &quot;grunt&quot;: &quot;~0.4.2&quot;,
        &quot;grunt-contrib-connect&quot;: &quot;~0.6.0&quot;,
        &quot;grunt-contrib-concat&quot;: &quot;~0.3.0&quot;,
        &quot;grunt-contrib-cssmin&quot;: &quot;~0.7.0&quot;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It’s a little bit of a spoiler as to what we will be doing later, but it’s the dependencies we will need for our Grunt tasks.&lt;/p&gt;

&lt;p&gt;With all these files ready, let’s go add the methods to scaffold a new project. So back in our &lt;code&gt;index.js&lt;/code&gt; file, right after the &lt;code&gt;promptUser&lt;/code&gt; method, let’s add a function to create all the folders we will need:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;scaffoldFolders: function(){
    this.mkdir(&quot;app&quot;);
    this.mkdir(&quot;app/css&quot;);
    this.mkdir(&quot;app/sections&quot;);
    this.mkdir(&quot;build&quot;);
},
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I added an &lt;code&gt;app&lt;/code&gt; folder and inside, two more directories: &lt;code&gt;css&lt;/code&gt; and &lt;code&gt;sections&lt;/code&gt;, this is where the end-user would build there application. I also created a &lt;code&gt;build&lt;/code&gt; folder which is where the different sections and CSS files will get compiled together and built into a single file.&lt;/p&gt;

&lt;p&gt;Next, let’s add another method to copy over some of our templates:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;copyMainFiles: function(){
    this.copy(&quot;_footer.html&quot;, &quot;app/footer.html&quot;);
    this.copy(&quot;_gruntfile.js&quot;, &quot;Gruntfile.js&quot;);
    this.copy(&quot;_package.json&quot;, &quot;package.json&quot;);
    this.copy(&quot;_main.css&quot;, &quot;app/css/main.css&quot;);

    var context = {
        site_name: this.appName
    };

    this.template(&quot;_header.html&quot;, &quot;app/header.html&quot;, context);
},
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here we use two new methods, &lt;code&gt;copy&lt;/code&gt; and &lt;code&gt;template&lt;/code&gt;, which are pretty similar in function. &lt;code&gt;copy&lt;/code&gt; will take the file from the templates directory and move it to the output folder, using the provided paths. &lt;code&gt;template&lt;/code&gt; does the same thing, except before writing to the output folder it will run it through Underscore’s templating function along with the context in order to fill in the placeholders.&lt;/p&gt;

&lt;p&gt;I didn’t copy the menu over yet because for that, we need to generate the links, but we can’t really generate the links until we add the demo section. So the next method we create, will add the demo section:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generateDemoSection: function(){
    if (this.addDemoSection) {
        var context = {
            content: &quot;Demo Section&quot;,
            id: this._.classify(&quot;Demo Section&quot;)
        }

        var fileBase = Date.now() + &quot;_&quot; + this._.underscored(&quot;Demo Section&quot;);
        var htmlFile = &quot;app/sections/&quot; + fileBase + &quot;.html&quot;;
        var cssFile  = &quot;app/css/&quot; + fileBase + &quot;.css&quot;;

        this.template(&quot;_section.html&quot;, htmlFile, context);
        this.template(&quot;_section.css&quot;, cssFile, context);
    }
},
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another function that you may not be familiar with is the &lt;code&gt;classify&lt;/code&gt; function, which is provided to you by &lt;a href=&quot;https://github.com/epeli/underscore.string&quot;&gt;Underscore Strings&lt;/a&gt;. What it does is it takes a string and it creates a “class” version of it, it will remove things like spaces and create a camel-cased version, suitable for things like HTML classes and IDs; &lt;code&gt;underscored&lt;/code&gt; does the same thing except instead of camel-casing it snake-cases them. Besides that, it’s all stuff we have done in the previous function, the only other thing worth mentioning is that we are pre-pending a time-stamp, both to keep the files unique but also for ordering. When we load the files in, they are alphabetized so having the time as the prefix will keep them in order.&lt;/p&gt;

&lt;p&gt;The last file that needs to be copied over is the &lt;code&gt;menu.html&lt;/code&gt; file but to do that, we need to generate the links. The problem is we don’t really know at this stage which files were generated before or if the user added sections manually. So to build up the menu, we need to read from the output path and after reading the sections that exist there, we need to construct the menu links. There are a handful of new functions that we haven’t used yet, so we will go through it line by line:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generateMenu: function(){
    var menu = this.read(&quot;_menu.html&quot;);

    var t = &#39;&amp;lt;%= name %&amp;gt;&#39;;
    var files = this.expand(&quot;app/sections/*.html&quot;);

    for (var i = 0; i &amp;lt; files.length; i++) {
        var name = this._.chain(files[i]).strRight(&quot;_&quot;).strLeftBack(&quot;.html&quot;).humanize().value();

        var context = {
            name: name,
            id: this._.classify(name)
        };

        var link = this.engine(t, context);
        menu = this.append(menu, &quot;div.menu&quot;, link);
    }

    this.write(&quot;app/menu.html&quot;, menu);
},
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first line reads in the menu’s outer HTML and then I created a template string that we can use for each link. After that, I used the &lt;code&gt;expand&lt;/code&gt; function, which accepts a resource path, relative to the folder the generator was called in (the output path) and it returns an array of all the files that match the provided pattern, in our case this will return all the section HTML files.&lt;/p&gt;

&lt;p&gt;Then we cycle though the list of files and for each one, we use Underscore Strings to remove the timestamp and file extension so that we are left with just the name of the file. The &lt;code&gt;humanize&lt;/code&gt; method will take things that are camel-cased or characters like underscores and dashes and convert them to spaces, so you get a human readable string. It will also capitalize the first letter of the string which will work out great for our menu. With the name separated, we create a context object along with the ID we used before, so that the links will actually take us to the correct sections.&lt;/p&gt;

&lt;p&gt;Now we have two new functions we haven’t seen before, &lt;code&gt;engine&lt;/code&gt; and &lt;code&gt;append&lt;/code&gt;. &lt;code&gt;engine&lt;/code&gt; takes a template string as the first parameter and a context object as the second and it will run it through the templating engine and returns the results. &lt;code&gt;append&lt;/code&gt; accepts an HTML string as the first parameter, a selector as the second, and something to insert as the third parameter. What it will do is insert the provided content at the end of all the elements that match the selector. Here we are adding the link to the end of the &lt;code&gt;menu&lt;/code&gt; div.&lt;/p&gt;

&lt;p&gt;Last, but not least, we have the &lt;code&gt;write&lt;/code&gt; method which will take our computed HTML string and write it out to the file. Now, just to finish up here, let’s add a method to run &lt;code&gt;npm&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;runNpm: function(){
    var done = this.async();
    this.npmInstall(&quot;&quot;, function(){
        console.log(&quot;nEverything Setup !!!n&quot;);
        done();
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The first parameter for &lt;code&gt;npmInstall&lt;/code&gt; is the paths, but you can just leave this blank, besides that I am just printing out a message at the end, telling the user the app is ready.&lt;/p&gt;

&lt;p&gt;So as a quick recap, when our generator runs, it will ask the user for the project name and whether or not to include a demo section. After that, it will go on to create the folder structure and copy in all the files needed for our project. Once done, it will run &lt;code&gt;npm&lt;/code&gt; to install the dependencies we defined and it will display the message we just put in.&lt;/p&gt;

&lt;p&gt;This is pretty much all the main generator needs to do, but it’s not that useful without the Grunt tasks. Currently, it’s just a bunch of separate files but in order to properly develop the sections, we need a way to preview them as a single file and we will also need to the ability to build the results. So open &lt;code&gt;_gruntfile.js&lt;/code&gt; from the templates directory and let’s get started:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;module.exports = function(grunt) {
  grunt.initConfig({
    //task config
  });

  grunt.loadNpmTasks(&#39;grunt-contrib-connect&#39;);
  grunt.loadNpmTasks(&#39;grunt-contrib-cssmin&#39;);
  grunt.loadNpmTasks(&#39;grunt-contrib-concat&#39;);

  grunt.registerTask(&#39;serve&#39;, [&#39;connect&#39;]);
  grunt.registerTask(&#39;build&#39;, [&#39;concat&#39;, &#39;cssmin&#39;]);
  grunt.registerTask(&#39;default&#39;, [&#39;build&#39;]);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So far, this is just the standard boilerplate, we need to export a function and inside we include the three dependencies we added to the &lt;code&gt;package.json&lt;/code&gt; file, and then we register the tasks. We will have a &lt;code&gt;serve&lt;/code&gt; task which will act like a server and let us view the separate files together while we develop our site and then we have the &lt;code&gt;build&lt;/code&gt; command which will combine all the HTML and CSS in our app together for deployment. I also added the last line, so if you just run &lt;code&gt;grunt&lt;/code&gt; by itself, it will assume you want to build.&lt;/p&gt;

&lt;p&gt;Now, let’s start with the configuration for the &lt;code&gt;build&lt;/code&gt; command as it’s a lot shorter:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;concat: {
    dist: {
        src: [&quot;app/header.html&quot;, &quot;app/menu.html&quot;, &quot;app/sections/*.html&quot;, &quot;app/footer.html&quot;],
        dest: &quot;build/index.html&quot;
    }
},
cssmin: {
    css: {
        files: {
            &quot;build/css/main.css&quot;: [&quot;app/css/*.css&quot;]
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;For the HTML, we are just going to concatenate all the HTML files together in the order specified into the build folder under the name &lt;code&gt;index.html&lt;/code&gt;. With the CSS, we also want to minify it, so we are using the &lt;code&gt;cssmin&lt;/code&gt; plugin and we are specifying that we want to output a file called &lt;code&gt;main.css&lt;/code&gt; inside the &lt;code&gt;build/css&lt;/code&gt; folder and we want it to include the minified versions of all the CSS files in our project.&lt;/p&gt;

&lt;h3 id=&quot;connect-server&quot;&gt;Connect Server&lt;/h3&gt;

&lt;p&gt;Next, we need to add the configuration for the Connect server, connect provides a lot of great middleware for serving static files or directories, but here we need to combine all the files first, so we are going to have to create some custom handlers. To begin, let’s put the base configuration in:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;connect: {
    server: {
        options: {
            keepalive: true,
            open: true,
            middleware: function(){
                //custom handlers here
            }
        }
    }
},
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;keepalive&lt;/code&gt; option tells Grunt to keep the server running, the &lt;code&gt;open&lt;/code&gt; option will tell Grunt to open the URL in your browser automatically when you start the server (it’s more of a personal preference though) and the &lt;code&gt;middleware&lt;/code&gt; function is meant to return an array of middleware handlers to process the requests.&lt;/p&gt;

&lt;p&gt;In our application, there are basically two resources we need to handle, the root resource (our “&lt;code&gt;index.html&lt;/code&gt;”) in which case we need to combine all our HTML files and return them and then the “&lt;code&gt;main.css&lt;/code&gt;” resource, in which case we would want to return all the CSS files combined together. As for anything else, we can just return a 404.&lt;/p&gt;

&lt;p&gt;So let’s start by creating an array for the middleware and let’s add the first one (this goes inside the &lt;code&gt;middleware&lt;/code&gt; property’s function, where I placed the comment):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  var middleware = [];

  middleware.push(function(req, res, next) {
      if (req.url !== &quot;/&quot;) return next();

      res.setHeader(&quot;Content-type&quot;, &quot;text/html&quot;);
      var html = grunt.file.read(&quot;app/header.html&quot;);
      html += grunt.file.read(&quot;app/menu.html&quot;);

      var files = grunt.file.expand(&quot;app/sections/*.html&quot;);

      for (var i = 0; i &amp;lt; files.length; i++) {
          html += grunt.file.read(files[i]);
      }

      html += grunt.file.read(&quot;app/footer.html&quot;);
      res.end(html);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We have kind of shifted from Yeoman’s API to Grunt’s, but luckily the command names are almost identical, we are still using &lt;code&gt;read&lt;/code&gt; to read files and &lt;code&gt;expand&lt;/code&gt; to get the list of files. Besides that, all we are doing is setting the content-type and returning the concatenated version of all the HTML files. If you are unfamiliar with a middleware based server, basically it will run through the middleware stack until somewhere along the line, a function can handle the request.&lt;/p&gt;

&lt;p&gt;In the first line, we check if the request is for the root URL, if it is we handle the request, otherwise we call &lt;code&gt;next()&lt;/code&gt; which will pass the request down the line onto the next middleware.&lt;/p&gt;

&lt;p&gt;Next, we need to hand the request to &lt;code&gt;/css/main.css&lt;/code&gt; which, if you remember, is what we set up in the header:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  middleware.push(function(req, res, next){
      if (req.url !== &quot;/css/main.css&quot;) return next();

      res.setHeader(&quot;Content-type&quot;, &quot;text/css&quot;);
      var css = &quot;&quot;;

      var files = grunt.file.expand(&quot;app/css/*.css&quot;);
      for (var i = 0; i &amp;lt; files.length; i++) {
           css += grunt.file.read(files[i]);
      }

      res.end(css);
  });
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Basically, this is the same function as before except for the CSS files. Last, but not least, I will add a 404 message and return the middleware stack:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  middleware.push(function(req, res){
      res.statusCode = 404;
      res.end(&quot;Not Found&quot;);
  });

  return middleware;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This means if any requests don’t get handled by the previous two functions, then we will send this 404 message. And that’s all there is to it, we have the generator which will create the project and the Grunt tasks which will allow us to preview and build our app. The last topic I want to cover briefly, is sub generators.&lt;/p&gt;

&lt;h2 id=&quot;sub-generators&quot;&gt;Sub Generators&lt;/h2&gt;

&lt;p&gt;We have already created the main generator that builds out our application but Yeoman allows you to create as many sub-generators as you want to use after the initial scaffolding. In our application, we need one to generate new sections. To get started, we can actually use a sub generator from the &lt;code&gt;generator:generator&lt;/code&gt; to scaffold the file, to do this, just run the following command from inside our &lt;code&gt;onepage&lt;/code&gt; folder:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;yo generator:subgenerator section
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will create a new folder called &lt;code&gt;section&lt;/code&gt; with an &lt;code&gt;index.js&lt;/code&gt; file and a &lt;code&gt;templates&lt;/code&gt; folder just like our main (app) generator. Let’s empty out the generator like we did last time and you should be left with the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&#39;use strict&#39;;
var util = require(&#39;util&#39;);
var yeoman = require(&#39;yeoman-generator&#39;);

var SectionGenerator = yeoman.generators.NamedBase.extend({

});

module.exports = SectionGenerator;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You may also notice we are extending from the &lt;code&gt;NamedBase&lt;/code&gt; not the regular &lt;code&gt;Base&lt;/code&gt;, that means you have to supply a name parameter when you call the generator and you can then access that name using &lt;code&gt;this.name&lt;/code&gt;. Now this code is essentially the two functions we already wrote in the previous generator: &lt;code&gt;generateDemoSection&lt;/code&gt; and &lt;code&gt;generateMenu&lt;/code&gt;, so we can just copy those two functions here.  I will replace the name of the first one to something more appropriate:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generateSection: function(){
    var context = {
        content: this.name,
        id: this._.classify(this.name)
    }

    var fileBase = Date.now() + &quot;_&quot; + this._.underscored(this.name);
    var htmlFile = &quot;app/sections/&quot; + fileBase + &quot;.html&quot;;
    var cssFile  = &quot;app/css/&quot; + fileBase + &quot;.css&quot;;

    this.template(&quot;_section.html&quot;, htmlFile, context);
    this.template(&quot;_section.css&quot;, cssFile, context);
},

generateMenu: function(){
    var menu = this.read(&quot;_menu.html&quot;);

    var t = &#39;&amp;lt;%= name %&amp;gt;&#39;;
    var files = this.expand(&quot;app/sections/*.html&quot;);

    for (var i = 0; i &amp;lt; files.length; i++) {
        var name = this._.chain(files[i]).strRight(&quot;_&quot;).strLeftBack(&quot;.html&quot;).humanize().value();

        var context = {
            name: name,
            id: this._.classify(name)
        };

        var link = this.engine(t, context);
        menu = this.append(menu, &quot;div.menu&quot;, link);
    }

    this.write(&quot;app/menu.html&quot;, menu);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The only difference is instead of entering the name directly, I am using the &lt;code&gt;this.name&lt;/code&gt; property. The only other thing is we need to move the template files &lt;code&gt;_sections.html&lt;/code&gt;, &lt;code&gt;_section.css&lt;/code&gt; and &lt;code&gt;_menu.html&lt;/code&gt; from &lt;code&gt;app/templates&lt;/code&gt; to &lt;code&gt;section/templates&lt;/code&gt; as that is where the &lt;code&gt;template&lt;/code&gt;/&lt;code&gt;read&lt;/code&gt; commands will look.&lt;/p&gt;

&lt;h3 id=&quot;code-duplication&quot;&gt;Code Duplication&lt;/h3&gt;

&lt;p&gt;The problem now is code duplication. So back in the &lt;code&gt;app/index.js&lt;/code&gt; file, instead of it having the same code as the sub generator, we can just call the sub generator and pass it the name argument.  You can remove &lt;code&gt;generateMenu&lt;/code&gt; from &lt;code&gt;app/index.js&lt;/code&gt; altogether and we will modify &lt;code&gt;generateDemoSection&lt;/code&gt; to the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;generateDemoSection: function() {
      if (this.addDemoSection) {
          var done = this.async();
          this.invoke(&quot;onepage:section&quot;, {args: [&quot;Demo Section&quot;]}, function(){
              done();
          });
      } else {
          this.write( &quot;app/menu.html&quot;, &quot;&quot;);
      }
},
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So if the user wanted to create the demo section, then we &lt;code&gt;invoke&lt;/code&gt; the sub generator passing in the first argument which is the name. If the user did not want the demo post, we still need to create something for the menu because our Grunt tasks will try and read it, so in the last section, we just write an empty string to the menu file.&lt;/p&gt;

&lt;p&gt;Our generator is finally complete and we can now test it out.&lt;/p&gt;

&lt;h2 id=&quot;testing-it-out&quot;&gt;Testing It Out&lt;/h2&gt;

&lt;p&gt;The first thing we need to do is install our generator on your system. Instead of installing the gem regularly, we can use the &lt;code&gt;link&lt;/code&gt; command to just link the folder into the gem path, that way we can continue to make changes here without needing to re-install it every time. From the project directory, simply run &lt;code&gt;nom link&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The last step is to actually run the generator. Just create a new folder and inside run &lt;code&gt;yo onepage&lt;/code&gt; this will run our main generator and install the dependencies via &lt;code&gt;npm&lt;/code&gt;. We can then use our Grunt tasks to view the page (&lt;code&gt;grunt serve&lt;/code&gt;) or add some more sections with our generator using something like &lt;code&gt;yo onpage:section &quot;Another section&quot;&lt;/code&gt; and the new files will be added.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;In this article, we covered a lot of the common features but there are still &lt;a href=&quot;http://yeoman.github.io/generator/&quot;&gt;more interesting options&lt;/a&gt; to check out. As you can probably tell, there is a bit of boilerplate required when building a generator, but that is kind of the point, you get it all done once and then you’re able to use it throughout all your applications.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed reading this article, if you have any questions or comments, feel free to leave them below.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/please%20explain/build-your-own-yeoman-generator&quot;&gt;Build your own Yeoman Generator&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 04, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[The Internet - 1966 & beyond]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/fact%20geek/the-internet-1966-and-beyond"/>
  <id>http:/notepad/fact%20geek/the-internet-1966-and-beyond</id>
  <published>2014-12-02T00:00:00+11:00</published>
  <updated>2014-12-02T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#Internet" term="Internet" /><category scheme="http:/notepad/tags/#facts" term="facts" /><category scheme="http:/notepad/tags/#history" term="history" />
  <content type="html">
  
    &lt;h6 id=&quot;internet-timeline--1969-&quot;&gt;Internet Timeline | 1969 ~&lt;/h6&gt;

&lt;p&gt;Significant milestones, advancements, and major breakthroughs in the development of the Internet.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1969&lt;/strong&gt;&lt;br /&gt;
- ARPA (Advanced Research Projects Agency) goes online in December, connecting four major U.S. universities. Designed for research, education, and government organizations, it provides a communications network linking the country in the event that a military attack destroys conventional communications systems.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1972&lt;/strong&gt;&lt;br /&gt;
- Electronic mail is introduced by Ray Tomlinson, a Cambridge, Mass., computer scientist. He uses the @ to distinguish between the sender’s name and network name in the email address.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1973&lt;/strong&gt;&lt;br /&gt;
- Transmission Control Protocol/Internet Protocol (TCP/IP) is designed and in 1983 it becomes the standard for communicating between computers over the Internet. One of these protocols, FTP (File Transfer Protocol), allows users to log onto a remote computer, list the files on that computer, and download files from that computer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1976&lt;/strong&gt;&lt;br /&gt;
- Presidential candidate Jimmy Carter and running mate Walter Mondale use email to plan campaign events.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Queen Elizabeth sends her first email. She’s the first state leader to do so.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1982&lt;/strong&gt;&lt;br /&gt;
- The word “Internet” is used for the first time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1984&lt;/strong&gt;&lt;br /&gt;
- Domain Name System (DNS) is established, with network addresses identified by extensions such as .com, .org, and .edu.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Writer William Gibson coins the term “cyberspace.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1985&lt;/strong&gt;&lt;br /&gt;
- Quantum Computer Services, which later changes its name to America Online, debuts. It offers email, electronic bulletin boards, news, and other information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1988&lt;/strong&gt;&lt;br /&gt;
- A virus called the Internet Worm temporarily shuts down about 10% of the world’s Internet servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1989&lt;/strong&gt;&lt;br /&gt;
- The World (world.std.com) debuts as the first provider of dial-up Internet access for consumers.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Tim Berners-Lee of CERN (European Laboratory for Particle Physics) develops a new technique for distributing information on the Internet. He calls it the World Wide Web. The Web is based on hypertext, which permits the user to connect from one document to another at different sites on the Internet via hyperlinks (specially programmed words, phrases, buttons, or graphics). Unlike other Internet protocols, such as FTP and email, the Web is accessible through a graphical user interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1990&lt;/strong&gt;&lt;br /&gt;
- The first effort to index the Internet is created by Peter Deutsch at McGill University in Montreal, who devises Archie, an archive of FTP sites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1991&lt;/strong&gt;&lt;br /&gt;
- Gopher, which provides point-and-click navigation, is created at the University of Minnesota and named after the school mascot. Gopher becomes the most popular interface for several years.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Another indexing system, WAIS (Wide Area Information Server), is developed by Brewster Kahle of Thinking Machines Corp.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1993&lt;/strong&gt;&lt;br /&gt;
- Mosaic is developed by Marc Andreeson at the National Center for Supercomputing Applications (NCSA). It becomes the dominant navigating system for the World Wide Web, which at this time accounts for merely 1% of all Internet traffic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1994&lt;/strong&gt;&lt;br /&gt;
- The White House launches its website, www.whitehouse.gov.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Initial commerce sites are established and mass marketing campaigns are launched via email, introducing the term “spamming” to the Internet vocabulary.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Marc Andreessen and Jim Clark start Netscape Communications. They introduce the Navigator browser.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1995&lt;/strong&gt;&lt;br /&gt;
- CompuServe, America Online, and Prodigy start providing dial-up Internet access.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Sun Microsystems releases the Internet programming language called Java.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The Vatican launches its own website, www.vatican.va.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1996&lt;/strong&gt;&lt;br /&gt;
- Approximately 45 million people are using the Internet, with roughly 30 million of those in North America (United States and Canada), 9 million in Europe, and 6 million in Asia/Pacific (Australia, Japan, etc.). 43.2 million (44%) U.S. households own a personal computer, and 14 million of them are online.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1997&lt;/strong&gt;&lt;br /&gt;
- On July 8, 1997, Internet traffic records are broken as the NASA website broadcasts images taken by &lt;em&gt;Pathfinder&lt;/em&gt; on Mars. The broadcast generates 46 million hits in one day.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The term “weblog” is coined. It’s later shortened to “blog.”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1998&lt;/strong&gt;&lt;br /&gt;
- Google opens its first office, in California.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1999&lt;/strong&gt;&lt;br /&gt;
- College student Shawn Fanning invents Napster, a computer application that allows users to swap music over the Internet.&lt;br /&gt;
The number of Internet users worldwide reaches 150 million by the beginning of 1999. More than 50% are from the United States.
“E-commerce” becomes the new buzzword as Internet shopping rapidly spreads.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;MySpace.com is launched.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2000&lt;/strong&gt;&lt;br /&gt;
- To the chagrin of the Internet population, deviant computer programmers begin designing and circulating viruses with greater frequency. “Love Bug” and “Stages” are two examples of self-replicating viruses that send themselves to people listed in a computer user’s email address book. The heavy volume of email messages being sent and received forces many infected companies to temporarily shut down their clogged networks.&lt;br /&gt;
The Internet bubble bursts, as the fountain of investment capital dries up and the Nasdaq stock index plunges, causing the initial public offering (IPO) window to slam shut and many dotcoms to close their doors.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;America Online buys Time Warner for $16 billion. It’s the biggest merger of all time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2001&lt;/strong&gt;&lt;br /&gt;
- Napster is dealt a potentially fatal blow when the 9th U.S. Circuit Court of Appeals in San Francisco rules that the company is violating copyright laws and orders it to stop distributing copyrighted music. The file-swapping company says it is developing a subscription-based service.&lt;br /&gt;
About 9.8 billion electronic messages are sent daily.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Wikipedia is created.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2002&lt;/strong&gt;&lt;br /&gt;
- As of January, 58.5% of the U.S. population (164.14 million people) uses the Internet. Worldwide there are 544.2 million users.&lt;br /&gt;
The death knell tolls for Napster after a bankruptcy judge ruled in September that German media giant Bertelsmann cannot buy the assets of troubled Napster Inc. The ruling prompts Konrad Hilbers, Napster CEO, to resign and lay off his staff.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2003&lt;/strong&gt;&lt;br /&gt;
- It’s estimated that Internet users illegally download about 2.6 billion music files each month.&lt;br /&gt;
Spam, unsolicited email, becomes a server-clogging menace. It accounts for about half of all emails. In December, President Bush signs the Controlling the Assault of Non-Solicited Pornography and Marketing Act of 2003 (CAN-SPAM Act), which is intended to help individuals and businesses control the amount of unsolicited email they receive.&lt;br /&gt;
Apple Computer introduces Apple iTunes Music Store, which allows people to download songs for 99 cents each.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Spam, unsolicited email, becomes a server-clogging menace. It accounts for about half of all emails.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Apple Computer introduces Apple iTunes Music Store, which allows people to download songs for 99 cents each.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2004&lt;/strong&gt;&lt;br /&gt;
- Internet Worm, called MyDoom or Novarg, spreads through Internet servers. About 1 in 12 email messages are infected.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Online spending reaches a record high—$117 billion in 2004, a 26% increase over 2003.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2005&lt;/strong&gt;&lt;br /&gt;
- YouTube.com is launched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2006&lt;/strong&gt;&lt;br /&gt;
- There are more than 92 million websites online.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2007&lt;/strong&gt;&lt;br /&gt;
- Legal online music downloads triple to 6.7 million downloads per week.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Colorado Rockies’ computer system crashes when it receives 8.5 million hits within the first 90 minutes of World Series ticket sales.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The online game, World of Warcraft, hits a milestone when it surpasses 9 million subscribers worldwide in July.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2008&lt;/strong&gt;&lt;br /&gt;
- In a move to challenge Google’s dominance of search and advertising on the Internet, software giant Microsoft offers to buy Yahoo for $44.6 billion.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;In a San Fransisco federal district court, Judge Jeffrey S. White orders the disabling of Wikileaks.org, a Web site that discloses confidential information. The case was brought by Julius Baer Bank and Trust, located in the Cayman Islands, after a disgruntled ex-employee allegedly provided Wikileaks with stolen documents that implicate the bank in asset hiding, money laundering, and tax evasion. Many web communities, who see the ruling as unconstitutional, publicized alternate addresses for the site and distributed bank documents through their own networks. In response, Judge White issues another order to stop the distribution of bank documents.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Microsoft is fined $1.3 billion by the European Commission for further abusing its dominant market position, and failing to comply to their 2004 judgment, which ordered Microsoft to give competitors information necessary to operate with Windows. Since 2004, Microsoft has been fined a total of $2.5 billion by the Commission for not adhering to their ruling.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2012&lt;/strong&gt;&lt;br /&gt;
- A major protest online in January shakes up Congressional support for anti-Web piracy measures. The protest, including a 24-hour shutdown of the English-language Wikipedia site, is over two bills, the Stop Online Piracy Act in the House and the Protect IP Act in the Senate. The main goal of both bills is to stop illegal downloading and streaming of TV shows and movies online. The tech industry is concerned that the bills will give media companies too much power to shut down websites.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2014&lt;/strong&gt;&lt;br /&gt;
- A coding error discovered in April in OpenSSL, encryption software that makes transactions between a computer and a remote secure, makes users vulnerable to having their usernames, passwords, and personal information stolen. Millions of banks, Internet commerce companies, email services, government sites, and social media sites rely on OpenSSL to conduct secure transactions. The coding error was made in 2012. Computer security experts encourage computer users to change their passwords.&lt;/p&gt;

&lt;p&gt;Sources for this timeline include International Data Corporation, the W3C Consortium, Nielsen/NetRatings, and the Internet Society.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/fact%20geek/the-internet-1966-and-beyond&quot;&gt;The Internet - 1966 & beyond&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on December 02, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[GitHub Pages Ruby Gem]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/web-development/github-pages-ruby-gem"/>
  <id>http:/notepad/web-development/github-pages-ruby-gem</id>
  <published>2014-11-29T00:00:00+11:00</published>
  <updated>2014-11-29T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#jekyll" term="jekyll" /><category scheme="http:/notepad/tags/#dev" term="dev" /><category scheme="http:/notepad/tags/#github" term="github" />
  <content type="html">
  
    &lt;p&gt;A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://badge.fury.io/rb/github-pages&quot;&gt;&lt;img src=&quot;https://badge.fury.io/rb/github-pages.svg&quot; alt=&quot;Gem Version&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;https://travis-ci.org/github/pages-gem&quot;&gt;&lt;img src=&quot;https://travis-ci.org/github/pages-gem.svg?branch=master&quot; alt=&quot;Build Status&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&quot;usage&quot;&gt;Usage&lt;/h2&gt;

&lt;p&gt;Run the following command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install github-pages&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, you can add the following to your project’s Gemfile:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem &#39;github-pages&#39;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: You are not required to install Jekyll separately. Once the &lt;code&gt;github-pages&lt;/code&gt; gem is installed, you can build your site using &lt;code&gt;jekyll build&lt;/code&gt;, or preview your site using &lt;code&gt;jekyll serve&lt;/code&gt;.&lt;/em&gt; For more information about installing Jekyll locally, please see &lt;a href=&quot;https://help.github.com/articles/using-jekyll-with-pages#installing-jekyll&quot;&gt;the GitHub Help docs on the matter&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;command-line-usage&quot;&gt;Command line usage&lt;/h3&gt;

&lt;p&gt;The GitHub Pages gem also comes with several command-line tools, contained within the &lt;code&gt;github-pages&lt;/code&gt; command.&lt;/p&gt;

&lt;h4 id=&quot;list-dependency-versions&quot;&gt;List dependency versions&lt;/h4&gt;

&lt;pre&gt;&lt;code&gt;$ github-pages versions
+-----------------------+---------+
| Gem                   | Version |
+-----------------------+---------+
| jekyll                | 2.4.0   |
| jekyll-coffeescript   | 1.0.0   |
| jekyll-sass-converter | 1.2.0   |
| kramdown              | 1.3.1   |
| maruku                | 0.7.0   |
| rdiscount             | 2.1.7   |
| redcarpet             | 3.1.2   |
| RedCloth              | 4.2.9   |
| liquid                | 2.6.1   |
| pygments.rb           | 0.6.0   |
| jemoji                | 0.3.0   |
| jekyll-mentions       | 0.1.3   |
| jekyll-redirect-from  | 0.6.2   |
| jekyll-sitemap        | 0.6.0   |
+-----------------------+---------+
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Note, you can also pass the &lt;code&gt;--gemfile&lt;/code&gt; flag to get the dependencies listed in a valid Gemfile dependency format.&lt;/p&gt;

&lt;h4 id=&quot;health-check&quot;&gt;Health check&lt;/h4&gt;

&lt;p&gt;Checks your GitHub Pages site for common DNS configuration issues.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ github-pages health-check
Checking domain foo.invalid...
Uh oh. Looks like something&#39;s fishy: A record points to deprecated IP address
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;See the &lt;a href=&quot;https://github.com/github/pages-health-check&quot;&gt;GitHub Pages Health Check&lt;/a&gt; documentation for more information.&lt;/p&gt;

&lt;h2 id=&quot;updating&quot;&gt;Updating&lt;/h2&gt;

&lt;p&gt;To update to the latest version of Jekyll and associated dependencies, simply run &lt;code&gt;gem update github-pages&lt;/code&gt;, or if you’ve installed via Bundler, &lt;code&gt;bundle update github-pages&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id=&quot;project-goals&quot;&gt;Project Goals&lt;/h2&gt;

&lt;p&gt;The goal of the GitHub Pages gem is to help GitHub Pages users bootstrap and maintain a Jekyll build environment that most closely matches the GitHub pages build environment. The GitHub Pages gem relies on explicit requirements shared between both users’ computers and the build servers to ensure that the result of a user’s local build is consistently also the result of the server’s build.&lt;/p&gt;

&lt;p&gt;Additional tools, such as tools that integrate with the GitHub API to make managing GitHub Pages sites easier are not the primary goal, but may be within the project’s scope.&lt;/p&gt;

&lt;h2 id=&quot;whats-versioned&quot;&gt;What’s versioned&lt;/h2&gt;

&lt;p&gt;The GitHub Pages gem seeks to version two aspects of the build environment:&lt;/p&gt;

&lt;h3 id=&quot;ruby&quot;&gt;1. Ruby&lt;/h3&gt;

&lt;p&gt;The version of Ruby with which Jekyll is executed. Although Jekyll itself may be compatible with prior or future versions of Ruby, different execution environments yield different results. Ruby 1.8.7 parses YML differently than 1.9.3, for example, and Kramdown has trouble processing &lt;code&gt;mailto&lt;/code&gt; links prior to 1.9.3. In order to ensure that building locally consistently results in the same build as what appears when published, it’s essential that Ruby itself is versioned along side the Gem, despite no known incompatibilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you’re using &lt;code&gt;rbenv&lt;/code&gt;, check out &lt;a href=&quot;https://github.com/parkr/ruby-build-github&quot;&gt;ruby-build-github&lt;/a&gt; for ruby-build, a collection of GitHub-shipped Ruby versions. If you clone down this repository and run ./install.sh support/2.1.0-github, it should install properly for you.&lt;/p&gt;

&lt;h3 id=&quot;dependencies&quot;&gt;2. Dependencies&lt;/h3&gt;

&lt;p&gt;This includes Markdown processors, and any other Jekyll dependency for which version incongruency may produce unexpected results. Traditionally, MaruKu, Kramdown, RedCloth, liquid, rdiscount, and redcarpet have been strictly maintained due to known breaking changes.&lt;/p&gt;

&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;/h2&gt;

&lt;p&gt;See &lt;a href=&quot;https://github.com/github/pages-gem/releases&quot;&gt;all releases&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;releasing&quot;&gt;Releasing&lt;/h2&gt;

&lt;p&gt;To release a new version of this gem, run &lt;code&gt;script/release&lt;/code&gt; from the &lt;code&gt;master&lt;/code&gt; branch.&lt;/p&gt;

&lt;h2 id=&quot;license&quot;&gt;License&lt;/h2&gt;

&lt;p&gt;Distributed under the &lt;a href=&quot;LICENSE&quot;&gt;MIT License&lt;/a&gt;.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/web-development/github-pages-ruby-gem&quot;&gt;GitHub Pages Ruby Gem&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 29, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Creating a Successful School Digital Citizenship Plan]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/kids%20stuff/digital-citizenship"/>
  <id>http:/notepad/kids%20stuff/digital-citizenship</id>
  <published>2014-11-29T00:00:00+11:00</published>
  <updated>2014-11-29T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#privacy" term="privacy" /><category scheme="http:/notepad/tags/#schools" term="schools" /><category scheme="http:/notepad/tags/#security" term="security" /><category scheme="http:/notepad/tags/#kids" term="kids" />
  <content type="html">
  
    &lt;h2 id=&quot;what-is-digital-citizenship&quot;&gt;What is Digital Citizenship?&lt;/h2&gt;

&lt;p&gt;Advances in technology have caused a huge problem in areas of education dealing with copyright laws; in response, educators are implementing programs designed to teach students about digital citizenship.&lt;/p&gt;

&lt;p&gt;Digital citizenship in schools was designed to educate students of all ages about their responsibilities to a digital society. When a person becomes a citizen of a nation whether by birth or immigration, they agree to adhere to the rules and regulation set forth by the government or pay a penalty. Simple rules are set in place to protect people’s property, heath, and rights. Digital citizenship works in much the same way.&lt;/p&gt;

&lt;p&gt;Digital citizenship in schools has been discussed for years, but recently in June 2010, the Online Safety Working Group sent a letter to Congress entitled Youth Safety on a Living Internet. In this report, the Internet is declared “a living thing” in its form and function. Because of this, it grows and changes, so society must be prepared for these changes and know how to steward what has been given. They decided that the job of promoting online safety should fall to the education system because they have the greatest access to computers and other digital media.That being done, teaching students about digital citizenship in schools is now a requirement in school districts across the nation.&lt;/p&gt;

&lt;h3 id=&quot;elements-to-create-plan&quot;&gt;Elements to Create Plan&lt;/h3&gt;

&lt;p&gt;So what are the needed elements in order to implement a digital citizenship plan? A better question is probably “Where do we start?” With all the media outlets available today, this subject is difficult to address. It is usually better to assume that everything needs to be included.&lt;/p&gt;

&lt;p&gt;A good focus question would be to ask an adult and a student how they use technology on a daily basis. By gathering information about technological use, you are better equipped to come up with a plan. These plans need to cover all areas of technology.&lt;/p&gt;

&lt;p&gt;Computer and Internet use will obviously be a major topic for discussion with all that is available out there. Students need to know how to properly find information on websites, which websites are reliable, and how to cite their source information. These things cannot be assumed knowledge; a majority of students do now know how to do proper work citations when they enter college. They need to know the gravity of violating copyright laws when it comes to published works of all kinds. Most students do not believe that they will ever get caught plagiarizing, so they need to have a reason not to that is foundation to them.&lt;/p&gt;

&lt;h3 id=&quot;finding-lesson-plans&quot;&gt;Finding Lesson Plans&lt;/h3&gt;

&lt;p&gt;There are many resources available to help teachers and school districts make digital citizenship agreements and lesson plans. A great place to start is by going to &lt;a href=&quot;http://www.digitalcitizenship.net&quot;&gt;www.digitalcitizenship.net&lt;/a&gt; and looking at their free online lesson plans. These lesson plans provide activities that give students choices and opportunities to explore real-life scenarios that they may find themselves in one day. It would also be a good idea to download a &lt;a href=&quot;http://www.digitalcitizenship.net/uploads/ISTECompass.pdf&quot;&gt;21st Century Digital Compass&lt;/a&gt; and go through its contents with your students. These resources are easy to find and an invaluable source of information and protection for your students and your school.&lt;/p&gt;

&lt;h3 id=&quot;developing-a-contract&quot;&gt;Developing a Contract&lt;/h3&gt;

&lt;p&gt;The main component of becoming digital citizens is the implementation of a contract that must be signed by the student and the parent/guardian of that student before they are allowed any access to digital media of any kind on school grounds. This will protect everyone in the case of misuse of the privilege of living in a digital world. Students will be accountable to their signatures on that contract and their digital citizenship and all the rights and privileges will be realized to a higher degree.&lt;/p&gt;

&lt;p&gt;A digital world has changed the face of education, so it is important that school create a world of healthy digital citizens.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://blog.edmodo.com/wp-content/uploads/2012/10/Screen-Shot-2012-10-15-at-11.41.13-AM1.png&quot; alt=&quot;poster&quot; /&gt;&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/kids%20stuff/digital-citizenship&quot;&gt;Creating a Successful School Digital Citizenship Plan&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 29, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Get Your Badge On]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/tips%20n%20tricks/get-your-badge-on"/>
  <id>http:/notepad/tips%20n%20tricks/get-your-badge-on</id>
  <published>2014-11-28T00:00:00+11:00</published>
  <updated>2014-11-28T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#geek" term="geek" /><category scheme="http:/notepad/tags/#open-source" term="open-source" /><category scheme="http:/notepad/tags/#badges" term="badges" />
  <content type="html">
  
    &lt;p&gt;I love adding badges to my projects. It’s an easy way to quickly check dependencies are up to date, and build are passing. Others are just to show what services you use on the project, and others just for fun. So what can you use badges for? Check out the list below for some examples.&lt;/p&gt;

&lt;h5 id=&quot;what-kind-of-meta-data-can-you-convey-using-badges&quot;&gt;What kind of meta data can you convey using badges?&lt;/h5&gt;

&lt;ul&gt;
  &lt;li&gt;test build status: &lt;code&gt;build | failing&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;code coverage percentage: &lt;code&gt;coverage | 80%&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;stable release version: &lt;code&gt;version | 1.2.3&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;package manager release: &lt;code&gt;gem | 1.2.3&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;status of third-party dependencies: &lt;code&gt;dependencies | out-of-date&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;static code analysis GPA: &lt;code&gt;code climate | 3.8&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://semver.org/&quot;&gt;semver&lt;/a&gt; version observance: &lt;code&gt;semver | 2.0.0&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;amount of &lt;a href=&quot;http://gittip.com&quot;&gt;gittip&lt;/a&gt; donations per week: &lt;code&gt;tips | $2/week&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h6 id=&quot;services-that-give-you-badges-using-the-shields-standard&quot;&gt;Services that give you badges! (using the Shields standard)&lt;/h6&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/travis-ci/travis-ci/issues/630#issuecomment-38054967&quot;&gt;Travis CI&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://codeclimate.com/changelog/510d4fde56b102523a0004bf&quot;&gt;Code Climate&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://coveralls.io/r/kaize/nastachku&quot;&gt;Coveralls&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://badge.fury.io/&quot;&gt;Gemfury/RubyGems&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://support.gemnasium.com/forums/236528-general/suggestions/5518400-use-svg-for-badges-so-they-still-look-sharp-on-r&quot;&gt;Gemnasium&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://scrutinizer-ci.com/&quot;&gt;Scrutinizer CI&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://semaphoreapp.com&quot;&gt;Semaphore&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.versioneye.com/&quot;&gt;VersionEye&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://readthedocs.org/&quot;&gt;Read the Docs&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/badges/badgerbadgerbadger&quot;&gt;BadgerBadgerBadger&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bfontaine/badges2svg&quot;&gt;badges2svg&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/rexfinn/reposs&quot;&gt;reposs&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bogdanRada/ruby-gem-downloads-badge/&quot;&gt;ruby-gem-downloads-badge&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;do-you-grunt&quot;&gt;Do you Grunt?&lt;/h5&gt;

&lt;p&gt;Do you use Grunt in a project? If so you should proudly display that in your project README or on your project website? Now you can with the “Built with Grunt” badge!&lt;/p&gt;

&lt;p&gt;Built with Grunt
&lt;a href=&quot;http://gruntjs.com/&quot;&gt;&lt;img src=&quot;https://cdn.gruntjs.com/builtwith.png&quot; alt=&quot;Built with Grunt&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h6 id=&quot;using-the-badge&quot;&gt;Using the Badge&lt;/h6&gt;

&lt;p&gt;Just copy the following Markdown code snippet and paste it right underneath the headline in your project README. You can also put it on your project website homepage or footer.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-markdown&quot;&gt;[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you need an HTML version, we’ve got you covered.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;lt;a href=&quot;http://gruntjs.com/&quot;&amp;gt;&amp;lt;img src=&quot;https://cdn.gruntjs.com/builtwith.png&quot; alt=&quot;Built with Grunt&quot;&amp;gt;&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/tips%20n%20tricks/get-your-badge-on&quot;&gt;Get Your Badge On&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 28, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[The HTML email Boilerplate]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/design/the-html-email-boilerplate"/>
  <id>http:/notepad/design/the-html-email-boilerplate</id>
  <published>2014-11-18T00:00:00+11:00</published>
  <updated>2014-11-18T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#email" term="email" /><category scheme="http:/notepad/tags/#design" term="design" />
  <content type="html">
  
    &lt;p&gt;With web development there are lots of common tasks that we do over and over again. This is where it’s helpful to work with tools that make our lives easier, this can be Server-side frameworks, HTML project boilerplates and HTML email boilerplates. &lt;/p&gt;

&lt;p&gt;Some of the most popular boilerplates you would of heard of are Twitter bootstrap and HTML5 boilerplate. These projects are both available on Github for you to fork and modify for your own use and both are very useful projects to use when you first start any new website project.&lt;/p&gt;

&lt;p&gt;One of the problems that web developers have is getting email newsletters to look correct in most of email clients. This is where the HTML email boilerplate can be useful, it will provide you with helpful code snippets to aid in developing all your HTML emails. This will take care of the correct doctype to use, how to reset the styling to work in all clients, how to display images correctly and how to style HTML tables to align correctly in your email.&lt;/p&gt;

&lt;h3 id=&quot;html-doctype&quot;&gt;HTML Doctype&lt;/h3&gt;

&lt;p&gt;While many email clients will strip out the doctype, it’s good practice to add a doctype so that when we are testing we know that the HTML will render correctly. When popular clients remove the doctype from the email it will be replaced by XHTML 1.0 strict doctype, this is why we make sure we set it as XHTML 1.0 strict.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Strict//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&amp;quot;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;images&quot;&gt;Images&lt;/h3&gt;

&lt;p&gt;The HTML boilerplate will help you in setting up your images correctly, if you have links around your images then a border will be placed around the images, adding these styles will remove all borders around your images.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;outline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;interpolation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bicubic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt; 
&lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.image_fix&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;img&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;image_fix&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;full path to image&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;alt=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Your alt text&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;title=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;Your title text&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;x&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;height=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;x&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;tables&quot;&gt;Tables&lt;/h3&gt;

&lt;p&gt;The HTML boilerplate gives you a starting point to deal with tables, this will provide you with a starting point of defaults to use on your table to avoid any formatting problems.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;#backgroundTable&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-html&quot; data-lang=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;cellpadding=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;cellspacing=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;border=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;backgroundTable&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;nt&quot;&gt;&amp;lt;table&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;cellpadding=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;cellspacing=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;border=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;align=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;center&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
                 &lt;span class=&quot;nt&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                      &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;200&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;valign=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                      &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;200&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;valign=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                      &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;width=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;200&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;valign=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;top&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;nt&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
             &lt;span class=&quot;nt&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt; 
        &lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id=&quot;resetting-your-styles&quot;&gt;Resetting Your Styles&lt;/h3&gt;

&lt;p&gt;Use the following snippet to reset the styles in the email clients, this will also help with font sizes on mobile devices.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-css&quot; data-lang=&quot;css&quot;&gt;&lt;span class=&quot;c&quot;&gt;/* Client-specific Styles */&lt;/span&gt;
&lt;span class=&quot;nf&quot;&gt;#outlook&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Force Outlook to provide a &amp;quot;view in browser&amp;quot; menu link. */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;adjust&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;adjust&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt; 
&lt;span class=&quot;c&quot;&gt;/* Prevent Webkit and Windows Mobile platforms from changing default font sizes, while not breaking desktop design. */&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Force Hotmail to display emails at full width */&lt;/span&gt;  
&lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;span&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ExternalClass&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Force Hotmail to display normal line spacing.  More on that: http://www.emailonacid.com/forum/viewthread/43/ */&lt;/span&gt; 
&lt;span class=&quot;nf&quot;&gt;#backgroundTable&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* End reset */&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Use the HTML boilerplate the next time you need to create a HTML email newsletter.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/seanpowell/Email-Boilerplate/zipball/master&quot;&gt;DOWNLOAD THE BOILERPLATE&lt;/a&gt;&amp;gt;&lt;/p&gt;

&lt;script src=&quot;https://gist.github.com/roachhd/12f0ba1aa6fed83033d8.js&quot;&gt;&lt;/script&gt;

&lt;p&gt;Resources and information taken from the &lt;a href=&quot;http://htmlemailboilerplate.com/&quot;&gt;HTMLemailboilerplate.com&lt;/a&gt; website.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/design/the-html-email-boilerplate&quot;&gt;The HTML email Boilerplate&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 18, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[How to Write a Great README]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/tips%20n%20tricks/how-to-write-a-readme"/>
  <id>http:/notepad/tips%20n%20tricks/how-to-write-a-readme</id>
  <published>2014-11-17T00:00:00+11:00</published>
  <updated>2014-11-17T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#geek" term="geek" /><category scheme="http:/notepad/tags/#open-source" term="open-source" /><category scheme="http:/notepad/tags/#readme" term="readme" />
  <content type="html">
  
    &lt;p&gt;As many other have blogged before me, a good README should be simple and succinct, but a great README can save time and encourage developers to look more at your project, especially if it’s for something like command-line parameter parsing library.&lt;/p&gt;

&lt;p&gt;Here’s what I think it should include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;name of the projects and all sub-modules and libraries (sometimes they are named different and very confusing to new users)&lt;/li&gt;
  &lt;li&gt;descriptions of all the project, and all sub-modules and libraries&lt;/li&gt;
  &lt;li&gt;5-line code snippet on how its used (if it’s a library)&lt;/li&gt;
  &lt;li&gt;copyright and licensing information (or “Read LICENSE”) &lt;/li&gt;
  &lt;li&gt;instruction to grab the documentation&lt;/li&gt;
  &lt;li&gt;instructions to install, configure, and to run the programs&lt;/li&gt;
  &lt;li&gt;instruction to grab the latest code and detailed instructions to build it (or quick overview and “Read INSTALL”)&lt;/li&gt;
  &lt;li&gt;list of authors or “Read AUTHORS”&lt;/li&gt;
  &lt;li&gt;instructions to submit bugs, feature requests, submit patches, join mailing list, get announcements, or join the user or dev community in other forms&lt;/li&gt;
  &lt;li&gt;other contact info (email address, website, company name, address, etc)&lt;/li&gt;
  &lt;li&gt;a brief history if it’s a replacement or a fork of something else&lt;/li&gt;
  &lt;li&gt;legal notices (crypto stuff)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Apache HTTP Server has a simple yet good README. Another good one I found available online is GNU Make’s README.&lt;/p&gt;

&lt;p&gt;As per formatting, I would say stick to the Unix traditions as much as possible, and/or use markdown especially for github projects, which renders README.md as html.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ASCII characters only, if the README is written in English&lt;/li&gt;
  &lt;li&gt;write it in English if possible, and ship translated version with two-letter language code extension like README.ja&lt;/li&gt;
  &lt;li&gt;80 characters or less per line&lt;/li&gt;
  &lt;li&gt;single empty line between paragraphs&lt;/li&gt;
  &lt;li&gt;dashes under the headers&lt;/li&gt;
  &lt;li&gt;indent using whitespace (0x20) not tab&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;putting-it-all-together&quot;&gt;Putting it all together…&lt;/h3&gt;

&lt;pre&gt;&lt;code&gt;Documentation
GNU make is fully documented in the GNU Make manual, which is contained
in this distribution as the file make.texinfo.  You can also find
on-line and preformatted (PostScript and DVI) versions at the FSF&#39;s web
site.  There is information there about ordering hardcopy documentation.

  http://www.gnu.org/
  http://www.gnu.org/doc/doc.html
  http://www.gnu.org/manual/manual.html 
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;wikipedia-defines-as&quot;&gt;Wikipedia defines as:&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;A readme (or read me) file contains information about other files in a directory or archive and is very commonly distributed with computer software.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and it lists the following contents:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;ul&gt;
    &lt;li&gt;configuration instructions&lt;/li&gt;
    &lt;li&gt;installation instructions&lt;/li&gt;
    &lt;li&gt;operating instructions&lt;/li&gt;
    &lt;li&gt;a file manifest&lt;/li&gt;
    &lt;li&gt;copyright and licensing information&lt;/li&gt;
    &lt;li&gt;contact information for the distributor or programmer&lt;/li&gt;
    &lt;li&gt;known bugs&lt;/li&gt;
    &lt;li&gt;troubleshooting&lt;/li&gt;
    &lt;li&gt;credits and acknowledgements&lt;/li&gt;
    &lt;li&gt;a changelog&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s it for now, but I have another post about readme file soon. They are very important to the developer and assist with planning and keeping on track.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/tips%20n%20tricks/how-to-write-a-readme&quot;&gt;How to Write a Great README&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 17, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Organise Gists with GistBox]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/tips%20n%20tricks/organise-gists-with-gistbox"/>
  <id>http:/notepad/tips%20n%20tricks/organise-gists-with-gistbox</id>
  <published>2014-11-15T00:00:00+11:00</published>
  <updated>2014-11-15T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#github" term="github" /><category scheme="http:/notepad/tags/#gist" term="gist" /><category scheme="http:/notepad/tags/#tips" term="tips" />
  <content type="html">
  
    &lt;p&gt;I can across this &lt;a href=&quot;http://www.paulund.co.uk/organise-gists-with-gistbox&quot; title=&quot;Permalink to Organise Your Github Gists With GistBox&quot;&gt;article&lt;/a&gt; and it’s exactly what I wanted to write.&lt;/p&gt;

&lt;h1 id=&quot;organise-your-github-gists-with-gistbox&quot;&gt;Organise Your Github Gists With GistBox&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;http://www.paulund.co.uk/wp-content/uploads/2013/07/gistbox-590x407.png&quot; alt=&quot;gistbox&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Do you have a good way of organising and storing all your different code snippets?&lt;/p&gt;

&lt;p&gt;Because I use &lt;a href=&quot;http://www.paulund.co.uk/web-development-with-sublime-text-2&quot; title=&quot;Web Development With Sublime Text 2&quot;&gt;sublime text 3 as my code editor&lt;/a&gt; I used to just store all my &lt;strong&gt;code snippets as a snippet in sublime&lt;/strong&gt;, this was fine if your are always working on one computer but what if you code on multiple computers? You won’t be able to take all these code snippets with you.&lt;/p&gt;

&lt;p&gt;I’ve started to change this and have been adding to my profile on Gist and using this to store my code snippets, the benefit of using this means that I can have access to all my snippets from any computer I use.&lt;/p&gt;

&lt;p&gt;Another benefit is that a Gist uses version control so I can see the changes made to the snippet as I learn a new trick.&lt;/p&gt;

&lt;p&gt;As these snippets are open to the public other people have the chance to comment on these code snippets if they know a better way of doing what I’m trying to achieve.&lt;/p&gt;

&lt;p&gt;Other people can even fork these snippets so that they have access to this code on their own Gist profile.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://gist.github.com/paulund&quot;&gt;View my Gist profile&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The problem with Gist is they way you organise and search for your code snippets, there isn’t a good way to do this. &lt;strong&gt;GistBox&lt;/strong&gt; was created to solve that very problem. GistBox can be a desktop application or a Google Chrome application and uses the &lt;a href=&quot;http://www.paulund.co.uk/embed-github-gists-shortcode&quot; title=&quot;Create A Embed Github Gists Shortcode&quot;&gt;Gist API&lt;/a&gt; to get all your Gists and gives you a nice interface to search and organise them.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.paulund.co.uk/wp-content/uploads/2013/07/color_coded_labels.png&quot; alt=&quot;Color coded labels&quot; /&gt;&lt;/p&gt;

&lt;p&gt;GistBox allows you to place labels on your Gists so that you can group them together in any way you want, not just any language but you could group them by framework or by project.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.paulund.co.uk/wp-content/uploads/2013/07/search_and_filters.png&quot; alt=&quot;Search and filters&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It will allow you to search through your Gists using labels and keywords.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://www.paulund.co.uk/wp-content/uploads/2013/07/feature_rich_code_editor.png&quot; alt=&quot;Code Editor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Using the in-built code editor you can create new Gists directly inside the application and it will use the API to update your profile on Gist.&lt;/p&gt;

&lt;p&gt;If you use Gist to store your code snippets it really is a nice tool to organise the code, try it out.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.gistboxapp.com/&quot;&gt;GistBox&lt;/a&gt;&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/tips%20n%20tricks/organise-gists-with-gistbox&quot;&gt;Organise Gists with GistBox&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 15, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[The JavaScript List]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/resources/learn-javascript-resources"/>
  <id>http:/notepad/resources/learn-javascript-resources</id>
  <published>2014-11-15T00:00:00+11:00</published>
  <updated>2014-11-15T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#links" term="links" /><category scheme="http:/notepad/tags/#JavaScript" term="JavaScript" /><category scheme="http:/notepad/tags/#lists" term="lists" />
  <content type="html">
  
    &lt;p&gt;&lt;a href=&quot;http://roachhd.github.comhttp:/notepad/extras/actual-javascript/performance&quot;&gt;Actual JavaScript Engine Performance &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/javascript.html&quot;&gt;JavaScript:  The Wrrrld’s Most Misunderstood Programming Language&lt;/a&gt; (&lt;a href=&quot;http://javascript.crockford.com/zh/javascript.html&quot;&gt;Chinese&lt;/a&gt; &lt;a href=&quot;http://devel.virtage.com/2009/01/cs-javascript-nejnepochopenejsi-programovaci-jazyk-sveta/&quot;&gt;Czech&lt;/a&gt; &lt;a href=&quot;http://microclub.ch/2012/10/21/javascript-le-langage-de-programmation-le-plus-incompris-du-monde/&quot;&gt;French&lt;/a&gt; &lt;a href=&quot;http://www.pseliger.de/translations/Douglas-Crockford/missunderstood-JavaScript.html&quot;&gt;German&lt;/a&gt; &lt;a href=&quot;http://eineki.wordpress.com/2009/07/19/javascript-il-linguaggio-di-programmazione-piu-incompreso-del-mondo/&quot;&gt;Italian&lt;/a&gt; &lt;a href=&quot;http://d.hatena.ne.jp/brazil/20050829/1125321936&quot;&gt;Japanese&lt;/a&gt; &lt;a href=&quot;http://home.postech.ac.kr/~skyul/javascript.html&quot;&gt;Korean&lt;/a&gt; &lt;a href=&quot;http://javascript.crockford.com/pt/javascript.html&quot;&gt;Portuguese&lt;/a&gt; &lt;a href=&quot;http://blog.digitalbank.org/2009/02/javascript-javascript-mocha-livescript.html&quot;&gt;Russian&lt;/a&gt; &lt;a href=&quot;http://science.webhostinggeeks.com/ava-na-vishe-pogreshno-skhva-en-programski-ezik-na-svetu-be&quot;&gt;Serbian&lt;/a&gt; &lt;a href=&quot;http://javascriptexperts.blogspot.com/2009/03/javascript-el-lennguaje-de-programacion.html&quot;&gt;Spanish&lt;/a&gt; &lt;a href=&quot;http://blog.tayfunsen.com/2009/02/javascript-dunyann-en-fazla-yanls.html&quot;&gt;Turkish&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/popular.html&quot;&gt;The World’s Most Misunderstood Programming Language Has Become the World’s Most Popular Programming Language&lt;/a&gt; (&lt;a href=&quot;http://www.ajaxjs.com/popular.htm&quot;&gt;Chinese&lt;/a&gt; &lt;a href=&quot;http://blog.continuum.cl/?p=18&quot;&gt;Spanish&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/survey.html&quot;&gt;A Survey of the JavaScript Programming Language&lt;/a&gt; (&lt;a href=&quot;http://jinsh2.blogspot.com/2006/12/survey-of-javascript-programming.html&quot;&gt;Chinese&lt;/a&gt; &lt;a href=&quot;http://steadypost.net/post/lecture/id/2/&quot;&gt;Korean&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/code.html&quot;&gt; Code Conventions for the JavaScript Programming Language&lt;/a&gt; (&lt;a href=&quot;http://pc.de/pages/kodeks-kanvencyi-javaScript&quot;&gt;Belorussian&lt;/a&gt; &lt;a href=&quot;http://news.csdn.net/n/20080114/112705.html&quot;&gt;Chinese&lt;/a&gt; &lt;a href=&quot;http://anton.kovalyov.net/javascript/conventions.html&quot;&gt;Russian&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/little.html&quot;&gt;The Little JavaScripter&lt;/a&gt; (&lt;a href=&quot;http://eineki.wordpress.com/2009/08/13/javascript-il-piccolo-programmatore-javascript/&quot;&gt;Italian&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/private.html&quot;&gt;Private Members in JavaScript&lt;/a&gt; (&lt;a href=&quot;http://javascript.crockford.com/zh/private.html&quot;&gt;Chinese&lt;/a&gt; &lt;a href=&quot;http://javascript.crockford.com/he/private.html&quot;&gt;Hebrew&lt;/a&gt; &lt;a href=&quot;http://d.hatena.ne.jp/brazil/20051028/1130468761&quot;&gt;Japanese&lt;/a&gt; &lt;a href=&quot;http://mulriver.egloos.com/4666528&quot;&gt;Korean&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/prototypal.html&quot;&gt;Prototypal Inheritance in JavaScript&lt;/a&gt; (&lt;a href=&quot;http://webhostingrating.com/libs/prototypal-inheritance-in-javascript-be&quot;&gt;Belorussian&lt;/a&gt; &lt;a href=&quot;http://blog.continuum.cl/?p=33&quot;&gt;Spanish&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/script.html&quot;&gt;JavaScript and HTML Script Tags&lt;/a&gt; (&lt;a href=&quot;http://www.dreamdu.com/blog/2008/08/08/script/&quot;&gt;Chinese&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/memory/leak.html&quot;&gt;JScript Memory Leaks&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/tdop/tdop.html&quot;&gt;Top Down Operator Precedence&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/style1.html&quot;&gt;The Elements of JavaScript Style, Parts One&lt;/a&gt; (&lt;a href=&quot;http://dancewithnet.com/2008/01/26/the-elements-of-javascript-style-part-one/&quot;&gt;Chinese&lt;/a&gt;) and &lt;a href=&quot;http://javascript.crockford.com/style2.html&quot;&gt;Two&lt;/a&gt; (&lt;a href=&quot;http://dancewithnet.com/2008/01/30/the-elements-of-javascript-style-part-two/&quot;&gt;Chinese&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.yuiblog.com/&quot;&gt;Yahoo! User Interface Blog&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2006/03/06/minification-v-obfuscation/&quot;&gt;Minification v. Obfuscation&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2006/04/04/synchronous-v-asynchronous/&quot;&gt;Synchronous v. Asynchronous&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2006/04/11/with-statement-considered-harmful/&quot;&gt;&lt;code&gt;with&lt;/code&gt; Statement Considered Harmful&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2006/06/01/global-domination/&quot;&gt;Global Domination&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2008/04/16/global-domination-part-two/&quot;&gt;Global Domination, Part Two&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2006/09/26/for-in-intrigue/&quot;&gt;&lt;code&gt;for&lt;/code&gt; &lt;code&gt;in&lt;/code&gt; Intrigue&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2006/11/13/javascript-we-hardly-new-ya/&quot;&gt;JavaScript, We Hardly &lt;code&gt;new&lt;/code&gt; Ya&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2007/04/10/json-and-browser-security/&quot;&gt;JSON and Browser Security&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2007/04/25/id-rather-switch-than-fight/&quot;&gt; IÂ’d Rather &lt;code&gt;switch&lt;/code&gt; Than Fight!&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2008/08/14/premature-standardization/&quot;&gt; The Only Thing We Have To Fear Is Premature Standardization&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://yuiblog.com/blog/2009/03/10/when-you-cant-count-on-your-numbers/&quot;&gt; When You Can’t Count On Your Numbers&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://www.yuiblog.com/blog/2010/12/14/strict-mode-is-coming-to-town/&quot;&gt; Strict Mode Is Coming To Town&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;a href=&quot;http://www.JSLint.com&quot;&gt;&lt;code&gt;JSLint&lt;/code&gt;: The JavaScript Verifier&lt;/a&gt; (&lt;a href=&quot;http://www.JSLint.com/lint.html&quot;&gt;Documentation&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://javascript.crockford.com/jsmin.html&quot;&gt;&lt;code&gt;JSMin&lt;/code&gt;: The JavaScript Minifier&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also have a &lt;a href=&quot;http://katieball.me/big-ass-resource-list/&quot;&gt;Big List&lt;/a&gt; over on at &lt;a href=&quot;http://github.com/roachhd&quot;&gt;GitHub&lt;/a&gt;. If you have something to add just &lt;a href=&quot;https://github.com/roachhd/big-ass-resource-list/fork&quot;&gt;Fork&lt;/a&gt; it and submit a &lt;code&gt;pull request&lt;/code&gt;.&lt;/p&gt;


  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/resources/learn-javascript-resources&quot;&gt;The JavaScript List&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 15, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[My Mini GitHub Deployment Workflow with Jekyll]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/workflow/mini-github-deployment-workflow"/>
  <id>http:/notepad/workflow/mini-github-deployment-workflow</id>
  <published>2014-11-14T00:00:00+11:00</published>
  <updated>2014-11-14T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#git" term="git" /><category scheme="http:/notepad/tags/#tips" term="tips" /><category scheme="http:/notepad/tags/#github" term="github" /><category scheme="http:/notepad/tags/#jekyll" term="jekyll" /><category scheme="http:/notepad/tags/#dev" term="dev" />
  <content type="html">
  
    &lt;p&gt;Grunt is always running when I’m writing or designing. It handles a few things, as defined in my Gruntfile.&lt;/p&gt;

&lt;p&gt;This is my process: &lt;br /&gt;
  - SVGMin to minify my SVG files and remove unnecessary code&lt;br /&gt;
  - SVG2PNG to make PNG copies of my SVG files&lt;br /&gt;
  - Sass to make authoring my stylesheets easier&lt;br /&gt;
  - Autoprefixer to prefix CSS properties and values as needed&lt;br /&gt;
  - Jekyll to build my site into static HTML files&lt;br /&gt;
  - Finally, a “watch” task to watch my files for changes and perform the above tasks&lt;/p&gt;

&lt;p&gt;Jekyll builds my site in a &lt;code&gt;_site&lt;/code&gt; directory, which is ignored by Git so that I don’t end up with duplicate content and unnecessary bloat on GitHub.&lt;/p&gt;

&lt;p&gt;When my post or design changes are in a state I’m happy with, I commit my changes and push to GitHub.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;“Simples”&lt;br /&gt;
- Meerkat&lt;/p&gt;
&lt;/blockquote&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/workflow/mini-github-deployment-workflow&quot;&gt;My Mini GitHub Deployment Workflow with Jekyll&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 14, 2014.&lt;/p&gt;</content>
</entry>


<entry>
  <title type="html"><![CDATA[Package Dependencies Done Right]]></title>
  <link rel="alternate" type="text/html" href="http:/notepad/reference/package-dependencies-done-right"/>
  <id>http:/notepad/reference/package-dependencies-done-right</id>
  <published>2014-11-13T00:00:00+11:00</published>
  <updated>2014-11-13T00:00:00+11:00</updated>
  <author>
    <name>Katie Ball</name>
    <uri>http:/notepad</uri>
    <email>katie@roachhd.com</email>
  </author>
  <category scheme="http:/notepad/tags/#tech" term="tech" /><category scheme="http:/notepad/tags/#geek" term="geek" /><category scheme="http:/notepad/tags/#dev" term="dev" /><category scheme="http:/notepad/tags/#tips" term="tips" /><category scheme="http:/notepad/tags/#dependencies" term="dependencies" />
  <content type="html">
  
    &lt;p&gt;“Best practices” is a term that is often misused and thus can be ambiguous in this context. For such reasons, it is important to make clear the goals behind this particular versioning scheme:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Strive to be forwards compatible with node.js (within reason) &lt;/li&gt;
  &lt;li&gt;Keep the dependencies of multiple installations of the same app cohesive &lt;/li&gt;
  &lt;li&gt;Reduce the surface area of potential bugs due to breaking changes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here is a sample package.json that uses the best practices we will discuss:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
  &quot;name&quot;: &quot;best-practices&quot;,
  &quot;description&quot;: &quot;A package using versioning best-practices&quot;,
  &quot;author&quot;: &quot;Charlie Robbins &amp;lt;charlie@nodejitsu.com&amp;gt;&quot;,
  &quot;dependencies&quot;: {
    &quot;colors&quot;: &quot;0.x.x&quot;,
    &quot;express&quot;: &quot;2.3.x&quot;,
    &quot;optimist&quot;: &quot;0.2.x&quot;
  },
  &quot;devDependencies&quot;: {
    &quot;vows&quot;: &quot;0.5.x&quot;
  },
  &quot;engine&quot;: &quot;node &amp;gt;= 0.4.1&quot;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;When specifying modules dependencies: use &lt;code&gt;1.0.x&lt;/code&gt; syntax&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Until recently, I was guilty of not following this guideline: I continued to use the &lt;code&gt;&amp;gt;= 0.2.0&lt;/code&gt; syntax illustrated above in the naive.package.json example. At first glance there doesn’t seem to be anything wrong with that style. You’re saying “If there are changes in the future I want them.” &lt;/p&gt;

&lt;p&gt;The problem arises because authors are conveying meaning in their versions. Not every version will be completely backwards compatible with the particular version you were using when you wrote your application. This is conveyed in the version string:&lt;/p&gt;

&lt;p&gt;e.g.: 0.3.18&lt;br /&gt;
- Major Version (0) &lt;br /&gt;
- Minor Version (3)&lt;br /&gt;
- Patch Version (18)&lt;/p&gt;

&lt;p&gt;Changes to the major and minor parts of the version mean that changes have happened, although there is no convention to convey they are breaking. Changes to patch versions are used to express that a fix has been made and it is (usually) safe to upgrade.&lt;/p&gt;

&lt;p&gt;Conversely, when using the &lt;code&gt;0.2.x&lt;/code&gt; syntax you’re saying: “If there are patch changes in the future I want them, but no minor or major versions.” Given the description of the meaning conveyed by each of the version components above this means you won’t &lt;strong&gt;be tearing your hair out over breaking changes in a module you depend on.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;__When specifying node versions in apps: use &lt;code&gt;0.4.x&lt;/code&gt; or &lt;code&gt;0.4.0&lt;/code&gt; syntax&lt;br /&gt;
__&lt;/p&gt;

&lt;p&gt;As with any sufficiently important problem, there are nuances to dependency management you should be aware of. One such nuance is the difference between specifying dependencies in an application vs. modules. &lt;/p&gt;

&lt;p&gt;Module authors encounter a much wider surface area of use cases, and as such should be more liberal in the versions of node.js they accept. On the other hand, application developers typically have no upstream dependencies and should be more explicit about what version of node.js they are expecting on the target system.&lt;/p&gt;

&lt;p&gt;Take advantage of devDependencies&lt;/p&gt;

&lt;p&gt;The package.json specification used by npm has an additional property for separately listing dependencies which are only required for development purposes. Why separate you might ask? Besides not having to download these dependencies from the registry when running in production, npm it is required if you wish to take advantage of a couple of neat npm features such as test:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;$ pwd
  /Users/charlie/GitHub/nconf

  $ npm test
  npm info it worked if it ends with ok
  npm info using npm@1.0.6
  npm info using node@v0.4.8
  npm info pretest nconf@0.1.9
  npm info test nconf@0.1.9

  &amp;gt; nconf@0.1.9 test /Users/Charlie/GitHub/nconf
  &amp;gt; vows test/*-test.js --spec

  (...)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If I had not specified my test library, vows, in the devDependencies section of the package.json for nconf I would have received:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;  $ npm test
  npm info it worked if it ends with ok
  npm info using npm@1.0.6
  npm info using node@v0.4.8
  npm info pretest nconf@0.1.9
  npm info test nconf@0.1.9

  &amp;gt; nconf@0.1.9 test /Users/Charlie/GitHub/nconf
  &amp;gt; vows test/*-test.js --spec

  sh: vows: command not found
  npm info nconf@0.1.9 Failed to exec test script
  npm ERR! nconf@0.1.9 test: `vows test/*-test.js --spec`
  npm ERR! `sh &quot;-c&quot; &quot;vows test/*-test.js --spec&quot;` failed with 127
  npm ERR! 
  npm ERR! Failed at the nconf@0.1.9 test script.

  (...)
&lt;/code&gt;&lt;/pre&gt;

&lt;h5 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h5&gt;

&lt;p&gt;Node.js is evolving rapidly: it has been less than a month since npm 1.0 was released which dramatically changed the way in which dependencies are handled. More importantly: the modules on-top of node.js critical to building scalable web applications are evolving even faster, making the best practices outlined here that much more important if you want to cope.&lt;/p&gt;

&lt;p&gt;Thanks &lt;a href=&quot;http://blog.nodejitsu.com/&quot;&gt;nodejitsu&lt;/a&gt; for ask your brilliant info.&lt;/p&gt;

  
  &lt;p&gt;&lt;a href=&quot;http:/notepad/reference/package-dependencies-done-right&quot;&gt;Package Dependencies Done Right&lt;/a&gt; was originally published by Katie Ball at &lt;a href=&quot;http:/notepad&quot;&gt;MY NOTEPAD&lt;/a&gt; on November 13, 2014.&lt;/p&gt;</content>
</entry>

</feed>
