<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>public/images/cheatsweets.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,3 @@
 *.log
-.DS_Store 
 *.pid
+.DS_Store</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -9,18 +9,36 @@ get &quot;/&quot; do
   cheats_size = $cheats_list.size
   current_cheat = $cheats_list[rand(cheats_size)]
 
-  @cookie = request.cookies[&quot;thing&quot;]
+  @cookie = request.cookies[&quot;last_cheat&quot;]
+
+  if current_cheat == @cookie
+    redirect &quot;/&quot;
+  end
 
   @cheats =  (`cheat #{current_cheat}`).split(&quot;\n&quot;)
 
-  @list = &quot;[{text: 'Curious George'}, {text: 'George of the Jungle'}, {text: 'Felix the Cat'}]&quot;
+  # Reset the cookie
+  set_cookie(&quot;last_cheat&quot;, current_cheat)
+  erb :index
+
+end
+
+
+get &quot;/query/:cheat&quot; do
+
+  current_cheat = params[:cheat]
+  @cookie = request.cookies[&quot;last_cheat&quot;]
+
+  @cheats =  (`cheat #{current_cheat}`).split(&quot;\n&quot;)
 
   # Reset the cookie
-  set_cookie(&quot;thing&quot;, current_cheat)
+  set_cookie(&quot;last_cheat&quot;, current_cheat)
   erb :index
+
 end
 
 
+#Exception handing for production environment
 configure :production do
 
   not_found do</diff>
      <filename>app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,11 @@ describe :app do
     get_it '/'
     should.be.ok
   end
-
+  
+  it &quot;should show page&quot; do
+    get_it '/query?cheat=emacs'
+    should.be.ok
+  end
+  
 end
 </diff>
      <filename>app_test.rb</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>public/.DS_Store</filename>
    </modified>
    <modified>
      <diff>@@ -1,90 +1,159 @@
-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
-	&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
-&lt;html&gt;
+&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
+    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
+&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 &lt;head&gt;
-		&lt;title&gt; Cheats &lt;/title&gt;
-		
-		&lt;style&gt;
-			* {
-		    margin: 0;
-		    padding: 0;
-		  }
-			body {
-         font-family: Verdana,Arial,sans-serif;
-         font-size:14px;
-			}
-			#cheat_block {
-       position:absolute;
-       top: 50px;
-       left: 250px;
-				
-			}
-			#cheat_name {
-				font-weight:bold;
-				margin: 20px 0px 30px 0px;
-			}
-			#cheat_info {
-				
-			}
-		&lt;/style&gt;
-    &lt;link rel=&quot;stylesheet&quot; href=&quot;/stylesheets/jquery.ui.autocomplete.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
-    &lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;/javascripts/jquery.dimensions.js&quot;&gt;&lt;/script&gt;  
-    &lt;script src=&quot;/javascripts/jquery.templating.js&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;/javascripts/jquery.ui.autocomplete.ext.js&quot;&gt;&lt;/script&gt;
-    &lt;script src=&quot;/javascripts/jquery.ui.autocomplete.js&quot;&gt;&lt;/script&gt;
-
-    &lt;script&gt;
-
-             
-      $(function() {
-         var list = &lt;%= @list %&gt; ;
-         $(&quot;input.autocomplete&quot;).autocomplete({
-          list: list,
-        match: function(typed) {
-          this.typed = typed;
-          this.pre_match = this.text;
-          this.match = this.post_match = '';
-          if (!this.ajax &amp;&amp; !typed || typed.length == 0) { return true; }
-          var match_at = this.text.search(new RegExp(&quot;\\b&quot; + typed, &quot;i&quot;));
-          if (match_at != -1) {
-            this.pre_match = this.text.slice(0,match_at);
-            this.match = this.text.slice(match_at,match_at + typed.length);
-            this.post_match = this.text.slice(match_at + typed.length);
-            return true;
-          }
-          return false;
-        },
-        insertText: function(obj) { return obj.text },
-        templateText: &quot;&lt;li&gt;&lt;span class='matching' &gt;&lt;/span&gt;&lt;/li&gt;&quot;
-      })
-         
-        .bind(&quot;activate.autocomplete&quot;, function(e, d) { console.log(d); })
-        .bind(&quot;cancel.autocomplete&quot;, function(e) { console.log(&quot;Cancelled&quot;); });
-    });
-
-    &lt;/script&gt;
+&lt;title&gt;CheatSweets&lt;/title&gt;
+
+&lt;style type=&quot;text/css&quot;&gt;
+/*&lt;![CDATA[*/
+      * {
+        margin: 0;
+        padding: 0;
+      }
+      body {
+        font-family: Arial,Verdana,sans-serif;
+        font-size:14px;
+        margin:0;
+        background:url(/images/cheatsweets.png) no-repeat top;
+      }
+ 
+      #wrap {
+        margin:0 auto;
+        width: 800px;
+      }
+
+      #last_viewed_cheat{
+       margin:30px 0px 20px 0px;
+      }
+
+      #cheat_block {
+       margin: 10px 0px 20px 0px;
+      }
+
+      #cheat_name {
+        font-weight:bold;
+        margin: 20px 0px 30px 0px;
+      }
+
+      #footer{
+        font-size: 0.9em;
+        margin-top: 30px;
+        padding: 5px 0px 20px 0px;
+        border-top: 1px solid #afa;
+      }
+/*]]&gt;*/
+&lt;/style&gt;
+
+&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/yui/2.6.0/build/yuiloader/yuiloader-min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
+
+&lt;!-- Combo-handled YUI CSS files: --&gt;
+&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://yui.yahooapis.com/combo?2.6.0/build/autocomplete/assets/skins/sam/autocomplete.css&quot; /&gt;
+
+&lt;!-- Combo-handled YUI JS files: --&gt;
+&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://yui.yahooapis.com/2.6.0/build/fonts/fonts-min.css&quot; /&gt;
+&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;http://yui.yahooapis.com/2.6.0/build/autocomplete/assets/skins/sam/autocomplete.css&quot; /&gt;
+
+&lt;script type=&quot;text/javascript&quot; src=&quot;http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;http://yui.yahooapis.com/2.6.0/build/animation/animation-min.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;http://yui.yahooapis.com/2.6.0/build/datasource/datasource-min.js&quot;&gt;&lt;/script&gt;
+&lt;script type=&quot;text/javascript&quot; src=&quot;http://yui.yahooapis.com/2.6.0/build/autocomplete/autocomplete-min.js&quot;&gt;&lt;/script&gt;
+
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+//&lt;![CDATA[
+      &lt;%
+        @cheats_list = $cheats_list.clone;
+        @cheats_list.shift;
+      %&gt;
+      YAHOO.example.Data =  {
+        arrayStates: [
+      &lt;%for i in @cheats_list %&gt;&quot;&lt;%=i.strip%&gt;&quot;,&lt;% end %&gt;
+        ],
+      };
+//]]&gt;
+&lt;/script&gt;
+
+
+&lt;script type=&quot;text/javascript&quot;&gt;
+  open_url =  function(sType, aArgs) {
+  try {
+    var cheat_code =  aArgs[2][0];
+    var url =  &quot;/query/&quot; + cheat_code;
+    window.location.href = url;
+    return false;
+ }
+ catch(e) {}
+};
+
+&lt;/script&gt;
+
+&lt;style type=&quot;text/css&quot;&gt;
+/*&lt;![CDATA[*/
+      #myAutoComplete {
+        width:15em; /* set width here or else widget will expand to fit its container */
+        padding-bottom:2em;
+      }
+/*]]&gt;*/
+&lt;/style&gt;
 
 &lt;/head&gt;
-&lt;body&gt;
-  &lt;div id=&quot;cheat_block&quot;&gt;
-  &lt;div&gt;
-     &lt;input type=&quot;text&quot; class=&quot;autocomplete&quot; autocomplete=&quot;off&quot; /&gt;
+
+&lt;body class=&quot; yui-skin-sam&quot;&gt;
+
+&lt;div id=&quot;wrap&quot;&gt;
+  
+&lt;div id=&quot;last_viewed_cheat&quot;&gt;
+  &lt;% if !@cookie.nil? and @cookie != &quot;&quot; %&gt;
+  Last viewed cheat was: &lt;a href=&quot;/query/&lt;%= @cookie %&gt;&quot; &gt;&lt;%= @cookie %&gt; &lt;/a&gt;
+  &lt;% end %&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;cheat_block&quot;&gt;
+ 
+  &lt;div id=&quot;myAutoComplete&quot;&gt;
+    &lt;input id=&quot;myInput&quot; type=&quot;text&quot; autocomplete=&quot;off&quot; /&gt;
+    &lt;div id=&quot;myContainer&quot;&gt;
+    &lt;/div&gt;
   &lt;/div&gt;
-	&lt;div id=&quot;cheat_name&quot;&gt;
-	&lt;%= @cheats[0] %&gt;
-	&lt;/div&gt;
-	&lt;% @cheats.shift %&gt;
-	&lt;div id=&quot;cheat_info&quot;&gt;
-	&lt;%= @cheats.join(&quot;&lt;br /&gt;&quot;) %&gt;
-	&lt;/div&gt;
+
+  &lt;div id=&quot;cheat_name&quot;&gt;
+    &lt;%= @cheats[0] %&gt;
   &lt;/div&gt;
 
-  &lt;div style=&quot;float:clear&quot;&gt;
-     Last viewed cheat was: &lt;%= @cookie %&gt;
-   &lt;/div&gt;
- 
-&lt;/body&gt;
+  &lt;% @cheats.shift %&gt;
+  &lt;div id=&quot;cheat_info&quot;&gt;
+    &lt;%= @cheats.join(&quot;&lt;br /&gt;&quot;) %&gt;
+  &lt;/div&gt;
+
+&lt;/div&gt;
+
+&lt;div id=&quot;footer&quot; &gt;
+  &lt;span style=&quot;float:left;&quot;&gt;This is Digital Codes!&lt;/span&gt; &lt;span style=&quot;float:right;&quot;&gt;anil@digitalcodes.org&lt;/span&gt;
+&lt;/div&gt;
+
+&lt;/div&gt;
+&lt;script type=&quot;text/javascript&quot;&gt;
+//&lt;![CDATA[
 
+      YAHOO.example.BasicLocal = function() {
+        // Use a LocalDataSource
+        var oDS = new YAHOO.util.LocalDataSource(YAHOO.example.Data.arrayStates);
+        // Optional to define fields for single-dimensional array
+        oDS.responseSchema = {fields : [&quot;state&quot;]};
 
+        // Instantiate the AutoComplete
+        var oAC = new YAHOO.widget.AutoComplete(&quot;myInput&quot;, &quot;myContainer&quot;, oDS);
+        oAC.prehighlightClassName = &quot;yui-ac-prehighlight&quot;;
+        oAC.useShadow = true;
+
+        oAC.itemSelectEvent.subscribe(open_url); 
+
+        return {
+       oDS: oDS,
+       oAC: oAC
+        };
+      }();
+//]]&gt;
+&lt;/script&gt;
+&lt;/body&gt;
 &lt;/html&gt;
\ No newline at end of file</diff>
      <filename>views/index.erb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>public/javascripts/jquery.dimensions.js</filename>
    </removed>
    <removed>
      <filename>public/javascripts/jquery.templating.js</filename>
    </removed>
    <removed>
      <filename>public/javascripts/jquery.ui.autocomplete.ext.js</filename>
    </removed>
    <removed>
      <filename>public/javascripts/jquery.ui.autocomplete.js</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>429ba84108cd3b28325224e84deef5254d948fdf</id>
    </parent>
  </parents>
  <author>
    <name>Anil Wadghule</name>
    <email>anildigital@gmail.com</email>
  </author>
  <url>http://github.com/anildigital/cheatsweets/commit/a9e8f2b95b88a5d5c7e63a1a349c34ad1c547bda</url>
  <id>a9e8f2b95b88a5d5c7e63a1a349c34ad1c547bda</id>
  <committed-date>2009-01-11T11:41:34-08:00</committed-date>
  <authored-date>2009-01-11T11:41:34-08:00</authored-date>
  <message>More improvements in cheatsweets</message>
  <tree>52991d8530e7a045de5e96b8ce2b70bd8fb9e886</tree>
  <committer>
    <name>Anil Wadghule</name>
    <email>anildigital@gmail.com</email>
  </committer>
</commit>
