From 999dd38d5f29935afa44de54565e99671cf1fb59 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sat, 18 Dec 2010 11:22:47 -0800 Subject: [PATCH] new blog post, tweak style, minor fixes --- assets/blog.css | 9 +- assets/blog.js | 20 +- blog/37signals-chalk-dissected.html | 2 +- blog/a-preview-of-mach-o-file-generation.html | 2 +- blog/basics-of-the-mach-o-file-format.html | 2 +- blog/index.html | 3 +- ...-emacs-to-develop-mojo-apps-for-webos.html | 188 ++++++++++++++++++ .../working-with-c-style-structs-in-ruby.html | 3 +- discussd/discussd.js | 2 +- templates/blog/index.html | 2 +- templates/blog/post.html | 2 +- 11 files changed, 223 insertions(+), 12 deletions(-) create mode 100644 blog/using-emacs-to-develop-mojo-apps-for-webos.html diff --git a/assets/blog.css b/assets/blog.css index c4873b8..947e49a 100644 --- a/assets/blog.css +++ b/assets/blog.css @@ -71,15 +71,15 @@ a.img { border: none } #posts { border-left: solid 0.15em #999 ; width: 80% ; min-width: 400px - ; max-width: 800px + ; max-width: 680px ; margin: 4em auto 2em - ; padding: 0 3em + ; padding: 0 5% ; font-size: 1.2em + ; line-height: 1.4em } article { color: #222 ; padding-bottom: 1em - ; line-height: 1.2em } article:last-child { padding-bottom: 0 @@ -88,6 +88,7 @@ article:last-child { padding-bottom: 0 article h1 { text-align: left ; font-size: 2em + ; line-height: 1.1em ; font-weight: normal ; color: #222 ; margin: 1em 0 @@ -167,6 +168,8 @@ input[type=submit]:active, ; padding: 2em 0 } +#comments-spinner { text-align: center } + #comments { width: 70% ; max-width: 400px ; margin: 0 auto diff --git a/assets/blog.js b/assets/blog.js index edadf14..40e1ecd 100644 --- a/assets/blog.js +++ b/assets/blog.js @@ -55,6 +55,17 @@ $('#comment-form').submit(function() { var comment = $(this).serializeObject() + comment.name = (comment.name || '').trim() || 'anonymous' + comment.url = (comment.url || '').trim() + if (comment.url && !comment.url.match(/^https?:\/\//)) { + comment.url = 'http://' + comment.url + } + comment.body = comment.body || '' + if (!comment.body) { + alert("is that all you have to say?") + return false + } + var options = { method: 'POST' , uri: postCommentURL() , body: JSON.stringify(comment) @@ -63,13 +74,20 @@ if (err) { console.dir(err) alert('derp') - return + return false } // FIXME check for error, how do we get the returned status code? + $('#comment-form').get(0).reset() + comment.timestamp = +new Date() comment.html = showdown.makeHtml(comment.body) + comment.name = (comment.name || '').trim() || 'anonymous' + comment.url = (comment.url || '').trim() + if (comment.url && !comment.url.match(/^https?:\/\//)) { + comment.url = 'http://' + comment.url + } $('#comments').append(tmpl('comment_tmpl', comment)) }) return false diff --git a/blog/37signals-chalk-dissected.html b/blog/37signals-chalk-dissected.html index 3117f39..79e0961 100644 --- a/blog/37signals-chalk-dissected.html +++ b/blog/37signals-chalk-dissected.html @@ -285,7 +285,7 @@ addLineNumbersToAllGists();
show the discussion
- +
diff --git a/blog/a-preview-of-mach-o-file-generation.html b/blog/a-preview-of-mach-o-file-generation.html index 9403f26..03b5dff 100644 --- a/blog/a-preview-of-mach-o-file-generation.html +++ b/blog/a-preview-of-mach-o-file-generation.html @@ -80,7 +80,7 @@ straightforward, an example is in asm/binary.rb, in the #output method.

- +
diff --git a/blog/basics-of-the-mach-o-file-format.html b/blog/basics-of-the-mach-o-file-format.html index de48c98..94ab5f9 100644 --- a/blog/basics-of-the-mach-o-file-format.html +++ b/blog/basics-of-the-mach-o-file-format.html @@ -303,7 +303,7 @@ would almost have a useful Mach object file.)

- +
diff --git a/blog/index.html b/blog/index.html index 8eb7d32..8a83e9e 100644 --- a/blog/index.html +++ b/blog/index.html @@ -42,6 +42,7 @@ SJS.filename = "37signals-chalk-dissected.html"
  • A preview of Mach-O file generation January 20, 2010
  • Basics of the Mach-O file format January 18, 2010
  • Working with C-style structs in Ruby January 17, 2010
  • +
  • Using Emacs to Develop Mojo Apps for WebOS November 21, 2009
  • @@ -304,7 +305,7 @@ addLineNumbersToAllGists();
    - +
    diff --git a/blog/using-emacs-to-develop-mojo-apps-for-webos.html b/blog/using-emacs-to-develop-mojo-apps-for-webos.html new file mode 100644 index 0000000..719ded1 --- /dev/null +++ b/blog/using-emacs-to-develop-mojo-apps-for-webos.html @@ -0,0 +1,188 @@ + + + +Using Emacs to Develop Mojo Apps for WebOS :: samhuri.net + + + + + +
    +

    sjs' blog

    +
    + +
    + +
    +
    +

    Using Emacs to Develop Mojo Apps for WebOS

    + +
    +

    + The latest technology I've been learning is Palm's SDK for webOS, + Mojo. My first impression is that it's a great platform and + Palm could do a great job of 2.0 if they cut down on some of the + verbosity of gluing together the UI. I have learned to like + JavaScript over the years as I learned that despite its + warts there + are good parts too. If you squint just right you can + see that it's scheme with Algol syntax. HTML and CSS are what + they are, but with WebKit running the show and only a single engine + to target it's not that bad. I've gone from Eclipse to Emacs + for the coding itself and highly recommend Emacs for Mojo + development. There is nothing that I miss from the Eclipse or + Komodo Edit thanks to the fact that Mojo uses open languages and + standards. +

    + + + + +

    + As far as actual development goes the Mojo documentation steers you + towards a combination of Eclipse, Palm's Mojo plugin for Eclipse, + and the Aptana Studio plugin. My editor of choice is Emacs but + I decided to give it a spin just to get started quickly, how bad + could it be? I'm not going to get into details but I will say that I + don't think I'll ever use Eclipse for anything; it's far too + sluggish and provides no compelling features for the languages + that I use. I tried Komodo Edit and it was significantly + better but still not for me. Emacs is great for editing HTML, + JavaScript, and CSS so all I really missed from the IDEs were the + shortcuts to package, install, and launch apps in the + emulator. I headed over to + the Emacs Wiki and + downloaded Jonathan + Arkell's Mojo + support for Emacs which provided a great base to get + started with. There are wrappers around (all?) of the Palm SDK + commands but it needed a bit of work to make it just do what I + wanted with as little input and thought as possible. +

    + + + + +

    + A couple of of Lisp hacking sessions later and I'm happy enough with + mojo.el to bump the version to v0.9. I've checked off what I + feel are the most important checkpoints on + the webOS + Internals comparison of editors and the framework is in + place to make implementing most of the remaining commands very + trivial. I might take a bit of time today to flesh things out + just to check more points off so people feel more confident that + it's a fully featured environment, because it certainly is. +

    + + + + +

    + It now requires json.el in order to parse appinfo.json. json.el + might be included with Emacs if you have a very recent version, + otherwise you can google for it or get it from + my config + file repo on github where you can also find my latest + version of mojo.el. You still just (require 'mojo) in your + .emacs file. +

    + + + + +

    + The wrappers around Palm SDK commands now search upwards for the + Mojo project root directory (from the default-directory for + current-buffer) and parse appinfo.json to give you sane defaults for + mojo-package, mojo-install, mojo-launch, mojo-delete, and + mojo-inspect. You can list installed apps and when entering app + ids there is completion and history, as you have come to expect in + Emacs. The most useful command for development is + mojo-package-install-and-inspect which does exactly what it says: + packages, installs, and launches the application for + inspection. No interaction is required as long as you are + editing a buffer inside your Mojo project. +

    + + + + +

    + If you read the install instructions in mojo.el and decide to setup + some keybindings then you will have single-task commands for + packaging, installing, launching, or all three steps at once. +

    + + + + +

    + Please give me some feedback if you try this out. I've + developed it on Mac OS X and Jonathan on Windows so please try it on + Linux and send me a patch or even better a pull request on github if + it needs some work. There is room for improvement. The next feature + on my radar before I would consider it worthy of a v1.0 tag is + intelligent switching to corresponding buffers, + e.g. mojo-switch-to-view, mojo-switch-to-assistant, things like + that. Basically things I miss from the Rails package for Emacs. +

    + + + + +

    Happy hacking!

    + + +
    +
    +

    + +

    (discussion requires JavaScript)

    + +
    +
    +
    +
    + + +

    +

    +

    +

    +

    + +
    + + diff --git a/blog/working-with-c-style-structs-in-ruby.html b/blog/working-with-c-style-structs-in-ruby.html index f12e1cc..b27c472 100644 --- a/blog/working-with-c-style-structs-in-ruby.html +++ b/blog/working-with-c-style-structs-in-ruby.html @@ -144,6 +144,7 @@ of the Mach-O file format

    @@ -151,7 +152,7 @@ of the Mach-O file format

    - +
    diff --git a/discussd/discussd.js b/discussd/discussd.js index 06ee271..4fffe8b 100755 --- a/discussd/discussd.js +++ b/discussd/discussd.js @@ -223,7 +223,7 @@ function commentServer(context) { name = (data.name || 'anonymous').trim() email = (data.email || '').trim() url = (data.url || '').trim() - if (!url.match(/^https?:\/\//)) url = 'http://' + url + if (url && !url.match(/^https?:\/\//)) url = 'http://' + url body = data.body || '' if (!post || !body || context.posts.indexOf(post) === -1) { console.warn('mising post, body, or post not found: ' + post) diff --git a/templates/blog/index.html b/templates/blog/index.html index 2e0d3d1..e027779 100644 --- a/templates/blog/index.html +++ b/templates/blog/index.html @@ -72,7 +72,7 @@ SJS.filename = "{{filename}}"
    - +
    diff --git a/templates/blog/post.html b/templates/blog/post.html index 006b0d1..0f0e9de 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -54,7 +54,7 @@ SJS.filename = "{{filename}}"
    - +