Summarized using AI

- Xiki: the Rubyfied Next-Generation Shell

Craig Muth • November 01, 2012 • Denver, Colorado • Talk

Introduction

In this presentation at RubyConf 2012, Craig Muth introduces Xiki, a next-generation shell console designed to enhance the user experience for executing commands in an interactive and visually appealing manner. Xiki aims to revolutionize traditional shell consoles that have remained essentially unchanged for decades.

Key Points

  • Xiki's Principles: Muth emphasizes three guiding principles: 1) A large editable plain text area, 2) The ability to type commands anywhere, and 3) Freedom to input any text or command. These features differentiate Xiki from traditional shell consoles, which are more restrictive.
  • User Interaction Enhancements: Xiki allows users to type commands in various locations within the interface, edit commands, and run them dynamically without being tethered to a single command prompt. Users can also structure outputs, add notes, and directly interact with code and databases, all through simple inputs.
  • Rich Integration with Ruby: As Xiki is implemented in Ruby, it permit users to create new commands using straightforward Ruby classes. Features include: executing Ruby code, querying databases using SQL, and seamless integration with web technologies like HTML and JavaScript, enhancing the development workflow.
  • File Management and Notes: Xiki allows users to save commands and notes to reusable text files, which can be revisited or shared, fostering better documentation practices.
  • Extensibility through Menus: Users can easily create custom menus and commands, optimizing workflows based on their specific needs. Muth demonstrates adding a menu dynamically via typing, emphasizing the intuitive design of Xiki.
  • Comparison and Future Outlook: Muth discusses Xiki's conceptual roots in wikis and acknowledges existing shell tools while expressing a vision for how Xiki could expand, including integration with modern features such as mobile interfaces and advanced text processing capabilities.

Conclusion

Craig Muth's Xiki presents a marked evolution of the traditional command-line interface by focusing on usability, flexibility, and powerful integrations with Ruby. The innovations in Xiki not only augment shell capabilities but also serve as a springboard for further interactive tools in programming and development workflows, with plans to enhance features and community engagement.

- Xiki: the Rubyfied Next-Generation Shell
Craig Muth • Denver, Colorado • Talk

Date: November 01, 2012
Published: March 19, 2013
Announced: unknown

The shell console hasn't changed in 40 years. Time for an update. Use Ruby to make commands that have menus, that you can navigate with the keyboard or your mouse. Type commands anywhere, not just at the bottom prompt. Control your rails apps, web browser, databases, and other tools. Type wiki elements like headings and bullet points. Xiki is implemented in ruby. Make new commands out of simple ruby classes.

RubyConf 2012

00:00:15.679 all right I'm going to go ahead and get it started this is a presentation about
00:00:20.960 ziki ziki is like a shell console but better the homepage is zi. org that's x
00:00:26.519 i k.org the Z the x is pronounced like a z uh this window that I'm doing the
00:00:33.200 presentation from is ziki enabled and the whole presentation is going to be a
00:00:38.320 live demo of ziki thank
00:00:44.440 you uh so the uh three guiding principles of ziki are uh very
00:00:50.280 straightforward you need an editable uh plain text area and uh you can type whatever you
00:00:56.960 want you can type wherever you want and you can type whatever you want uh ziki does a lot of stuff and can be
00:01:03.079 used in uh many different ways but if you get these three points and their implications then you get
00:01:09.720 ziky so this window satisfies these three points it's a big editable plan
00:01:14.799 text area you can see it's plain text when I toggle the formatting the formatting is optional and just based on
00:01:21.600 patterns uh point two you can type wherever you want I could type up here I
00:01:27.840 can type up here I can type here and three you can type whatever you want
00:01:33.759 I could type pigs fly and no one can stop me from doing it so are these three points stating the
00:01:43.000 obvious uh let's take a look at uh a standard text editor these three points apply to pretty much every text editor
00:01:50.240 uh editable text you can type whatever you want wherever you want so show of hands who thinks uh these three points
00:01:56.880 are uh stly obvious Co I I do uh in the context of text
00:02:03.920 editor windows they're very much stating the obvious um but how about in the context of other
00:02:10.879 things like how about in the context of a shell console are these three points stly obvious uh well with point one uh
00:02:17.400 shell consols are pretty much plain text uh areas but you can't just edit whatever you want uh you can't type
00:02:24.959 wherever you want you're limited to the single active prompt at the bottom and
00:02:30.040 you can't type whatever you want uh you have to type shell commands if you want to do anything useful so in the context of shell
00:02:37.120 consoles these three points very much are not stating something that's obvious so why do I say that ziki is
00:02:44.319 like a shell console but better uh well we all know how shell consoles work you
00:02:49.440 type commands at the single active prompt at the bottom you press enter and the results are appended read only and
00:02:57.000 when you're done you've got a bunch of read only output and you can use the up arrow and controlr to rerun commands
00:03:05.879 Etc uh this isn't bad shell consoles work pretty well but let's see if we can improve on this a little bit what would
00:03:11.519 happen if we applied these three guiding principles of ziki to Shell consoles uh editable PL text area type wherever type
00:03:20.280 whatever what if in your shell console instead of only being able to type commands at the prompt at the bottom you
00:03:27.360 could make a prompt anywhere just by typing a dollar sign what if you could double click on a
00:03:32.560 command to run it or move your cursor onto a command and type control enter to
00:03:39.239 run it what if you could double click again to to collapse a command and
00:03:44.480 double click again to rerun a command as many times as you wanted to or move your cursor onto the command and type control
00:03:52.760 enter to rerun it and to
00:03:57.879 collapse what if you could edit commands and collapse them and rerun
00:04:03.720 them what if when you ran commands you could optionally type uh letters to incrementally narrow down the
00:04:10.959 output to just the part you car about what if everything was editable so
00:04:16.880 you could edit the part of the output that you don't care about and you could add arbitrary notes like check out these
00:04:24.520 files or uh fix this one
00:04:31.160 oops fix this uh one uh what if everything was plain text
00:04:38.440 so you could save the stuff that you type into files and use the files later
00:04:43.960 to look at your notes and to rerun the commands or share the files with other people so that they can look at your
00:04:49.840 notes and they can run the commands uh what if you could see commands in specific directories that
00:04:57.199 you've run and typed and narrow down and uh run commands rather than the uh you know total lists of commands you run in
00:05:04.039 all directories like with bash what if you could uh type other
00:05:11.600 stuff like Ruby code what if you could type Ruby code
00:05:16.880 and double click to see the output what if you could type Ruby
00:05:22.639 methods on classes that you create and double click to see the output
00:05:29.880 what if you could type words that you could map two classes that you create and double click on them to invoke the
00:05:36.800 class and show the output what if you could Define new
00:05:42.240 words just by dragging simple Ruby files into your home directory into a
00:05:49.160 directory named menu
00:05:59.960 uh Zoom back out and then what if you could type the name of the class you just Dragged In and double click to
00:06:07.039 invoke the class and see the output what if you could type paths to files and
00:06:12.560 then uh navigate the file system with your mouse or with the keyboard and open
00:06:20.599 files what if you could type SQL statements and double click to see the
00:06:26.680 output and type to narrow down or edit the uh text in line and double
00:06:34.120 click again to save back to the
00:06:39.960 database thank you what if you could type Ruby code in the context of other Ruby apps like rails for
00:06:46.960 example and double click and if the output is active record why not be able
00:06:52.520 to double click on that and save and why if what if the uh
00:07:01.440 what if the the code ran in the actual server so you could interact with the request in the user session unlike IRB
00:07:07.800 in rails console what if you could type URLs and double click to bring them up
00:07:13.800 in the web browser um let me uh make that a little
00:07:19.840 smaller so you guys can see uh ziky behind
00:07:27.759 it what if you could type J JavaScript and double click on it to run it in the context of the browser can see it
00:07:34.039 updating over here on the left what if you could type Dom and double click on that to drill into the uh browser into
00:07:40.240 the dime and make changes to the uh
00:07:46.680 file you can see it blink up here when I edit
00:07:52.479 it what if you could search in the Dum and double click and drill into a
00:07:58.879 specific section and edit it what if you type
00:08:05.440 bootstrap and use a wiish uh simple simple syntax to make
00:08:11.159 headings and double click to see a preview and sentences and what if you could make uh
00:08:18.840 multiple sections which is kind of The Sweet Spot of
00:08:24.159 bootstrap and double click to see that and what if you could uh make multicolumn layouts which uh really is
00:08:31.039 The Sweet Spot of bootstrap just by sandwiching sections together what if with bootstrap and
00:08:36.599 other Frameworks you could double click and be guided through uh some examples
00:08:42.360 that you could that you could use as uh beginning points so get started really quickly and then edit
00:08:48.000 them uh and see the changes what if you could create and run rails
00:08:53.880 apps uh using menus and generate stuff like resources and be shown default
00:09:00.720 values that you could get started with what if you could type node and other uh
00:09:06.600 app servers and be given a default controller and have it start up a server for you and then when you uh make
00:09:12.560 changes have it uh update the server and show you in your browser what if you could R uh review
00:09:19.040 and navigate uh git diffs and navigate to the files and uh
00:09:27.000 group a couple files together and commit them what if you could navigate and run unit
00:09:33.519 tests and double click to jump to the point where it failed what if you could browse and edit
00:09:40.120 databases like MySQL mimc mongodb uh browser local storage and
00:09:45.600 update them what if when a menu didn't exist and you double clicked on it it
00:09:51.040 would walk you through creating the menu in line uh this first option says create
00:09:56.920 here let's double click on that it's telling we can just create a couple menu items in line and it tells us a keyboard
00:10:03.160 shortcut which you can see if I wrap that we can type to save the menu so let's add
00:10:09.200 uh eggs and milk and type that keyboard shortcut and then if we type shopping
00:10:16.279 lists uh anywhere that menu is defined what if when you double click on
00:10:22.320 a menu that doesn't exist you have an option to create a class which is the second option here and it gives you a
00:10:29.519 default class and tells you keyboard shortcut to type and then the next time you expand the menu it invokes that
00:10:36.320 code what if you could put uh Wiki elements under menus by using uh special
00:10:42.760 characters like greater than for a heading uh dash for a bullet point more
00:10:47.959 space for nested bullet points Etc what if you could type ziky in your
00:10:53.440 web browser and navigate menus with a mobile like interface
00:11:00.800 here's one with a bootstrap layout what if you could do fun stuff like type a few uh musical
00:11:07.639 notes and uh send them to a midi app like Garage
00:11:13.920 Band and what if you could even randomize notes using a little DSL
00:11:29.639 you can see it's randomizing the key change when it gets to the
00:11:42.920 end you can do all this with
00:11:53.040 ziki thanks uh all right so let's take a look at how you install ziki since ziki
00:11:58.200 requires only an edit text area its ideal environment to run in is a text
00:12:04.440 editor or an IDE uh really anything with a big editable text area that's extendable
00:12:11.680 that usually means a text editor or sometimes an IDE so ziki is like a shell console but ziky really is a text editor
00:12:19.079 plugin most of the time uh so you can ziy enable your text editor you might be wondering why not
00:12:25.160 make it an actual uh binary shell like bash or like iterm perhaps and that uh
00:12:32.600 can be interesting but you kind of have two options you can extend existing editors like ziky does or you could
00:12:38.839 write your own and then you know deal with file management deal with keyboard shortcuts deal with OS integration um
00:12:44.440 but you probably wouldn't be able to do that as well as existing text edit editors already do it in existing IDs so
00:12:50.680 to me option one is the the clear winner uh this augmenting existing tools I think is an interesting path to to
00:12:58.120 explore versus competing with them uh and since ziki runs into a text
00:13:03.600 editor it can take advantage of text editor features that consoles can't really do like saving stuff into text
00:13:08.920 files to use later doing searching replacing on the output of commands or on the commands themselves before you
00:13:15.240 run them uh multi-line input is awkward to do in in Shell consoles but in a uh menu
00:13:22.880 that you want to pass multiple lines to in a text area that's not an
00:13:28.000 issue uh uh undo is interesting to have in the context of running commands swapping lines this is something that's
00:13:34.480 not obvious at first uh here's the Syntax for running a couple commands in
00:13:40.560 the uh uh in in these directories so you can double click to run these and then
00:13:45.600 if you want to run them in a different directory you can just make this uh directory be the root this is the uh say
00:13:51.440 it's your produ your remote production site then you can double click on these to run the same commands and the same
00:13:56.639 mirror directory structure on a remote server or another local directory the supported
00:14:01.959 text editors uh right now the the most supported and the most recommended is aquamax if you haven't heard of aquax
00:14:07.320 it's like emac but it's super Mac friendly it's based on emac but it uh
00:14:13.160 lets you do command Q to quit command C and command VI to copy and paste uh it has a friendly menu bar it lets you uh
00:14:22.160 hold down shift and select and type to replace the selection all the Mac ways
00:14:27.560 of editing you'll be totally comtable in it uh you can use the mouse uh if you're
00:14:32.759 not if you're not on the Mac or you don't or you're familiar with emac you might want to use just Bas Emax uh aquamax is actually 95% based on emac
00:14:41.240 but way easier to get started with uh and the for the emac versions of of ziki
00:14:48.720 it uses this awesome e forrar Library written by Rubik who's one of the core
00:14:54.360 Ruby guys and uh it's really amazing it uses it for
00:14:59.920 the bridge between Ruby and um and
00:15:06.480 emex there's experimental support for Vim here is uh me and Mac Vim typing IP
00:15:14.639 and then or IP and double clicking on it you can see it shows the IP
00:15:20.880 underneath uh there's also experimental support for COD mirr which is a really nice uh browser
00:15:28.399 based Ed I can uh type IP and double click on it or control enter I can type
00:15:34.440 uh a heading and begin it with a dollar sign I'm sorry with the angle bracket a greater than sign and it formats
00:15:42.360 it uh there's a guy in uh Southern California who wrote most of a red car plugin for ziki which is which is
00:15:49.079 awesome uh other uh editors Sublime some guy on the internet offered a $500 uh award for the first ziky support
00:15:57.639 for Sublime which I didn't know all the details that but I thought that was really cool textmate there's been a little progress on that Ruby mine is
00:16:03.680 another obvious Target for being able to type zicky stuff in so the actual install instructions if
00:16:11.600 uh if I'm hooked up to the Internet which I guess I'm not I could go to the GitHub homepage uh here I'll just go to
00:16:17.440 the readme file in the ziky homepage and insert all the contents and use the mark
00:16:22.839 down menu and then double click on that and that'll render it in the browser
00:16:29.360 so these are the install instructions you'll find on the GitHub page uh you can pseudo Jim install ziky now as of a
00:16:35.880 couple months ago with some awesome uh help from some collaborators have got that working it made the install for
00:16:41.720 ziki way way nicer than it was before um as soon as you run the gem
00:16:47.240 install you can you can type ziky on the command line that'll give you just the base command line interface which we'll
00:16:52.560 look at later then you just uh run a couple commands add a couple lines to conf big
00:16:59.160 file and if things go well you'll be up and running if not join the Google group and um tell us your problems and we'll
00:17:05.839 get you through them so once you've got ziki installed how do you use it uh the easiest use
00:17:12.600 case is to use it to replace or augment your shell console and as you use
00:17:18.559 commands you'll probably be tempted to Type in little notes because you can and you'll start to to build up
00:17:25.160 notes um experimenting with a web browser is a really fun way sort of like you saw in the intro
00:17:31.679 which is similar to what you would do with Firebug or the uh Chrome console but when you're when you reload the page
00:17:37.120 it doesn't all go away it stays in a text file so you can use it again later and build up uh
00:17:42.640 notes trying out new tools and Frameworks is kind of my favorite uh use case for ziki you should be able to uh
00:17:49.679 type node mango bootstrap SVG any any interesting uh framework you want on a
00:17:55.520 blank line and double click and be guided through in in a few seconds getting up and running with making
00:18:00.960 things work and then being able to look at what you made and it's possible to use ziky as uh
00:18:07.000 an IDE to navigate files run unit tests uh run shell consoles well I've got a
00:18:12.440 section on that I don't know if we'll get to it I don't know if we'll have enough time
00:18:18.159 um if you want to add ziki support for your editor and you know how to extend
00:18:23.600 your editor you totally should uh the way that works is you just have your editor shell out to the ziky Shell
00:18:30.559 command so for example if uh your user types IP you
00:18:37.720 write a plugin basically that goes in and intercepts the double click or the control enter and then you
00:18:43.520 programmatically shell out to uh the ziky command and you pass it IP the name of the menu and then you just grab the
00:18:50.600 output programmatically and insert it underneath andent it over two spaces for multi-line uh examples
00:18:59.440 uh same thing for the first level you just insert that underneath on the second level you just climb the tree
00:19:05.640 because really when you're when you're the user is clicking on uh pets it's
00:19:10.679 really animals pets right just kind of like a file directory so you pass animals pets to the ziky command and you
00:19:19.760 grab the output and you insert it underneath so if you know how to extend your editor it's not it's not tough to
00:19:25.600 get basic ziky support so now let's uh take a look at the
00:19:31.120 inspiration for ziki I won't dwell on this too long but belated introduction my name is Craig Muth I've been working
00:19:36.559 on ziki off and on for about 11 years I started out in lisp and then about seven years ago I ported to uh Ruby and that
00:19:44.559 gave me I think about a 3X productivity increase uh lisp is is great for a lot
00:19:49.880 of stuff but Ruby is great for what ziki does in particular with the text processing and the and the dynamic uh oo
00:19:57.080 stuff so ziki starting get some adoption which is which is amazing and awesome in the last few weeks we've gotten a lot of
00:20:03.080 views on the latest uh ziki screencast uh a lot of people joining the user group uh a lot of people uh tweeting and
00:20:10.760 following the the ziki user we were number one one Hacker News for about a day which really helps um we've recently
00:20:17.520 started shifting Focus toward adoption which is you know what that Gem and stall ziki is all about we're going to continue to make it easier to
00:20:25.039 install um and get up and running with ziki stands for uh executable Wiki it's
00:20:32.480 very Wiki inspired first time I saw a Wiki uh many years ago I was kind of
00:20:37.640 Blown Away by the Simplicity of it and how it broke all the
00:20:42.880 rules and uh how it was a super simple solution that was way simpler than other
00:20:49.600 Alternatives like word docs and file shares and content Management Systems which it kind of competed with and still
00:20:54.679 sort of does um if you're going to implement a Wiki yourself it's actually
00:21:00.799 kind of easy I don't know if you've done it you just have make a big text area and you search and replace for you know whatever uh equals. star and add H1 tags
00:21:09.600 around it and show it in the browser um uh you persist things to one giant text
00:21:15.320 field easy application design uh since it's just a big text area you just save it reopen it all your pages are on in
00:21:22.200 one name space uh very simple very elegant this uh Wiki idea of just a big
00:21:28.600 text area uh is kind of spreading Twitter is a prominent
00:21:34.240 example uh in Twitter you have a little text area that you can just go to town with if you want to refer to someone you
00:21:39.840 just put at and then their username you don't type a button or rightclick um if you want to do a
00:21:46.880 hashtag you just put a pound it's simple users get it users are getting smarter
00:21:52.120 these days they're not using their CD trays for uh coffee anymore um and once
00:21:58.679 you've done this you know users can learn from other users they can see a tweet and they can know how to do it and you can uh like Twitter did you can add
00:22:05.240 gooey stuff uh on top of the the commands like in Twitter if you type a a
00:22:10.559 username it'll expand out afterward so it's kind of a hybrid between gooey stuff and um and text and uh crud
00:22:19.520 becomes trivial if the user wants to delete this they just select it and delete they want to copy and paste they just copy and paste Etc
00:22:29.120 so ziki is really applying this Wiki idea of just a big text area with these
00:22:34.600 characters with special meaning to executing things that's really Zik's kind of goal so in wikis you make a
00:22:41.080 bullet point by beginning the line with uh Dash space in ziky you run a command
00:22:48.240 by beginning the line with dollar sign space word Cunningham is the the guy who
00:22:53.279 invented the wiki he's a really amazing guy I've had the honor of of chatting with over the last few months and and brain storming about ziki and also some
00:23:00.440 of the stuff that he's been working on which which is awesome you should check out this is a quote uh from from him you
00:23:06.640 don't have to uh read the whole thing I'll just highlight some of my favorite Parts I was obviously thrilled uh that
00:23:13.880 he gave this to me um so next
00:23:19.039 topic let's talk about creating the menus in ziki which is the funnest part of ziki these last three are really
00:23:25.200 short uh not sure if we'll get through all of them
00:23:30.600 so using the existing menus uh like bootstrap and rails is is pretty good in ziky it's pretty fun but making your own
00:23:37.320 is where zy really gets interesting because it's super simple and there's a super uh simple um uh
00:23:45.919 API so the words that you type like rails and double click on those are called zicky menus uh if you weren't uh
00:23:52.720 following my terminology uh so when your interface is text you can just type your
00:23:59.840 interface and by that I mean that when you mock something out you're just typing nested menus and indenting with
00:24:05.919 two spaces and that is the same thing as your end product so the distinction between mocking stuff out and
00:24:11.480 implementing the actual menu uh goes away so let's make an example um Subway
00:24:17.600 menu you already saw how we dragged a class into the menu directory in your home
00:24:22.640 directory um now let's do it a different way there are many ways to create a menu pretty much most things that you can
00:24:27.960 think of is seem obvious it seem to go along with this free form text uh zicky way of doing things if it seems obvious
00:24:34.880 it probably works uh so typing Subway seems pretty obvious let's try that and
00:24:40.240 double click on it it's telling us there's no Subway menu yet and it gives us some options uh let's pick the first one
00:24:47.480 create here and as we saw in the intro it tells us hey just type a few things and type this keyboard shortcut so let's
00:24:53.880 give it a couple items uh station lists and let's give it an about which will
00:24:59.960 sort of be documentation um and then we'll type the Str out it told us and then the Subway menu is there and we can use it
00:25:07.159 anywhere including the web interface uh so all that happened here behind the scenes is it created a file
00:25:14.159 in the menus directory in your home directory the menu directory uh named subway. menu and it's just a text file
00:25:21.720 and it has this contents in it I'll I'll open the actual file so I don't confuse you so this is the text file that's the
00:25:29.520 contents this is just a ziky way of showing file contents and you could edit that and it would update the
00:25:36.279 menu uh one of the interesting things about making text based menus is you can
00:25:42.799 in dicki is you can add things incrementally like let's say we wanted to do those first things and figure out
00:25:48.399 what the menus should be and now we want to add something underneath about uh which is just some information we can
00:25:53.840 use our Wiki syntaxes like greater than can put urls so we can type that
00:25:59.279 underneath and we can type the shortcut to save the menu and now we can actually use this menu and then the station list
00:26:05.480 menu if we want to add an implementation what's an obvious thing to try there let's just try to double click on it and see what
00:26:10.640 happens it tells us the menu does nothing yet and gives us an option to create a class and if we double click on
00:26:16.440 that it gives us a default implementation and tells us to type of keyboard shortcut and now the uh menu
00:26:22.880 run some re code and we could go use a gem to make a web service call to get an
00:26:28.480 station list and we can jump back and edit the file um one more example let's make a
00:26:35.039 menu to browse my SQL that is pretty much just like this menu uh so it'll
00:26:40.840 show you all your tables and then you could go in and show the contents of of a table uh I've already got in my SQL
00:26:46.480 menu so let's call this your SQL uh so if we double click on that it
00:26:53.080 tells us there's there's no menu and we can click here to make a class but let's do do it a simpler way let's
00:27:00.919 go uh make a file uh in the home directory so it'll
00:27:07.320 just be a class with the same name as the menu class your
00:27:12.840 SQL uh I'll save it in the home directory in the menus directory the menu directory and it's just a standard
00:27:20.159 Ruby class with no dependencies so it's called your SQL
00:27:27.000 RB and and the convention is there just needs to be one
00:27:32.159 class menu and whatever you return will be
00:27:37.960 returned by the class and the class menu is named menu so if we save that and then double
00:27:43.760 click on this it will run the code it's that simple um now let's make
00:27:50.399 it show the list of tables like the real one so we can I'll
00:27:56.320 go consult my notes for my SQL and I'll find the command to run that so here's a command
00:28:02.760 that shows all all the tables can double click to run it make sure it works um I'll copy it and then uh stick
00:28:10.120 it up here in back ticks uh you could use a gem of course but I'm lazy so let's collapse and uh
00:28:16.159 rerun and we can see it works probably want to get rid of this but we won't bother for demonstration purposes uh now if you double click on
00:28:23.120 one of these we want to show the menu right I mean show the table rather so
00:28:28.640 let's go grab the SQL statement for showing a table put it down here and we'll make uh a parameter up here and
00:28:36.159 the uh menu will be passed in as a parameter which is kind of an obvious way of doing it uh the parameter is
00:28:42.159 going to be a table let's make it optional and we'll say We'll
00:28:48.519 return this if there's no uh table yet otherwise we'll go down
00:28:54.799 here and we'll run this and we'll pass pass in the table to the statement so
00:29:02.760 now if we run this and expand it shows the results if this was real you'd
00:29:08.600 probably want to go search and replace up here to uh put slashes at the end and probably like dashes the beginning just
00:29:14.480 because it looks more gooey like that way here is a example of using a ziki
00:29:22.799 menu in uh combination with a browser menu this is kind of like a picking your
00:29:28.120 character on the Wii um so it's just when you run these it's running Ruby code that just goes
00:29:34.279 and tells the browser to run stuff uh you can pick the hair unicorn hair is the
00:29:41.240 coolest and uh one interesting thing about uh making text only menus is you can add an item if you know it's going
00:29:46.760 to work or if you want to make it work later
00:29:51.840 uh you can just add it in and then double click if that guy ever knocks on your
00:29:57.679 your door and you open it and you see him just turn around and run trust
00:30:02.799 me uh here here's an example of uh a menu uh that does some shoes
00:30:13.320 stuff you can uh obviously call any rby code you want and use other libraries so
00:30:20.080 here's a a shoes program that will pop something up you can encapsulate that into a uh menu that just uh takes you
00:30:29.799 know stuff from ziki and displays it in a gooey way um you can type ziky menu name in
00:30:39.919 your browser uh we saw this earlier so I won't do it again to to browse in a
00:30:46.200 mobile like way so shell consoles are uh referred to as repel most of you
00:30:52.159 probably know that term it means redevelop print Loop which usually means stuff gets appended to the bottom and
00:30:58.120 you type in hit enter uh ziky I've been calling a renew interface because you read a Val
00:31:04.360 and then it nests under don't Google that I just made it up you won't find it
00:31:11.639 um side note every time you can use the mouse in ziky you can also use the
00:31:17.360 keyboard the mouse is completely optional I've gotten people kind of upset about the mouse use but totally
00:31:24.679 optional uh this is an example of extending um uh a menu by subclassing so we've
00:31:33.000 seen the boot strap menu that will let you make Pages
00:31:41.960 uh so what if you want a version like that but that shows your logo at the top I made a uh ziky strap logo that does
00:31:50.399 the same thing but just adds the uh the logo zy strap menu and if you look at that class it's just extending bootstrap
00:31:57.960 making a string and uh appending it to the output of this function very
00:32:03.960 standard OA of uh extending things different ways of uh creating
00:32:11.200 menus here is a class with a string that
00:32:16.440 uh let me actually make this a little bigger so you can you can see all of
00:32:21.679 it can you guys see that it's a little small huh um this is a class with a string that return from the menu and
00:32:29.159 when you run it ziki will handle uh calling the returning the right thing so first it you can see down here it
00:32:35.120 returns fruit and nuts and then if you drill into nuts it will uh we'll call that so it
00:32:41.880 lets you declare menus without having to handle all of the ifls here is a pi menu with a uh a
00:32:51.559 method at the top that will print out some items and when you double click on
00:32:56.720 it it'll return the top items and then notice down here the bottom one starts with a DOT that's your way of telling
00:33:02.440 ziki you want that to be a method call so if you double click on nuts at the bottom it will invoke this method named
00:33:08.399 nuts and return insert the output here are two menus that work
00:33:14.799 together so there's a menu file and then there's a a drinks Ruby file that will take over uh
00:33:22.639 if the menu file can't handle it so if you uh if you drill into one of these uh
00:33:30.000 there's no child of smoothie up here so it will delegate to the class uh you can also use you can also
00:33:36.519 make menus with uh JavaScript and python code as
00:33:41.720 well um here is a uh very simple Ruby
00:33:46.880 class with not only no ziki dependencies like the other ones but no conventions so it's just a simple Ruby class with uh
00:33:53.519 two class methods and ziki will look at that when you double click on drinks and it'll say like oh this is all I have so
00:33:59.880 I'll just use uh the two methods as menus and the simplest way of making a
00:34:07.120 menu is in one line you say hey uh if someone clicks on a line that starts
00:34:12.240 with a exclamation mark or something anything that matches a regex you just
00:34:17.679 uh call this pass the regex and call a block that runs uh when the user double
00:34:22.720 clicks on that um okay really quick taking notes
00:34:29.560 uh with ziki ziki is a a general purpose note uh taking tool which is pretty pretty uh decent um in addition to the
00:34:37.000 other things that that zy is you just make text files at end in. notes and then you add headings so why I go over
00:34:43.679 here and make a new uh notes file for JavaScript we'll say we'll say like
00:34:49.520 running JavaScript on command line which is a dollar sign JS and then uh a file
00:34:59.280 uh and you know you can make notes for whatever and once you've made notes with
00:35:04.359 these headings these uh headings let you search in them you can also add uh bunch
00:35:12.599 of other stuff like Google searches uh just by typing Google sluh JavaScript and if you double
00:35:21.079 click on that it'll open the browser I think I'm not connected to the internet um we've seen uh that you can add URL
00:35:28.880 files so uh once you've made a file like this you can type uh to outline it's a
00:35:34.079 keyboard shortcut contrl T control o bless you and um I'll actually go to my
00:35:39.240 real JavaScript notes and type two outline and you can see it just Narrows down to the headings
00:35:46.119 and I can type to drill in and then I can look at examples and I can run the
00:35:52.319 examples and if you're not in a file if you're just somewhere else you can type
00:35:58.119 a keyboard shortcut to take you there and then type to nerd down so it's an easy way of of
00:36:04.480 navigating notes uh there's an Interactive Learning
00:36:10.880 mode where you can type facts and then type some facts separated by uh
00:36:16.640 colons and you can double click to have it go through and quiz you with the flashcard process which is very
00:36:22.839 interesting to have in in notes that you make It's very effective any uh automated memorization process is super
00:36:28.280 effective uh if you've got the stuff the content so you can type show answer and it will tell you the answer that it
00:36:34.640 pulled from what we saw before this is all just text and if you got it right it'll just move on if you got it wrong
00:36:40.760 it'll come back uh later and make you get it again and it'll keep quizzing you
00:36:46.720 until you get it and then it'll go to the end uh this is the learning process
00:36:52.680 taken from memorize.com which is a website that has a web- based version of this um
00:36:58.240 it's the memorize.com uh learning process of memorize tables uh fold
00:37:03.520 disclosure memorize.com is one of my projects uh all right I think we might
00:37:09.240 have time for the last two yeah I think we do uh so how about using ziki as an
00:37:17.640 IDE uh you can take advantages of your existing Text Editor to um split windows
00:37:27.880 and uh maybe make a a file tree down here I'll just make a file tree of ziky
00:37:35.400 uh and you know maybe over here your editing files so if you double click
00:37:40.560 here it'll bring up the the file up here you can uh you can put unit tests I'll just type test and double click on it it
00:37:46.599 takes me to the unit tests um you can you can navigate to the unit test you
00:37:52.319 can split the window if your if your editor supports it and open a shell console down here open IB or whatever
00:37:58.680 you would like
00:38:07.359 um you can do all kinds of other stuff using this basic textual uh way of
00:38:14.000 making trees to simulate uh UI stuff that uh that idees
00:38:20.359 do um to create keyboard shortcuts in ziki which you don't have to do this is
00:38:25.480 optional um it looks like this it's the simplest way I could think of of doing it if you type this and add it to a ruby
00:38:32.640 file it will Define control Z and it will make it run this block when you type the shortcut you can also of course
00:38:39.640 uh use the existing shortcuts of your of your editor that you're you're using um
00:38:46.359 and I don't know if you can see this but up here in the menu bar there's a keys menu that's part of the the emac ziky
00:38:53.280 and it's got a bunch of built-in shortcuts that are completely optional they're kind of nice because they're all type the acronym so if you want to split
00:39:00.599 the window it's layout create which means you hold down control and you type L and
00:39:05.640 C so the the name of the shortcut is uh the thing that you type which I think is
00:39:10.920 better than option shift F Etc uh so layout create layout hide layout
00:39:17.000 hide um there are a bunch of different
00:39:23.359 acronyms so next topic um
00:39:29.200 thanks everyone for the interest in ziki I've gotten a lot of awesome interests in the last two months which is which is
00:39:34.400 really awesome after 11 years of of no one caring um there have been some really really
00:39:40.680 good tweets to the uh ziky Twitter user which I I love um there's been a lot of awesome Google group activity I promise
00:39:47.599 I'll get to all the uh errors that people are getting soon um if you have
00:39:53.200 an open source project or a non-op source project find me today or tomorrow let's sit together for 10 minutes and
00:39:59.079 make a menu for your project if you can think of a a little admin interface or a interface that will go hit your web
00:40:04.920 service something like that I love to pair program love to collaborate um future ziky plans I want
00:40:12.640 uh to continue to make menus get other people to make and contribute menus and get them all into ziki so that anything
00:40:18.240 that you can type uh you can type and double click on it and it will either do something or or it will redirect you to
00:40:25.160 something useful So eventually you can just sort of type anything um more future plans of ziky uh
00:40:32.240 I've got some ideas for using ziki as a a web backend that uh you can Ajax to uh to ziky and speak
00:40:40.920 in this menu language to handle your data and your navigation uh in rails I've I've got a lot a lot of prototypes
00:40:47.839 where you can embed menus into rails apps so what if it was a model view
00:40:53.319 controller menus could be kind of cool
00:40:59.160 um and backbone you know you could make a backbone page that just uh did the UI
00:41:04.280 and then did Ajax to the server to handle the everything else unit tests
00:41:10.000 there's something uh that's sort of in the works I don't know what it is yet but when you uh use a ziki menu you've
00:41:16.520 got text input and text output that basically is all you need for a unit test aside from some mocking which could
00:41:23.040 be put somewhere else uh I've been toying with some ideas for that if any of you guys have ideas I would love to hear them uh OS integration wouldn't be
00:41:30.319 cool if you're in Mac OS and you could click into folders and just keep clicking into a menu and navigate it uh
00:41:37.520 and you know if you can type to make a menu that you can browse in your web browser why not just autogenerate
00:41:42.960 generate an iPhone app uh which I don't know how to do but uh maybe someone will do that or maybe I'll I'll learn iOS um
00:41:51.560 so one thing that keeps me motivated about ziki uh is that it gets simpler over time it's it
00:41:57.760 uh becomes more more elegant in their obvious next steps for things that you
00:42:03.480 can do to to simplify it that pop up all the time like a friend of mine said like hey you've got these menus you can type
00:42:08.720 why not do like a quick silver thing where you've got a global shortcut and you can type IP and then it pops up and shows your IP so did that uh any of you
00:42:16.640 guys that have random thoughts about where to take this next menus to create I'd love to hear them so hopefully the
00:42:22.960 uh future ziky plans include your ideas that's
00:42:36.680 it questions are you a
00:42:44.559 witch thanks thanks no I'm not uh UDA so
00:42:51.160 uh really cool one thing that I noticed was that you it seems like you have a pretty big DSL Texs for doing stuff I
00:42:59.280 understand the desire not to have a dependency on stuff but it also seems like having
00:43:06.520 a yeah I I uh think that could be could be could I repeat that having a ruby DSL
00:43:12.079 for making menus would be really convenient versus instead of having
00:43:17.119 giant strings and dsls all over the place yeah I I uh I think that would be very interesting uh the approach I've
00:43:22.280 kind of taken with ziki is like if I think of something and it seems fun and seems simple then it should be done uh
00:43:29.119 so yeah there there are some things in ziki menus that are sort of like ziky uh conventions like you can type a label
00:43:36.000 with Dash and that's useful enough to be a a ziky wide convention if you if you
00:43:41.119 run this it just passes in the uh value after the label not the the menu and that's General enough that it should be
00:43:47.599 probably Global to ziki but there are other things that are you know really useful and should be accessible
00:43:52.960 somewhere and there's some you could just do yourself for your own little specific menu like the menu like for
00:43:58.040 example you mentioned like you might want to copy like do a final replace on this my SQL thing to add dashes like
00:44:03.720 that seems like the thing that there should be a yeah yeah totally yeah someone should
00:44:09.520 make a menu for that uh yes how well does it play with rvm
00:44:18.240 and rvm and all that that was one of the botx we got over two months ago thanks to my friend Caleb who knows way more
00:44:24.640 about that than I do it works pretty well with rvm
00:44:31.319 uh I want to take this offline but I need to talk to you about uh zy and Ruby
00:44:37.480 dependencies okay I probably just broke stuff so you got it working and you
00:44:42.920 broke it okay you're not
00:44:49.280 alone uh White CH any specific emac e
00:44:55.119 configuration files that collide with either in mappings or in any other way
00:45:00.480 that we should avoid or that we just need to kind of configure so that there isn't a clash I ran into a collision
00:45:07.240 with the Viper shortcuts they could probably be gotten around if you use those um it tries really hard to not
00:45:13.040 Collide uh with the default emac shortcuts if you're using emac for ziky
00:45:18.359 uh the way that works is it uh uh uses a bunch of characters as a prefix if you
00:45:23.920 want to type the uh emac equivalent it will um you just type like control a twice and
00:45:30.040 it will do the normal control a I should probably wrap it up so the next speaker can get in in here but uh find me after
00:45:36.280 I'd love to talk thanks so much
Explore all talks recorded at RubyConf 2012
+46