Category Archives: Code
Project Euler and Math
I’ve always had the sense that there was a lot of math out there that I didn’t know. There is a great deal of graphics math and crypto math and others that I’ve never felt I had much reason to explore – but I recently realized that there’s value in looking into some of this [...]
Add To Yojimbo with AppleScript
I’ve started using Yojimbo more as an Anything Bucket and I wanted an easy way to get stuff into it. I found several AppleScripts and they were all good, but they were for individual applications. I try to minimize how much I have to think about routine stuff – I’d much rather have code that [...]
View in Readability AppleScript
I’ve been using Readability for a while now and it’s an amazingly cool tool. I highly recommend it for anyone who reads anything online.
In the interest of making things easier and more streamlined I’ve written an AppleScript that can load pages in Readability from various sources. The script is smart and “does the right thing” [...]
Get Current Application with AppleScript
My recent applescript development required different action based on what application was currently active. Surprisingly, there is no good result for this from google. I pulled this out of a Daring Fireball code example (Writing AppleScripts That Dynamically Target Either Safari or WebKit) and am showcasing it so that others who are looking for the [...]
Marking Duplicate Web Archive Items in Yojimbo
I saw Archive Flagged Items from NetNewsWire into Yojimbo (via) and found it a really neat tool. I’ve started using it to keep a more permanent record of interesting new articles.
I have lots of news articles flagged and I’ve had the import crash on me before for various reasons which has resulted in some duplicate [...]
Testing Syntax Highlighting
I’d like to start posting code on my blog so I’m testing out a syntax highlighter plugin. This post will likely go through several iterations as I see what it can do and how to do it.
Here’s some ruby:
[ruby]
def addPages(urls)
return false unless urls
urls.each{ |u| @queue 2; i–)
if (i % 3 == [...]
My First Rails Plugin – JavaScriptFunction
I’m working on a Rails app using RJS and Prototype Window Class. I needed to be able to return an anonymous JavaScript function in my RJS template but when passing it in a string to
page.call
it kept getting quoted and didn’t work right (as you would expect).
I solved it by creating a JavaScriptFunction class and helpers [...]
Creative Writing vs Coding
So, as you probably noticed, my creative writing on the site has fallen off quite a bit lately. It seems that I can focus on creative writing or I can focus on coding, but I’m not so good at doing both at the same time.
I’m going to be focusing on coding for the foreseeable future [...]
Rails – Edit In Place with Local Autocomplete
I purchased a copy of Chad Fowler’s excellent Rails Recipes recently. He’s got a few recipes dealing with edit in place and one about building local autocomplete. I pulled these recipes together into a single solution that gives me an edit in place with local autocomplete functionality.
Rails Helper
I created a couple Rails helper functions to [...]
“We found no matches for phil's phalse bottom. Below are results for pool.”
So, I was on Amazon yesterday, looking for a false bottom for making a lauter tun. I was awfully surprised to see that result. I’m guessing that it’s a perfect example of what can happen when suggestion code goes wrong, probably due to the combination of specific and uncommon search terms.
Even more interesting is the [...]