From 5ed68c45f83140e4118cb1200f2ce84a53425554 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Wed, 4 Dec 2019 20:27:27 -0800 Subject: [PATCH] Migrate posts back from harp format to markdown with headers once again --- Makefile | 10 +- Readme.md | 6 +- .../SiteGenerator/Generator/Generator.swift | 12 +- .../Sources/SiteGenerator/Posts/Post.swift | 20 +- .../SiteGenerator/Posts/PostsPlugin.swift | 17 +- .../Projects/ProjectsPlugin.swift | 12 +- bin/build-sitegen | 6 + bin/harp2swift | 83 ++++++++ bin/test | 5 - posts/2006/02/_data.json | 181 ------------------ posts/2006/02/first-post.md | 9 + posts/2006/02/girlfriend-x.md | 9 + posts/2006/02/index.ejs | 1 - ...ent-migration-snippets-0_1-for-textmate.md | 9 + .../02/jump-to-viewcontroller-in-textmate.md | 9 + .../02/obligatory-post-about-ruby-on-rails.md | 9 + .../02/sjs-rails-bundle-0_2-for-textmate.md | 9 + ...-textmate-snippets-for-rails-migrations.md | 9 + .../02/textmate-insert-text-into-self-down.md | 9 + .../textmate-move-selection-to-self-down.md | 9 + .../textmate-snippets-for-rails-assertions.md | 9 + posts/2006/02/touch-screen-on-steroids.md | 9 + posts/2006/02/urban-extreme-gymnastics.md | 9 + posts/2006/03/_data.json | 46 ----- ...erate-selfdown-in-your-rails-migrations.md | 9 + posts/2006/03/i-dont-mind-fairplay-either.md | 9 + posts/2006/03/index.ejs | 1 - posts/2006/03/spore.md | 9 + posts/2006/04/_data.json | 16 -- posts/2006/04/index.ejs | 1 - .../2006/04/zsh-terminal-goodness-on-os-x.md | 9 + posts/2006/05/_data.json | 34 ---- posts/2006/05/index.ejs | 1 - posts/2006/05/os-x-and-fitts-law.md | 9 + .../2006/05/wikipediafs-on-linux-in-python.md | 9 + posts/2006/06/_data.json | 52 ----- .../2006/06/apple-pays-attention-to-detail.md | 9 + ...-auslnder-und-spreche-nicht-gut-deutsch.md | 9 + posts/2006/06/index.ejs | 1 - posts/2006/06/never-buy-a-german-keyboard.md | 9 + ...thing-regular-about-regular-expressions.md | 9 + posts/2006/07/_data.json | 72 ------- ...instance-method-it-doesnt-matter-to-php.md | 9 + posts/2006/07/index.ejs | 1 - posts/2006/07/late-static-binding.md | 9 + .../ruby-and-rails-have-spoiled-me-rotten.md | 9 + .../07/ubuntu-linux-for-linux-users-please.md | 9 + .../07/working-with-the-zend-framework.md | 9 + posts/2006/08/_data.json | 13 -- posts/2006/08/index.ejs | 1 - posts/2006/08/where-are-my-headphones.md | 9 + posts/2006/09/_data.json | 26 --- ...buffalo-buffalo-buffalo-buffalo-buffalo.md | 10 + posts/2006/09/index.ejs | 1 - ...tures-you-might-have-missed-in-itunes-7.md | 21 +- posts/2006/12/_data.json | 16 -- ...ng-with-windows-xp-activiation-on-a-mac.md | 27 ++- posts/2006/12/index.ejs | 1 - posts/2006/index.ejs | 1 - posts/2007/03/_data.json | 40 ---- ...v4-reply-to-replies-greasemonkey-script.md | 9 + posts/2007/03/diggscuss-0_9.md | 9 + posts/2007/03/full-screen-cover-flow.md | 9 + posts/2007/03/index.ejs | 1 - posts/2007/04/_data.json | 58 ------ .../a-triple-booting-schizophrenic-macbook.md | 9 + ...e_find_or_create-and-find_or_initialize.md | 9 + .../04/funny-how-code-can-be-beautiful.md | 9 + posts/2007/04/getting-to-know-vista.md | 9 + posts/2007/04/index.ejs | 1 - ...ting-millions-of-rows-with-mysql-innodb.md | 9 + posts/2007/05/_data.json | 152 --------------- .../05/a-new-way-to-look-at-networking.md | 9 + .../05/a-scheme-parser-in-haskell-part-1.md | 9 + posts/2007/05/cheating-at-life-in-general.md | 9 + posts/2007/05/dtrace-ruby-goodness-for-sun.md | 9 + ...dumping-objects-to-the-browser-in-rails.md | 9 + ...rable-pluck-and-string-to_proc-for-ruby.md | 9 + ...ules-css-ineffective-at-protecting-dvds.md | 9 + posts/2007/05/gotta-love-the-ferry-ride.md | 9 + ...hat-matt-stone-trey-parker-do-with-this.md | 9 + posts/2007/05/index.ejs | 1 - posts/2007/05/inspirado.md | 9 + posts/2007/05/iphone-humour.md | 9 + posts/2007/05/rails-plugins-link-dump.md | 9 + posts/2007/05/typo-and-i-are-friends-again.md | 9 + posts/2007/06/301-moved-permanently.md | 9 + posts/2007/06/_data.json | 179 ----------------- .../06/back-on-gentoo-trying-new-things.md | 9 + posts/2007/06/begging-the-question.md | 9 + ...olling-volume-via-the-keyboard-on-linux.md | 9 + posts/2007/06/emacs-for-textmate-junkies.md | 9 + .../06/emacs-tagify-region-or-insert-tag.md | 9 + posts/2007/06/embrace-the-database.md | 9 + posts/2007/06/floating-point-in-elschemo.md | 9 + posts/2007/06/index.ejs | 1 - posts/2007/06/more-scheming-with-haskell.md | 9 + posts/2007/06/propaganda-makes-me-sick.md | 57 +++--- .../2007/06/recent-ruby-and-rails-regales.md | 9 + posts/2007/06/reinventing-the-wheel.md | 9 + posts/2007/06/rtfm.md | 9 + ...ng-typo-and-thanks-for-all-the-timeouts.md | 9 + ...n-rails-declared-awesome-just-one-catch.md | 9 + posts/2007/07/_data.json | 48 ----- .../2007/07/a-textmate-tip-for-emacs-users.md | 9 + posts/2007/07/index.ejs | 1 - posts/2007/07/people.md | 9 + .../2007/07/rushcheck-quickcheck-for-ruby.md | 9 + .../see-your-regular-expressions-in-emacs.md | 9 + ...oid-looking-like-a-jerk-on-the-internet.md | 9 + posts/2007/08/_data.json | 90 --------- posts/2007/08/captivating-little-creatures.md | 9 + .../08/catch-compiler-errors-at-runtime.md | 9 + posts/2007/08/cheat-from-emacs.md | 9 + posts/2007/08/cheat-productively-in-emacs.md | 9 + .../elschemo-boolean-logic-and-branching.md | 9 + posts/2007/08/index.ejs | 1 - posts/2007/08/opera-is-pretty-slick.md | 9 + posts/2007/08/snap-crunchle-pop.md | 9 + posts/2007/09/_data.json | 23 --- posts/2007/09/index.ejs | 1 - posts/2007/09/learning-lisp-read-pcl.md | 9 + posts/2007/09/python-and-ruby-brain-dump.md | 9 + posts/2007/10/_data.json | 17 -- .../10/gtkpod-in-gutsy-got-you-groaning.md | 10 +- posts/2007/10/index.ejs | 1 - posts/2007/index.ejs | 1 - posts/2008/01/_data.json | 13 -- posts/2008/01/index.ejs | 1 - posts/2008/01/random-pet-peeve-of-the-day.md | 9 + posts/2008/02/_data.json | 12 -- posts/2008/02/index.ejs | 1 - posts/2008/02/thoughts-on-arc.md | 9 + posts/2008/03/_data.json | 13 -- posts/2008/03/index.ejs | 1 - .../2008/03/project-euler-code-repo-in-arc.md | 9 + posts/2008/index.ejs | 1 - posts/2009/11/_data.json | 16 -- posts/2009/11/index.ejs | 1 - ...ng-emacs-to-develop-mojo-apps-for-webos.md | 9 + posts/2009/index.ejs | 1 - posts/2010/01/_data.json | 39 ---- .../01/a-preview-of-mach-o-file-generation.md | 9 + .../01/basics-of-the-mach-o-file-format.md | 9 + posts/2010/01/index.ejs | 1 - .../working-with-c-style-structs-in-ruby.md | 9 + posts/2010/11/37signals-chalk-dissected.md | 10 +- posts/2010/11/_data.json | 19 -- posts/2010/11/index.ejs | 1 - posts/2010/index.ejs | 1 - posts/2011/11/_data.json | 25 --- posts/2011/11/index.ejs | 1 - posts/2011/11/lights.md | 10 + posts/2011/11/recovering-old-posts.md | 9 + posts/2011/12/_data.json | 68 ------- posts/2011/12/i-see-http.md | 10 + posts/2011/12/index.ejs | 1 - posts/2011/12/my-kind-of-feature-checklist.md | 11 +- ...refox-for-android-optimized-for-tablets.md | 10 + .../12/pure-css3-images-hmm-maybe-later.md | 10 + .../12/static-url-shortener-using-htaccess.md | 9 + posts/2011/12/the-broken-pixel-theory.md | 10 + posts/2011/index.ejs | 1 - posts/2012/01/_data.json | 52 ----- posts/2012/01/fujitsu-has-lost-their-mind.md | 10 + posts/2012/01/index.ejs | 1 - ...ering-from-a-computer-science-education.md | 10 + ...d-mpaa-calls-protests-an-abuse-of-power.md | 10 + posts/2012/01/the-40-standup-desk.md | 10 + posts/2012/01/yak-shaving.md | 10 + posts/2012/index.ejs | 1 - posts/2013/03/_data.json | 17 -- posts/2013/03/index.ejs | 1 - posts/2013/03/zelda-tones-for-ios.md | 9 + posts/2013/09/_data.json | 17 -- posts/2013/09/index.ejs | 1 - posts/2013/09/linky.md | 13 +- posts/2013/index.ejs | 1 - posts/2014/02/_data.json | 12 -- posts/2014/02/ember-structure.md | 9 + posts/2014/02/index.ejs | 1 - posts/2014/index.ejs | 1 - posts/2015/05/_data.json | 98 ---------- ...miner-in-every-device-and-in-every-hand.md | 11 +- .../apple-watch-human-interface-guidelines.md | 11 +- .../05/constraints-and-transforms-in-ios-8.md | 11 +- posts/2015/05/github-flow-like-a-pro.md | 11 +- posts/2015/05/importing-modules-in-lldb.md | 11 +- posts/2015/05/index.ejs | 1 - posts/2015/05/lenovo-thinkpad-x1-carbon.md | 11 +- posts/2015/05/magical-wristband.md | 11 +- .../05/undocumented-corestorage-commands.md | 11 +- posts/2015/06/_data.json | 26 --- ...th-recursive-view-descriptions-in-xcode.md | 11 +- posts/2015/06/index.ejs | 1 - .../the-unofficial-guide-to-xcconfig-files.md | 11 +- posts/2015/07/_data.json | 26 --- posts/2015/07/index.ejs | 1 - posts/2015/07/scripts-to-rule-them-all.md | 11 +- .../07/swift-new-stuff-in-xcode-7-beta-3.md | 11 +- posts/2015/08/_data.json | 26 --- posts/2015/08/acorn-5s-live-help-search.md | 11 +- .../2015/08/cloaks-updated-privacy-policy.md | 11 +- posts/2015/08/index.ejs | 1 - posts/2015/index.ejs | 1 - posts/2016/03/_data.json | 26 --- posts/2016/03/index.ejs | 1 - .../03/moving-beyond-the-oop-obsession.md | 11 +- .../reduce-the-cognitive-load-of-your-code.md | 11 +- posts/2016/04/_data.json | 14 -- posts/2016/04/index.ejs | 1 - .../2016/04/tales-of-prk-laser-eye-surgery.md | 9 + posts/2016/08/_data.json | 28 --- posts/2016/08/easy-optimization-wins.md | 10 +- posts/2016/08/index.ejs | 1 - posts/2016/08/ios-git-pre-commit-hook.md | 134 +++++++------ posts/2016/index.ejs | 1 - posts/2017/10/_data.json | 15 -- posts/2017/10/index.ejs | 1 - posts/2017/10/swift-optional-or.md | 3 +- posts/2017/index.ejs | 1 - posts/2018/index.ejs | 1 - posts/2019/index.ejs | 1 - posts/_month.ejs | 52 ----- posts/_year.ejs | 64 ------- posts/index.html | 11 -- public/css/style.less | 2 +- templates/partial-post-link.html | 2 +- templates/partial-post-text.html | 2 +- templates/posts-month.html | 10 +- templates/posts-year.html | 7 +- 231 files changed, 1418 insertions(+), 1962 deletions(-) create mode 100755 bin/build-sitegen create mode 100755 bin/harp2swift delete mode 100644 posts/2006/02/_data.json delete mode 100644 posts/2006/02/index.ejs delete mode 100644 posts/2006/03/_data.json delete mode 100644 posts/2006/03/index.ejs delete mode 100644 posts/2006/04/_data.json delete mode 100644 posts/2006/04/index.ejs delete mode 100644 posts/2006/05/_data.json delete mode 100644 posts/2006/05/index.ejs delete mode 100644 posts/2006/06/_data.json delete mode 100644 posts/2006/06/index.ejs delete mode 100644 posts/2006/07/_data.json delete mode 100644 posts/2006/07/index.ejs delete mode 100644 posts/2006/08/_data.json delete mode 100644 posts/2006/08/index.ejs delete mode 100644 posts/2006/09/_data.json delete mode 100644 posts/2006/09/index.ejs delete mode 100644 posts/2006/12/_data.json delete mode 100644 posts/2006/12/index.ejs delete mode 100644 posts/2006/index.ejs delete mode 100644 posts/2007/03/_data.json delete mode 100644 posts/2007/03/index.ejs delete mode 100644 posts/2007/04/_data.json delete mode 100644 posts/2007/04/index.ejs delete mode 100644 posts/2007/05/_data.json delete mode 100644 posts/2007/05/index.ejs delete mode 100644 posts/2007/06/_data.json delete mode 100644 posts/2007/06/index.ejs delete mode 100644 posts/2007/07/_data.json delete mode 100644 posts/2007/07/index.ejs delete mode 100644 posts/2007/08/_data.json delete mode 100644 posts/2007/08/index.ejs delete mode 100644 posts/2007/09/_data.json delete mode 100644 posts/2007/09/index.ejs delete mode 100644 posts/2007/10/_data.json delete mode 100644 posts/2007/10/index.ejs delete mode 100644 posts/2007/index.ejs delete mode 100644 posts/2008/01/_data.json delete mode 100644 posts/2008/01/index.ejs delete mode 100644 posts/2008/02/_data.json delete mode 100644 posts/2008/02/index.ejs delete mode 100644 posts/2008/03/_data.json delete mode 100644 posts/2008/03/index.ejs delete mode 100644 posts/2008/index.ejs delete mode 100644 posts/2009/11/_data.json delete mode 100644 posts/2009/11/index.ejs delete mode 100644 posts/2009/index.ejs delete mode 100644 posts/2010/01/_data.json delete mode 100644 posts/2010/01/index.ejs delete mode 100644 posts/2010/11/_data.json delete mode 100644 posts/2010/11/index.ejs delete mode 100644 posts/2010/index.ejs delete mode 100644 posts/2011/11/_data.json delete mode 100644 posts/2011/11/index.ejs delete mode 100644 posts/2011/12/_data.json delete mode 100644 posts/2011/12/index.ejs delete mode 100644 posts/2011/index.ejs delete mode 100644 posts/2012/01/_data.json delete mode 100644 posts/2012/01/index.ejs delete mode 100644 posts/2012/index.ejs delete mode 100644 posts/2013/03/_data.json delete mode 100644 posts/2013/03/index.ejs delete mode 100644 posts/2013/09/_data.json delete mode 100644 posts/2013/09/index.ejs delete mode 100644 posts/2013/index.ejs delete mode 100644 posts/2014/02/_data.json delete mode 100644 posts/2014/02/index.ejs delete mode 100644 posts/2014/index.ejs delete mode 100644 posts/2015/05/_data.json delete mode 100644 posts/2015/05/index.ejs delete mode 100644 posts/2015/06/_data.json delete mode 100644 posts/2015/06/index.ejs delete mode 100644 posts/2015/07/_data.json delete mode 100644 posts/2015/07/index.ejs delete mode 100644 posts/2015/08/_data.json delete mode 100644 posts/2015/08/index.ejs delete mode 100644 posts/2015/index.ejs delete mode 100644 posts/2016/03/_data.json delete mode 100644 posts/2016/03/index.ejs delete mode 100644 posts/2016/04/_data.json delete mode 100644 posts/2016/04/index.ejs delete mode 100644 posts/2016/08/_data.json delete mode 100644 posts/2016/08/index.ejs delete mode 100644 posts/2016/index.ejs delete mode 100644 posts/2017/10/_data.json delete mode 100644 posts/2017/10/index.ejs delete mode 100644 posts/2017/index.ejs delete mode 100644 posts/2018/index.ejs delete mode 100644 posts/2019/index.ejs delete mode 100644 posts/_month.ejs delete mode 100644 posts/_year.ejs delete mode 100644 posts/index.html diff --git a/Makefile b/Makefile index b4eaff8..743d203 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ -all: compile +all: blog -compile: +blog: @echo ./bin/compile . www @@ -12,8 +12,12 @@ publish_beta: compile @echo ./bin/publish --beta --delete +sitegen: + @echo + ./bin/build-sitegen + test: @echo ./bin/test -.PHONY: compile publish publish_beta test +.PHONY: blog publish publish_beta sitegen test diff --git a/Readme.md b/Readme.md index 8ec5d1e..7af7519 100644 --- a/Readme.md +++ b/Readme.md @@ -57,7 +57,7 @@ Execution, trying TDD for the first time: - [x] Decide whether to migrate from [9af9d75][] or the current harp format (probably easier to migrate the new format because posts may have been updated since then) - - [ ] Migrate posts + - [x] Migrate posts - [x] Migrate year indexes @@ -65,7 +65,9 @@ Execution, trying TDD for the first time: - [ ] Migrate index / recent posts - - [ ] Migrate archive + - [ ] Migrate archive and put it at /posts/index.html, duh! + + - [ ] 301 redirect /archive to /posts, and update the header link - [ ] Check and delete _data.json filse diff --git a/SiteGenerator/Sources/SiteGenerator/Generator/Generator.swift b/SiteGenerator/Sources/SiteGenerator/Generator/Generator.swift index ded1c45..79cc768 100644 --- a/SiteGenerator/Sources/SiteGenerator/Generator/Generator.swift +++ b/SiteGenerator/Sources/SiteGenerator/Generator/Generator.swift @@ -18,6 +18,8 @@ public final class Generator { let plugins: [Plugin] let renderers: [Renderer] + let ignoredFilenames = [".DS_Store", ".gitkeep"] + public init(sourceURL: URL, plugins: [Plugin], renderers: [Renderer]) throws { let siteURL = sourceURL.appendingPathComponent("site.json") let site = try Site.decode(from: siteURL) @@ -47,6 +49,9 @@ public final class Generator { // Recursively copy or render every file in the given path. func renderPath(_ path: String, to targetURL: URL) throws { for filename in try fileManager.contentsOfDirectory(atPath: path) { + guard !ignoredFilenames.contains(filename) else { + continue + } // Recurse into subdirectories, updating the target directory as well. let fileURL = URL(fileURLWithPath: path).appendingPathComponent(filename) @@ -60,18 +65,13 @@ public final class Generator { // Make sure this path exists so we can write to it. try fileManager.createDirectory(at: targetURL, withIntermediateDirectories: true, attributes: nil) - // Processes the file, transforming it if necessary. + // Process the file, transforming it if necessary. try renderOrCopyFile(url: fileURL, targetDir: targetURL) } } func renderOrCopyFile(url fileURL: URL, targetDir: URL) throws { let filename = fileURL.lastPathComponent - guard filename != ".DS_Store", filename != ".gitkeep" else { - print("Ignoring hidden file \(filename)") - return - } - let ext = String(filename.split(separator: ".").last!) for renderer in renderers { if renderer.canRenderFile(named: filename, withExtension: ext) { diff --git a/SiteGenerator/Sources/SiteGenerator/Posts/Post.swift b/SiteGenerator/Sources/SiteGenerator/Posts/Post.swift index 031114a..2f22e83 100644 --- a/SiteGenerator/Sources/SiteGenerator/Posts/Post.swift +++ b/SiteGenerator/Sources/SiteGenerator/Posts/Post.swift @@ -27,8 +27,8 @@ struct Post { let month = dateComponents.month! return "/" + [ "posts", - "\(year)", - "\(month)", + String(format: "%02d", year), + String(format: "%02d", month), "\(slug)", ].joined(separator: "/") } @@ -46,16 +46,16 @@ extension Post { case deficientMetadata(missingKeys: [String]) } - init(bodyMarkdown: String, metadata: [String: String]) throws { + init(slug: String, bodyMarkdown: String, metadata: [String: String]) throws { + self.slug = slug self.bodyMarkdown = bodyMarkdown - let requiredKeys = ["Slug", "Title", "Author", "Date", "Timestamp", "Tags", "Path_deprecated"] + let requiredKeys = ["Title", "Author", "Date", "Timestamp"] let missingKeys = requiredKeys.filter { metadata[$0] == nil } guard missingKeys.isEmpty else { throw Error.deficientMetadata(missingKeys: missingKeys) } - slug = metadata["Slug"]! title = metadata["Title"]! author = metadata["Author"]! date = Date(timeIntervalSince1970: TimeInterval(metadata["Timestamp"]!)!) @@ -66,10 +66,12 @@ extension Post { else { link = nil } - tags = metadata["Tags"]!.split(separator: ",").map { $0.trimmingCharacters(in: .whitespaces) } - - let handWrittenPath = metadata["Path_deprecated"]! - assert(path == handWrittenPath, "FUCK: Generated path (\(path)) doesn't match the hand-written one \(handWrittenPath)") + if let string = metadata["Tags"] { + tags = string.split(separator: ",").map({ $0.trimmingCharacters(in: .whitespaces) }) + } + else { + tags = [] + } } } diff --git a/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift b/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift index 37cec80..b3d5338 100644 --- a/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift +++ b/SiteGenerator/Sources/SiteGenerator/Posts/PostsPlugin.swift @@ -34,7 +34,8 @@ final class PostsPlugin: Plugin { do { let markdown = try String(contentsOf: url) let result = markdownParser.parse(markdown) - return try Post(bodyMarkdown: result.html, metadata: result.metadata) + let slug = url.deletingPathExtension().lastPathComponent + return try Post(slug: slug, bodyMarkdown: result.html, metadata: result.metadata) } catch { print("Cannot create post from markdown file \(url): \(error)") @@ -94,7 +95,11 @@ final class PostsPlugin: Plugin { let monthDir = yearDir.appendingPathComponent(month.padded) try fileManager.createDirectory(at: monthDir, withIntermediateDirectories: true, attributes: nil) - let context: [String: Any] = ["posts": renderedPosts.map { $0.dictionary }] + #warning("FIXME: get the site name out of here somehow") + let context: [String: Any] = [ + "title": "samhuri.net: \(month.name) \(year)", + "posts": renderedPosts.map { $0.dictionary }, + ] let monthHTML = try templateRenderer.renderTemplate(name: "posts-month", context: context) let monthURL = monthDir.appendingPathComponent("index.html") try monthHTML.write(to: monthURL, atomically: true, encoding: .utf8) @@ -107,7 +112,9 @@ final class PostsPlugin: Plugin { dict[month.padded] = renderedPosts.map { $0.dictionary } } let monthsPadded = months.map { $0.padded } + #warning("FIXME: get the site name out of here somehow") let context: [String: Any] = [ + "title": "samhuri.net: \(year)", "path": postsPath, "year": year, "months": monthsPadded, @@ -132,7 +139,11 @@ final class PostsPlugin: Plugin { let postURL = monthDir.appendingPathComponent(filename) let bodyHTML = markdownParser.html(from: post.bodyMarkdown) let renderedPost = RenderedPost(post: post, body: bodyHTML) - let postHTML = try templateRenderer.renderTemplate(name: "post", context: ["post": renderedPost.dictionary]) + #warning("FIXME: get the site name out of here somehow") + let postHTML = try templateRenderer.renderTemplate(name: "post", context: [ + "title": "samhuri.net: \(renderedPost.post.title)", + "post": renderedPost.dictionary, + ]) try postHTML.write(to: postURL, atomically: true, encoding: .utf8) } diff --git a/SiteGenerator/Sources/SiteGenerator/Projects/ProjectsPlugin.swift b/SiteGenerator/Sources/SiteGenerator/Projects/ProjectsPlugin.swift index d69bc89..4262ecc 100644 --- a/SiteGenerator/Sources/SiteGenerator/Projects/ProjectsPlugin.swift +++ b/SiteGenerator/Sources/SiteGenerator/Projects/ProjectsPlugin.swift @@ -46,13 +46,21 @@ final class ProjectsPlugin: Plugin { let projectsDir = targetURL.appendingPathComponent(path) try fileManager.createDirectory(at: projectsDir, withIntermediateDirectories: true, attributes: nil) let projectsURL = projectsDir.appendingPathComponent("index.html") - let projectsHTML = try templateRenderer.renderTemplate(name: "projects", context: ["projects": projects]) + #warning("FIXME: get the site name out of here somehow") + let projectsHTML = try templateRenderer.renderTemplate(name: "projects", context: [ + "title": "samhuri.net: Projects", + "projects": projects, + ]) try projectsHTML.write(to: projectsURL, atomically: true, encoding: .utf8) for project in projects { let filename = "\(project.title).html" let projectURL = projectsDir.appendingPathComponent(filename) - let projectHTML = try templateRenderer.renderTemplate(name: "project", context: ["project": project]) + #warning("FIXME: get the site name out of here somehow") + let projectHTML = try templateRenderer.renderTemplate(name: "project", context: [ + "title": "samhuri.net: \(project.title)", + "project": project, + ]) try projectHTML.write(to: projectURL, atomically: true, encoding: .utf8) } } diff --git a/bin/build-sitegen b/bin/build-sitegen new file mode 100755 index 0000000..239bdfc --- /dev/null +++ b/bin/build-sitegen @@ -0,0 +1,6 @@ +#!/bin/bash + +pushd "SiteGenerator" >/dev/null +swift build +cp .build/x86_64-apple-macosx/debug/SiteGenerator ../bin/sitegen +popd >/dev/null diff --git a/bin/harp2swift b/bin/harp2swift new file mode 100755 index 0000000..0b5ed89 --- /dev/null +++ b/bin/harp2swift @@ -0,0 +1,83 @@ +#!/usr/bin/env ruby -w +# encoding: utf-8 + +require 'rubygems' +require 'time' +require 'bundler/setup' +require 'builder' +require 'json' +require 'rdiscount' +require 'mustache' + +class Hash + def compact + h = {} + each_pair do |k, v| + h[k] = v unless v.nil? + end + h + end +end + +def main + dir = ARGV.shift.to_s + unless File.directory? dir + puts 'usage: harp2swift ' + exit 1 + end + b = Blag.new dir + b.migrate! +end + +class Blag + + def initialize dir + @dir = dir + end + + def migrate! + migrate_posts + end + + def migrate_posts + Dir[File.join(@dir, 'posts/*/*')].sort.map do |dir| + next unless File.directory?(dir) && dir =~ /\/\d\d$/ + year, month = dir.split('/')[-2..-1] + data_json = File.read File.join(dir, '_data.json') rescue nil + next unless data_json + data = JSON.parse data_json + data.each do |slug, post| + post_path = File.join dir, "#{slug}.md" + plain_md = File.read post_path + if plain_md[0, 3] == '---' + puts ">>>> Skipping #{post_path} which already has metadata" + next + end + author = post['author'] && post['author'] != "" ? post['author'] : 'Sami Samhuri' + headers = { + 'Title' => post['title'], + 'Author' => author, + 'Date' => post['date'], + 'Timestamp' => post['timestamp'], + 'Tags' => post['tags'].join(', '), + } + if post['link'] + headers['Link'] = post['link'] + end + header_string = headers.map { |name, value| "#{name}: #{value}" }.join("\n") + fancy_md = <<-EOT +--- +#{header_string} +--- + +#{plain_md} + EOT + File.write post_path, fancy_md + puts ">>>> Migrated #{post_path}" + end + end + end # def migrate_posts + +end # class Blag + +main if $0 == __FILE__ diff --git a/bin/test b/bin/test index f24d106..c93ecef 100755 --- a/bin/test +++ b/bin/test @@ -2,11 +2,6 @@ set -e -pushd "SiteGenerator" >/dev/null -swift build -cp .build/x86_64-apple-macosx/debug/SiteGenerator ../bin/sitegen -popd >/dev/null - for site in Tests/test-*; do bin/compile "$site/in" "$site/actual" # >/dev/null diff -ru "$site/expected" "$site/actual" diff --git a/posts/2006/02/_data.json b/posts/2006/02/_data.json deleted file mode 100644 index e5b72fa..0000000 --- a/posts/2006/02/_data.json +++ /dev/null @@ -1,181 +0,0 @@ -{ - "first-post": { - "title": "First Post!", - "date": "8th February, 2006", - "timestamp": 1139368860, - "tags": [ - "life" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/first-post" - }, - "touch-screen-on-steroids": { - "title": "Touch Screen on Steroids", - "date": "8th February, 2006", - "timestamp": 1139407560, - "tags": [ - "technology", - "touch" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/touch-screen-on-steroids" - }, - "urban-extreme-gymnastics": { - "title": "Urban Extreme Gymnastics?", - "date": "15th February, 2006", - "timestamp": 1140028860, - "tags": [ - "amusement" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/urban-extreme-gymnastics" - }, - "girlfriend-x": { - "title": "Girlfriend X", - "date": "18th February, 2006", - "timestamp": 1140292200, - "tags": [ - "crazy", - "funny" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/girlfriend-x" - }, - "jump-to-viewcontroller-in-textmate": { - "title": "Jump to view/controller in TextMate", - "date": "18th February, 2006", - "timestamp": 1140303060, - "tags": [ - "hacking", - "rails", - "textmate", - "rails", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/jump-to-viewcontroller-in-textmate" - }, - "some-textmate-snippets-for-rails-migrations": { - "title": "Some TextMate snippets for Rails Migrations", - "date": "18th February, 2006", - "timestamp": 1140331680, - "tags": [ - "textmate", - "rails", - "hacking", - "rails", - "snippets", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/some-textmate-snippets-for-rails-migrations" - }, - "obligatory-post-about-ruby-on-rails": { - "title": "Obligatory Post about Ruby on Rails", - "date": "20th February, 2006", - "timestamp": 1140424260, - "tags": [ - "rails", - "coding", - "hacking", - "migration", - "rails", - "testing" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/obligatory-post-about-ruby-on-rails", - "styles": [ - "/css/typocode.css" - ] - }, - "textmate-snippets-for-rails-assertions": { - "title": "TextMate Snippets for Rails Assertions", - "date": "20th February, 2006", - "timestamp": 1140508320, - "tags": [ - "textmate", - "rails", - "coding", - "rails", - "snippets", - "testing", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/textmate-snippets-for-rails-assertions" - }, - "textmate-move-selection-to-self-down": { - "title": "TextMate: Move selection to self.down", - "date": "21st February, 2006", - "timestamp": 1140510360, - "tags": [ - "textmate", - "rails", - "hacking", - "hack", - "macro", - "rails", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/textmate-move-selection-to-self-down", - "styles": [ - "/css/typocode.css" - ] - }, - "textmate-insert-text-into-self-down": { - "title": "TextMate: Insert text into self.down", - "date": "21st February, 2006", - "timestamp": 1140562500, - "tags": [ - "textmate", - "rails", - "hacking", - "commands", - "macro", - "rails", - "snippets", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/textmate-insert-text-into-self-down", - "styles": [ - "/css/typocode.css" - ] - }, - "intelligent-migration-snippets-0_1-for-textmate": { - "title": "Intelligent Migration Snippets 0.1 for TextMate", - "date": "22nd February, 2006", - "timestamp": 1140607680, - "tags": [ - "mac os x", - "textmate", - "rails", - "hacking", - "migrations", - "snippets" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/intelligent-migration-snippets-0_1-for-textmate" - }, - "sjs-rails-bundle-0_2-for-textmate": { - "title": "SJ's Rails Bundle 0.2 for TextMate", - "date": "23rd February, 2006", - "timestamp": 1140743880, - "tags": [ - "textmate", - "rails", - "coding", - "bundle", - "macros", - "rails", - "snippets", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/02/sjs-rails-bundle-0_2-for-textmate", - "styles": [ - "/css/typocode.css" - ] - } -} diff --git a/posts/2006/02/first-post.md b/posts/2006/02/first-post.md index d231ed7..01576e3 100644 --- a/posts/2006/02/first-post.md +++ b/posts/2006/02/first-post.md @@ -1,3 +1,12 @@ +--- +Title: First Post! +Author: Sami Samhuri +Date: 8th February, 2006 +Timestamp: 1139368860 +Tags: life +--- + so it's 2am and i should be asleep, but instead i'm setting up a blog. i got a new desk last night and so today i finally got my apartment re-arranged and it's much better now. that's it for now... time to sleep. (speaking of sleep, this new [sleeping bag](http://www.musuchouse.com/) design makes so much sense. awesome.) + diff --git a/posts/2006/02/girlfriend-x.md b/posts/2006/02/girlfriend-x.md index f96872d..bd750b3 100644 --- a/posts/2006/02/girlfriend-x.md +++ b/posts/2006/02/girlfriend-x.md @@ -1,5 +1,14 @@ +--- +Title: Girlfriend X +Author: Sami Samhuri +Date: 18th February, 2006 +Timestamp: 1140292200 +Tags: crazy, funny +--- + This is hilarious! Someone wrote software that manages a "parallel" dating style. > In addition to storing each woman's contact information and picture, the Girlfriend profiles include a Score Card where you track her sexual preferences, her menstrual cycles and how she styles her pubic hair. It's called [Girlfriend X](http://www.wired.com/news/columns/0,70231-0.html), but that's a link to an article about it. I didn't go to the actual website. I just thing it's amusing someone went through the trouble to do this. Maybe there's a demand for it. *\*shrug\** + diff --git a/posts/2006/02/index.ejs b/posts/2006/02/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/02/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/02/intelligent-migration-snippets-0_1-for-textmate.md b/posts/2006/02/intelligent-migration-snippets-0_1-for-textmate.md index ed1f7dd..cd5af9f 100644 --- a/posts/2006/02/intelligent-migration-snippets-0_1-for-textmate.md +++ b/posts/2006/02/intelligent-migration-snippets-0_1-for-textmate.md @@ -1,3 +1,11 @@ +--- +Title: Intelligent Migration Snippets 0.1 for TextMate +Author: Sami Samhuri +Date: 22nd February, 2006 +Timestamp: 1140607680 +Tags: mac os x, textmate, rails, hacking, migrations, snippets +--- + *This should be working now. I've tested it under a new user account here.* *This does requires the syncPeople bundle to be installed to work. That's ok, because you should get the [syncPeople on Rails bundle][syncPeople] anyways.* @@ -35,3 +43,4 @@ Run **Quick Install.app** to install these commands to your Duane came up with a way to jump to the controller method for the view you're editing, or vice versa in TextMate while coding using Rails. This is a huge time-saver, thanks! + diff --git a/posts/2006/02/obligatory-post-about-ruby-on-rails.md b/posts/2006/02/obligatory-post-about-ruby-on-rails.md index 37f47d5..7a51136 100644 --- a/posts/2006/02/obligatory-post-about-ruby-on-rails.md +++ b/posts/2006/02/obligatory-post-about-ruby-on-rails.md @@ -1,3 +1,11 @@ +--- +Title: Obligatory Post about Ruby on Rails +Author: Sami Samhuri +Date: 20th February, 2006 +Timestamp: 1140424260 +Tags: rails, coding, hacking, migration, rails, testing +--- +

I'm a Rails newbie and eager to learn. I welcome any suggestions or criticism you have. You can direct them to my inbox or leave me a comment below.

I finally set myself up with a blog. I mailed my dad the address and mentioned that it was running Typo, which is written in Ruby on Rails. The fact that it is written in Rails was a big factor in my decision. I am currently reading Agile Web Development With Rails and it will be great to use Typo as a learning tool, since I will be modifying my blog anyways regardless of what language it's written in.

@@ -205,3 +213,4 @@

I love how I've only been coding in Rails for a week or two and I can do so much already. It's natural, concise and takes care of the inane details. I love how I know that I don't even have to explain that migration example. It's plainly clear what it does to the database. It doesn't take long to get the basics down and once you do it goes fast.

+ diff --git a/posts/2006/02/sjs-rails-bundle-0_2-for-textmate.md b/posts/2006/02/sjs-rails-bundle-0_2-for-textmate.md index 64f5a91..48db595 100644 --- a/posts/2006/02/sjs-rails-bundle-0_2-for-textmate.md +++ b/posts/2006/02/sjs-rails-bundle-0_2-for-textmate.md @@ -1,3 +1,11 @@ +--- +Title: SJ's Rails Bundle 0.2 for TextMate +Author: Sami Samhuri +Date: 23rd February, 2006 +Timestamp: 1140743880 +Tags: textmate, rails, coding, bundle, macros, rails, snippets, textmate +--- + Everything that you've seen posted on my blog is now available in one bundle. Snippets for Rails database migrations and assertions are all included in this bundle. There are 2 macros for class-end and def-end blocks, bound to ⌃C and ⌃D respectively. Type the class or method definition, except for class or def, and then type the keyboard shortcut and the rest is filled in for you. @@ -21,3 +29,4 @@ Without further ado, here is the bundle:

Download Download SJ's Rails Bundle 0.2

This is a work in progress, so any feedback you have is very helpful in making the next release better. + diff --git a/posts/2006/02/some-textmate-snippets-for-rails-migrations.md b/posts/2006/02/some-textmate-snippets-for-rails-migrations.md index 88967ca..5022ed9 100644 --- a/posts/2006/02/some-textmate-snippets-for-rails-migrations.md +++ b/posts/2006/02/some-textmate-snippets-for-rails-migrations.md @@ -1,3 +1,11 @@ +--- +Title: Some TextMate snippets for Rails Migrations +Author: Sami Samhuri +Date: 18th February, 2006 +Timestamp: 1140331680 +Tags: textmate, rails, hacking, rails, snippets, textmate +--- + My arsenal of snippets and macros in TextMate is building as I read through the rails canon, Agile Web Development... I'm only 150 pages in so I haven't had to add much so far because I started with the bundle found on the rails wiki. The main ones so far are for migrations. Initially I wrote a snippet for adding a table and one for dropping a table, but I don't want to write it twice every time! If I'm adding a table in **up** then I probably want to drop it in **down**. @@ -83,3 +91,4 @@ I'll be adding more snippets and macros. There should be a central place where t

P.S. I tried several ways to get the combo-snippets to put the pieces inside the right functions but failed. We'll see tomorrow if Allan (creator of TextMate) has any ideas.

+ diff --git a/posts/2006/02/textmate-insert-text-into-self-down.md b/posts/2006/02/textmate-insert-text-into-self-down.md index 20a4a88..9ca11c9 100644 --- a/posts/2006/02/textmate-insert-text-into-self-down.md +++ b/posts/2006/02/textmate-insert-text-into-self-down.md @@ -1,3 +1,11 @@ +--- +Title: TextMate: Insert text into self.down +Author: Sami Samhuri +Date: 21st February, 2006 +Timestamp: 1140562500 +Tags: textmate, rails, hacking, commands, macro, rails, snippets, textmate +--- +

UPDATE: I got everything working and it's all packaged up here. There's an installation script this time as well.

Thanks to a helpful thread on the TextMate mailing list I have the beginning of a solution to insert text at 2 (or more) locations in a file.

@@ -52,3 +60,4 @@ The macro I'm thinking of to invoke this is tab-triggered and will simply:
  • Run command "Put in self.down"
  • + diff --git a/posts/2006/02/textmate-move-selection-to-self-down.md b/posts/2006/02/textmate-move-selection-to-self-down.md index c43087a..4a9dcc1 100644 --- a/posts/2006/02/textmate-move-selection-to-self-down.md +++ b/posts/2006/02/textmate-move-selection-to-self-down.md @@ -1,3 +1,11 @@ +--- +Title: TextMate: Move selection to self.down +Author: Sami Samhuri +Date: 21st February, 2006 +Timestamp: 1140510360 +Tags: textmate, rails, hacking, hack, macro, rails, textmate +--- +

    UPDATE: This is obsolete, see this post for a better solution.

    Duane's comment prompted me to think about how to get the drop_table and remove_column lines inserted in the right place. I don't think TextMate's snippets are built to do this sort of text manipulation. It would be nicer, but a quick hack will suffice for now.

    Use MCDT to insert:

    @@ -20,3 +28,4 @@

    The caveat here is that if there is a create_table or add_column between self.down and the table you just added, it will jump back to the wrong spot. It's still faster than doing it all manually, but should be improved. If you use these exclusively, the order they occur in self.down will be opposite of that in self.up. That means either leaving things backwards or doing the re-ordering manually. =/

    + diff --git a/posts/2006/02/textmate-snippets-for-rails-assertions.md b/posts/2006/02/textmate-snippets-for-rails-assertions.md index 6eaf9c8..7ea84ad 100644 --- a/posts/2006/02/textmate-snippets-for-rails-assertions.md +++ b/posts/2006/02/textmate-snippets-for-rails-assertions.md @@ -1,3 +1,11 @@ +--- +Title: TextMate Snippets for Rails Assertions +Author: Sami Samhuri +Date: 20th February, 2006 +Timestamp: 1140508320 +Tags: textmate, rails, coding, rails, snippets, testing, textmate +--- + This time I've got a few snippets for assertions. Using these to type up your tests quickly, and then hitting **⌘R** to run the tests without leaving TextMate, makes testing your Rails app that much more convenient. Just when you thought it was already too easy! (Don't forget that you can use **⌥⌘↓** to move between your code and the corresponding test case.) This time I'm posting the .plist files to make it easier for you to add them to TextMate. All you need to do is copy these to **~/Library/Application Support/TextMate/Bundles/Rails.tmbundle/Snippets**. @@ -7,3 +15,4 @@ This time I'm posting the .plist files to make it easier for you to add them to If anyone would rather I list them all here I can do that as well. Just leave a comment. *(I wanted to include a droplet in the zip file that will copy the snippets to the right place, but my 3-hour attempt at writing the AppleScript to do so left me feeling quite bitter. Maybe I was just mistaken in thinking it would be easy to pick up AppleScript.)* + diff --git a/posts/2006/02/touch-screen-on-steroids.md b/posts/2006/02/touch-screen-on-steroids.md index 45d030d..23eba80 100644 --- a/posts/2006/02/touch-screen-on-steroids.md +++ b/posts/2006/02/touch-screen-on-steroids.md @@ -1,3 +1,11 @@ +--- +Title: Touch Screen on Steroids +Author: Sami Samhuri +Date: 8th February, 2006 +Timestamp: 1139407560 +Tags: technology, touch +--- + If you thought the PowerBook's two-finger scrolling was cool check out this touch screen: Multi-Touch Interaction Research @@ -5,3 +13,4 @@ If you thought the PowerBook's two-finger scrolling was cool check out this touc > "While touch sensing is commonplace for single points of contact, multi-touch sensing enables a user to interact with a system with more than one finger at a time, as in chording and bi-manual operations. Such sensing devices are inherently also able to accommodate multiple users simultaneously, which is especially useful for larger interaction scenarios such as interactive walls and tabletops." This is really amazing. Forget traditional tablet PCs... this is revolutionary and useful in so many applications. I hope this kind of technology is mainstream by 2015. + diff --git a/posts/2006/02/urban-extreme-gymnastics.md b/posts/2006/02/urban-extreme-gymnastics.md index 8c2351e..702059d 100644 --- a/posts/2006/02/urban-extreme-gymnastics.md +++ b/posts/2006/02/urban-extreme-gymnastics.md @@ -1,3 +1,12 @@ +--- +Title: Urban Extreme Gymnastics? +Author: Sami Samhuri +Date: 15th February, 2006 +Timestamp: 1140028860 +Tags: amusement +--- + This crazy russian goes all over the place scaling buildings, doing all sorts of flips, bouncing off the walls literally. He'd be impossible to catch. Russian parkour (urban extreme gymnastics) + diff --git a/posts/2006/03/_data.json b/posts/2006/03/_data.json deleted file mode 100644 index e9a5d4d..0000000 --- a/posts/2006/03/_data.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "generate-selfdown-in-your-rails-migrations": { - "title": "Generate self.down in your Rails migrations", - "date": "3rd March, 2006", - "timestamp": 1141450680, - "tags": [ - "rails", - "textmate", - "migrations", - "rails", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/03/generate-selfdown-in-your-rails-migrations" - }, - "spore": { - "title": "Spore", - "date": "3rd March, 2006", - "timestamp": 1141450980, - "tags": [ - "amusement", - "technology", - "cool", - "fun", - "games" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/03/spore" - }, - "i-dont-mind-fairplay-either": { - "title": "I don't mind FairPlay either", - "date": "3rd March, 2006", - "timestamp": 1141451760, - "tags": [ - "apple", - "mac os x", - "life", - "drm", - "fairplay", - "ipod", - "itunes" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/03/i-dont-mind-fairplay-either" - } -} diff --git a/posts/2006/03/generate-selfdown-in-your-rails-migrations.md b/posts/2006/03/generate-selfdown-in-your-rails-migrations.md index 058d46d..7a94eea 100644 --- a/posts/2006/03/generate-selfdown-in-your-rails-migrations.md +++ b/posts/2006/03/generate-selfdown-in-your-rails-migrations.md @@ -1 +1,10 @@ +--- +Title: Generate self.down in your Rails migrations +Author: Sami Samhuri +Date: 3rd March, 2006 +Timestamp: 1141450680 +Tags: rails, textmate, migrations, rails, textmate +--- + Scott wrote a really cool program that will scan `self.up` and then consult db/schema.rb to automatically fill in `self.down` for you. Brilliant! + diff --git a/posts/2006/03/i-dont-mind-fairplay-either.md b/posts/2006/03/i-dont-mind-fairplay-either.md index 30a4ce6..68a2429 100644 --- a/posts/2006/03/i-dont-mind-fairplay-either.md +++ b/posts/2006/03/i-dont-mind-fairplay-either.md @@ -1,3 +1,11 @@ +--- +Title: I don't mind FairPlay either +Author: Sami Samhuri +Date: 3rd March, 2006 +Timestamp: 1141451760 +Tags: apple, mac os x, life, drm, fairplay, ipod, itunes +--- + I think that Jim is right about Apple's DRM not being all that evil. I buy music from the iTunes Music Store *because* I bought an iPod. The fact I can't play them on another device doesn't matter to me. With my purchased songs I can: @@ -13,3 +21,4 @@ I dislike DRM as much as the next guy, but like CSS encryption on DVDs, FairPlay It reminds me of how here in North America I have to live with the crappy cell phone companies that lock their phones to their networks. If it's something I need or want, sometimes I'll live with restrictions because there are no alternatives yet. *__Update:__ It's almost settled. The pope got an iPod so all that's left is to see if he buys any music off of iTunes. If he does, then it can't be evil. heh...* + diff --git a/posts/2006/03/index.ejs b/posts/2006/03/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/03/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/03/spore.md b/posts/2006/03/spore.md index febd559..164b1b5 100644 --- a/posts/2006/03/spore.md +++ b/posts/2006/03/spore.md @@ -1,3 +1,12 @@ +--- +Title: Spore +Author: Sami Samhuri +Date: 3rd March, 2006 +Timestamp: 1141450980 +Tags: amusement, technology, cool, fun, games +--- + This game that Jim blogged about is probably the coolest game I've seen. You really just have to watch the video, I won't bother explaining it here. I don't really play games much, but this I would play. + diff --git a/posts/2006/04/_data.json b/posts/2006/04/_data.json deleted file mode 100644 index 7746ff1..0000000 --- a/posts/2006/04/_data.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "zsh-terminal-goodness-on-os-x": { - "title": "zsh terminal goodness on OS X", - "date": "4th April, 2006", - "timestamp": 1144187820, - "tags": [ - "mac os x", - "apple", - "osx", - "terminal", - "zsh" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/04/zsh-terminal-goodness-on-os-x" - } -} diff --git a/posts/2006/04/index.ejs b/posts/2006/04/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/04/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/04/zsh-terminal-goodness-on-os-x.md b/posts/2006/04/zsh-terminal-goodness-on-os-x.md index 87c919b..65c0aa3 100644 --- a/posts/2006/04/zsh-terminal-goodness-on-os-x.md +++ b/posts/2006/04/zsh-terminal-goodness-on-os-x.md @@ -1,3 +1,12 @@ +--- +Title: zsh terminal goodness on OS X +Author: Sami Samhuri +Date: 4th April, 2006 +Timestamp: 1144187820 +Tags: mac os x, apple, osx, terminal, zsh +--- + Apple released the OS X 10.4.6 update which fixed a really annoying bug for me. Terminal (and iTerm) would fail to open a new window/tab when your shell is zsh. iTerm would just open then immediately close the window, while Terminal would display the message: [Command completed] in a now-useless window. Rebooting twice to get the fix was reminiscent of Windows, but well worth it. + diff --git a/posts/2006/05/_data.json b/posts/2006/05/_data.json deleted file mode 100644 index c105787..0000000 --- a/posts/2006/05/_data.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "os-x-and-fitts-law": { - "title": "OS X and Fitt's law", - "date": "7th May, 2006", - "timestamp": 1147059780, - "tags": [ - "mac os x", - "apple", - "mac", - "os", - "usability", - "x" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/05/os-x-and-fitts-law" - }, - "wikipediafs-on-linux-in-python": { - "title": "WikipediaFS on Linux, in Python", - "date": "7th May, 2006", - "timestamp": 1147060140, - "tags": [ - "hacking", - "python", - "linux", - "fuse", - "linux", - "mediawiki", - "python", - "wikipediafs" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/05/wikipediafs-on-linux-in-python" - } -} diff --git a/posts/2006/05/index.ejs b/posts/2006/05/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/05/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/05/os-x-and-fitts-law.md b/posts/2006/05/os-x-and-fitts-law.md index 14b790a..afddd87 100644 --- a/posts/2006/05/os-x-and-fitts-law.md +++ b/posts/2006/05/os-x-and-fitts-law.md @@ -1 +1,10 @@ +--- +Title: OS X and Fitt's law +Author: Sami Samhuri +Date: 7th May, 2006 +Timestamp: 1147059780 +Tags: mac os x, apple, mac, os, usability, x +--- + I've realized that OS X really does obey Fitt's law in all 4 corners now. Apple menu in the top left, Spotlight top right, and the bottom 2 are always accessible for drag n drop, unless the dock is hidden. I rarely ever use it because I usually have pretty good chunks of the desktop showing, but it is useful. + diff --git a/posts/2006/05/wikipediafs-on-linux-in-python.md b/posts/2006/05/wikipediafs-on-linux-in-python.md index 63f6802..947fa40 100644 --- a/posts/2006/05/wikipediafs-on-linux-in-python.md +++ b/posts/2006/05/wikipediafs-on-linux-in-python.md @@ -1,3 +1,12 @@ +--- +Title: WikipediaFS on Linux, in Python +Author: Sami Samhuri +Date: 7th May, 2006 +Timestamp: 1147060140 +Tags: hacking, python, linux, fuse, linux, mediawiki, python, wikipediafs +--- + Until now I've been using my own version of pywikipedia for scripting MediaWiki, and it works well. But I read about WikipediaFS and had to check it out. It's a user space filesystem for Linux that's built using the Python bindings for FUSE. What it does is mounts a filesystem that represents your wiki, with articles as text files. You can use them just like any other files with mv, cp, ls, vim, and so on. There hasen't been any action on that project for 13 months though, and it doesn't work on my wiki (MediaWiki 1.4.15) so I'm going to try and make it work after I upgrade to MediaWiki 1.6.3 tonight. This will be pretty cool when it works. I haven't looked at the code yet but it's only 650 lines. + diff --git a/posts/2006/06/_data.json b/posts/2006/06/_data.json deleted file mode 100644 index 819ebb4..0000000 --- a/posts/2006/06/_data.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "ich-bin-auslnder-und-spreche-nicht-gut-deutsch": { - "title": "Ich bin Ausländer und spreche nicht gut Deutsch", - "date": "5th June, 2006", - "timestamp": 1149527460, - "tags": [ - "life", - "munich", - "seekport", - "work" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/06/ich-bin-auslnder-und-spreche-nicht-gut-deutsch" - }, - "never-buy-a-german-keyboard": { - "title": "Never buy a German keyboard!", - "date": "9th June, 2006", - "timestamp": 1149841020, - "tags": [ - "apple", - "apple", - "german", - "keyboard" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/06/never-buy-a-german-keyboard" - }, - "theres-nothing-regular-about-regular-expressions": { - "title": "There's nothing regular about regular expressions", - "date": "10th June, 2006", - "timestamp": 1149928080, - "tags": [ - "technology", - "book", - "regex" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/06/theres-nothing-regular-about-regular-expressions" - }, - "apple-pays-attention-to-detail": { - "title": "Apple pays attention to detail", - "date": "11th June, 2006", - "timestamp": 1150014600, - "tags": [ - "technology", - "mac os x", - "apple" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/06/apple-pays-attention-to-detail" - } -} diff --git a/posts/2006/06/apple-pays-attention-to-detail.md b/posts/2006/06/apple-pays-attention-to-detail.md index 6bcf056..9ba9063 100644 --- a/posts/2006/06/apple-pays-attention-to-detail.md +++ b/posts/2006/06/apple-pays-attention-to-detail.md @@ -1 +1,10 @@ +--- +Title: Apple pays attention to detail +Author: Sami Samhuri +Date: 11th June, 2006 +Timestamp: 1150014600 +Tags: technology, mac os x, apple +--- + I think this has to be one of the big reasons why people who love their Mac, love their Mac (or other Apple product). I usually just have cheap PC speakers plugged into my Mac mini, but I didn't bring any with me to Munich and the internal Mac mini speaker isn't very loud, so I'm using headphones to watch movies. My Mac remembers the volume setting when the headphones ore plugged in, and when they're not, so I don't accidentally blow my ears. It's like my iPod pausing when the headphones are unplugged. It's excruciating attention to the smallest, (seemingly) most unimportant detail. I love it, and I'm hooked. + diff --git a/posts/2006/06/ich-bin-auslnder-und-spreche-nicht-gut-deutsch.md b/posts/2006/06/ich-bin-auslnder-und-spreche-nicht-gut-deutsch.md index f80f7bd..411a80e 100644 --- a/posts/2006/06/ich-bin-auslnder-und-spreche-nicht-gut-deutsch.md +++ b/posts/2006/06/ich-bin-auslnder-und-spreche-nicht-gut-deutsch.md @@ -1,3 +1,11 @@ +--- +Title: Ich bin Ausländer und spreche nicht gut Deutsch +Author: Sami Samhuri +Date: 5th June, 2006 +Timestamp: 1149527460 +Tags: life, munich, seekport, work +--- + How's this for an update: I'm working in Munich for the summer at a European search engine called Seekport. The search engine isn't all they do, as right now I'm programming a desktop widget that shows live scores & news from World Cup matches (in English and Arabic). I'm building it on top of the Yahoo! Widget Engine because it needs to run on Windows. Even though I quite like the Y! Engine, I would still prefer to be coding in straight HTML, CSS & JavaScript like Dashboard programmers get to use. The Y! Engine uses XML (it is somewhat HTML-like) and JavaScript. The place I'm living in is like a dormitory for younger people. I share a bathroom & kitchen with a German guy named Sebastian who is 21 and an artist; a stonecutter actually. I only met him briefly yesterday, but he seems nice. I'm going to teach him English, and he'll teach me German, though his English is much better than my German. It's a pretty quiet place, and we get breakfast included, dinner can be bought for €2,50, and Internet access is included as well. I brought my Mac Mini with me, and as soon as I find an AC adapter I'll be ready to go with the 'net at home. I probably won't blog again until then, since I'm at work right now. @@ -5,3 +13,4 @@ The place I'm living in is like a dormitory for younger people. I share a bathro Germany is great so far, and as soon as I get learning some German I'll be a much happier person. I consider it rude of me to expect everyone to converse with me in English, like I have to do right now. (Oh, and they sell beer by the litre in Germany! They call it a maß.) + diff --git a/posts/2006/06/index.ejs b/posts/2006/06/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/06/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/06/never-buy-a-german-keyboard.md b/posts/2006/06/never-buy-a-german-keyboard.md index d2cf438..723a18b 100644 --- a/posts/2006/06/never-buy-a-german-keyboard.md +++ b/posts/2006/06/never-buy-a-german-keyboard.md @@ -1,3 +1,11 @@ +--- +Title: Never buy a German keyboard! +Author: Sami Samhuri +Date: 9th June, 2006 +Timestamp: 1149841020 +Tags: apple, apple, german, keyboard +--- + Nothing personal, but the backtick/tilde is located where the rest of the left shift key should be, and the return key is double-height, forcing the backslash/bar to the right of the dash/underscore (that'd be the apostrophe/double quote for pretty much everyone else who types qwerty). Note that I'm talking about using a German keyboard with an English layout. The German layout is flat out impossible for coding. German Apple Keyboard @@ -5,3 +13,4 @@ Nothing personal, but the backtick/tilde is located where the rest of the left s For some reason it gets even worse with a German Apple keyboard. Square brackets, where for art though? Through trial and error I found them using Alt/Opt+5/6... non-Apple German keyboards I've seen use Alt Gr+8/9, which is just as bad but at least they were labeled. I know why coders here don't use the German layout! I feel uneasy just talking about it. Here's a text file with each character of the 4 rows in it, normal and then shifted, in qwerty, qwertz, and dvorak. I personally think that some ways the German keys change must be some sick joke (double quote moved up to shift-2, single quote almost staying put, angle brackets being shoved aside only to put the semi-colon and colon on different keys as well). If you ask me lots of that could be avoided by getting rid of the key that replaced the backtick/tilde, and putting the 3 vowels with the umlaut (ü, ö, and ä) on Alt Gr/Opt+[aou]. But hey, I don't type in German so what do I know. + diff --git a/posts/2006/06/theres-nothing-regular-about-regular-expressions.md b/posts/2006/06/theres-nothing-regular-about-regular-expressions.md index 2c559f4..74c0b65 100644 --- a/posts/2006/06/theres-nothing-regular-about-regular-expressions.md +++ b/posts/2006/06/theres-nothing-regular-about-regular-expressions.md @@ -1,3 +1,11 @@ +--- +Title: There's nothing regular about regular expressions +Author: Sami Samhuri +Date: 10th June, 2006 +Timestamp: 1149928080 +Tags: technology, book, regex +--- + I'm almost half way reading Jeffrey Friedl's book Mastering Regular Expressions and I have to say that for a book on something that could potentially bore you to tears, he really does an excellent job of keeping it interesting. Even though a lot of the examples are contrived (I'm sure out of necessity), he also uses real examples of regexes that he's actually used at Yahoo!. As someone who has to know how everything works it's also an excellent lesson in patience, as he frequently says "here, take this knowledge and just accept it for now until I can explain why in the next chapter (or in 3 chapters!)". But it's all with good reason and when he does explain he does it well. @@ -12,3 +20,4 @@ QOTD, p. 329, about matching nested pairs of parens: Wow, that's ugly. (Don't worry, there's a much better solution on the next 2 pages after that quote.) + diff --git a/posts/2006/07/_data.json b/posts/2006/07/_data.json deleted file mode 100644 index 9a6276f..0000000 --- a/posts/2006/07/_data.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "working-with-the-zend-framework": { - "title": "Working with the Zend Framework", - "date": "6th July, 2006", - "timestamp": 1152196560, - "tags": [ - "coding", - "technology", - "php", - "framework", - "php", - "seekport", - "zend" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/07/working-with-the-zend-framework" - }, - "ubuntu-linux-for-linux-users-please": { - "title": "Ubuntu: Linux for Linux users please", - "date": "13th July, 2006", - "timestamp": 1152804840, - "tags": [ - "linux", - "linux", - "ubuntu" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/07/ubuntu-linux-for-linux-users-please" - }, - "ruby-and-rails-have-spoiled-me-rotten": { - "title": "Ruby and Rails have spoiled me rotten", - "date": "17th July, 2006", - "timestamp": 1153140000, - "tags": [ - "rails", - "ruby", - "php", - "coding", - "framework", - "php", - "rails", - "ruby", - "zend" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/07/ruby-and-rails-have-spoiled-me-rotten" - }, - "late-static-binding": { - "title": "Late static binding", - "date": "19th July, 2006", - "timestamp": 1153329780, - "tags": [ - "php", - "coding", - "coding", - "php" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/07/late-static-binding" - }, - "class-method-instance-method-it-doesnt-matter-to-php": { - "title": "Class method? Instance method? It doesn't matter to PHP", - "date": "21st July, 2006", - "timestamp": 1153493760, - "tags": [ - "php", - "coding" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/07/class-method-instance-method-it-doesnt-matter-to-php" - } -} diff --git a/posts/2006/07/class-method-instance-method-it-doesnt-matter-to-php.md b/posts/2006/07/class-method-instance-method-it-doesnt-matter-to-php.md index 4262eca..d9169b4 100644 --- a/posts/2006/07/class-method-instance-method-it-doesnt-matter-to-php.md +++ b/posts/2006/07/class-method-instance-method-it-doesnt-matter-to-php.md @@ -1,3 +1,11 @@ +--- +Title: Class method? Instance method? It doesn't matter to PHP +Author: Sami Samhuri +Date: 21st July, 2006 +Timestamp: 1153493760 +Tags: php, coding +--- + *Update: This has been discussed for PHP6. A little late, but I guess better than never.* I made a mistake while I was coding, for shame! Anyway this particular mistake was that I invoked a class method on the wrong class. The funny part was that this method was an instance method in the class which I typed by mistake. In the error log I saw something like "Invalid use of $this in class function." @@ -47,3 +55,4 @@ This is an instance method! What the fuck?! http://www.php.net/manual/en/language.oop5.static.php is lying to everyone. + diff --git a/posts/2006/07/index.ejs b/posts/2006/07/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/07/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/07/late-static-binding.md b/posts/2006/07/late-static-binding.md index 02ffb07..e2320f4 100644 --- a/posts/2006/07/late-static-binding.md +++ b/posts/2006/07/late-static-binding.md @@ -1,3 +1,11 @@ +--- +Title: Late static binding +Author: Sami Samhuri +Date: 19th July, 2006 +Timestamp: 1153329780 +Tags: php, coding, coding, php +--- + *Update: This has been discussed and will be uh, sort of fixed, in PHP6. You'll be able to use static::my_method() to get the real reference to self in class methods. Not optimal, but still a solution I guess.* As colder on ##php (freenode) told me today, class methods in PHP don't have what they call late static binding. What's that? It means that this code: @@ -38,3 +46,4 @@ class Bar extends Foo I was told that they had a discussion about this on the internal PHP list, so at least they're thinking about this stuff. Too bad PHP5 doesn't have it. I guess I should just be glad I won't be maintaining this code. The resident PHP coder said "just make your code simpler", which is what I was trying to do by removing duplication. Too bad that plan sort of backfired. I guess odd things like this are where PHP starts to show that OO was tacked on as an after-thought. + diff --git a/posts/2006/07/ruby-and-rails-have-spoiled-me-rotten.md b/posts/2006/07/ruby-and-rails-have-spoiled-me-rotten.md index 18657c9..d04ca6f 100644 --- a/posts/2006/07/ruby-and-rails-have-spoiled-me-rotten.md +++ b/posts/2006/07/ruby-and-rails-have-spoiled-me-rotten.md @@ -1,3 +1,11 @@ +--- +Title: Ruby and Rails have spoiled me rotten +Author: Sami Samhuri +Date: 17th July, 2006 +Timestamp: 1153140000 +Tags: rails, ruby, php, coding, framework, php, rails, ruby, zend +--- + It's true. I'm sitting here coding in PHP using the Zend Framework and all I can think about is how much nicer Rails is, or how much easier it is to do [x] in Ruby. It's not that the Zend Framework is bad or anything, it's quite nice, but you just can't match Ruby's expressiveness in a language like PHP. Add the amazing convenience Rails builds on top of Ruby and that's a really hard combo to compete with. I'd love to be using mixins instead of mucking around with abstract classes and interfaces, neither of which will just let you share a method between different classes. Writing proxy methods in these tiny in-between classes is annoying. (ie. inherit from Zend_class, then my real classes inherit from the middle-man class) I *could* add things to Zend's classes, but then upgrades are a bitch. I miss Ruby. I could use something like whytheluckystiff's PHP mixins, which is a clever hack, but still a hack. @@ -7,3 +15,4 @@ I keep looking at Rails code to see how things are done there, and I already cod It's no wonder David H. Hansson wasn't able to write a framework he was happy with in PHP. After using Rails everything seems like a chore. I'm just coding solved problems over again in an inferior language. But hey, I'm learning things and I still got to use Ruby even if the code won't be used later. I guess this experience will just make me appreciate the richness of Ruby and Rails even more. + diff --git a/posts/2006/07/ubuntu-linux-for-linux-users-please.md b/posts/2006/07/ubuntu-linux-for-linux-users-please.md index 41e798c..9145004 100644 --- a/posts/2006/07/ubuntu-linux-for-linux-users-please.md +++ b/posts/2006/07/ubuntu-linux-for-linux-users-please.md @@ -1,3 +1,11 @@ +--- +Title: Ubuntu: Linux for Linux users please +Author: Sami Samhuri +Date: 13th July, 2006 +Timestamp: 1152804840 +Tags: linux, linux, ubuntu +--- + Ubuntu is a fine Linux distro, which is why it's popular. I still use Gentoo on my servers but Ubuntu is fast to set up for a desktop. Linux for humans it certainly is, but dammit sometimes I want Linux like I'm used to. It should ship with build-essentials (gcc & others) installed. It *shouldn't* ask me if I'm sure I want to restart at the GDM login screen. I have no session open and already clicked twice to choose Restart. @@ -5,3 +13,4 @@ It should ship with build-essentials (gcc & others) installed. It *shouldn't* as Other things aren't quite ready for humans yet. Network config needs some work. It's very slow to apply changes. Connecting to Windows printers should be easier (ie. let us browse to find them, or just search and present a list). Fonts aren't amazing yet, though Mac OS X has spoiled me as far as fonts are concerned. Other than these things I think Ubuntu Dapper is a fine release. It installed on my work laptop without a problem and detected the volume keys and wireless network card flawlessly. + diff --git a/posts/2006/07/working-with-the-zend-framework.md b/posts/2006/07/working-with-the-zend-framework.md index 4acb512..3924f0c 100644 --- a/posts/2006/07/working-with-the-zend-framework.md +++ b/posts/2006/07/working-with-the-zend-framework.md @@ -1,3 +1,11 @@ +--- +Title: Working with the Zend Framework +Author: Sami Samhuri +Date: 6th July, 2006 +Timestamp: 1152196560 +Tags: coding, technology, php, framework, php, seekport, zend +--- + At [Seekport](http://translate.google.ca/translate?hl=en&sl=de&u=http://de.wikipedia.org/wiki/Seekport&prev=/search%3Fq%3Dseekport%26client%3Dsafari%26rls%3Den) I'm currently working on an app to handle the config of their business-to-business search engine. It's web-based and I'm using PHP, since that's what they're re-doing the front-end in. Right now it's a big mess of Perl, the main @@ -30,3 +38,4 @@ that nothing is coupled. So I'll probably be writing some notes here about my experience with this framework. I also hope to throw Adobe's [Spry](http://labs.adobe.com/technologies/spry/) into the mix. That little JS library is a lot of fun. + diff --git a/posts/2006/08/_data.json b/posts/2006/08/_data.json deleted file mode 100644 index 3c88f1c..0000000 --- a/posts/2006/08/_data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "where-are-my-headphones": { - "title": "Where are my headphones?", - "date": "22nd August, 2006", - "timestamp": 1156257060, - "tags": [ - "life", - "seekport" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/08/where-are-my-headphones" - } -} diff --git a/posts/2006/08/index.ejs b/posts/2006/08/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/08/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/08/where-are-my-headphones.md b/posts/2006/08/where-are-my-headphones.md index 7cb99b7..e204adb 100644 --- a/posts/2006/08/where-are-my-headphones.md +++ b/posts/2006/08/where-are-my-headphones.md @@ -1 +1,10 @@ +--- +Title: Where are my headphones? +Author: Sami Samhuri +Date: 22nd August, 2006 +Timestamp: 1156257060 +Tags: life, seekport +--- + Some people left Seekport this month and 2 of the remaining employees moved into the office I’m working in. That’s fine, and I’m leaving at the end of the week, but man I’m going crazy. This guy’s pounding on his keyboard like it’s a fucking whack-a-mole game! I don’t know what kind of keyboard he learned to type on but it must’ve been horrible. It sounds like he must go through at least 10 of those things in a year. I don’t know if I’ll make it until Friday without yelling "AGH! STOP THE MADNESS YOU CRAZY BASTARD YOU JUST HAVE TO TOUCH THE KEYS!" + diff --git a/posts/2006/09/_data.json b/posts/2006/09/_data.json deleted file mode 100644 index 303cae9..0000000 --- a/posts/2006/09/_data.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo": { - "title": "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo", - "date": "16th September, 2006", - "timestamp": 1158469860, - "tags": [ - "amusement", - "buffalo" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/09/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo", - "link": "http://en.wikipedia.org/wiki/Buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo" - }, - "some-features-you-might-have-missed-in-itunes-7": { - "title": "Some features you might have missed in iTunes 7", - "date": "22nd September, 2006", - "timestamp": 1158969540, - "tags": [ - "apple", - "apple", - "itunes" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/09/some-features-you-might-have-missed-in-itunes-7" - } -} diff --git a/posts/2006/09/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo.md b/posts/2006/09/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo.md index e562ae0..52e09de 100644 --- a/posts/2006/09/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo.md +++ b/posts/2006/09/buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo-buffalo.md @@ -1 +1,11 @@ +--- +Title: Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo +Author: Sami Samhuri +Date: 16th September, 2006 +Timestamp: 1158469860 +Tags: amusement, buffalo +Link: http://en.wikipedia.org/wiki/Buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo_buffalo +--- + Wouldn't the sentence 'I want to put a hyphen between the words Fish and And and And and Chips in my Fish-And-Chips sign' have been clearer if quotation marks had been placed before Fish, and between Fish and and, and and and And, and And and and, and and and And, and And and and, and and and Chips, as well as after Chips? + diff --git a/posts/2006/09/index.ejs b/posts/2006/09/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/09/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/09/some-features-you-might-have-missed-in-itunes-7.md b/posts/2006/09/some-features-you-might-have-missed-in-itunes-7.md index 952d586..5031de4 100644 --- a/posts/2006/09/some-features-you-might-have-missed-in-itunes-7.md +++ b/posts/2006/09/some-features-you-might-have-missed-in-itunes-7.md @@ -1,14 +1,22 @@ -New menu +--- +Title: Some features you might have missed in iTunes 7 +Author: Sami Samhuri +Date: 22nd September, 2006 +Timestamp: 1158969540 +Tags: apple, apple, itunes +--- Besides the big changes in iTunes 7 there have been some minor changes that are still pretty useful. +

    New menu

    + Here's a quick recap of a few major features: - * Coverflow built in, new views to flip through album covers and video thumbnails - * iTunes Music Store is now just the iTunes Store - * New look, no more brushed metal - * The menu on the left is more structured and easier to navigate (for me) - * Games support + - Coverflow built in, new views to flip through album covers and video thumbnails + - iTunes Music Store is now just the iTunes Store + - New look, no more brushed metal + - The menu on the left is more structured and easier to navigate (for me) + - Games support And now some of the smaller gems are listed below. @@ -41,3 +49,4 @@ For videos you can now set the Show, Season Number, Episode Number, and Episode I want to be able to change more than one movie's type to Movie, Music Video, or TV Show at once. Manually doing it for more than one season of a show gets old very fast, and I'm reluctant to write a program to let you do just that but I may if I have time. I'm sure I have other gripes, but honestly iTunes is a full-featured app and while there's room for improvement they do get a lot right with it as well. + diff --git a/posts/2006/12/_data.json b/posts/2006/12/_data.json deleted file mode 100644 index 66a3e2e..0000000 --- a/posts/2006/12/_data.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "coping-with-windows-xp-activiation-on-a-mac": { - "title": "Coping with Windows XP activiation on a Mac", - "date": "17th December, 2006", - "timestamp": 1166427000, - "tags": [ - "parallels", - "windows", - "apple", - "mac os x", - "bootcamp" - ], - "author": "Sami Samhuri", - "url": "/posts/2006/12/coping-with-windows-xp-activiation-on-a-mac" - } -} diff --git a/posts/2006/12/coping-with-windows-xp-activiation-on-a-mac.md b/posts/2006/12/coping-with-windows-xp-activiation-on-a-mac.md index 78f54e5..a7e6691 100644 --- a/posts/2006/12/coping-with-windows-xp-activiation-on-a-mac.md +++ b/posts/2006/12/coping-with-windows-xp-activiation-on-a-mac.md @@ -1,8 +1,16 @@ +--- +Title: Coping with Windows XP activiation on a Mac +Author: Sami Samhuri +Date: 17th December, 2006 +Timestamp: 1166427000 +Tags: parallels, windows, apple, mac os x, bootcamp +--- + **Update:** This needs to be run at system startup, before you log in. I have XP Home and haven't been able to get it to run that way yet. I can't test my method until I get XP Pro, if I get XP Pro at all. However chack left a comment saying that he got it to work on XP Pro, so it seems we've got a solution here. -
    +--- ### What is this about? ### @@ -14,7 +22,7 @@ I try and stick to Linux and OS X especially for any shell work, and on Windows If anyone actually knows how to write batch files I'd like to hear any suggestions you might have. -
    +--- ### Make sure things will work ### @@ -28,11 +36,11 @@ If you see a line of output like **"Description . . . . : Parallels Network Adap If you're lazy then you can download this test script and run it in a command window. Run it in both Parallels and Boot Camp to make sure it gets them both right. The output will either be "Boot Camp" or "Parallels", and a line above that which you can just ignore. -
    +--- **NOTE:** If you're running Windows in Boot Camp right now then do Step #2 before Step #1. -
    +--- ## Step #1 ## @@ -43,7 +51,7 @@ Run Windows in Parallels, activate it, then open a command window and run: Download backup-parallels-wpa.bat -
    +--- ## Step #2 ## @@ -54,7 +62,7 @@ Run Windows using Boot Camp, activate it, then run: Download backup-bootcamp-wpa.bat -
    +--- ## Step #3: Running the script at startup ## @@ -80,7 +88,7 @@ If you have XP Pro then you can get it to run using the Group Policy editor. Sav Download activate.bat -
    +--- ### You're done! ### @@ -90,10 +98,11 @@ If MS doesn't get their act together with this activation bullshit then maybe th This method worked for me and hopefully it will work for you as well. I'm interested to know if it does or doesn't so please leave a comment or e-mail me. -
    +--- #### Off-topic rant #### -I finally bought Windows XP this week and I'm starting to regret it because of all the hoops they make you jump through to use it. I only use it to fix sites in IE because it can't render a web page properl and I didn't want to buy it just for that. I thought that it would be good to finally get a legit copy since I was using a pirated version and was sick of working around validation bullshit for updates. Now I have to work around MS's activation bullshit and it's just as bad! Screw Microsoft for putting their customers through this sort of thing. Things like this and the annoying balloons near the system tray just fuel my contempt for Windows and reinforce my love of Linux and Mac OS X. +I finally bought Windows XP this week and I'm starting to regret it because of all the hoops they make you jump through to use it. I only use it to fix sites in IE because it can't render a web page properly and I didn't want to buy it just for that. I thought that it would be good to finally get a legit copy since I was using a pirated version and was sick of working around validation bullshit for updates. Now I have to work around MS's activation bullshit and it's just as bad! Screw Microsoft for putting their customers through this sort of thing. Things like this and the annoying balloons near the system tray just fuel my contempt for Windows and reinforce my love of Linux and Mac OS X. I don't make money off any of my sites, which is why I didn't want to have to buy stupid Windows. I hate MS so much for making shitty IE the standard browser. + diff --git a/posts/2006/12/index.ejs b/posts/2006/12/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2006/12/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2006/index.ejs b/posts/2006/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2006/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2007/03/_data.json b/posts/2007/03/_data.json deleted file mode 100644 index c4e060d..0000000 --- a/posts/2007/03/_data.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "full-screen-cover-flow": { - "title": "Full-screen Cover Flow", - "date": "6th March, 2007", - "timestamp": 1173217860, - "tags": [ - "apple", - "coverflow", - "itunes" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/03/full-screen-cover-flow" - }, - "digg-v4-reply-to-replies-greasemonkey-script": { - "title": "Digg v4: Reply to replies (Greasemonkey script)", - "date": "8th March, 2007", - "timestamp": 1173424740, - "tags": [ - "coding", - "digg", - "firefox", - "userscript" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/03/digg-v4-reply-to-replies-greasemonkey-script" - }, - "diggscuss-0_9": { - "title": "Diggscuss 0.9", - "date": "25th March, 2007", - "timestamp": 1174834980, - "tags": [ - "coding", - "digg", - "firefox", - "userscript" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/03/diggscuss-0_9" - } -} diff --git a/posts/2007/03/digg-v4-reply-to-replies-greasemonkey-script.md b/posts/2007/03/digg-v4-reply-to-replies-greasemonkey-script.md index 82e4507..0938b44 100644 --- a/posts/2007/03/digg-v4-reply-to-replies-greasemonkey-script.md +++ b/posts/2007/03/digg-v4-reply-to-replies-greasemonkey-script.md @@ -1,3 +1,11 @@ +--- +Title: Digg v4: Reply to replies (Greasemonkey script) +Author: Sami Samhuri +Date: 8th March, 2007 +Timestamp: 1173424740 +Tags: coding, digg, firefox, userscript +--- + It's nearly identical to the previous one but works with Digg v4 and should be slightly more efficient. I'm working on making it faster because I believe it is quite inefficient as it is. It was David Bendit's (the original author) first script though so kudos to him for starting this thing because I love it. I just hate a slow greasemonkey script on pages with hundreds of comments. Please leave me some comments if you appreciate this, or have any feedback on the code. @@ -5,3 +13,4 @@ Please leave me some comments if you appreciate this, or have any feedback on th Happy Digging! Digg this script! + diff --git a/posts/2007/03/diggscuss-0_9.md b/posts/2007/03/diggscuss-0_9.md index 356a7f0..5cbd577 100644 --- a/posts/2007/03/diggscuss-0_9.md +++ b/posts/2007/03/diggscuss-0_9.md @@ -1,3 +1,11 @@ +--- +Title: Diggscuss 0.9 +Author: Sami Samhuri +Date: 25th March, 2007 +Timestamp: 1174834980 +Tags: coding, digg, firefox, userscript +--- + The biggest change is that it uses XPath for the dirty work, which makes it quite a bit more readable. It's 100 lines longer than the previous version, but it does twice as much. Now both a [reply] and a [quote] link are added to each comment. Replying to parent comments now adds @username: to the comment field as well as the links added by the script. @@ -7,3 +15,4 @@ Regression: The link to the parent comment is no longer displayed. If you miss t Any comments, criticism or feature requests are welcome just leave me a comment here or on userscripts.org. Happy Digging! + diff --git a/posts/2007/03/full-screen-cover-flow.md b/posts/2007/03/full-screen-cover-flow.md index 4fd2640..59d21ee 100644 --- a/posts/2007/03/full-screen-cover-flow.md +++ b/posts/2007/03/full-screen-cover-flow.md @@ -1,5 +1,14 @@ +--- +Title: Full-screen Cover Flow +Author: Sami Samhuri +Date: 6th March, 2007 +Timestamp: 1173217860 +Tags: apple, coverflow, itunes +--- + Cover Flow now comes in a full-screen flavour. It's pretty sweet, but unfortunately the remote controls iTunes exactly the same so you need a mouse to flick through the covers. That made me wonder if Front Row used this full-screen Cover Flow view for albums now, but it doesn't. I hope Apple gets on this and adds it to Front Row and the Apple TV. I'm sure it's already on their list. I would love to be able to flick through my albums with the remote right now, but I'm not going to install one of those 3rd-party remote config tools. Guess I have to wait for Apple to do it. + diff --git a/posts/2007/03/index.ejs b/posts/2007/03/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/03/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/04/_data.json b/posts/2007/04/_data.json deleted file mode 100644 index 32985a5..0000000 --- a/posts/2007/04/_data.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "a-triple-booting-schizophrenic-macbook": { - "title": "A triple-booting, schizophrenic MacBook", - "date": "4th April, 2007", - "timestamp": 1175754600, - "tags": [ - "linux", - "mac os x", - "windows" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/04/a-triple-booting-schizophrenic-macbook" - }, - "activerecord-base_find_or_create-and-find_or_initialize": { - "title": "ActiveRecord::Base.find_or_create and find_or_initialize", - "date": "11th April, 2007", - "timestamp": 1176287040, - "tags": [ - "activerecord", - "coding", - "rails", - "ruby" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/04/activerecord-base_find_or_create-and-find_or_initialize" - }, - "getting-to-know-vista": { - "title": "Getting to know Vista", - "date": "16th April, 2007", - "timestamp": 1176746940, - "tags": [ - "windows" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/04/getting-to-know-vista" - }, - "quickly-inserting-millions-of-rows-with-mysql-innodb": { - "title": "Quickly inserting millions of rows with MySQL/InnoDB", - "date": "26th April, 2007", - "timestamp": 1177596360, - "tags": [ - "linux", - "mysql" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/04/quickly-inserting-millions-of-rows-with-mysql-innodb" - }, - "funny-how-code-can-be-beautiful": { - "title": "Funny how code can be beautiful", - "date": "30th April, 2007", - "timestamp": 1177942020, - "tags": [ - "haskell" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/04/funny-how-code-can-be-beautiful" - } -} diff --git a/posts/2007/04/a-triple-booting-schizophrenic-macbook.md b/posts/2007/04/a-triple-booting-schizophrenic-macbook.md index c4e16c2..db72d61 100644 --- a/posts/2007/04/a-triple-booting-schizophrenic-macbook.md +++ b/posts/2007/04/a-triple-booting-schizophrenic-macbook.md @@ -1,3 +1,11 @@ +--- +Title: A triple-booting, schizophrenic MacBook +Author: Sami Samhuri +Date: 4th April, 2007 +Timestamp: 1175754600 +Tags: linux, mac os x, windows +--- + The steps are well documented so I won’t get into detail here but if you have a backup and can wipe your disk all you do is: * Install OS X to a single partition filling your disk (optionally use your existing OS X intall) @@ -25,3 +33,4 @@ Oh yeah, I also have a Parallels VM for Windows 3.11. It boots in about second t * and/or going through a screwed up mode with a black & white scrambled screen for a seconds before getting to the houndstooth. Like I said the X.org boys are doing amazing work. Hopefully soon after the current eye-candy craze is over they’ll get to more important work that needs to be done. + diff --git a/posts/2007/04/activerecord-base_find_or_create-and-find_or_initialize.md b/posts/2007/04/activerecord-base_find_or_create-and-find_or_initialize.md index 592cc98..8271e38 100644 --- a/posts/2007/04/activerecord-base_find_or_create-and-find_or_initialize.md +++ b/posts/2007/04/activerecord-base_find_or_create-and-find_or_initialize.md @@ -1,3 +1,11 @@ +--- +Title: ActiveRecord::Base.find_or_create and find_or_initialize +Author: Sami Samhuri +Date: 11th April, 2007 +Timestamp: 1176287040 +Tags: activerecord, coding, rails, ruby +--- + I've extended ActiveRecord with `find_or_create(params)` and `find_or_initialize(params)`. Those are actually just wrappers around `find_or_do(action, params)` which does the heavy lifting. They work exactly as you'd expect them to work with possibly one gotcha. If you pass in an `id` attribute then it will just find that record directly. If it fails it will try and find the record using the other params as it would have done normally. @@ -98,3 +106,4 @@ Enough chat, here's the self-explanatory code: end end end + diff --git a/posts/2007/04/funny-how-code-can-be-beautiful.md b/posts/2007/04/funny-how-code-can-be-beautiful.md index db56f9d..9f29a52 100644 --- a/posts/2007/04/funny-how-code-can-be-beautiful.md +++ b/posts/2007/04/funny-how-code-can-be-beautiful.md @@ -1,3 +1,11 @@ +--- +Title: Funny how code can be beautiful +Author: Sami Samhuri +Date: 30th April, 2007 +Timestamp: 1177942020 +Tags: haskell +--- + While reading a Haskell tutorial I came across the following code for defining the Fibonacci numbers: fib = 1 : 1 : [ a + b | (a, b) <- zip fib (tail fib) ] @@ -16,3 +24,4 @@ Going deeper down the functional rabbit-hole you’ll find things like What the hell are Monads? * Monads on WikiBooks * Monads for the Working Haskell Programmer + diff --git a/posts/2007/04/getting-to-know-vista.md b/posts/2007/04/getting-to-know-vista.md index ca5bfb2..c22ba0f 100644 --- a/posts/2007/04/getting-to-know-vista.md +++ b/posts/2007/04/getting-to-know-vista.md @@ -1,3 +1,11 @@ +--- +Title: Getting to know Vista +Author: Sami Samhuri +Date: 16th April, 2007 +Timestamp: 1176746940 +Tags: windows +--- + ### It looks pretty good! ### After figuring out how to minimise the translucency of the window decorations I think Aero looks ok. Window titles, on both windows and the taskbar, can be difficult to read at a glance which is really stupid if you ask me. But it’s better than Luna! They really lay the effects on thick but overall I find it pretty pleasant and it runs well on my MacBook’s Intel 945 video chip. @@ -55,3 +63,4 @@ The bad: ### My conclusion ### Perhaps the scores of talented developers at Microsoft *can* save them despite their obvious shortcomings in management. .NET seems like a decent platform, but we’ll have to see how I like it once I actually use it. So far I don’t hate Vista and considering the previous versions of Windows that’s a pretty good review coming from me. I’m still recommending Macs to my family and friends, but who knows what the future holds. I don’t hate Vista and by the end of the summer I may even [gasp] like it, and/or .NET. I haven’t used an IDE since VB6 and MS has always had a decent IDE (albeit with a crummy text editor). I’m expecting to enjoy it. If there’s one thing MS knows it’s the value of good dev tools and developers. + diff --git a/posts/2007/04/index.ejs b/posts/2007/04/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/04/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/04/quickly-inserting-millions-of-rows-with-mysql-innodb.md b/posts/2007/04/quickly-inserting-millions-of-rows-with-mysql-innodb.md index 565e27d..f6f3d64 100644 --- a/posts/2007/04/quickly-inserting-millions-of-rows-with-mysql-innodb.md +++ b/posts/2007/04/quickly-inserting-millions-of-rows-with-mysql-innodb.md @@ -1,3 +1,11 @@ +--- +Title: Quickly inserting millions of rows with MySQL/InnoDB +Author: Sami Samhuri +Date: 26th April, 2007 +Timestamp: 1177596360 +Tags: linux, mysql +--- + The absolute first thing you should do is check your MySQL configuration to make sure it’s sane for the system you’re using. I kept getting a ‘The table is too large’ error on my Gentoo box after inserting several million rows because the default config limits the InnoDB tablespace size to 128M. It was also tuned for a box with as little as 64M of RAM. That’s cool for a small VPS or your old Pentium in the corner collecting dust. For a modern server, workstation, or even notebook with gigs of RAM you’ll likely want to make some changes. ### Tweaking my.cnf ### @@ -43,3 +51,4 @@ Now you should be able to insert dozens and indeed hundreds of millions of rows The solution now is to execute SET AUTOCOMMIT=0 before inserting the data, and then issuing a COMMIT when you’re done. With all that in place I’m inserting 14,000,000 rows into both MyISAM and InnoDB tables in 30 minutes. MyISAM is still ~ 2 min faster, but as I said earlier this is adequate for now. Prior to all this it took several hours to insert 14,000,000 rows so I am happy. Now you can enjoy the speed MyISAM is known for with your InnoDB tables. Consider the data integrity a bonus! ;-) + diff --git a/posts/2007/05/_data.json b/posts/2007/05/_data.json deleted file mode 100644 index 26767ba..0000000 --- a/posts/2007/05/_data.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "typo-and-i-are-friends-again": { - "title": "Typo and I are friends again", - "date": "1st May, 2007", - "timestamp": 1178081497, - "tags": [ - "typo" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/typo-and-i-are-friends-again" - }, - "a-scheme-parser-in-haskell-part-1": { - "title": "A Scheme parser in Haskell: Part 1", - "date": "3rd May, 2007", - "timestamp": 1178178470, - "tags": [ - "coding", - "haskell" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/a-scheme-parser-in-haskell-part-1" - }, - "gotta-love-the-ferry-ride": { - "title": "Gotta Love the Ferry Ride", - "date": "5th May, 2007", - "timestamp": 1178364300, - "tags": [ - "life", - "photo", - "bc", - "victoria" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/gotta-love-the-ferry-ride" - }, - "a-new-way-to-look-at-networking": { - "title": "A New Way to Look at Networking", - "date": "5th May, 2007", - "timestamp": 1178406600, - "tags": [ - "technology", - "networking" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/a-new-way-to-look-at-networking" - }, - "dtrace-ruby-goodness-for-sun": { - "title": "dtrace + Ruby = Goodness for Sun", - "date": "9th May, 2007", - "timestamp": 1178725500, - "tags": [ - "ruby", - "dtrace", - "sun" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/dtrace-ruby-goodness-for-sun" - }, - "i-cant-wait-to-see-what-matt-stone-trey-parker-do-with-this": { - "title": "I Can't Wait to See What Trey Parker & Matt Stone Do With This", - "date": "9th May, 2007", - "timestamp": 1178746440, - "tags": [ - "crazy" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/i-cant-wait-to-see-what-matt-stone-trey-parker-do-with-this" - }, - "rails-plugins-link-dump": { - "title": "Rails Plugins (link dump)", - "date": "10th May, 2007", - "timestamp": 1178756520, - "tags": [ - "rails" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/rails-plugins-link-dump" - }, - "enumerable-pluck-and-string-to_proc-for-ruby": { - "title": "Enumurable#pluck and String#to_proc for Ruby", - "date": "10th May, 2007", - "timestamp": 1178838840, - "tags": [ - "ruby", - "extensions" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/enumerable-pluck-and-string-to_proc-for-ruby", - "styles": [ - "/css/typocode.css" - ] - }, - "dumping-objects-to-the-browser-in-rails": { - "title": "Dumping Objects to the Browser in Rails", - "date": "15th May, 2007", - "timestamp": 1179261480, - "tags": [ - "rails" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/dumping-objects-to-the-browser-in-rails", - "styles": [ - "/css/typocode.css" - ] - }, - "cheating-at-life-in-general": { - "title": "Cheating at Life in General", - "date": "16th May, 2007", - "timestamp": 1179308760, - "tags": [ - "cheat", - "vim", - "emacs", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/cheating-at-life-in-general" - }, - "iphone-humour": { - "title": "iPhone Humour", - "date": "18th May, 2007", - "timestamp": 1179513240, - "tags": [ - "apple", - "funny", - "iphone" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/iphone-humour" - }, - "inspirado": { - "title": "Inspirado", - "date": "22nd May, 2007", - "timestamp": 1179865380, - "tags": [ - "rails", - "inspirado" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/inspirado" - }, - "finnish-court-rules-css-ineffective-at-protecting-dvds": { - "title": "Finnish court rules CSS ineffective at protecting DVDs", - "date": "26th May, 2007", - "timestamp": 1180175040, - "tags": [ - "drm" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/05/finnish-court-rules-css-ineffective-at-protecting-dvds" - } -} diff --git a/posts/2007/05/a-new-way-to-look-at-networking.md b/posts/2007/05/a-new-way-to-look-at-networking.md index 469286b..bbd953f 100644 --- a/posts/2007/05/a-new-way-to-look-at-networking.md +++ b/posts/2007/05/a-new-way-to-look-at-networking.md @@ -1,3 +1,11 @@ +--- +Title: A New Way to Look at Networking +Author: Sami Samhuri +Date: 5th May, 2007 +Timestamp: 1178406600 +Tags: technology, networking +--- + Van Jacobson gave a Google Tech Talk on some of his ideas of how a modern, global network could work more effectively, and with more trust in the data which changes many hands on its journey to its final destination.

    @@ -9,3 +17,4 @@ The man is very smart and his ideas are fascinating. He has the experience and k He explains the problems that were faced while using the phone networks for data, and how they were solved by realizing that a new problem had risen and needed a new, different solution. He then goes to explain how the Internet has changed significantly from the time it started off in research centres, schools, and government offices into what it is today (lots of identical bytes being redundantly pushed to many consumers, where broadcast would be more appropriate and efficient). If you have some time I really suggest watching this talk. I would love to research some of the things he spoke about if I ever got the chance. I'm sure they'll be on my mind anyway and inevitably I'll end up playing around with layering crap onto IPV6 and what not. Deep down I love coding in C and I think developing a protocol would be pretty fun. I'd learn a lot in any case. + diff --git a/posts/2007/05/a-scheme-parser-in-haskell-part-1.md b/posts/2007/05/a-scheme-parser-in-haskell-part-1.md index 497be5e..bf2e830 100644 --- a/posts/2007/05/a-scheme-parser-in-haskell-part-1.md +++ b/posts/2007/05/a-scheme-parser-in-haskell-part-1.md @@ -1,3 +1,11 @@ +--- +Title: A Scheme parser in Haskell: Part 1 +Author: Sami Samhuri +Date: 3rd May, 2007 +Timestamp: 1178178470 +Tags: coding, haskell +--- + From Write Yourself a Scheme in 48 hours:

    @@ -58,3 +66,4 @@ When I first read about Haskell I was overwhelmed by not knowing anything, and n I'm currently working on ex. 3.3.4, which is parsing R5RS compliant numbers (e.g. #o12345670, #xff, #d987). I'll probably write something about that once I figure it out, but in the meantime if you have any hints I'm all ears. *Update #1: I should do more proof-reading if I'm going to try and explain things. I made some changes in wording.* + diff --git a/posts/2007/05/cheating-at-life-in-general.md b/posts/2007/05/cheating-at-life-in-general.md index e37a145..cd765e9 100644 --- a/posts/2007/05/cheating-at-life-in-general.md +++ b/posts/2007/05/cheating-at-life-in-general.md @@ -1,3 +1,11 @@ +--- +Title: Cheating at Life in General +Author: Sami Samhuri +Date: 16th May, 2007 +Timestamp: 1179308760 +Tags: cheat, vim, emacs, textmate +--- + *NB: My definition of life is slightly skewed by my being somewhat of a geek* Luckily no one in the real world cares if you cheat. Most of life is open-book, but for the times when you just need to find something quick the answer, of course, is to [cheat](http://cheat.errtheblog.com/) profusely. @@ -8,3 +16,4 @@ I've only checked out a few of the cheat sheets but they are of high quality and They certainly know the way to my heart! Ruby, Rails, TextMate*, vim*, zsh, screen. That'll do snake. That'll do. *\* There are cheats for emacs, jEdit, and [e](http://www.e-texteditor.com/) too if TextMate and/or vim don't tickle your fancy.* + diff --git a/posts/2007/05/dtrace-ruby-goodness-for-sun.md b/posts/2007/05/dtrace-ruby-goodness-for-sun.md index 6b69a97..fe81369 100644 --- a/posts/2007/05/dtrace-ruby-goodness-for-sun.md +++ b/posts/2007/05/dtrace-ruby-goodness-for-sun.md @@ -1,3 +1,12 @@ +--- +Title: dtrace + Ruby = Goodness for Sun +Author: Sami Samhuri +Date: 9th May, 2007 +Timestamp: 1178725500 +Tags: ruby, dtrace, sun +--- + Suddenly I feel the urge to try out Solaris for i386 again. Last time I gave it a shot was when it was first released, and all I ever got out of the CD was a white screen. It's been 2-3 years since then and it should be well-tested. I'll try to install it into a VM first using the ISO and potentially save myself a CD. (I don't even think I have blank CDs lying around anymore, only DVDs.) The culprit. + diff --git a/posts/2007/05/dumping-objects-to-the-browser-in-rails.md b/posts/2007/05/dumping-objects-to-the-browser-in-rails.md index 6eca1da..898c367 100644 --- a/posts/2007/05/dumping-objects-to-the-browser-in-rails.md +++ b/posts/2007/05/dumping-objects-to-the-browser-in-rails.md @@ -1,3 +1,11 @@ +--- +Title: Dumping Objects to the Browser in Rails +Author: Sami Samhuri +Date: 15th May, 2007 +Timestamp: 1179261480 +Tags: rails +--- + Here's an easy way to solve a problem that may have nagged you as it did me. Simply using foo.inspect to dump out some object to the browser dumps one long string which is barely useful except for short strings and the like. The ideal output is already available using the PrettyPrint module so we just need to use it. @@ -23,3 +31,4 @@ Alternatively you could do as the extensions folks do and actually define pps.string end end + diff --git a/posts/2007/05/enumerable-pluck-and-string-to_proc-for-ruby.md b/posts/2007/05/enumerable-pluck-and-string-to_proc-for-ruby.md index ecee11b..9c46634 100644 --- a/posts/2007/05/enumerable-pluck-and-string-to_proc-for-ruby.md +++ b/posts/2007/05/enumerable-pluck-and-string-to_proc-for-ruby.md @@ -1,3 +1,11 @@ +--- +Title: Enumurable#pluck and String#to_proc for Ruby +Author: Sami Samhuri +Date: 10th May, 2007 +Timestamp: 1178838840 +Tags: ruby, extensions +--- + I wanted a method analogous to Prototype's pluck and invoke in Rails for building lists for options_for_select. Yes, I know about options_from_collection_for_select. I wanted something more general that I can use anywhere - not just in Rails - so I wrote one. In a second I'll introduce Enumerable#pluck, but first we need some other methods to help implement it nicely. @@ -116,3 +124,4 @@ I wrote another version without using the various #to_proc methods It's just icing on the cake considering Ruby's convenient block syntax, but there it is. Do with it what you will. You can change or extend any of these to support drilling down into hashes quite easily too. *Update #1: Fixed a potential performance issue in Enumerable#to_proc by saving the results of to_proc in @procs.* + diff --git a/posts/2007/05/finnish-court-rules-css-ineffective-at-protecting-dvds.md b/posts/2007/05/finnish-court-rules-css-ineffective-at-protecting-dvds.md index 9ba99f6..8ccd027 100644 --- a/posts/2007/05/finnish-court-rules-css-ineffective-at-protecting-dvds.md +++ b/posts/2007/05/finnish-court-rules-css-ineffective-at-protecting-dvds.md @@ -1 +1,10 @@ +--- +Title: Finnish court rules CSS ineffective at protecting DVDs +Author: Sami Samhuri +Date: 26th May, 2007 +Timestamp: 1180175040 +Tags: drm +--- + It's nice to see people making sane calls on issues like this. Ars has a nice summary and there's also a press release. + diff --git a/posts/2007/05/gotta-love-the-ferry-ride.md b/posts/2007/05/gotta-love-the-ferry-ride.md index 313ab56..f55d137 100644 --- a/posts/2007/05/gotta-love-the-ferry-ride.md +++ b/posts/2007/05/gotta-love-the-ferry-ride.md @@ -1,3 +1,12 @@ +--- +Title: Gotta Love the Ferry Ride +Author: Sami Samhuri +Date: 5th May, 2007 +Timestamp: 1178364300 +Tags: life, photo, bc, victoria +--- + I lived in Victoria for over a year before I ever rode the ferry between Vancouver Island and Tsawwassen (ignoring the time I was in BC with my family about 16 years ago, that is). I always just flew in and out of Victoria directly. The ferry is awesome and the view is incredible, navigating through all those little islands. Last time I rode the ferry I snapped this shot. It's possibly the best picture I've taken on that trip. Sunset + diff --git a/posts/2007/05/i-cant-wait-to-see-what-matt-stone-trey-parker-do-with-this.md b/posts/2007/05/i-cant-wait-to-see-what-matt-stone-trey-parker-do-with-this.md index 68241fd..0dd6875 100644 --- a/posts/2007/05/i-cant-wait-to-see-what-matt-stone-trey-parker-do-with-this.md +++ b/posts/2007/05/i-cant-wait-to-see-what-matt-stone-trey-parker-do-with-this.md @@ -1,3 +1,11 @@ +--- +Title: I Can't Wait to See What Trey Parker & Matt Stone Do With This +Author: Sami Samhuri +Date: 9th May, 2007 +Timestamp: 1178746440 +Tags: crazy +--- + I'd just like to say, bwa ha ha ha! Summary: Paris Hilton drove with a suspended license and is facing 45 days in jail. Now she's reaching out to lord knows who on her MySpace page to petition The Governator to pardon her. I might cry if I weren't pissing myself laughing. @@ -9,3 +17,4 @@ Paris Hilton is out of her mind, living in some fantasy world separate from Eart I take this as a learning experience. For example, I learned that the US is no longer part of the world. Flat out crazy, insane, not of sound mind. She is not any sort of hope, inspiration or role model for anyone. + diff --git a/posts/2007/05/index.ejs b/posts/2007/05/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/05/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/05/inspirado.md b/posts/2007/05/inspirado.md index 349b11f..1de5b6b 100644 --- a/posts/2007/05/inspirado.md +++ b/posts/2007/05/inspirado.md @@ -1,3 +1,11 @@ +--- +Title: Inspirado +Author: Sami Samhuri +Date: 22nd May, 2007 +Timestamp: 1179865380 +Tags: rails, inspirado +--- + spyderous is a Gentoo dev and I read his posts via the Gentoo planet (and again on the freedesktop.org planet). He recently mentioned an idea to foster participation in Gentoo (or any other project) by aggregating personal project plans for people to browse. I thought it sounded cool so I started coding and came up with what I call inspirado. @@ -9,3 +17,4 @@ Note that everything you see there is purely for testing purposes and any change There are several features on my TODO list but I'd love to hear about any you might have. Write to sami.samhuri@gmail.com if you have suggestions or anything else to say. (Inspirado is, of course, a Rails app.) + diff --git a/posts/2007/05/iphone-humour.md b/posts/2007/05/iphone-humour.md index 3cd7d7a..1129312 100644 --- a/posts/2007/05/iphone-humour.md +++ b/posts/2007/05/iphone-humour.md @@ -1,3 +1,11 @@ +--- +Title: iPhone Humour +Author: Sami Samhuri +Date: 18th May, 2007 +Timestamp: 1179513240 +Tags: apple, funny, iphone +--- + Love it or hate it - even though it's not even out yet - the iPhone has spawned at least 2 good jokes. [The other iPhone lawsuit](http://www.geekculture.com/joyoftech/joyarchives/910.html) (GeekCulture.com) @@ -5,3 +13,4 @@ Love it or hate it - even though it's not even out yet - the iPhone has spawned [A comment on slashdot](http://apple.slashdot.org/comments.pl?sid=235163&cid=19174829): > "I'm waiting for the iPhone-shuffle, no display, just a button to call a random person on your contacts list." + diff --git a/posts/2007/05/rails-plugins-link-dump.md b/posts/2007/05/rails-plugins-link-dump.md index 605c9ac..86e9ea8 100644 --- a/posts/2007/05/rails-plugins-link-dump.md +++ b/posts/2007/05/rails-plugins-link-dump.md @@ -1,3 +1,11 @@ +--- +Title: Rails Plugins (link dump) +Author: Sami Samhuri +Date: 10th May, 2007 +Timestamp: 1178756520 +Tags: rails +--- + Some Rails plugins I find useful: * Simply Helpful @@ -6,3 +14,4 @@ Some Rails plugins I find useful: * TextMate Footnotes (just awesome) * acts\_as\_taggable\_on\_steroids * acts\_as\_textiled + diff --git a/posts/2007/05/typo-and-i-are-friends-again.md b/posts/2007/05/typo-and-i-are-friends-again.md index cc9c80e..5acc736 100644 --- a/posts/2007/05/typo-and-i-are-friends-again.md +++ b/posts/2007/05/typo-and-i-are-friends-again.md @@ -1,3 +1,11 @@ +--- +Title: Typo and I are friends again +Author: Sami Samhuri +Date: 1st May, 2007 +Timestamp: 1178081497 +Tags: typo +--- +

    I've been really frustrated with Typo recently. For some reason changing my last post would cause MySQL to timeout and I'd have to kill the rogue ruby process manually before any other changes to the DB would work, instead of hanging for a minute or two then timing out. Luckily I was able to disable the post using the command line client, the bug only manifested itself when issuing an UPDATE with all the fields present. Presumably the body was tripping things up because most other fields are simple booleans, numbers, or very short strings. Add to that the random HTTP 500 errors which were very noticeable while I was trying to fix that post and I was about to write my own blog or switch to WordPress. @@ -5,3 +13,4 @@ Add to that the random HTTP 500 errors which were very noticeable while I was tr I don't love WP so I decided to just upgrade Typo instead. I was using Typo 2.6, and the current stable version is 4.1. They skipped version 3 to preclude any confusion that may have ensued between Typo v3 and the CMS Typo3. So it really isn't a big upgrade and it went perfectly. I checked out a new copy of the repo because I had some difficulty getting svn switch --relocate to work, configured the database settings and issued a rake db:migrate, copied my theme over and it all just worked. Bravo Typo team, that's how an upgrade should work. No more random 500 errors, things seem faster (better caching perhaps), and that troublesome post is troublesome no more. I am happy with Typo again. + diff --git a/posts/2007/06/301-moved-permanently.md b/posts/2007/06/301-moved-permanently.md index 89275c4..c78ff33 100644 --- a/posts/2007/06/301-moved-permanently.md +++ b/posts/2007/06/301-moved-permanently.md @@ -1 +1,10 @@ +--- +Title: 301 moved permanently +Author: Sami Samhuri +Date: 8th June, 2007 +Timestamp: 1181350800 +Tags: life +--- + Last weekend I moved out of the apartment I lived in for the last 3 1/2 years. Moving was a cinch thanks to a friend's garage, conveniently placed smack between my old place and the new one. Google maps tells me that I moved just under 3.4 km, which is 2.1 mi for the metric impaired, so it wasn't much of a move at all! My roommate and I live in the basement of a house split into 3 apartments. Our upstairs neighbours are friendly and seem pretty cool, except one lady upstairs seems a bit strange. It's a great place though and in the winter the wood stove fireplace is going to be awesome. + diff --git a/posts/2007/06/_data.json b/posts/2007/06/_data.json deleted file mode 100644 index 59b4180..0000000 --- a/posts/2007/06/_data.json +++ /dev/null @@ -1,179 +0,0 @@ -{ - "301-moved-permanently": { - "title": "301 moved permanently", - "date": "8th June, 2007", - "timestamp": 1181350800, - "tags": [ - "life" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/301-moved-permanently" - }, - "so-long-typo-and-thanks-for-all-the-timeouts": { - "title": "so long typo (and thanks for all the timeouts)", - "date": "8th June, 2007", - "timestamp": 1181350860, - "tags": [ - "mephisto", - "typo" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/so-long-typo-and-thanks-for-all-the-timeouts" - }, - "more-scheming-with-haskell": { - "title": "More Scheming with Haskell", - "date": "14th June, 2007", - "timestamp": 1181783340, - "tags": [ - "coding", - "haskell", - "scheme" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/more-scheming-with-haskell" - }, - "testspec-on-rails-declared-awesome-just-one-catch": { - "title": "test/spec on rails declared awesome, just one catch", - "date": "14th June, 2007", - "timestamp": 1181830860, - "tags": [ - "bdd", - "rails", - "test/spec" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/testspec-on-rails-declared-awesome-just-one-catch" - }, - "begging-the-question": { - "title": "Begging the question", - "date": "15th June, 2007", - "timestamp": 1181933340, - "tags": [ - "english", - "life", - "pedantry" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/begging-the-question" - }, - "back-on-gentoo-trying-new-things": { - "title": "Back on Gentoo, trying new things", - "date": "18th June, 2007", - "timestamp": 1182215100, - "tags": [ - "emacs", - "gentoo", - "linux", - "vim" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/back-on-gentoo-trying-new-things" - }, - "reinventing-the-wheel": { - "title": "Reinventing the wheel", - "date": "20th June, 2007", - "timestamp": 1182356820, - "tags": [ - "emacs", - "snippets" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/reinventing-the-wheel" - }, - "embrace-the-database": { - "title": "Embrace the database", - "date": "22nd June, 2007", - "timestamp": 1182507240, - "tags": [ - "activerecord", - "rails", - "ruby" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/embrace-the-database" - }, - "emacs-for-textmate-junkies": { - "title": "Emacs for TextMate junkies", - "date": "23rd June, 2007", - "timestamp": 1182565020, - "tags": [ - "emacs", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/emacs-for-textmate-junkies" - }, - "floating-point-in-elschemo": { - "title": "Floating point in ElSchemo", - "date": "24th June, 2007", - "timestamp": 1182711180, - "tags": [ - "elschemo", - "haskell", - "scheme" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/floating-point-in-elschemo" - }, - "propaganda-makes-me-sick": { - "title": "Propaganda makes me sick", - "date": "25th June, 2007", - "timestamp": 1182768900, - "tags": [ - "propaganda" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/propaganda-makes-me-sick" - }, - "rtfm": { - "title": "RTFM!", - "date": "26th June, 2007", - "timestamp": 1182806340, - "tags": [ - "emacs", - "rtfm" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/rtfm" - }, - "emacs-tagify-region-or-insert-tag": { - "title": "Emacs: tagify-region-or-insert-tag", - "date": "25th June, 2007", - "timestamp": 1182809580, - "tags": [ - "emacs", - "tagify" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/emacs-tagify-region-or-insert-tag" - }, - "recent-ruby-and-rails-regales": { - "title": "Recent Ruby and Rails Regales", - "date": "28th June, 2007", - "timestamp": 1183058580, - "tags": [ - "rails", - "rails on rules", - "regular expressions", - "ruby", - "sake", - "secure associations", - "regex" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/recent-ruby-and-rails-regales" - }, - "controlling-volume-via-the-keyboard-on-linux": { - "title": "Controlling volume via the keyboard on Linux", - "date": "30th June, 2007", - "timestamp": 1183245180, - "tags": [ - "alsa", - "linux", - "ruby", - "volume" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/06/controlling-volume-via-the-keyboard-on-linux" - } -} diff --git a/posts/2007/06/back-on-gentoo-trying-new-things.md b/posts/2007/06/back-on-gentoo-trying-new-things.md index 0dcf905..6cb4deb 100644 --- a/posts/2007/06/back-on-gentoo-trying-new-things.md +++ b/posts/2007/06/back-on-gentoo-trying-new-things.md @@ -1,3 +1,11 @@ +--- +Title: Back on Gentoo, trying new things +Author: Sami Samhuri +Date: 18th June, 2007 +Timestamp: 1182215100 +Tags: emacs, gentoo, linux, vim +--- + I started using my Gentoo box for development again and there are a few things about Linux I didn't realize I had been missing. ### Shell completion is awesome out of the box ### @@ -17,3 +25,4 @@ In the spirit of switching things up I'm going to forgo my usual routine of usin I'm just waiting for a bunch of crap to compile – because I use Gentoo – and soon I'll have a Gtk-enabled Emacs to work in. If I can paste to and from Firefox then I'll be happy. I'll have to open this in vim or gedit to paste it into Firefox, funny! I'm also going to try replacing a couple of desktop apps with web alternatives. I'm starting with 2 no-brainers: mail and feeds with Gmail and Google Reader. I never got into the Gmail craze and never really even used Gmail very much. After looking at the shortcuts I think I can get used to it. Seeing j/k for up/down is always nice. Thunderbird is ok but there isn't a mail client on Linux that I really like, except mutt. That played a part in my Gmail choice. I hadn't used G-Reader before either and it seems alright, but it'll be hard to beat NetNewsWire. + diff --git a/posts/2007/06/begging-the-question.md b/posts/2007/06/begging-the-question.md index 823b7d7..b5aa08d 100644 --- a/posts/2007/06/begging-the-question.md +++ b/posts/2007/06/begging-the-question.md @@ -1,3 +1,11 @@ +--- +Title: Begging the question +Author: Sami Samhuri +Date: 15th June, 2007 +Timestamp: 1181933340 +Tags: english, life, pedantry +--- + I'm currently reading SICP since it's highly recommended by many people, available for free, and interesting. The fact that I have a little Scheme interpreter to play with makes it much more fun since I can add missing functionality to it as I progress through the book, thereby learning more Haskell in the process. Yay! Anyway I was very pleased to see the only correct usage of the phrase "begs the question" I have seen in a while. It's a pet peeve of mine, but I have submitted myself to the fact that the phrase is so oft used to mean "begs for the following question to be asked..." that it may as well be re-defined. In its correct usage the sentence seems to hang there if you try to apply the commonly mistaken meaning to it. That's all very hazy so here's the usage in SICP (emphasis my own): @@ -14,3 +22,4 @@ This describes a perfectly legitimate mathematical function. We could use it to

    Begging the question is to assume what one is trying to prove (or here, define) and use that as the basis for a conclusion. Read the Wikipedia article for a better definition and some nice examples. + diff --git a/posts/2007/06/controlling-volume-via-the-keyboard-on-linux.md b/posts/2007/06/controlling-volume-via-the-keyboard-on-linux.md index dc061d4..5da0061 100644 --- a/posts/2007/06/controlling-volume-via-the-keyboard-on-linux.md +++ b/posts/2007/06/controlling-volume-via-the-keyboard-on-linux.md @@ -1,5 +1,14 @@ +--- +Title: Controlling volume via the keyboard on Linux +Author: Sami Samhuri +Date: 30th June, 2007 +Timestamp: 1183245180 +Tags: alsa, linux, ruby, volume +--- + I was using Amarok's global keyboard shortcuts to control the volume of my music via the keyboard but I wanted to control the system volume as well. A quick script later and now I can control both, and thanks to libnotify I get some feedback on what happened. It's not as pretty as OS X's volume control or Growl but it'll certainly do. ↓ Download volume.rb I save this as ~/bin/volume and call it thusly: volume + and volume -. I bind Alt-+ and Alt—to those in my fluxbox config. If you don't have a preferred key binding program I recommend trying xbindkeys. apt-get install, emerge, paludis -i, or rpm -i as needed. + diff --git a/posts/2007/06/emacs-for-textmate-junkies.md b/posts/2007/06/emacs-for-textmate-junkies.md index d160c31..45063b7 100644 --- a/posts/2007/06/emacs-for-textmate-junkies.md +++ b/posts/2007/06/emacs-for-textmate-junkies.md @@ -1,3 +1,11 @@ +--- +Title: Emacs for TextMate junkies +Author: Sami Samhuri +Date: 23rd June, 2007 +Timestamp: 1182565020 +Tags: emacs, textmate +--- + *Update #1: What I first posted will take out your < key by mistake (it's available via `C-q <`), it has since been revised to Do The Right Thing.* *Update #2: Thanks to an anonymouse[sic] commenter this code is a little cleaner.* @@ -126,3 +134,4 @@ attributes are specified then they are only included in the opening tag." ↓ Download wrap-region.el That more or less sums up why I like Emacs so much. I wanted that functionality so I implemented it (barely! It was basically done for me), debugged it by immediately evaluating sexps and then trying it out, and then once it worked I reloaded my config and used the wanted feature. That's just awesome, and shows one strength of open source. + diff --git a/posts/2007/06/emacs-tagify-region-or-insert-tag.md b/posts/2007/06/emacs-tagify-region-or-insert-tag.md index 38f0ce3..d89f50a 100644 --- a/posts/2007/06/emacs-tagify-region-or-insert-tag.md +++ b/posts/2007/06/emacs-tagify-region-or-insert-tag.md @@ -1,5 +1,14 @@ +--- +Title: Emacs: tagify-region-or-insert-tag +Author: Sami Samhuri +Date: 25th June, 2007 +Timestamp: 1182809580 +Tags: emacs, tagify +--- + After axing half of wrap-region.el I renamed it to tagify.el and improved it ever so slightly. It's leaner, and does more! tagify-region-or-insert-tag does the same thing as wrap-region-with-tag except if there is no region it now inserts the opening and closing tags and sets point in between them. I have this bound to C-z t, as I use C-z as my personal command prefix. < is bound to tagify-region-or-insert-self which really doesn't warrant an explanation. + diff --git a/posts/2007/06/embrace-the-database.md b/posts/2007/06/embrace-the-database.md index 20bcabb..9b85573 100644 --- a/posts/2007/06/embrace-the-database.md +++ b/posts/2007/06/embrace-the-database.md @@ -1,3 +1,11 @@ +--- +Title: Embrace the database +Author: Sami Samhuri +Date: 22nd June, 2007 +Timestamp: 1182507240 +Tags: activerecord, rails, ruby +--- + If you drink the Rails koolaid you may have read the notorious single layer of cleverness post by DHH. [5th post on the archive page] In a nutshell he states that it's better to have a single point of cleverness when it comes to business logic. The reasons for this include staying agile, staying in Ruby all the time, and being able to switch the back-end DB at any time. Put the logic in ActiveRecord and use the DB as a dumb data store, that is the Rails way. It's simple. It works. You don't need to be a DBA to be a Rails developer. Stephen created a Rails plugin called dependent-raise which imitates a foreign key constraint inside of Rails. I want to try this out because I believe that data integrity is fairly important, but it's really starting to make me think about this single point of cleverness idea. @@ -25,3 +33,4 @@ Using the DB from within Ruby is a solved problem. I don't see why this couldn' Many relationships could be derived from constraints as people have pointed out before. There are benefits to using the features of a decent RDBMS, and in some cases I think that we might be losing by not making use of them. I am not saying we should move everything to the DB, I am saying that we should exploit the implemented and debugged capabilities of our RDBMSs the best we can while practicing the agile methods we know and love, all from within Ruby. [1] I make liberal use of annotate_models as it is. + diff --git a/posts/2007/06/floating-point-in-elschemo.md b/posts/2007/06/floating-point-in-elschemo.md index e28e02d..0446450 100644 --- a/posts/2007/06/floating-point-in-elschemo.md +++ b/posts/2007/06/floating-point-in-elschemo.md @@ -1,3 +1,11 @@ +--- +Title: Floating point in ElSchemo +Author: Sami Samhuri +Date: 24th June, 2007 +Timestamp: 1182711180 +Tags: elschemo, haskell, scheme +--- + ### Parsing floating point numbers ### The first task is extending the LispVal type to grok floats. @@ -421,3 +429,4 @@ That was a bit of work but now ElSchemo supports floating point numbers, and if Next time I'll go over some of the special forms I have added, including short-circuiting and and or forms and the full repetoire of let, let*, and letrec. Stay tuned! + diff --git a/posts/2007/06/index.ejs b/posts/2007/06/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/06/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/06/more-scheming-with-haskell.md b/posts/2007/06/more-scheming-with-haskell.md index 169d8d1..7142d5e 100644 --- a/posts/2007/06/more-scheming-with-haskell.md +++ b/posts/2007/06/more-scheming-with-haskell.md @@ -1,3 +1,11 @@ +--- +Title: More Scheming with Haskell +Author: Sami Samhuri +Date: 14th June, 2007 +Timestamp: 1181783340 +Tags: coding, haskell, scheme +--- + It's been a little while since I wrote about Haskell and the Scheme interpreter I've been using to learn and play with both Haskell and Scheme. I finished the tutorial and got myself a working Scheme interpreter and indeed it has been fun to use it for trying out little things now and then. (Normally I would use Emacs or Dr. Scheme for that sort of thing.) There certainly are interesting things to try floating around da intranet. And also things to read and learn from, such as misp (via Moonbase). *I'm going to describe two new features of my Scheme in this post. The second one is more interesting and was more fun to implement (cond).* @@ -85,3 +93,4 @@ eval env (List (Atom "cond" : List (pred : conseq) : rest)) = * __Line 9:__ Anything other than #f is considered true and causes conseq to be evaluated and returned. Like else, conseq can be a sequence of expressions. So far my Scheme weighs in at 621 lines, 200 more than the tutorial's final code listing. Hopefully I'll keep adding things on my TODO list and it will grow a little bit more. Now that I have cond it will be more fun to expand my stdlib.scm as well. + diff --git a/posts/2007/06/propaganda-makes-me-sick.md b/posts/2007/06/propaganda-makes-me-sick.md index a9f1bb7..623434c 100644 --- a/posts/2007/06/propaganda-makes-me-sick.md +++ b/posts/2007/06/propaganda-makes-me-sick.md @@ -1,30 +1,39 @@ +--- +Title: Propaganda makes me sick +Author: Sami Samhuri +Date: 25th June, 2007 +Timestamp: 1182768900 +Tags: propaganda +--- + Things like this in modern times are surprising. Can't people spot this phony crap for what it is? -First they put away the dealers, keep our kids safe and off the streets
    -Then they put away the prostitutes, keep married men cloistered at home
    -Then they shooed away the bums, and they beat and bashed the queers
    -Turned away asylum-seekers, fed us suspicions and fears
    -We didn't raise our voice, we didn't make a fuss
    -It´s funny there was no one left to notice, when they came for us
    -
    -Looks like witches are in season, you better fly your flag and be aware
    -Of anyone who might fit the description, diversity is now our biggest fear
    -Now with our conversations tapped, and our differences exposed
    +First they put away the dealers, keep our kids safe and off the streets
    +Then they put away the prostitutes, keep married men cloistered at home
    +Then they shooed away the bums, and they beat and bashed the queers
    +Turned away asylum-seekers, fed us suspicions and fears
    +We didn't raise our voice, we didn't make a fuss
    +It´s funny there was no one left to notice, when they came for us
    +
    +Looks like witches are in season, you better fly your flag and be aware
    +Of anyone who might fit the description, diversity is now our biggest fear
    +Now with our conversations tapped, and our differences exposed
    How ya supposed to love your neighbour, with our minds and curtains -closed?
    -We used to worry 'bout big brother
    -Now we got a big father and an even bigger mother

    -
    -And still you believe, this aristocracy gives a fuck about you
    -They put the mock in democracy, and you swallowed every hook
    -The sad truth is, you'd rather follow the school into the net
    +closed?
    +We used to worry 'bout big brother
    +Now we got a big father and an even bigger mother

    +
    +And still you believe, this aristocracy gives a fuck about you
    +They put the mock in democracy, and you swallowed every hook
    +The sad truth is, you'd rather follow the school into the net
    'Cause swimming alone at sea, is not the kind of freedom that you -actually want
    -So go back to your crib, and suck on a tit
    -Bask in the warmth of your diaper, you're sitting in shit
    -And piss, while sucking on a giant pacifier
    -A country of adult infants, a legion of mental midgets
    -A country of adult infants, a country of adult infants
    -All regaining their unconsciousness
    +actually want
    +So go back to your crib, and suck on a tit
    +Bask in the warmth of your diaper, you're sitting in shit
    +And piss, while sucking on a giant pacifier
    +A country of adult infants, a legion of mental midgets
    +A country of adult infants, a country of adult infants
    +All regaining their unconsciousness
    —from the song Regaining Unconsciousness, by NOFX + diff --git a/posts/2007/06/recent-ruby-and-rails-regales.md b/posts/2007/06/recent-ruby-and-rails-regales.md index fea7c63..5b4686a 100644 --- a/posts/2007/06/recent-ruby-and-rails-regales.md +++ b/posts/2007/06/recent-ruby-and-rails-regales.md @@ -1,3 +1,11 @@ +--- +Title: Recent Ruby and Rails Regales +Author: Sami Samhuri +Date: 28th June, 2007 +Timestamp: 1183058580 +Tags: rails, rails on rules, regular expressions, ruby, sake, secure associations, regex +--- + Some cool Ruby and [the former on] Rails things are springing up and I haven't written much about the two Rs lately, though I work with them daily. ### Rails on Rules ### @@ -17,3 +25,4 @@ I've noticed a trend among some taw taught me a new technique for simplifying regular expressions by transforming the text in a reversible manner. In one example he replaced literal strings in SQL - which are easily parsed via a regex - with what he calls embedded objects. They're just tokens to identify the temporarily removed strings, but the important thing is that they don't interfere with the regexes that operate on the other parts of the SQL, which would have been very difficult to get right with the strings inside it. If I made it sound complicated just read the post, he explains it well. If you believe anything Steve Yegge says then that last regex trick may come in handy for Q&D parsing in any language, be it Ruby, NBL, or whataver. + diff --git a/posts/2007/06/reinventing-the-wheel.md b/posts/2007/06/reinventing-the-wheel.md index ad5ad9d..67d23b6 100644 --- a/posts/2007/06/reinventing-the-wheel.md +++ b/posts/2007/06/reinventing-the-wheel.md @@ -1,3 +1,11 @@ +--- +Title: Reinventing the wheel +Author: Sami Samhuri +Date: 20th June, 2007 +Timestamp: 1182356820 +Tags: emacs, snippets +--- + Emacs is very impressive. I only felt lost and unproductive for minutes and now it seems natural to use and get around in. I've got ElSchemo set as the default scheme, and running inferior processes interactively is an absolute dream. My scheme doesn't have readline support (which bothers me to the point where I've thought about adding it just so I can use the thing) but when running it under Emacs there's absoutely no need for anything like that since I have the power of my editor when interacting with any program. There has been a considerable amount of work done to aide in Rails development which makes Emacs especially comfortable for me. I now know why people have Emacs windows maximized on their screens. Because of its age Emacs is a handy window manager that basically eliminates the need for anything like GNU screen or a window manager such as Rat poison (which is great if you like screen), just maximize that Emacs "frame" or open one for each display and get to it. If you need a shell you just split the window and run your shell, when you're done you can easily switch back to your editing and your shell will wait in the background until you need it again. With rails-mode on I can run script/console (or switch back to it) with C-c C-c s c. My zsh alias for script/console is sc and I have other similarly succint ones for other stuff, so I took right to the shortcuts for all the handy things that I no longer have to switch applications to do: @@ -10,3 +18,4 @@ There has been a considerable amount of work done to aide in Rails development w The Rails integration is simply stunning and I could go on all day about the mature indentation support, the Speedbar and what not, but I won't. I'm fairly sure that Emacs has taken the place of TextMate as my weapon of choice now, on all platforms. And after only 2 days! Anyway, the point of all this was to mention the one thing that's missing: support for intelligent snippets which insert text at more than one point in the document (well, they appear to do so). I don't have any E-Lisp-fu to break out and solve the deficiency but if it ever bugs me enough I might try implementing it for Emacs one day. If they were useful to me outside of writing migrations I might have more incentive to do so, but I guess they aren't useful in normal editing situations (maybe I just haven't recognised the need). + diff --git a/posts/2007/06/rtfm.md b/posts/2007/06/rtfm.md index d7c2778..e4bf22b 100644 --- a/posts/2007/06/rtfm.md +++ b/posts/2007/06/rtfm.md @@ -1,3 +1,12 @@ +--- +Title: RTFM! +Author: Sami Samhuri +Date: 26th June, 2007 +Timestamp: 1182806340 +Tags: emacs, rtfm +--- + I should read the Emacs manual sometime, especially since I have it in dead-tree form. Check out skeleton pairs in the Emacs manual, or better yet C-h f skeleton-pair-insert-maybe. skeleton-pair has already been massaged to do what you most likely want if you set the correct options. Cool. I like Emacs more every day. This renders wrap-region useless, which is great! I like a trim .emacs and .emacs.d. + diff --git a/posts/2007/06/so-long-typo-and-thanks-for-all-the-timeouts.md b/posts/2007/06/so-long-typo-and-thanks-for-all-the-timeouts.md index c970ca6..9ff4190 100644 --- a/posts/2007/06/so-long-typo-and-thanks-for-all-the-timeouts.md +++ b/posts/2007/06/so-long-typo-and-thanks-for-all-the-timeouts.md @@ -1,3 +1,11 @@ +--- +Title: so long typo (and thanks for all the timeouts) +Author: Sami Samhuri +Date: 8th June, 2007 +Timestamp: 1181350860 +Tags: mephisto, typo +--- + Well for just over a year Typo ran the show. I thought I had worked out most of the kinks with Typo and Dreamhost but the latest problem I ran into was pretty major. I couldn't post new articles. If the stars aligned perfectly and I sacrificed baby animals and virgins, every now and then I could get it to work. Ok, all I really had to do was refresh several dozen times, waiting 1 minute for it to timeout every time, but it sucked nonetheless. Recently I had looked at converting Typo to Mephisto and it seemed pretty painless. I installed Mephisto and followed whatever instructions I found via Google and it all just worked, with one caveat. The Typo converter for Mephisto only supports Typo's schema version 56, while my Typo schema was at version 61. Rather than migrate backwards I brought Mephisto's Typo converter up to date instead. If you're interested, download the patch. The patch is relative to vendor/plugins, so patch accordingly. @@ -24,3 +32,4 @@ articles.each do |ta, ma| When I say something similar I mean exactly that. I just typed that from memory so it may not work, or even be syntactically correct. If any permalinks changed then you'll have to manually add new tags corresponding to old Typo categories. The only case where this bit me was when I had edited the title of an article, in which case the new Mephisto permalink matched the new title while the Typo permalink matched the initial title, whatever it was. I really dig Mephisto so far. It's snappier than Typo and the admin interface is slick. I followed the herd and went with the scribbish theme. Perhaps I'll get around to customizing it sometime, but who knows maybe I'll like a white background for a change. + diff --git a/posts/2007/06/testspec-on-rails-declared-awesome-just-one-catch.md b/posts/2007/06/testspec-on-rails-declared-awesome-just-one-catch.md index 248372b..5415dc6 100644 --- a/posts/2007/06/testspec-on-rails-declared-awesome-just-one-catch.md +++ b/posts/2007/06/testspec-on-rails-declared-awesome-just-one-catch.md @@ -1,3 +1,11 @@ +--- +Title: test/spec on rails declared awesome, just one catch +Author: Sami Samhuri +Date: 14th June, 2007 +Timestamp: 1181830860 +Tags: bdd, rails, test/spec +--- + This last week I've been getting to know test/spec via err's test/spec on rails plugin. I have to say that I really dig this method of testing my code and I look forward to trying out some actual BDD in the future. I did hit a little snag with functional testing though. The method of declaring which controller to use takes the form: @@ -81,3 +89,4 @@ This test will pass on its own as well, which is what really tripped me up. When The problem is that test/spec only creates one context with a specific name, and re-uses that context on subsequent tests using the same context name. The various setup methods are all added to a list and each one is executed, not just the one in the same context block as the specs. I can see how that's useful, but for me right now it's just a hinderance as I'd have to uniquely name each context. "Another guest" just looks strange in a file by itself, and I want my tests to work with my brain not against it. My solution was to just create a new context each time and re-use nothing. Only 2 lines in test/spec need to be changed to achieve this, but I'm not sure if what I'm doing is a bad idea. My tests pass and right now that's basically all I care about though. + diff --git a/posts/2007/07/_data.json b/posts/2007/07/_data.json deleted file mode 100644 index eb3f3ae..0000000 --- a/posts/2007/07/_data.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "a-textmate-tip-for-emacs-users": { - "title": "A TextMate tip for Emacs users", - "date": "3rd July, 2007", - "timestamp": 1183481100, - "tags": [ - "emacs", - "keyboard shortcuts", - "textmate" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/07/a-textmate-tip-for-emacs-users" - }, - "rushcheck-quickcheck-for-ruby": { - "title": "RushCheck: QuickCheck for Ruby", - "date": "5th July, 2007", - "timestamp": 1183665000, - "tags": [ - "quickcheck", - "ruby", - "rushcheck" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/07/rushcheck-quickcheck-for-ruby" - }, - "see-your-regular-expressions-in-emacs": { - "title": "See your regular expressions in Emacs", - "date": "6th July, 2007", - "timestamp": 1183740300, - "tags": [ - "emacs", - "regex" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/07/see-your-regular-expressions-in-emacs" - }, - "people": { - "title": "people", - "date": "12th July, 2007", - "timestamp": 1184243280, - "tags": [ - "life", - "people" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/07/people" - } -} diff --git a/posts/2007/07/a-textmate-tip-for-emacs-users.md b/posts/2007/07/a-textmate-tip-for-emacs-users.md index 6eb330f..8dc99b3 100644 --- a/posts/2007/07/a-textmate-tip-for-emacs-users.md +++ b/posts/2007/07/a-textmate-tip-for-emacs-users.md @@ -1,3 +1,11 @@ +--- +Title: A TextMate tip for Emacs users +Author: Sami Samhuri +Date: 3rd July, 2007 +Timestamp: 1183481100 +Tags: emacs, keyboard shortcuts, textmate +--- + *Update: The only place I've seen this mentioned is in a comment on the MacroMates blog.* My Linux box is down due to a hardware failure; a cheap SATA controller to be specific. Perhaps that will be a story for another day. As a result I've been working on my MacBook and back in TextMate. Old habits. And I haven't gotten comfortable in any of the OS X Emacsen yet. @@ -9,3 +17,4 @@ This gave me an opportunity to accidentally discover some shortcuts in TextMate. * C-y: yanks back the last thing on the kill ring (paste history). You still have to use C-S-v to yank previous items. I think TextMate may have helped ease me into Emacs without me even knowing. I had my suspicions that Allan was an Emacs fan and now I'm certain of it. I keep finding things in one that the other has, which makes switching between them easy. Well done Allan. + diff --git a/posts/2007/07/index.ejs b/posts/2007/07/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/07/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/07/people.md b/posts/2007/07/people.md index 70ec1aa..bcbad48 100644 --- a/posts/2007/07/people.md +++ b/posts/2007/07/people.md @@ -1,5 +1,14 @@ +--- +Title: people +Author: Sami Samhuri +Date: 12th July, 2007 +Timestamp: 1184243280 +Tags: life, people +--- + Sometimes this is difficult to remember for someone who (likes to think that he) thinks somewhat logically. > When dealing with people, let us remember that we are not dealing with creatures of logic. We are dealing with creatures of emotion, creatures bristling with prejudices and motivated by pride and vanity. —Dale Carnegie, *How to Win Friends and Influence People* + diff --git a/posts/2007/07/rushcheck-quickcheck-for-ruby.md b/posts/2007/07/rushcheck-quickcheck-for-ruby.md index 92447d9..43a85ec 100644 --- a/posts/2007/07/rushcheck-quickcheck-for-ruby.md +++ b/posts/2007/07/rushcheck-quickcheck-for-ruby.md @@ -1 +1,10 @@ +--- +Title: RushCheck: QuickCheck for Ruby +Author: Sami Samhuri +Date: 5th July, 2007 +Timestamp: 1183665000 +Tags: quickcheck, ruby, rushcheck +--- + I cannot wait to try out RushCheck. It is QuickCheck for Ruby. I don't have experience with QuickCheck or anything but it's clear to see how this helps you make certain your code is robust. + diff --git a/posts/2007/07/see-your-regular-expressions-in-emacs.md b/posts/2007/07/see-your-regular-expressions-in-emacs.md index f40b91c..4511fdb 100644 --- a/posts/2007/07/see-your-regular-expressions-in-emacs.md +++ b/posts/2007/07/see-your-regular-expressions-in-emacs.md @@ -1,5 +1,14 @@ +--- +Title: See your regular expressions in Emacs +Author: Sami Samhuri +Date: 6th July, 2007 +Timestamp: 1183740300 +Tags: emacs, regex +--- + First, if you are an Emacs newbie then be sure to read (at least) the introduction of Being Productive with Emacs. For some reason the PDF and HTML versions are slightly similar. Anyway, it mentions re-builder which is an awesome little gem if you use regular expressions at all1. What this baby does is open a small window at the bottom of your screen in which you can type a regex. It is parsed as you type it and matches are highlighted in the other window. Genius. [1] If you don't use them I encourage you to "learn them"http://regex.info/. Don't pay any attention to Jamie Zawinsky and his lack of appreciation for a fantastic tool. + diff --git a/posts/2007/08/5-ways-to-avoid-looking-like-a-jerk-on-the-internet.md b/posts/2007/08/5-ways-to-avoid-looking-like-a-jerk-on-the-internet.md index 6839786..106ecc5 100644 --- a/posts/2007/08/5-ways-to-avoid-looking-like-a-jerk-on-the-internet.md +++ b/posts/2007/08/5-ways-to-avoid-looking-like-a-jerk-on-the-internet.md @@ -1,3 +1,11 @@ +--- +Title: 5 ways to avoid looking like a jerk on the Internet +Author: Sami Samhuri +Date: 30th August, 2007 +Timestamp: 1188487500 +Tags: life, netiquette +--- + Let me begin by stating that these are tips I have gathered by posting in many public forums on the Internet and I have learned most of these rules by making the mistakes myself. I'm not trying to point fingers at anyone or act all holier-than-thou. It's a cold, emotionless medium text is. It can be difficult to accurately convey one's feelings when typing a quick reply somewhere. John Gabriel's theory certainly plays a part as well, but I'll try and assume that you are generally a nice person. I also assume that we are talking about a text medium (IRC, forums, Slashdot/Reddit/Digg). None of that fancy voice or video conferencing stuff! Also, this is not a guide on how to really be an arrogant prick, but just not look like one when you engage in conversations on the Internet. It's also not a guide on not being a jerk. Should you lack basic manners you will have to learn them elsewhere. @@ -25,3 +33,4 @@ Geeks often come across as know-it-alls. While most geeks probably do think the I'm not saying that we should all stop discussing things we're not experts on, just that we should try harder to keep open minds about things and realize that others may have some insight we do not. If in doubt, partake in civil discourse and try not to dismiss others without even asking them to back up their claims or ideas. Cue the comments pointing out how many of these rules I broke in this very post... :) + diff --git a/posts/2007/08/_data.json b/posts/2007/08/_data.json deleted file mode 100644 index 692e5cb..0000000 --- a/posts/2007/08/_data.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "elschemo-boolean-logic-and-branching": { - "title": "ElSchemo: Boolean logic and branching", - "date": "2nd August, 2007", - "timestamp": 1186073940, - "tags": [ - "elschemo", - "haskell", - "scheme" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/elschemo-boolean-logic-and-branching" - }, - "snap-crunchle-pop": { - "title": "Snap, crunchle, pop", - "date": "9th August, 2007", - "timestamp": 1186654620, - "tags": [ - "humans", - "injury", - "life" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/snap-crunchle-pop" - }, - "cheat-from-emacs": { - "title": "Cheat from Emacs", - "date": "9th August, 2007", - "timestamp": 1186710960, - "tags": [ - "Emacs" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/cheat-from-emacs" - }, - "opera-is-pretty-slick": { - "title": "Opera is pretty slick", - "date": "11th August, 2007", - "timestamp": 1186834260, - "tags": [ - "browsers", - "firefox", - "opera" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/opera-is-pretty-slick" - }, - "catch-compiler-errors-at-runtime": { - "title": "Catch compiler errors at runtime", - "date": "19th August, 2007", - "timestamp": 1187561820, - "tags": [ - "ruby" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/catch-compiler-errors-at-runtime" - }, - "cheat-productively-in-emacs": { - "title": "Cheat productively in Emacs", - "date": "21st August, 2007", - "timestamp": 1187720400, - "tags": [ - "Emacs" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/cheat-productively-in-emacs" - }, - "captivating-little-creatures": { - "title": "Captivating little creatures", - "date": "26th August, 2007", - "timestamp": 1188131700, - "tags": [ - "games", - "lemmings" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/captivating-little-creatures" - }, - "5-ways-to-avoid-looking-like-a-jerk-on-the-internet": { - "title": "5 ways to avoid looking like a jerk on the Internet", - "date": "30th August, 2007", - "timestamp": 1188487500, - "tags": [ - "life", - "netiquette" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/08/5-ways-to-avoid-looking-like-a-jerk-on-the-internet" - } -} diff --git a/posts/2007/08/captivating-little-creatures.md b/posts/2007/08/captivating-little-creatures.md index a35cd6b..ce9b7cb 100644 --- a/posts/2007/08/captivating-little-creatures.md +++ b/posts/2007/08/captivating-little-creatures.md @@ -1 +1,10 @@ +--- +Title: Captivating little creatures +Author: Sami Samhuri +Date: 26th August, 2007 +Timestamp: 1188131700 +Tags: games, lemmings +--- + Someone posted this JavaScript implementation of an old gem on Reddit, Lemmings! There goes my Sunday! :) + diff --git a/posts/2007/08/catch-compiler-errors-at-runtime.md b/posts/2007/08/catch-compiler-errors-at-runtime.md index e5676d3..854dd41 100644 --- a/posts/2007/08/catch-compiler-errors-at-runtime.md +++ b/posts/2007/08/catch-compiler-errors-at-runtime.md @@ -1,3 +1,11 @@ +--- +Title: Catch compiler errors at runtime +Author: Sami Samhuri +Date: 19th August, 2007 +Timestamp: 1187561820 +Tags: ruby +--- + While coding just now I had a small epiphany about Ruby. Though Ruby is highly dynamic and compiled at runtime, that doesn't preclude one catching some mistakes at compile time. I'm not talking about mere syntax errors or anything either. The only proviso to catching mistakes at compile time is that you must have a decent chunk of code executed during compilation. One benefit of Ruby's blurring of compile time and runtime is that you can run real code at compile time. This is largely how metaprogramming tricks are pulled off elegantly and with ease in projects such as Rails. Sure you won't get all the benefits of a strictly and/or statically typed compiler, but you can get some of them. If you have a library that makes substantial use of executing code at compile time then the mere act of loading your library causes your code to run, thus it compiles. If you require your lib and get true back then you know the code that bootstraps the runtime code is at least partially correct. @@ -7,3 +15,4 @@ Compile time is runtime. Runtime is compile time. Just because you have to run I admit that this is of limited use most of the time, but let it not be said that you can't catch any errors with your compiler just because you have to run your code to compile it. With Ruby the more meta you get the more the compiler rewards you. *[Of course this is true of languages such as Common Lisp too, which make available the full programming language at compile time. I just happened to be using Ruby when I realized this.]* + diff --git a/posts/2007/08/cheat-from-emacs.md b/posts/2007/08/cheat-from-emacs.md index ec720dd..6ceb24f 100644 --- a/posts/2007/08/cheat-from-emacs.md +++ b/posts/2007/08/cheat-from-emacs.md @@ -1,3 +1,11 @@ +--- +Title: Cheat from Emacs +Author: Sami Samhuri +Date: 9th August, 2007 +Timestamp: 1186710960 +Tags: Emacs +--- + *Update: I had inadvertently used string-join, a function provided by something in my ~/.emacs.d. The script has been updated to work with a vanilla Emacs (23, but should work with 22 as well).* *Update #2 [2007.08.10]: Editing cheats and diffs have been implemented.* @@ -29,3 +37,4 @@ Here's the rundown: *(Added)* I may add support for --diff and --edit in the future. Please do send me your patches so everyone can benefit from them. + diff --git a/posts/2007/08/cheat-productively-in-emacs.md b/posts/2007/08/cheat-productively-in-emacs.md index b9b3ec0..8681f45 100644 --- a/posts/2007/08/cheat-productively-in-emacs.md +++ b/posts/2007/08/cheat-productively-in-emacs.md @@ -1,3 +1,11 @@ +--- +Title: Cheat productively in Emacs +Author: Sami Samhuri +Date: 21st August, 2007 +Timestamp: 1187720400 +Tags: Emacs +--- + By now you may have heard about cheat, the command line cheat sheet collection that's completely open to editing, wiki style. A couple of weeks ago I posted cheat.el which allows one to cheat from within Emacs. There's an update. However, before I get to cheat.el there's a small detour. Cheat is not just about Ruby! A few examples of cheats available are: @@ -19,3 +27,4 @@ So what's new in this version of cheat.el? Completion! The on Download it now: cheat.el For any newcomers, just drop this into ~/.emacs.d, ~/.elisp, or any directory in your load-path and then (require 'cheat). For more info check the original article for a rundown on the cheat commands. + diff --git a/posts/2007/08/elschemo-boolean-logic-and-branching.md b/posts/2007/08/elschemo-boolean-logic-and-branching.md index 0ec44a9..edcc80a 100644 --- a/posts/2007/08/elschemo-boolean-logic-and-branching.md +++ b/posts/2007/08/elschemo-boolean-logic-and-branching.md @@ -1,3 +1,11 @@ +--- +Title: ElSchemo: Boolean logic and branching +Author: Sami Samhuri +Date: 2nd August, 2007 +Timestamp: 1186073940 +Tags: elschemo, haskell, scheme +--- + I've been developing a Scheme interpreter in Haskell called ElSchemo. @@ -180,3 +188,4 @@ plan on posting the Haskell code and my stdlib.scm in their entirety sometime, and I could do that before or after I finish writing about the features I've developed beyond the tutorial. Just let me know in the comments.* + diff --git a/posts/2007/08/index.ejs b/posts/2007/08/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/08/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/08/opera-is-pretty-slick.md b/posts/2007/08/opera-is-pretty-slick.md index 50f5955..5cd4da3 100644 --- a/posts/2007/08/opera-is-pretty-slick.md +++ b/posts/2007/08/opera-is-pretty-slick.md @@ -1,3 +1,11 @@ +--- +Title: Opera is pretty slick +Author: Sami Samhuri +Date: 11th August, 2007 +Timestamp: 1186834260 +Tags: browsers, firefox, opera +--- + Though I usually prefer free software, I don't have any problems using proprietary stuff if I think it's good. I had Firefox open for a couple of days and noticed that it was using 700M of memory. That's not a problem at all since I have 4G but it's also a lot of RAM to be in use for just one window with one tab open. The fact that Firefox gets sluggish after some time and needs to be restarted tells me that this isn't expected behaviour and is likely not due to caching for quick back/forward or whatever they claim is taking up the leaked memory. Konqueror is ok but I'm not a huge fan of it, partly due to its kitchen-sink browser/file manager hybrid design. IMO the KDE folks should break out the file manager part, but I digress. I can't really put my finger on anything specific I dislike about Konqueror, it's just not for me. To my dismay it seems to be the snappiest browser on Linux. @@ -7,3 +15,4 @@ The only other decent browser I know of (for Linux) is Opera so I found some qui I'm not sure if I'm going to stick with it yet but I've been using it for 2 days and haven't really missed Firefox at all. Of course as soon as I do any development I need Firefox for Firebug and the Web Developer extension and such. I've yet to investigate development tools on Opera. I'm comfortable developing in Firefox already so why switch? Man am I glad we're not in a Netscape/IE world anymore! If I open up my MacBook I can choose from at least 2 other browsers for every day browsing (Camino, Safari). + diff --git a/posts/2007/08/snap-crunchle-pop.md b/posts/2007/08/snap-crunchle-pop.md index 06bb4a5..28cfadb 100644 --- a/posts/2007/08/snap-crunchle-pop.md +++ b/posts/2007/08/snap-crunchle-pop.md @@ -1,5 +1,14 @@ +--- +Title: Snap, crunchle, pop +Author: Sami Samhuri +Date: 9th August, 2007 +Timestamp: 1186654620 +Tags: humans, injury, life +--- + I think that every now and then we need to be reminded of the frail nature of our human bodies. Yesterday morning as I walked to my kitchen I was turning right by pivoting on my right foot when my 24 years of walking experience suddenly failed me. I clearly did something wrong, as I heard a crunching pop or two in my right ankle and went down. Luckily it's just a sprain but my foot is fairly bruised and still sore today. I'm trying to follow the RICE method for recuperating but one can only lay down for so long before having to eat, work, use the bathroom, etc. Thank goodness I don't work on my feet or I'd be out of commission. If it still hurts next week I'm going to see a doctor but until then I'm trying not to leave my house. The idea of hopping and hobbling to a bus to go to a doctor does not thrill me in the slightest. Oh, if you find yourself in a bind an upside down hockey stick is a decent makeshift crutch. You'll need 2 hands to operate the thing though. At the opposite end of the spectrum there are times when we seem to be amazingly resilient creatures. Check out a documentary called *"101 Things Removed from the Human Head"* if you can find it anywhere. One of those things was a boat anchor, I kid you not. + diff --git a/posts/2007/09/_data.json b/posts/2007/09/_data.json deleted file mode 100644 index daf18e6..0000000 --- a/posts/2007/09/_data.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "learning-lisp-read-pcl": { - "title": "Learning Lisp? Read PCL", - "date": "25th September, 2007", - "timestamp": 1190714340, - "tags": [ - "lisp" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/09/learning-lisp-read-pcl" - }, - "python-and-ruby-brain-dump": { - "title": "Python and Ruby brain dump", - "date": "26th September, 2007", - "timestamp": 1190802840, - "tags": [ - "python", - "ruby" - ], - "author": "Sami Samhuri", - "url": "/posts/2007/09/python-and-ruby-brain-dump" - } -} diff --git a/posts/2007/09/index.ejs b/posts/2007/09/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/09/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/09/learning-lisp-read-pcl.md b/posts/2007/09/learning-lisp-read-pcl.md index 5236061..c290a03 100644 --- a/posts/2007/09/learning-lisp-read-pcl.md +++ b/posts/2007/09/learning-lisp-read-pcl.md @@ -1 +1,10 @@ +--- +Title: Learning Lisp? Read PCL +Author: Sami Samhuri +Date: 25th September, 2007 +Timestamp: 1190714340 +Tags: lisp +--- + Yes, it's a book. But it's so well written you should breeze through it as if it were a Lisp tutorial! + diff --git a/posts/2007/09/python-and-ruby-brain-dump.md b/posts/2007/09/python-and-ruby-brain-dump.md index 785ac41..eb006df 100644 --- a/posts/2007/09/python-and-ruby-brain-dump.md +++ b/posts/2007/09/python-and-ruby-brain-dump.md @@ -1,3 +1,11 @@ +--- +Title: Python and Ruby brain dump +Author: Sami Samhuri +Date: 26th September, 2007 +Timestamp: 1190802840 +Tags: python, ruby +--- + It turns out that Python is the language of choice on the OLPC, both for implementing applications and exposing to the users. There is a view source key available. I think Python is a great choice. I've been using Ruby almost exclusively for over a year but the last week I've been doing a personal project in Python using Storm (which is pretty nice btw) and urwid. I'm remembering why I liked Python when I first learned it a few years ago. It may not be as elegant as Ruby, conceptually, but it sure is fun to code in. It really is executable pseudo-code for the most part. @@ -13,3 +21,4 @@ Ruby has some Perl-ish features that make it a good sysadmin scripting language, Python is faster than Ruby so it is open to classes of software that would be cumbersome in Ruby. Source control, for example. You can write a slow SCM in Python though, as Bazaar demonstrates. You could probably write a passable one in Ruby as well. If it didn't quite perform well enough right now it should fare better in a year's time. I still think that my overall joy is greater when using Ruby, but if Ruby isn't the right tool for the job I'll probably look to Python next (unless some feature of the problem indicates something else would be more appropriate). The reason I chose Python for my current project is because of libs like urwid and I needed an excuse to try out Storm and brush up on my Python. ;-) + diff --git a/posts/2007/10/_data.json b/posts/2007/10/_data.json deleted file mode 100644 index 581b841..0000000 --- a/posts/2007/10/_data.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "gtkpod-in-gutsy-got-you-groaning": { - "id": "gtkpod-in-gutsy-got-you-groaning", - "author": "Sami Samhuri", - "title": "Gtkpod in Gutsy Got You Groaning?", - "date": "29th October, 2007", - "timestamp": 1193692440, - "link": null, - "url": "/posts/2007/10/gtkpod-in-gutsy-got-you-groaning", - "tags": [ - "broken", - "gtkpod", - "linux", - "ubuntu" - ] - } -} \ No newline at end of file diff --git a/posts/2007/10/gtkpod-in-gutsy-got-you-groaning.md b/posts/2007/10/gtkpod-in-gutsy-got-you-groaning.md index b6ff525..ae6e614 100644 --- a/posts/2007/10/gtkpod-in-gutsy-got-you-groaning.md +++ b/posts/2007/10/gtkpod-in-gutsy-got-you-groaning.md @@ -1,3 +1,11 @@ +--- +Title: Gtkpod in Gutsy Got You Groaning? +Author: Sami Samhuri +Date: 29th October, 2007 +Timestamp: 1193692440 +Tags: broken, gtkpod, linux, ubuntu +--- + I recently upgraded the Ubuntu installation on my workstation from Feisty Fawn to Gutsy Gibbon and for the most part I am happy with the changes. One thing I don't care much for is the fact that gtkpod-aac is a sham. Ubuntu provides the gtkpod-aac package for one to transfer aac files, and thus mp4 files with aac audio tracks, to their iPod. The version in the Gutsy repos is broken. This shows a weakness in Ubuntu, and though it's rather small it is one that will piss off a lot of people who expect things to just work. The kind of people who would buy an iPod. The kind of people who use Linux. The kind of Linux users that use Ubuntu. The kicker is that it doesn't look like they will ship a working version of gtkpod-aac for Gutsy at all. I know it's only 6 months but that seems like an eternity when you have the same old crap to watch on your iPod for that long. All is not lost. A kind soul left a helpful comment on the bug report explaining how he got it to work. It's a pretty simple fix. Just google for libmpeg4ip and find a Debian repo that has the following packages for your architecture: @@ -38,4 +46,4 @@ svn co https://gtkpod.svn.sourceforge.net/svnroot/gtkpod/gtkpod/trunk gtkpod cd gtkpod ./autogen.sh --with-mp4v2 && make && sudo make install cd -rm -rf /tmp/gtkpod-fix
    \ No newline at end of file +rm -rf /tmp/gtkpod-fix diff --git a/posts/2007/10/index.ejs b/posts/2007/10/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2007/10/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2007/index.ejs b/posts/2007/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2007/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2008/01/_data.json b/posts/2008/01/_data.json deleted file mode 100644 index 30a503f..0000000 --- a/posts/2008/01/_data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "random-pet-peeve-of-the-day": { - "title": "Random pet peeve of the day", - "date": "7th January, 2008", - "timestamp": 1199727720, - "tags": [ - "usability", - "web" - ], - "author": "Sami Samhuri", - "url": "/posts/2008/01/random-pet-peeve-of-the-day" - } -} diff --git a/posts/2008/01/index.ejs b/posts/2008/01/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2008/01/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2008/01/random-pet-peeve-of-the-day.md b/posts/2008/01/random-pet-peeve-of-the-day.md index b5959be..88591e8 100644 --- a/posts/2008/01/random-pet-peeve-of-the-day.md +++ b/posts/2008/01/random-pet-peeve-of-the-day.md @@ -1,3 +1,12 @@ +--- +Title: Random pet peeve of the day +Author: Sami Samhuri +Date: 7th January, 2008 +Timestamp: 1199727720 +Tags: usability, web +--- + So long since my last post, and all I'm going to do is complain. ;-) Seriously though, if you have a website and the content on said site is dated then please – for the love of our almighty saviour, the Flying Spaghetti Monsterput the date at the top of the page. Don't make me scroll down to the end of the article just to see how relevant it is or just to give me some context. Not to mention that I always end up doing a "Where is the end? Oh crap, I passed it and now I'm in the comments, blargh!" I'm looking at Lifehacker since they're the most recent offender I've come across, but they are definitely not the only ones guilty of this. + diff --git a/posts/2008/02/_data.json b/posts/2008/02/_data.json deleted file mode 100644 index cc419ca..0000000 --- a/posts/2008/02/_data.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "thoughts-on-arc": { - "title": "Thoughts on Arc", - "date": "19th February, 2008", - "timestamp": 1203420360, - "tags": [ - "lisp arc" - ], - "author": "Sami Samhuri", - "url": "/posts/2008/02/thoughts-on-arc" - } -} diff --git a/posts/2008/02/index.ejs b/posts/2008/02/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2008/02/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2008/02/thoughts-on-arc.md b/posts/2008/02/thoughts-on-arc.md index daf17c7..16105b1 100644 --- a/posts/2008/02/thoughts-on-arc.md +++ b/posts/2008/02/thoughts-on-arc.md @@ -1,3 +1,11 @@ +--- +Title: Thoughts on Arc +Author: Sami Samhuri +Date: 19th February, 2008 +Timestamp: 1203420360 +Tags: lisp arc +--- + *NB: This is just a braindump. There's nothing profound or particularly insightful in this post.* You may have heard that Paul Graham recently released his pet dialect of Lisp: Arc. It's a relatively small language consisting of just 4500 lines of code. In just under 1200 lines of PLT Scheme the core of Arc is defined. The rest of the language is written in Arc itself. The heart of that is a file arc.arc, weighing in at 1500 lines. The remaining 1000-1300 lines are spread between libraries, mainly for writing web apps: html.arc, srv.arc, app.arc, and a few others. @@ -33,3 +41,4 @@ The app I'm writing is standard CRUD stuff so I haven't done anything cool using ### Non-conclusion ### I feel as though I should have a conclusion, but I don't. I've only been using Arc for a short time. It feels nice. I think Paul is doing a good job on the design by keeping it small, compact, and simple. Seeing as it's still in its infancy it's just a toy for me, but a toy with some decent potential. And hopefully an impact on other Lisps. Common Lisp may have industrial implementations and a 1500 page spec, but Arc is more fun and hackable. More so than Scheme, too. I think Arc has out-Schemed Scheme. + diff --git a/posts/2008/03/_data.json b/posts/2008/03/_data.json deleted file mode 100644 index cb652f2..0000000 --- a/posts/2008/03/_data.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "project-euler-code-repo-in-arc": { - "title": "Project Euler code repo in Arc", - "date": "3rd March, 2008", - "timestamp": 1204561440, - "tags": [ - "arc", - "project euler" - ], - "author": "Sami Samhuri", - "url": "/posts/2008/03/project-euler-code-repo-in-arc" - } -} diff --git a/posts/2008/03/index.ejs b/posts/2008/03/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2008/03/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2008/03/project-euler-code-repo-in-arc.md b/posts/2008/03/project-euler-code-repo-in-arc.md index 9df8e88..10167eb 100644 --- a/posts/2008/03/project-euler-code-repo-in-arc.md +++ b/posts/2008/03/project-euler-code-repo-in-arc.md @@ -1,3 +1,11 @@ +--- +Title: Project Euler code repo in Arc +Author: Sami Samhuri +Date: 3rd March, 2008 +Timestamp: 1204561440 +Tags: arc, project euler +--- + Release early and often. This is a code repo web app for solutions to Project Euler problems. You can only see your own solutions so it's not that exciting yet (but it scratches my itch... once it highlights syntax). You can try it out or download the source. You'll need an up-to-date copy of Anarki to untar the source in. Just run arc.sh then enter this at the REPL: @@ -6,3 +14,4 @@ arc> (esv) That will setup the web server on port 3141. If you want a different port then run (esv 25) (just to mess with 'em). + diff --git a/posts/2008/index.ejs b/posts/2008/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2008/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2009/11/_data.json b/posts/2009/11/_data.json deleted file mode 100644 index 3257bdf..0000000 --- a/posts/2009/11/_data.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "using-emacs-to-develop-mojo-apps-for-webos": { - "title": "Using Emacs to Develop Mojo Apps for WebOS", - "date": "21st November, 2009", - "timestamp": 1258790400, - "tags": [ - "emacs", - "mojo", - "webos", - "lisp", - "javascript" - ], - "author": "Sami Samhuri", - "url": "/posts/2009/11/using-emacs-to-develop-mojo-apps-for-webos" - } -} diff --git a/posts/2009/11/index.ejs b/posts/2009/11/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2009/11/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2009/11/using-emacs-to-develop-mojo-apps-for-webos.md b/posts/2009/11/using-emacs-to-develop-mojo-apps-for-webos.md index be3eb34..d13ebd8 100644 --- a/posts/2009/11/using-emacs-to-develop-mojo-apps-for-webos.md +++ b/posts/2009/11/using-emacs-to-develop-mojo-apps-for-webos.md @@ -1,3 +1,11 @@ +--- +Title: Using Emacs to Develop Mojo Apps for WebOS +Author: Sami Samhuri +Date: 21st November, 2009 +Timestamp: 1258790400 +Tags: emacs, mojo, webos, lisp, javascript +--- + 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 @@ -78,3 +86,4 @@ 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! + diff --git a/posts/2009/index.ejs b/posts/2009/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2009/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2010/01/_data.json b/posts/2010/01/_data.json deleted file mode 100644 index f70cfd7..0000000 --- a/posts/2010/01/_data.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "working-with-c-style-structs-in-ruby": { - "title": "Working with C-style structs in Ruby", - "date": "17th January, 2010", - "timestamp": 1263715200, - "tags": [ - "ruby", - "cstruct", - "compiler" - ], - "author": "Sami Samhuri", - "url": "/posts/2010/01/working-with-c-style-structs-in-ruby" - }, - "basics-of-the-mach-o-file-format": { - "title": "Basics of the Mach-O file format", - "date": "18th January, 2010", - "timestamp": 1263801600, - "tags": [ - "mach-o", - "os x", - "compiler" - ], - "author": "Sami Samhuri", - "url": "/posts/2010/01/basics-of-the-mach-o-file-format" - }, - "a-preview-of-mach-o-file-generation": { - "title": "A preview of Mach-O file generation", - "date": "20th January, 2010", - "timestamp": 1263974400, - "tags": [ - "ruby", - "mach-o", - "os x", - "compiler" - ], - "author": "Sami Samhuri", - "url": "/posts/2010/01/a-preview-of-mach-o-file-generation" - } -} diff --git a/posts/2010/01/a-preview-of-mach-o-file-generation.md b/posts/2010/01/a-preview-of-mach-o-file-generation.md index 6141521..ec7f111 100644 --- a/posts/2010/01/a-preview-of-mach-o-file-generation.md +++ b/posts/2010/01/a-preview-of-mach-o-file-generation.md @@ -1,3 +1,11 @@ +--- +Title: A preview of Mach-O file generation +Author: Sami Samhuri +Date: 20th January, 2010 +Timestamp: 1263974400 +Tags: ruby, mach-o, os x, compiler +--- + This month I got back into an x86 compiler I started last May. It lives [on github](https://github.com/samsonjs/compiler). @@ -17,3 +25,4 @@ asm/machofile.rb, a library for creating Mach-O files. Using it is quite straightforward, an example is in asm/binary.rb, in the #output method. Definitely time for bed now! + diff --git a/posts/2010/01/basics-of-the-mach-o-file-format.md b/posts/2010/01/basics-of-the-mach-o-file-format.md index e0cc415..d6f0ba2 100644 --- a/posts/2010/01/basics-of-the-mach-o-file-format.md +++ b/posts/2010/01/basics-of-the-mach-o-file-format.md @@ -1,3 +1,11 @@ +--- +Title: Basics of the Mach-O file format +Author: Sami Samhuri +Date: 18th January, 2010 +Timestamp: 1263801600 +Tags: mach-o, os x, compiler +--- +

    This post is part of a series on generating basic x86 Mach-O files with Ruby. The @@ -156,3 +164,4 @@ name of \_\_TEXT, and some x86 machine code as the section data, you would almost have a useful Mach object file.)

    Until next time, happy hacking!

    + diff --git a/posts/2010/01/index.ejs b/posts/2010/01/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2010/01/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2010/01/working-with-c-style-structs-in-ruby.md b/posts/2010/01/working-with-c-style-structs-in-ruby.md index 8daf26f..a91165d 100644 --- a/posts/2010/01/working-with-c-style-structs-in-ruby.md +++ b/posts/2010/01/working-with-c-style-structs-in-ruby.md @@ -1,3 +1,11 @@ +--- +Title: Working with C-style structs in Ruby +Author: Sami Samhuri +Date: 17th January, 2010 +Timestamp: 1263715200 +Tags: ruby, cstruct, compiler +--- + This is the beginning of a series on generating Mach-O object files in Ruby. We start small by introducing some Ruby tools that are useful when working with binary data. Subsequent articles will cover a subset of the @@ -60,3 +68,4 @@ but I decided to just go with what I have already so I can get on with the more interesting and fun tasks. *Next in this series: [Basics of the Mach-O file format](/posts/2010/01/basics-of-the-mach-o-file-format)* + diff --git a/posts/2010/11/37signals-chalk-dissected.md b/posts/2010/11/37signals-chalk-dissected.md index c68b26c..0264969 100644 --- a/posts/2010/11/37signals-chalk-dissected.md +++ b/posts/2010/11/37signals-chalk-dissected.md @@ -1,3 +1,11 @@ +--- +Title: 37signals' Chalk Dissected +Author: Sami Samhuri +Date: 4th November, 2010 +Timestamp: 1288854000 +Tags: 37signals, chalk, ipad, javascript, web, html, css, zepto.js +--- +

    Update 2010-11-05: I dove into the JavaScript a little and explained most of it. Sam Stephenson tweeted that Chalk is written in CoffeeScript and compiled on the fly when served using Brochure. That's hot! (for those unaware Sam Stephenson works at 37signals, and is also the man behind Prototype.)

    37signals recently released a blackboard web app for iPad called Chalk.

    @@ -295,4 +303,4 @@ addLineNumbersToAllGists();

    Very cool code! Good job guys...

    - \ No newline at end of file + diff --git a/posts/2010/11/_data.json b/posts/2010/11/_data.json deleted file mode 100644 index 9d7d96d..0000000 --- a/posts/2010/11/_data.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "37signals-chalk-dissected": { - "title": "37signals' Chalk Dissected", - "date": "4th November, 2010", - "timestamp": 1288854000, - "tags": [ - "37signals", - "chalk", - "ipad", - "javascript", - "web", - "html", - "css", - "zepto.js" - ], - "author": "Sami Samhuri", - "url": "/posts/2010/11/37signals-chalk-dissected" - } -} diff --git a/posts/2010/11/index.ejs b/posts/2010/11/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2010/11/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2010/index.ejs b/posts/2010/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2010/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2011/11/_data.json b/posts/2011/11/_data.json deleted file mode 100644 index 8ccdbe2..0000000 --- a/posts/2011/11/_data.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "recovering-old-posts": { - "title": "Recovering Old Blog Posts", - "date": "27th November, 2011", - "timestamp": 1322385300, - "tags": [ - "recover", - "old", - "blog", - "posts" - ], - "author": "Sami Samhuri", - "url": "/posts/2011/11/recovering-old-posts" - }, - "lights": { - "title": "Lights", - "date": "27th November, 2011", - "timestamp": 1322446260, - "tags": [ - - ], - "url": "/posts/2011/11/lights", - "link": "http://lights.elliegoulding.com/" - } -} diff --git a/posts/2011/11/index.ejs b/posts/2011/11/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2011/11/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2011/11/lights.md b/posts/2011/11/lights.md index 1240902..32e0a28 100644 --- a/posts/2011/11/lights.md +++ b/posts/2011/11/lights.md @@ -1 +1,11 @@ +--- +Title: Lights +Author: Sami Samhuri +Date: 27th November, 2011 +Timestamp: 1322446260 +Tags: +Link: http://lights.elliegoulding.com/ +--- + An interactive WebGL visualization. Where's the LSD when you need it? + diff --git a/posts/2011/11/recovering-old-posts.md b/posts/2011/11/recovering-old-posts.md index af9eae9..11afa6b 100644 --- a/posts/2011/11/recovering-old-posts.md +++ b/posts/2011/11/recovering-old-posts.md @@ -1,2 +1,11 @@ +--- +Title: Recovering Old Blog Posts +Author: Sami Samhuri +Date: 27th November, 2011 +Timestamp: 1322385300 +Tags: recover, old, blog, posts +--- + I'm in the process of recovering some old blog posts from the [Wayback Machine](http://web.archive.org). Some of them might be culled, because nobody cares about my old blog posts except for me. + diff --git a/posts/2011/12/_data.json b/posts/2011/12/_data.json deleted file mode 100644 index a761e65..0000000 --- a/posts/2011/12/_data.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "static-url-shortener-using-htaccess": { - "title": "A Static URL Shortener Using .htaccess", - "date": "10th December, 2011", - "timestamp": 1323584949, - "tags": [ - "s42.ca", - "url", - "shortener", - "samhuri.net", - "url shortener" - ], - "author": "Sami Samhuri", - "url": "/posts/2011/12/static-url-shortener-using-htaccess" - }, - "pure-css3-images-hmm-maybe-later": { - "title": "Pure CSS3 images? Hmm, maybe later", - "date": "11th December, 2011", - "timestamp": 1323635103, - "tags": [ - - ], - "url": "/posts/2011/12/pure-css3-images-hmm-maybe-later", - "link": "http://calendar.perfplanet.com/2011/pure-css3-images-hmm-maybe-later/" - }, - "i-see-http": { - "title": "I see HTTP", - "date": "15th December, 2011", - "timestamp": 1323964035, - "tags": [ - - ], - "url": "/posts/2011/12/i-see-http", - "link": "http://calendar.perfplanet.com/2011/i-see-http/" - }, - "my-kind-of-feature-checklist": { - "id": "my-kind-of-feature-checklist", - "author": "Sami Samhuri", - "title": "My kind of feature checklist", - "date": "19th December, 2011", - "timestamp": 1324354805, - "link": "http://www.marco.org/2011/12/19/amazon-kindle-vs-ipad", - "url": "/posts/2011/12/my-kind-of-feature-checklist", - "tags": [ - - ] - }, - "new-release-of-firefox-for-android-optimized-for-tablets": { - "title": "New Release of Firefox for Android, Optimized for Tablets", - "date": "22nd December, 2011", - "timestamp": 1324868051, - "tags": [ - - ], - "url": "/posts/2011/12/new-release-of-firefox-for-android-optimized-for-tablets", - "link": "http://daringfireball.net/linked/2011/12/22/firefox-android" - }, - "the-broken-pixel-theory": { - "title": "The Broken Pixel Theory", - "date": "25th December, 2011", - "timestamp": 1324868060, - "tags": [ - - ], - "url": "/posts/2011/12/the-broken-pixel-theory", - "link": "http://jtaby.com/2011/12/25/the-broken-pixel-theory.html" - } -} \ No newline at end of file diff --git a/posts/2011/12/i-see-http.md b/posts/2011/12/i-see-http.md index dc72547..5ccc798 100644 --- a/posts/2011/12/i-see-http.md +++ b/posts/2011/12/i-see-http.md @@ -1,2 +1,12 @@ +--- +Title: I see HTTP +Author: Sami Samhuri +Date: 15th December, 2011 +Timestamp: 1323964035 +Tags: +Link: http://calendar.perfplanet.com/2011/i-see-http/ +--- + Icy is a public domain iOS app that lets you see everything a web page loads in great detail. This looks useful. + diff --git a/posts/2011/12/index.ejs b/posts/2011/12/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2011/12/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2011/12/my-kind-of-feature-checklist.md b/posts/2011/12/my-kind-of-feature-checklist.md index d4daa2e..dc5649f 100644 --- a/posts/2011/12/my-kind-of-feature-checklist.md +++ b/posts/2011/12/my-kind-of-feature-checklist.md @@ -1,3 +1,12 @@ +--- +Title: My kind of feature checklist +Author: Sami Samhuri +Date: 19th December, 2011 +Timestamp: 1324354805 +Tags: +Link: http://www.marco.org/2011/12/19/amazon-kindle-vs-ipad +--- + 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 @@ -32,4 +41,4 @@ support for Emacs](http://www.emacswiki.org/emacs/MojoSdk) 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. \ No newline at end of file +wanted with as little input and thought as possible. diff --git a/posts/2011/12/new-release-of-firefox-for-android-optimized-for-tablets.md b/posts/2011/12/new-release-of-firefox-for-android-optimized-for-tablets.md index 23a80ba..1932536 100644 --- a/posts/2011/12/new-release-of-firefox-for-android-optimized-for-tablets.md +++ b/posts/2011/12/new-release-of-firefox-for-android-optimized-for-tablets.md @@ -1,3 +1,12 @@ +--- +Title: New Release of Firefox for Android, Optimized for Tablets +Author: Sami Samhuri +Date: 22nd December, 2011 +Timestamp: 1324868051 +Tags: +Link: http://daringfireball.net/linked/2011/12/22/firefox-android +--- + > On the other hand, watch this video. Even in Mozilla's own demo - which presumably puts Firefox for Android in its best light - doesn't the whole thing look a bit herky-jerky, in terms of touch responsiveness and scrolling smoothness? Surely they could do better on iOS though. I have faith in the Firefox @@ -5,3 +14,4 @@ team to provide a good experience because they have done so in the past. Modern versions of Firefox are excellent. [New Release of Firefox for Android, Optimized for Tablets](http://blog.mozilla.com/blog/2011/12/20/new-firefox-for-android-experience-optimized-for-tablets/) + diff --git a/posts/2011/12/pure-css3-images-hmm-maybe-later.md b/posts/2011/12/pure-css3-images-hmm-maybe-later.md index a259048..f65f9f4 100644 --- a/posts/2011/12/pure-css3-images-hmm-maybe-later.md +++ b/posts/2011/12/pure-css3-images-hmm-maybe-later.md @@ -1,3 +1,13 @@ +--- +Title: Pure CSS3 images? Hmm, maybe later +Author: Sami Samhuri +Date: 11th December, 2011 +Timestamp: 1323635103 +Tags: +Link: http://calendar.perfplanet.com/2011/pure-css3-images-hmm-maybe-later/ +--- + Great analysis of the performance of CSS based images. Not directly mentioned, but very apparent, is that the task of making CSS images itself is prohibitively difficult. + diff --git a/posts/2011/12/static-url-shortener-using-htaccess.md b/posts/2011/12/static-url-shortener-using-htaccess.md index bf2eca2..ca26b28 100644 --- a/posts/2011/12/static-url-shortener-using-htaccess.md +++ b/posts/2011/12/static-url-shortener-using-htaccess.md @@ -1,3 +1,11 @@ +--- +Title: A Static URL Shortener Using .htaccess +Author: Sami Samhuri +Date: 10th December, 2011 +Timestamp: 1323584949 +Tags: s42.ca, url, shortener, samhuri.net, url shortener +--- + This blog is statically generated. A few Ruby and Node.js scripts along with a Makefile and some duct tape hold it all together. All of [samhuri.net is on Github][GH] if you want to take a look. Most of it is quite minimal, sometimes to a fault. Little improvements are made here and there and the most recent one is a neat [.htaccess][htaccess-wiki] hack. I want to automatically announce new posts on Twitter so short URLs are in order. I try to strike a reasonable balance between writing everything for this site myself and using libraries. A quick look at a few short URL projects was enough to see they weren't what I was looking for. They were all database backed servers. Comments on this blog are served up dynamically but everything else is static and I try to avoid dynamic behaviour when possible. Comments are moving to a more static system sometime. Anyway I registered the domain [s42.ca][s42] and nabbed [an algorithm for creating the short codes from Jonathan Snook][snook] before diving into TextMate to implement my idea. @@ -14,3 +22,4 @@ I think this is a pretty neat hack and have not seen this technique anywhere els [snook]: http://snook.ca/archives/php/url-shortener [RewriteRule]: http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule [scp]: http://en.wikipedia.org/wiki/Secure_copy + diff --git a/posts/2011/12/the-broken-pixel-theory.md b/posts/2011/12/the-broken-pixel-theory.md index 7de7905..b5b2627 100644 --- a/posts/2011/12/the-broken-pixel-theory.md +++ b/posts/2011/12/the-broken-pixel-theory.md @@ -1,3 +1,13 @@ +--- +Title: The Broken Pixel Theory +Author: Sami Samhuri +Date: 25th December, 2011 +Timestamp: 1324868060 +Tags: +Link: http://jtaby.com/2011/12/25/the-broken-pixel-theory.html +--- + > For example, a clean desk tends to stay clean until a piece of paper stays on it for a couple of days. Similarly, I'm much less likely to care about a 2-3 pixel UI bug when the whole UI is a mess. Great insight from Majd Taby. + diff --git a/posts/2011/index.ejs b/posts/2011/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2011/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2012/01/_data.json b/posts/2012/01/_data.json deleted file mode 100644 index 0357bc9..0000000 --- a/posts/2012/01/_data.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "yak-shaving": { - "title": "Yak shaving", - "date": "4th January, 2012", - "timestamp": 1325712240, - "tags": [ - - ], - "url": "/posts/2012/01/yak-shaving", - "link": "http://blog.hasmanythrough.com/2012/1/4/yak-shaving" - }, - "the-40-standup-desk": { - "title": "The $40 Standup Desk", - "date": "9th January, 2012", - "timestamp": 1326097000, - "tags": [ - - ], - "url": "/posts/2012/01/the-40-standup-desk", - "link": "http://opensoul.org/blog/archives/2012/01/09/the-40-standup-desk/" - }, - "recovering-from-a-computer-science-education": { - "title": "Recovering From a Computer Science Education", - "date": "17th January, 2012", - "timestamp": 1326787200, - "tags": [ - - ], - "url": "/posts/2012/01/recovering-from-a-computer-science-education", - "link": "http://prog21.dadgum.com/123.html" - }, - "sopa-lives-and-mpaa-calls-protests-an-abuse-of-power": { - "title": "SOPA lives - and MPAA calls protests an \"abuse of power\"", - "date": "17th January, 2012", - "timestamp": 1326797200, - "tags": [ - - ], - "url": "/posts/2012/01/sopa-lives-and-mpaa-calls-protests-an-abuse-of-power", - "link": "http://arstechnica.com/tech-policy/news/2012/01/sopa-livesand-mpaa-calls-protests-an-abuse-of-power.ars" - }, - "fujitsu-has-lost-their-mind": { - "title": "Fujitsu has lost their mind", - "date": "19th January, 2012", - "timestamp": 1327032333, - "tags": [ - - ], - "url": "/posts/2012/01/fujitsu-has-lost-their-mind", - "link": "http://tablet-news.com/2012/01/17/fujitsu-lifebook-2013-concept-incorporates-a-tablet-for-a-keyboard-phone-and-digital-camera/" - } -} diff --git a/posts/2012/01/fujitsu-has-lost-their-mind.md b/posts/2012/01/fujitsu-has-lost-their-mind.md index 12466a9..5e06bb5 100644 --- a/posts/2012/01/fujitsu-has-lost-their-mind.md +++ b/posts/2012/01/fujitsu-has-lost-their-mind.md @@ -1,3 +1,13 @@ +--- +Title: Fujitsu has lost their mind +Author: Sami Samhuri +Date: 19th January, 2012 +Timestamp: 1327032333 +Tags: +Link: http://tablet-news.com/2012/01/17/fujitsu-lifebook-2013-concept-incorporates-a-tablet-for-a-keyboard-phone-and-digital-camera/ +--- + Does this even warrant any comments on why it's already a massive failure? The many, many drawbacks seem so apparent I cannot believe this escaped from their drawing board. + diff --git a/posts/2012/01/index.ejs b/posts/2012/01/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2012/01/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2012/01/recovering-from-a-computer-science-education.md b/posts/2012/01/recovering-from-a-computer-science-education.md index 54232e0..7ef5c9c 100644 --- a/posts/2012/01/recovering-from-a-computer-science-education.md +++ b/posts/2012/01/recovering-from-a-computer-science-education.md @@ -1 +1,11 @@ +--- +Title: Recovering From a Computer Science Education +Author: Sami Samhuri +Date: 17th January, 2012 +Timestamp: 1326787200 +Tags: +Link: http://prog21.dadgum.com/123.html +--- + Something to keep in mind. + diff --git a/posts/2012/01/sopa-lives-and-mpaa-calls-protests-an-abuse-of-power.md b/posts/2012/01/sopa-lives-and-mpaa-calls-protests-an-abuse-of-power.md index db7e988..e29dff0 100644 --- a/posts/2012/01/sopa-lives-and-mpaa-calls-protests-an-abuse-of-power.md +++ b/posts/2012/01/sopa-lives-and-mpaa-calls-protests-an-abuse-of-power.md @@ -1,3 +1,12 @@ +--- +Title: SOPA lives - and MPAA calls protests an "abuse of power" +Author: Sami Samhuri +Date: 17th January, 2012 +Timestamp: 1326797200 +Tags: +Link: http://arstechnica.com/tech-policy/news/2012/01/sopa-livesand-mpaa-calls-protests-an-abuse-of-power.ars +--- + > rather than coming to the table to find solutions to a problem that all now seem to agree is very real and damaging. @@ -28,3 +37,4 @@ Their tactic of choice seems to be to loudly decry "Nuh-uh! Piracy *does* hurt us!" and then strong arming everyone worldwide while suing anyone and everyone. If times are so tough maybe they should cut some of their budgets for lawyers and lobbyists. + diff --git a/posts/2012/01/the-40-standup-desk.md b/posts/2012/01/the-40-standup-desk.md index 883245a..1a6adf8 100644 --- a/posts/2012/01/the-40-standup-desk.md +++ b/posts/2012/01/the-40-standup-desk.md @@ -1,3 +1,13 @@ +--- +Title: The $40 Standup Desk +Author: Sami Samhuri +Date: 9th January, 2012 +Timestamp: 1326097000 +Tags: +Link: http://opensoul.org/blog/archives/2012/01/09/the-40-standup-desk/ +--- + > Ultimately, I decided I might as well just do something cheap for now. So I built my own. I had thinking about doing it for a while when my coworker Steve Smith built his desk. After seeing his, I was convinced this was what I wanted to do. It turns out, the cheap option is pretty awesome. This looks great. Might have to consider it when or if I get a desk. + diff --git a/posts/2012/01/yak-shaving.md b/posts/2012/01/yak-shaving.md index ae5a655..2a12e3f 100644 --- a/posts/2012/01/yak-shaving.md +++ b/posts/2012/01/yak-shaving.md @@ -1 +1,11 @@ +--- +Title: Yak shaving +Author: Sami Samhuri +Date: 4th January, 2012 +Timestamp: 1325712240 +Tags: +Link: http://blog.hasmanythrough.com/2012/1/4/yak-shaving +--- + The best plain-english explanation of yak shaving I have seen. + diff --git a/posts/2012/index.ejs b/posts/2012/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2012/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2013/03/_data.json b/posts/2013/03/_data.json deleted file mode 100644 index 2ffad51..0000000 --- a/posts/2013/03/_data.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "zelda-tones-for-ios": { - "title": "Zelda Tones for iOS", - "date": "6th March, 2013", - "timestamp": 1362624673, - "tags": [ - "zelda", - "nintendo", - "pacman", - "ringtones", - "tones", - "ios" - ], - "author": "Sami Samhuri", - "url": "/posts/2013/03/zelda-tones-for-ios" - } -} diff --git a/posts/2013/03/index.ejs b/posts/2013/03/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2013/03/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2013/03/zelda-tones-for-ios.md b/posts/2013/03/zelda-tones-for-ios.md index e5c79f6..37736f6 100644 --- a/posts/2013/03/zelda-tones-for-ios.md +++ b/posts/2013/03/zelda-tones-for-ios.md @@ -1,3 +1,11 @@ +--- +Title: Zelda Tones for iOS +Author: Sami Samhuri +Date: 6th March, 2013 +Timestamp: 1362624673 +Tags: zelda, nintendo, pacman, ringtones, tones, ios +--- +

    Zelda

    @@ -97,3 +105,4 @@

    Get the O Fortuna ringtone

    Enjoy!

    + diff --git a/posts/2013/09/_data.json b/posts/2013/09/_data.json deleted file mode 100644 index 8547d5d..0000000 --- a/posts/2013/09/_data.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "linky": { - "title": "Linky", - "date": "27th September, 2013", - "timestamp": 1380343742, - "tags": [ - "linky", - "north watcher", - "ruby", - "gmail", - "links", - "notifications" - ], - "author": "Sami Samhuri", - "url": "/posts/2013/09/linky" - } -} diff --git a/posts/2013/09/index.ejs b/posts/2013/09/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2013/09/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2013/09/linky.md b/posts/2013/09/linky.md index aba23ce..0c5183e 100644 --- a/posts/2013/09/linky.md +++ b/posts/2013/09/linky.md @@ -1,3 +1,11 @@ +--- +Title: Linky +Author: Sami Samhuri +Date: 27th September, 2013 +Timestamp: 1380343742 +Tags: linky, north watcher, ruby, gmail, links, notifications +--- + ## Send links from mobile devices to your computers. The last few months I've been annoyed by my workflow for sending links from my touch devices to my computers. For example if I come across a cool Mac app or an open source project I want to check out, or anything along those lines. Until now I have been mailing links to my work or home addresses, or saving links in Instapaper. The problem with both of those is the same: I have to remember to check something when I arrive at the correct machine. It sounds trivial but I have been annoyed by it nonetheless. @@ -36,8 +44,8 @@ The filename field is defined as: And the content is: - {Subject}
    - {BodyPlain}
    + {Subject}
    + {BodyPlain}
    That means that when you email links, the subject should contain the title and the body should contain the link on the first line. It's ok if there's stuff after the body (like your signature), they will be ignored later. @@ -72,3 +80,4 @@ You can get `terminal-notifier` with [homebrew](http://brew.sh) in a few seconds ## Cool story, bro It may not be exciting, but as someone who typically suffers from [NIH syndrome](http://en.wikipedia.org/wiki/Not_invented_here) and writes too much from scratch, I found it pretty rewarding to cobble something seemingly complicated together with a bunch of existing components. It didn't take very long and only involved about 10 lines of code. It's not exactly what I wanted but it's surprisingly close. Success! + diff --git a/posts/2013/index.ejs b/posts/2013/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2013/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2014/02/_data.json b/posts/2014/02/_data.json deleted file mode 100644 index e6cf656..0000000 --- a/posts/2014/02/_data.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ember-structure": { - "title": "Structure of an Ember app", - "date": "3rd February, 2014", - "timestamp": 1391479549, - "tags": [ - "ember.js" - ], - "author": "Sami Samhuri", - "url": "/posts/2014/02/ember-structure" - } -} diff --git a/posts/2014/02/ember-structure.md b/posts/2014/02/ember-structure.md index ec5acc3..e47d20a 100644 --- a/posts/2014/02/ember-structure.md +++ b/posts/2014/02/ember-structure.md @@ -1,4 +1,13 @@ +--- +Title: Structure of an Ember app +Author: Sami Samhuri +Date: 3rd February, 2014 +Timestamp: 1391479549 +Tags: ember.js +--- + I made a diagram of an Ember app. There's [a discussion about it](http://discuss.emberjs.com/t/diagram-of-an-ember-apps-structure/4060) on the [Ember Discussion Forum](http://discuss.emberjs.com/). Here is the source file, created with OmniGraffle: [Ember structure.graffle](https://www.dropbox.com/s/onnmn1oq096hv5f/Ember%20structure.graffle) [![Structure of an Ember app](/f/ember-structure.png)](/f/ember-structure.png) + diff --git a/posts/2014/02/index.ejs b/posts/2014/02/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2014/02/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2014/index.ejs b/posts/2014/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2014/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2015/05/_data.json b/posts/2015/05/_data.json deleted file mode 100644 index a8a1914..0000000 --- a/posts/2015/05/_data.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "apple-watch-human-interface-guidelines": { - "id": "apple-watch-human-interface-guidelines", - "author": "Sami Samhuri", - "title": "Apple Watch Human Interface Guidelines", - "date": "10th May, 2015", - "timestamp": 1431223039, - "link": "https://developer.apple.com/watch/human-interface-guidelines/", - "url": "/posts/2015/05/apple-watch-human-interface-guidelines", - "tags": [ - - ] - }, - "importing-modules-in-lldb": { - "id": "importing-modules-in-lldb", - "author": "Sami Samhuri", - "title": "Importing Modules in LLDB", - "date": "12th May, 2015", - "timestamp": 1431396215, - "link": "http://furbo.org/2015/05/11/an-import-ant-change-in-xcode/", - "url": "/posts/2015/05/importing-modules-in-lldb", - "tags": [ - - ] - }, - "constraints-and-transforms-in-ios-8": { - "id": "constraints-and-transforms-in-ios-8", - "author": "Sami Samhuri", - "title": "Constraints and Transforms in iOS 8", - "date": "15th May, 2015", - "timestamp": 1431699995, - "link": "http://revealapp.com/blog/constraints-and-transforms.html", - "url": "/posts/2015/05/constraints-and-transforms-in-ios-8", - "tags": [ - - ] - }, - "a-bitcoin-miner-in-every-device-and-in-every-hand": { - "id": "a-bitcoin-miner-in-every-device-and-in-every-hand", - "author": "Sami Samhuri", - "title": "A bitcoin miner in every device and in every hand", - "date": "19th May, 2015", - "timestamp": 1432004034, - "link": "https://medium.com/@21dotco/a-bitcoin-miner-in-every-device-and-in-every-hand-e315b40f2821", - "url": "/posts/2015/05/a-bitcoin-miner-in-every-device-and-in-every-hand", - "tags": [ - - ] - }, - "lenovo-thinkpad-x1-carbon": { - "id": "lenovo-thinkpad-x1-carbon", - "author": "Sami Samhuri", - "title": "Lenovo ThinkPad X1 Carbon", - "date": "22nd May, 2015", - "timestamp": 1432254989, - "link": "http://www.anandtech.com/show/9264/the-lenovo-thinkpad-x1-carbon-review-2015", - "url": "/posts/2015/05/lenovo-thinkpad-x1-carbon", - "tags": [ - - ] - }, - "undocumented-corestorage-commands": { - "id": "undocumented-corestorage-commands", - "author": "Sami Samhuri", - "title": "Undocumented CoreStorage Commands", - "date": "24th May, 2015", - "timestamp": 1432436316, - "link": "http://blog.fosketts.net/2011/08/05/undocumented-corestorage-commands/", - "url": "/posts/2015/05/undocumented-corestorage-commands", - "tags": [ - - ] - }, - "magical-wristband": { - "id": "magical-wristband", - "author": "Sami Samhuri", - "title": "Magical Wristband", - "date": "27th May, 2015", - "timestamp": 1432703849, - "link": "http://www.wired.com/2015/03/disney-magicband/", - "url": "/posts/2015/05/magical-wristband", - "tags": [ - - ] - }, - "github-flow-like-a-pro": { - "id": "github-flow-like-a-pro", - "author": "Sami Samhuri", - "title": "GitHub Flow Like a Pro", - "date": "28th May, 2015", - "timestamp": 1432824147, - "link": "http://haacked.com/archive/2014/07/28/github-flow-aliases/", - "url": "/posts/2015/05/github-flow-like-a-pro", - "tags": [ - - ] - } -} \ No newline at end of file diff --git a/posts/2015/05/a-bitcoin-miner-in-every-device-and-in-every-hand.md b/posts/2015/05/a-bitcoin-miner-in-every-device-and-in-every-hand.md index 6fba117..0608af7 100644 --- a/posts/2015/05/a-bitcoin-miner-in-every-device-and-in-every-hand.md +++ b/posts/2015/05/a-bitcoin-miner-in-every-device-and-in-every-hand.md @@ -1,3 +1,12 @@ +--- +Title: A bitcoin miner in every device and in every hand +Author: Sami Samhuri +Date: 19th May, 2015 +Timestamp: 1432004034 +Tags: +Link: https://medium.com/@21dotco/a-bitcoin-miner-in-every-device-and-in-every-hand-e315b40f2821 +--- + > A wide variety of new internet-connected devices require an associated SAAS subscription to work. Rather than paying a number of different subscription bills, by including the right-sized 21 BitShare with the device one can under many scenarios wholly or partially defray the expense of the cloud service. -I've joked about shipping apps that mine bitcoins instead of showing ads. Now hardware vendors can easily do the same thing. We live in interesting times. \ No newline at end of file +I've joked about shipping apps that mine bitcoins instead of showing ads. Now hardware vendors can easily do the same thing. We live in interesting times. diff --git a/posts/2015/05/apple-watch-human-interface-guidelines.md b/posts/2015/05/apple-watch-human-interface-guidelines.md index 9aed1ba..3959e9a 100644 --- a/posts/2015/05/apple-watch-human-interface-guidelines.md +++ b/posts/2015/05/apple-watch-human-interface-guidelines.md @@ -1 +1,10 @@ -Time to read this again now that I've had a watch for a few days. \ No newline at end of file +--- +Title: Apple Watch Human Interface Guidelines +Author: Sami Samhuri +Date: 10th May, 2015 +Timestamp: 1431223039 +Tags: +Link: https://developer.apple.com/watch/human-interface-guidelines/ +--- + +Time to read this again now that I've had a watch for a few days. diff --git a/posts/2015/05/constraints-and-transforms-in-ios-8.md b/posts/2015/05/constraints-and-transforms-in-ios-8.md index 6448a48..493fd89 100644 --- a/posts/2015/05/constraints-and-transforms-in-ios-8.md +++ b/posts/2015/05/constraints-and-transforms-in-ios-8.md @@ -1 +1,10 @@ -Looks like a nice improvement. \ No newline at end of file +--- +Title: Constraints and Transforms in iOS 8 +Author: Sami Samhuri +Date: 15th May, 2015 +Timestamp: 1431699995 +Tags: +Link: http://revealapp.com/blog/constraints-and-transforms.html +--- + +Looks like a nice improvement. diff --git a/posts/2015/05/github-flow-like-a-pro.md b/posts/2015/05/github-flow-like-a-pro.md index 5e67fc1..6715f2e 100644 --- a/posts/2015/05/github-flow-like-a-pro.md +++ b/posts/2015/05/github-flow-like-a-pro.md @@ -1 +1,10 @@ -I'm going to snag `bclean` and `bdone` and add them to [my git aliases](https://github.com/samsonjs/config/blob/45cd33c3c3bc7692c18a5c1b9f6cb489d245ac97/zsh/zshrc#L218). \ No newline at end of file +--- +Title: GitHub Flow Like a Pro +Author: Sami Samhuri +Date: 28th May, 2015 +Timestamp: 1432824147 +Tags: +Link: http://haacked.com/archive/2014/07/28/github-flow-aliases/ +--- + +I'm going to snag `bclean` and `bdone` and add them to [my git aliases](https://github.com/samsonjs/config/blob/45cd33c3c3bc7692c18a5c1b9f6cb489d245ac97/zsh/zshrc#L218). diff --git a/posts/2015/05/importing-modules-in-lldb.md b/posts/2015/05/importing-modules-in-lldb.md index cc2ed5d..8d449f6 100644 --- a/posts/2015/05/importing-modules-in-lldb.md +++ b/posts/2015/05/importing-modules-in-lldb.md @@ -1 +1,10 @@ -It's great that Apple added this but I don't understand why Foundation and UIKit aren't imported automatically when you're writing an iOS app. \ No newline at end of file +--- +Title: Importing Modules in LLDB +Author: Sami Samhuri +Date: 12th May, 2015 +Timestamp: 1431396215 +Tags: +Link: http://furbo.org/2015/05/11/an-import-ant-change-in-xcode/ +--- + +It's great that Apple added this but I don't understand why Foundation and UIKit aren't imported automatically when you're writing an iOS app. diff --git a/posts/2015/05/index.ejs b/posts/2015/05/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2015/05/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2015/05/lenovo-thinkpad-x1-carbon.md b/posts/2015/05/lenovo-thinkpad-x1-carbon.md index 4e3dacd..41ff175 100644 --- a/posts/2015/05/lenovo-thinkpad-x1-carbon.md +++ b/posts/2015/05/lenovo-thinkpad-x1-carbon.md @@ -1 +1,10 @@ -Being an iOS developer, it wouldn't make sense to buy a Windows machine. But this looks like one hell of a notebook. I love that it has an LTE option. \ No newline at end of file +--- +Title: Lenovo ThinkPad X1 Carbon +Author: Sami Samhuri +Date: 22nd May, 2015 +Timestamp: 1432254989 +Tags: +Link: http://www.anandtech.com/show/9264/the-lenovo-thinkpad-x1-carbon-review-2015 +--- + +Being an iOS developer, it wouldn't make sense to buy a Windows machine. But this looks like one hell of a notebook. I love that it has an LTE option. diff --git a/posts/2015/05/magical-wristband.md b/posts/2015/05/magical-wristband.md index 8d75169..dd5fc4a 100644 --- a/posts/2015/05/magical-wristband.md +++ b/posts/2015/05/magical-wristband.md @@ -1 +1,10 @@ -> When everything works, the reader flashes green and emits a pleasing tone; if something goes wrong, it glows blue—never red. Red lights are forbidden at Disney, as they imply something bad happened. Nothing bad can happen at Disney World. \ No newline at end of file +--- +Title: Magical Wristband +Author: Sami Samhuri +Date: 27th May, 2015 +Timestamp: 1432703849 +Tags: +Link: http://www.wired.com/2015/03/disney-magicband/ +--- + +> When everything works, the reader flashes green and emits a pleasing tone; if something goes wrong, it glows blue—never red. Red lights are forbidden at Disney, as they imply something bad happened. Nothing bad can happen at Disney World. diff --git a/posts/2015/05/undocumented-corestorage-commands.md b/posts/2015/05/undocumented-corestorage-commands.md index 5552305..3dae4a2 100644 --- a/posts/2015/05/undocumented-corestorage-commands.md +++ b/posts/2015/05/undocumented-corestorage-commands.md @@ -1 +1,10 @@ -You can upgrade a drive to a Fusion drive in-place with these commands. Without cloning or reinstalling. `convert`, `addDisk`, then `resizeVolume`. \ No newline at end of file +--- +Title: Undocumented CoreStorage Commands +Author: Sami Samhuri +Date: 24th May, 2015 +Timestamp: 1432436316 +Tags: +Link: http://blog.fosketts.net/2011/08/05/undocumented-corestorage-commands/ +--- + +You can upgrade a drive to a Fusion drive in-place with these commands. Without cloning or reinstalling. `convert`, `addDisk`, then `resizeVolume`. diff --git a/posts/2015/06/_data.json b/posts/2015/06/_data.json deleted file mode 100644 index 007f2f5..0000000 --- a/posts/2015/06/_data.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "the-unofficial-guide-to-xcconfig-files": { - "id": "the-unofficial-guide-to-xcconfig-files", - "author": "Sami Samhuri", - "title": "The Unofficial Guide to xcconfig files", - "date": "1st June, 2015", - "timestamp": 1433171811, - "link": "http://pewpewthespells.com/blog/xcconfig_guide.html?utm_campaign=iOS%2BDev%2BWeekly&utm_source=iOS_Dev_Weekly_Issue_200", - "url": "/posts/2015/06/the-unofficial-guide-to-xcconfig-files", - "tags": [ - - ] - }, - "debugging-layouts-with-recursive-view-descriptions-in-xcode": { - "id": "debugging-layouts-with-recursive-view-descriptions-in-xcode", - "author": "Sami Samhuri", - "title": "Debugging Layouts with Recursive View Descriptions in Xcode", - "date": "2nd June, 2015", - "timestamp": 1433288135, - "link": "http://jeffreysambells.com/2013/01/24/debugging-layouts-with-recursive-view-descriptions-in-xcode", - "url": "/posts/2015/06/debugging-layouts-with-recursive-view-descriptions-in-xcode", - "tags": [ - - ] - } -} \ No newline at end of file diff --git a/posts/2015/06/debugging-layouts-with-recursive-view-descriptions-in-xcode.md b/posts/2015/06/debugging-layouts-with-recursive-view-descriptions-in-xcode.md index e3ae974..be0850b 100644 --- a/posts/2015/06/debugging-layouts-with-recursive-view-descriptions-in-xcode.md +++ b/posts/2015/06/debugging-layouts-with-recursive-view-descriptions-in-xcode.md @@ -1 +1,10 @@ -[Yoink](https://github.com/samsonjs/config/commit/5e8e69326b774da2b122fa021dd0f520feeda17b). \ No newline at end of file +--- +Title: Debugging Layouts with Recursive View Descriptions in Xcode +Author: Sami Samhuri +Date: 2nd June, 2015 +Timestamp: 1433288135 +Tags: +Link: http://jeffreysambells.com/2013/01/24/debugging-layouts-with-recursive-view-descriptions-in-xcode +--- + +[Yoink](https://github.com/samsonjs/config/commit/5e8e69326b774da2b122fa021dd0f520feeda17b). diff --git a/posts/2015/06/index.ejs b/posts/2015/06/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2015/06/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2015/06/the-unofficial-guide-to-xcconfig-files.md b/posts/2015/06/the-unofficial-guide-to-xcconfig-files.md index 7c0c802..6c6e7a9 100644 --- a/posts/2015/06/the-unofficial-guide-to-xcconfig-files.md +++ b/posts/2015/06/the-unofficial-guide-to-xcconfig-files.md @@ -1 +1,10 @@ -> One of the least documented aspects of the configuration process are xcconfig files. As of this writing there seem to be no documents provided by Apple that explain how to use xcconfigs or why they exist. A xcconfig file is used as a supplemental file to a specific build configuration. A build configuration can have an associated xcconfig file, this allows for additional changes to the target's build settings from outside the Xcode project editor. \ No newline at end of file +--- +Title: The Unofficial Guide to xcconfig files +Author: Sami Samhuri +Date: 1st June, 2015 +Timestamp: 1433171811 +Tags: +Link: http://pewpewthespells.com/blog/xcconfig_guide.html?utm_campaign=iOS%2BDev%2BWeekly&utm_source=iOS_Dev_Weekly_Issue_200 +--- + +> One of the least documented aspects of the configuration process are xcconfig files. As of this writing there seem to be no documents provided by Apple that explain how to use xcconfigs or why they exist. A xcconfig file is used as a supplemental file to a specific build configuration. A build configuration can have an associated xcconfig file, this allows for additional changes to the target's build settings from outside the Xcode project editor. diff --git a/posts/2015/07/_data.json b/posts/2015/07/_data.json deleted file mode 100644 index 78f9018..0000000 --- a/posts/2015/07/_data.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "scripts-to-rule-them-all": { - "id": "scripts-to-rule-them-all", - "author": "Sami Samhuri", - "title": "Scripts to Rule Them All", - "date": "1st July, 2015", - "timestamp": 1435761424, - "link": "http://githubengineering.com/scripts-to-rule-them-all/", - "url": "/posts/2015/07/scripts-to-rule-them-all", - "tags": [ - - ] - }, - "swift-new-stuff-in-xcode-7-beta-3": { - "id": "swift-new-stuff-in-xcode-7-beta-3", - "author": "Sami Samhuri", - "title": "Swift: New stuff in Xcode 7 Beta 3", - "date": "9th July, 2015", - "timestamp": 1436458633, - "link": "http://ericasadun.com/2015/07/08/swift-new-stuff-in-xcode-7-beta-3/", - "url": "/posts/2015/07/swift-new-stuff-in-xcode-7-beta-3", - "tags": [ - - ] - } -} \ No newline at end of file diff --git a/posts/2015/07/index.ejs b/posts/2015/07/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2015/07/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2015/07/scripts-to-rule-them-all.md b/posts/2015/07/scripts-to-rule-them-all.md index fb839d9..26406b6 100644 --- a/posts/2015/07/scripts-to-rule-them-all.md +++ b/posts/2015/07/scripts-to-rule-them-all.md @@ -1 +1,10 @@ -I really like this idea. I try to make bootstrap scripts for most projects but can do better. \ No newline at end of file +--- +Title: Scripts to Rule Them All +Author: Sami Samhuri +Date: 1st July, 2015 +Timestamp: 1435761424 +Tags: +Link: http://githubengineering.com/scripts-to-rule-them-all/ +--- + +I really like this idea. I try to make bootstrap scripts for most projects but can do better. diff --git a/posts/2015/07/swift-new-stuff-in-xcode-7-beta-3.md b/posts/2015/07/swift-new-stuff-in-xcode-7-beta-3.md index 8f88cff..d299a90 100644 --- a/posts/2015/07/swift-new-stuff-in-xcode-7-beta-3.md +++ b/posts/2015/07/swift-new-stuff-in-xcode-7-beta-3.md @@ -1 +1,10 @@ -This is all good stuff. I need to spend more time reading the Swift 2 book. \ No newline at end of file +--- +Title: Swift: New stuff in Xcode 7 Beta 3 +Author: Sami Samhuri +Date: 9th July, 2015 +Timestamp: 1436458633 +Tags: +Link: http://ericasadun.com/2015/07/08/swift-new-stuff-in-xcode-7-beta-3/ +--- + +This is all good stuff. I need to spend more time reading the Swift 2 book. diff --git a/posts/2015/08/_data.json b/posts/2015/08/_data.json deleted file mode 100644 index 2978161..0000000 --- a/posts/2015/08/_data.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "acorn-5s-live-help-search": { - "id": "acorn-5s-live-help-search", - "author": "Sami Samhuri", - "title": "Acorn 5's Live Help Search", - "date": "25th August, 2015", - "timestamp": 1440478827, - "link": "http://shapeof.com/archives/2015/8/acorn_5_search_index.html", - "url": "/posts/2015/08/acorn-5s-live-help-search", - "tags": [ - - ] - }, - "cloaks-updated-privacy-policy": { - "id": "cloaks-updated-privacy-policy", - "author": "Sami Samhuri", - "title": "Cloak's Updated Privacy Policy", - "date": "27th August, 2015", - "timestamp": 1440644214, - "link": "https://blog.getcloak.com/2015/08/25/updated-privacy-policy/", - "url": "/posts/2015/08/cloaks-updated-privacy-policy", - "tags": [ - - ] - } -} \ No newline at end of file diff --git a/posts/2015/08/acorn-5s-live-help-search.md b/posts/2015/08/acorn-5s-live-help-search.md index b467cdb..7890d0a 100644 --- a/posts/2015/08/acorn-5s-live-help-search.md +++ b/posts/2015/08/acorn-5s-live-help-search.md @@ -1 +1,10 @@ -If you make Mac software please look into this. It looks sweet. \ No newline at end of file +--- +Title: Acorn 5's Live Help Search +Author: Sami Samhuri +Date: 25th August, 2015 +Timestamp: 1440478827 +Tags: +Link: http://shapeof.com/archives/2015/8/acorn_5_search_index.html +--- + +If you make Mac software please look into this. It looks sweet. diff --git a/posts/2015/08/cloaks-updated-privacy-policy.md b/posts/2015/08/cloaks-updated-privacy-policy.md index a55e8b6..cb08208 100644 --- a/posts/2015/08/cloaks-updated-privacy-policy.md +++ b/posts/2015/08/cloaks-updated-privacy-policy.md @@ -1 +1,10 @@ -This is exactly what I want to see from my VPN. Good stuff. \ No newline at end of file +--- +Title: Cloak's Updated Privacy Policy +Author: Sami Samhuri +Date: 27th August, 2015 +Timestamp: 1440644214 +Tags: +Link: https://blog.getcloak.com/2015/08/25/updated-privacy-policy/ +--- + +This is exactly what I want to see from my VPN. Good stuff. diff --git a/posts/2015/08/index.ejs b/posts/2015/08/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2015/08/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2015/index.ejs b/posts/2015/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2015/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2016/03/_data.json b/posts/2016/03/_data.json deleted file mode 100644 index d54320f..0000000 --- a/posts/2016/03/_data.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "moving-beyond-the-oop-obsession": { - "id": "moving-beyond-the-oop-obsession", - "author": "Sami Samhuri", - "title": "Moving Beyond the OOP Obsession", - "date": "28th March, 2016", - "timestamp": 1459181327, - "link": "http://prog21.dadgum.com/218.html", - "url": "/posts/2016/03/moving-beyond-the-oop-obsession", - "tags": [ - - ] - }, - "reduce-the-cognitive-load-of-your-code": { - "id": "reduce-the-cognitive-load-of-your-code", - "author": "Sami Samhuri", - "title": "Reduce the cognitive load of your code", - "date": "30th March, 2016", - "timestamp": 1459347029, - "link": "http://chrismm.com/blog/how-to-reduce-the-cognitive-load-of-your-code/", - "url": "/posts/2016/03/reduce-the-cognitive-load-of-your-code", - "tags": [ - - ] - } -} \ No newline at end of file diff --git a/posts/2016/03/index.ejs b/posts/2016/03/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2016/03/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2016/03/moving-beyond-the-oop-obsession.md b/posts/2016/03/moving-beyond-the-oop-obsession.md index 622a73e..a9117a6 100644 --- a/posts/2016/03/moving-beyond-the-oop-obsession.md +++ b/posts/2016/03/moving-beyond-the-oop-obsession.md @@ -1 +1,10 @@ -I really like this style of modularity in C and Lisp. Using delegation and other patterns you can go a really long way without inheritance too. \ No newline at end of file +--- +Title: Moving Beyond the OOP Obsession +Author: Sami Samhuri +Date: 28th March, 2016 +Timestamp: 1459181327 +Tags: +Link: http://prog21.dadgum.com/218.html +--- + +I really like this style of modularity in C and Lisp. Using delegation and other patterns you can go a really long way without inheritance too. diff --git a/posts/2016/03/reduce-the-cognitive-load-of-your-code.md b/posts/2016/03/reduce-the-cognitive-load-of-your-code.md index db3ca7f..7c96221 100644 --- a/posts/2016/03/reduce-the-cognitive-load-of-your-code.md +++ b/posts/2016/03/reduce-the-cognitive-load-of-your-code.md @@ -1 +1,10 @@ -This is all good advice. I should use more intermediate variables for longer conditions. \ No newline at end of file +--- +Title: Reduce the cognitive load of your code +Author: Sami Samhuri +Date: 30th March, 2016 +Timestamp: 1459347029 +Tags: +Link: http://chrismm.com/blog/how-to-reduce-the-cognitive-load-of-your-code/ +--- + +This is all good advice. I should use more intermediate variables for longer conditions. diff --git a/posts/2016/04/_data.json b/posts/2016/04/_data.json deleted file mode 100644 index 2a6668c..0000000 --- a/posts/2016/04/_data.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "tales-of-prk-laser-eye-surgery": { - "id": "tales-of-prk-laser-eye-surgery", - "author": "Sami Samhuri", - "title": "Tales of PRK Laser Eye Surgery", - "date": "12th April, 2016", - "timestamp": 1460433173, - "link": null, - "url": "/posts/2016/04/tales-of-prk-laser-eye-surgery", - "tags": [ - - ] - } -} \ No newline at end of file diff --git a/posts/2016/04/index.ejs b/posts/2016/04/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2016/04/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2016/04/tales-of-prk-laser-eye-surgery.md b/posts/2016/04/tales-of-prk-laser-eye-surgery.md index 64413d7..5bd7f17 100644 --- a/posts/2016/04/tales-of-prk-laser-eye-surgery.md +++ b/posts/2016/04/tales-of-prk-laser-eye-surgery.md @@ -1,3 +1,11 @@ +--- +Title: Tales of PRK Laser Eye Surgery +Author: Sami Samhuri +Date: 12th April, 2016 +Timestamp: 1460433173 +Tags: +--- + Today I scheduled PRK laser eye surgery on April 19th. Exciting but also kind of terrifying because the procedure sounds a bit horrific. Most accounts from people don't sound very bad though so the operation itself should be a breeze! I scoured the web for PRK recovery stories to get an idea of what I was in for and found some good quotes. ---- @@ -35,3 +43,4 @@ Unfortunately they also failed to get as good of a result as many others. > I found that the surgery was actually very entertaining! It’s kinda like your eyes are going through a car wash. After popping a Valium, you relax and just lay on your back while the surgeon does everything. Thanks to plenty of freezing drops, you can’t even tell when the surgeon touches your eye – you just watch it all unfold like a movie. [anson]: http://www.ansonkao.com/blog/2015/10/01/the-prk-recovery-experience/ + diff --git a/posts/2016/08/_data.json b/posts/2016/08/_data.json deleted file mode 100644 index 6b2ac83..0000000 --- a/posts/2016/08/_data.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "ios-git-pre-commit-hook": { - "id": "ios-git-pre-commit-hook", - "author": "Sami Samhuri", - "title": "A Git Pre-commit Hook for iOS", - "date": "4th August, 2016", - "timestamp": 1470328683, - "link": null, - "url": "/posts/2016/08/ios-git-pre-commit-hook", - "tags": [ - "ios", - "git" - ] - }, - "easy-optimization-wins": { - "id": "easy-optimization-wins", - "author": "Sami Samhuri", - "title": "Easy Optimization Wins", - "date": "10th August, 2016", - "timestamp": 1470850249, - "link": null, - "url": "/posts/2016/08/easy-optimization-wins", - "tags": [ - "ios", - "git" - ] - } -} \ No newline at end of file diff --git a/posts/2016/08/easy-optimization-wins.md b/posts/2016/08/easy-optimization-wins.md index 656c975..0cdf27e 100644 --- a/posts/2016/08/easy-optimization-wins.md +++ b/posts/2016/08/easy-optimization-wins.md @@ -1,3 +1,11 @@ +--- +Title: Easy Optimization Wins +Author: Sami Samhuri +Date: 10th August, 2016 +Timestamp: 1470850249 +Tags: ios, git +--- + It's not hard to hide a whole lot of complexity behind a function call, so you have to be very aware of what the functions you are using actually do, and how long they take to do it. Here's some example code illustrating a big performance problem I found in a codebase I've inherited. We have a dictionary keyed by a string representing a date, e.g. "2016-08-10", and where the values are arrays of videos for that given date. Due to some unimportant product details videos can actually appear in more than one of the array values. The goal is to get an array of all videos, sorted by date, and with no duplicates. So we need to discard duplicates when building the sorted array. @@ -44,4 +52,4 @@ Putting the constant back in let's see how many operations it now takes to get a Getting practical, in this case running the original function against **4,990 videos takes 29.653 seconds** on an iPhone 4S. Running the new function against the same set of videos takes **4.792 seconds**. Still not great and there's room for improvement, but that was a big, easy win already. -Mind your algorithms folks, it makes a huge difference in the real world. \ No newline at end of file +Mind your algorithms folks, it makes a huge difference in the real world. diff --git a/posts/2016/08/index.ejs b/posts/2016/08/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2016/08/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2016/08/ios-git-pre-commit-hook.md b/posts/2016/08/ios-git-pre-commit-hook.md index 2810989..15c53ec 100644 --- a/posts/2016/08/ios-git-pre-commit-hook.md +++ b/posts/2016/08/ios-git-pre-commit-hook.md @@ -1,3 +1,11 @@ +--- +Title: A Git Pre-commit Hook for iOS +Author: Sami Samhuri +Date: 4th August, 2016 +Timestamp: 1470328683 +Tags: ios, git +--- + [Krzysztof Zabłocki][kztwitter] wrote [a nice article on using a git pre-commit hook to catch mistakes in iOS projects][link] before you push those mistakes out to the whole team/world. It's a great idea! But the shell script has some problems, so let's fix those. If you don't care what I did or why then you can just [see the updated script][gist]. @@ -10,11 +18,13 @@ If you don't care what I did or why then you can just [see the updated script][g The diff command is repeated. This is any easy win: - diff-index() { - git diff-index -p -M --cached HEAD -- "$@" - } +
    +diff-index() {
    +    git diff-index -p -M --cached HEAD -- "$@"
    +}
     
    -    if diff-index '*Tests.swift' | ...
    +if diff-index '*Tests.swift' | ...
    +
    You get the idea. @@ -24,7 +34,7 @@ One problem is that the bootstrap script uses an absolute path when creating a s That's easily fixed by using a relative path to your pre-commit hook, like so: - ln -s ../../scripts/pre-commit.sh .git/hooks/pre-commit +
    ln -s ../../scripts/pre-commit.sh .git/hooks/pre-commit
    Ah, this is more flexible! Of course if you ever move the script itself then it's on you to update the symlink and bootstrap.sh, but that was already the case anyway. @@ -36,34 +46,42 @@ Ok great so this script tells me there are errors. Well, script, what exactly _a First ignore the fact I'm talking to a shell script. I don't get out much. Anyway... now we need to pull out the regular expressions and globs so we can reuse them to show what the actual errors are if we find any. - test_pattern='^\+\s*\b(fdescribe|fit|fcontext|xdescribe|xit|xcontext)\(' - test_glob='*Tests.swift *Specs.swift' - if diff-index $test_glob | egrep "$test_pattern" >/dev/null 2>&1 - ... +
    +test_pattern='^\+\s*\b(fdescribe|fit|fcontext|xdescribe|xit|xcontext)\('
    +test_glob='*Tests.swift *Specs.swift'
    +if diff-index $test_glob | egrep "$test_pattern" >/dev/null 2>&1
    +...
    +
    _Pro tip: I prefixed test\_pattern with `\b` to only match word boundaries to reduce false positives._ And: - misplaced_pattern='misplaced="YES"' - misplaced_glob='*.xib *.storyboard' - if diff-index $misplaced_glob | grep '^+' | egrep "$misplaced_pattern" >/dev/null 2>&1 - ... +
    +misplaced_pattern='misplaced="YES"'
    +misplaced_glob='*.xib *.storyboard'
    +if diff-index $misplaced_glob | grep '^+' | egrep "$misplaced_pattern" >/dev/null 2>&1
    +...
    +
    You may notice that I snuck in `*Specs.swift` as well. Let's not be choosy about file naming. Then we need to show where the errors are by using `diff-indef`, with an `|| true` at the end because the whole script fails if any single command fails, and `git diff-index` regularly exits with non-zero status (I didn't look into why that is). - echo "COMMIT REJECTED for fdescribe/fit/fcontext/xdescribe/xit/xcontext." >&2 - echo "Remove focused and disabled tests before committing." >&2 - diff-index $test_glob | egrep -2 "$test_pattern" || true >&2 - echo '----' >&2 +
    +echo "COMMIT REJECTED for fdescribe/fit/fcontext/xdescribe/xit/xcontext." >&2
    +echo "Remove focused and disabled tests before committing." >&2
    +diff-index $test_glob | egrep -2 "$test_pattern" || true >&2
    +echo '----' >&2
    +
    And for misplaced views: - echo "COMMIT REJECTED for misplaced views. Correct them before committing." >&2 - git grep -E "$misplaced_pattern" $misplaced_glob || true >&2 - echo '----' >&2 +
    +echo "COMMIT REJECTED for misplaced views. Correct them before committing." >&2
    +git grep -E "$misplaced_pattern" $misplaced_glob || true >&2
    +echo '----' >&2
    +
    ## Fix all the things, at once @@ -73,15 +91,15 @@ The first step is to exit at the end using a code in a variable that is set to 1 Up top: - failed=0 +
    failed=0
    In the middle, where we detect errors: - failed=1 +
    failed=1
    And at the bottom: - exit $failed +
    exit $failed
    That's all there is to it. If we don't exit early then all the code runs. @@ -95,37 +113,39 @@ Those were all the obvious improvements in my mind and now I'm using this modifi Here's the whole thing put together: - #!/usr/bin/env bash - # - # Based on http://merowing.info/2016/08/setting-up-pre-commit-hook-for-ios/ - - set -eu - - diff-index() { - git diff-index -p -M --cached HEAD -- "$@" - } - - failed=0 - - test_pattern='^\+\s*\b(fdescribe|fit|fcontext|xdescribe|xit|xcontext)\(' - test_glob='*Tests.swift *Specs.swift' - if diff-index $test_glob | egrep "$test_pattern" >/dev/null 2>&1 - then - echo "COMMIT REJECTED for fdescribe/fit/fcontext/xdescribe/xit/xcontext." >&2 - echo "Remove focused and disabled tests before committing." >&2 - diff-index $test_glob | egrep -2 "$test_pattern" || true >&2 - echo '----' >&2 - failed=1 - fi - - misplaced_pattern='misplaced="YES"' - misplaced_glob='*.xib *.storyboard' - if diff-index $misplaced_glob | grep '^+' | egrep "$misplaced_pattern" >/dev/null 2>&1 - then - echo "COMMIT REJECTED for misplaced views. Correct them before committing." >&2 - git grep -E "$misplaced_pattern" $misplaced_glob || true >&2 - echo '----' >&2 - failed=1 - fi - - exit $failed +
    +#!/usr/bin/env bash
    +#
    +# Based on http://merowing.info/2016/08/setting-up-pre-commit-hook-for-ios/
    +
    +set -eu
    +
    +diff-index() {
    +  git diff-index -p -M --cached HEAD -- "$@"
    +}
    +
    +failed=0
    +
    +test_pattern='^\+\s*\b(fdescribe|fit|fcontext|xdescribe|xit|xcontext)\('
    +test_glob='*Tests.swift *Specs.swift'
    +if diff-index $test_glob | egrep "$test_pattern" >/dev/null 2>&1
    +then
    +  echo "COMMIT REJECTED for fdescribe/fit/fcontext/xdescribe/xit/xcontext." >&2
    +  echo "Remove focused and disabled tests before committing." >&2
    +  diff-index $test_glob | egrep -2 "$test_pattern" || true >&2
    +  echo '----' >&2
    +  failed=1
    +fi
    +
    +misplaced_pattern='misplaced="YES"'
    +misplaced_glob='*.xib *.storyboard'
    +if diff-index $misplaced_glob | grep '^+' | egrep "$misplaced_pattern" >/dev/null 2>&1
    +then
    +  echo "COMMIT REJECTED for misplaced views. Correct them before committing." >&2
    +  git grep -E "$misplaced_pattern" $misplaced_glob || true >&2
    +  echo '----' >&2
    +  failed=1
    +fi
    +
    +exit $failed
    +
    \ No newline at end of file diff --git a/posts/2016/index.ejs b/posts/2016/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2016/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2017/10/_data.json b/posts/2017/10/_data.json deleted file mode 100644 index a5ffbd0..0000000 --- a/posts/2017/10/_data.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "swift-optional-or": { - "id": "swift-optional-or", - "author": "Sami Samhuri", - "title": "A nil-coalescing alternative for Swift", - "date": "6th October, 2017", - "timestamp": 1507324813, - "link": null, - "url": "/posts/2017/10/swift-optional-or", - "tags": [ - "ios", - "swift" - ] - } -} diff --git a/posts/2017/10/index.ejs b/posts/2017/10/index.ejs deleted file mode 100644 index 72c8d6b..0000000 --- a/posts/2017/10/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../../_month') %> diff --git a/posts/2017/10/swift-optional-or.md b/posts/2017/10/swift-optional-or.md index bba17db..4a57f49 100644 --- a/posts/2017/10/swift-optional-or.md +++ b/posts/2017/10/swift-optional-or.md @@ -1,11 +1,10 @@ --- -Slug: swift-optional-or Author: Sami Samhuri Title: A nil-coalescing alternative for Swift Date: 6th October, 2017 Timestamp: 1507324813 -Path_deprecated: /posts/2017/10/swift-optional-or Tags: iOS, Swift +Path_deprecated: /posts/2017/10/swift-optional-or --- Swift compile times leave something to be desired and a common culprit is the affectionately-named [nil-coalescing operator][nilop]. A small extension to `Optional` can improve this without sacrificing a lot of readability. diff --git a/posts/2017/index.ejs b/posts/2017/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2017/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2018/index.ejs b/posts/2018/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2018/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/2019/index.ejs b/posts/2019/index.ejs deleted file mode 100644 index 74a1f27..0000000 --- a/posts/2019/index.ejs +++ /dev/null @@ -1 +0,0 @@ -<%- partial('../_year') %> diff --git a/posts/_month.ejs b/posts/_month.ejs deleted file mode 100644 index 07cd52a..0000000 --- a/posts/_month.ejs +++ /dev/null @@ -1,52 +0,0 @@ -<% function pad(n) { -%> -<% return +n < 10 ? '0' + n : String(n) -%> -<% } -%> - -<% var _months = 'January February March April May June July August September October November December'.split(' ') -%> -<% var _shortMonths = _months.map(function(m) { return m.slice(0, 3) }) -%> -<% function formatDate(t) { -%> -<% var d = new Date(t) -%> -<% return d.getDate() + ' ' + _shortMonths[d.getMonth()] -%> -<% } -%> - -<% function sortPosts(dir) { -%> -<% var slugs = Object.keys(dir._data) -%> -<% var posts = slugs.map(function(slug) { -%> -<% var d = dir._data[slug]; -%> -<% d.slug = slug; -%> -<% return d; -%> -<% }) -%> -<% posts.sort(function(a, b) { -%> -<% var t1 = a.timestamp -%> -<% var t2 = b.timestamp -%> -<% return t1 < t2 ? 1 : (t1 > t2 ? -1 : 0) -%> -<% }) -%> -<% return posts -%> -<% } -%> - -<% var posts = sortPosts(public.posts[current.path[1]][current.path[2]]) -%> -<% for (var i in posts) { -%> -<% var post = posts[i] -%> -<% if (post.hidden) continue -%> - -
    -
    -<% if (post.link) { -%> -

    → <%= post.title %>

    - - -<% } else { -%> -

    <%= post.title %>

    - -<% } -%> - -
    - - <%- partial(current.path[1] + '/' + current.path[2] + '/' + post.slug) %> -
    - -
    -

    -
    - -<% } -%> diff --git a/posts/_year.ejs b/posts/_year.ejs deleted file mode 100644 index d45546e..0000000 --- a/posts/_year.ejs +++ /dev/null @@ -1,64 +0,0 @@ -<% function pad(n) { -%> -<% return +n < 10 ? '0' + n : String(n) -%> -<% } -%> - -<% var _months = 'January February March April May June July August September October November December'.split(' ') -%> -<% var _shortMonths = _months.map(function(m) { return m.slice(0, 3) }) -%> -<% function formatDate(t) { -%> -<% var d = new Date(t) -%> -<% return d.getDate() + ' ' + _shortMonths[d.getMonth()] -%> -<% } -%> - -<% function sortPosts(dir) { -%> -<% var slugs = Object.keys(dir._data) -%> -<% var posts = slugs.map(function(slug) { -%> -<% var d = dir._data[slug]; -%> -<% d.slug = slug; -%> -<% return d; -%> -<% }) -%> -<% posts.sort(function(a, b) { -%> -<% var t1 = a.timestamp -%> -<% var t2 = b.timestamp -%> -<% return t1 < t2 ? 1 : (t1 > t2 ? -1 : 0) -%> -<% }) -%> -<% return posts -%> -<% } -%> - -<% function posts(dir, year, month) { -%> -<% if (!dir) return -%> - -

    - <%= _months[month - 1] %> -

    - - -<% } -%> - -<% var year = current.path[1] %> - -
    -

    - <%= year %> -

    - -<% for (var month = 12; month >= 1; month--) { -%> -<% posts(public.posts[year][pad(month)], year, month) -%> -<% } -%> - -
    diff --git a/posts/index.html b/posts/index.html deleted file mode 100644 index 4f1c693..0000000 --- a/posts/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - samhuri.net - - - -

    samhuri.net

    - - diff --git a/public/css/style.less b/public/css/style.less index 63735e1..0569b3c 100644 --- a/public/css/style.less +++ b/public/css/style.less @@ -413,7 +413,7 @@ article { header { - h1 { + h1, h2 { word-wrap: break-word; margin-bottom: 0.3rem; } diff --git a/templates/partial-post-link.html b/templates/partial-post-link.html index 7661a61..ae279ae 100644 --- a/templates/partial-post-link.html +++ b/templates/partial-post-link.html @@ -1,6 +1,6 @@
    -

    → {{ post.title }}

    +

    → {{ post.title }}

    diff --git a/templates/partial-post-text.html b/templates/partial-post-text.html index 6e0fdaf..d0fbdad 100644 --- a/templates/partial-post-text.html +++ b/templates/partial-post-text.html @@ -1,6 +1,6 @@
    -

    {{ post.title }}

    +

    {{ post.title }}

    {{ post.body }} diff --git a/templates/posts-month.html b/templates/posts-month.html index 6de6e03..6a84d15 100644 --- a/templates/posts-month.html +++ b/templates/posts-month.html @@ -1,7 +1,11 @@ {% extends "samhuri.net.html" %} {% block body %} - {% for post in posts %} - {% include "partial-post.html" post %} - {% endfor %} +
    +

    {{ title }}

    +
    + +{% for post in posts %} + {% include "partial-post.html" post %} +{% endfor %} {% endblock %} diff --git a/templates/posts-year.html b/templates/posts-year.html index 86e3b94..c5bf75f 100644 --- a/templates/posts-year.html +++ b/templates/posts-year.html @@ -1,13 +1,14 @@ {% extends "samhuri.net.html" %} {% block body %} +
    -

    {{ year }}

    +

    {{ title }}

    {% for month in months %} -

    +

    {{ monthNames[month] }} -

    +
      {% for post in postsByMonth[month] %}