37signals, 40hz, 2008, 2010, 05401, 05403, 05446, 05462, 05482, 05673, 05701, aardman animations, ac propulsion, adium, ads, aim, airport, al franken, algorithm, amazon, andy hertzfeld, animation, apache, apple, applescript, architecture, archive, art, article id, asterisk, at&t, atom, automobile, away message, backpack, badge, barack obama, basecamp, bash, beos, bernie sanders, bicycling, bill atkinson, billboard, blacklisting, blog, blogroll, blogzot, bluetooth, blunt, bluray, book, bookmarklet, bot-net, brad bird, browser, btv, bug, build, bungie, bunny, burlington, call of duty, camera, camping, can-spam, cars, centralized, channel camp, chocolate, classic, classic mac workshop, clipcat, clothing, cms, collection, color classic, comedy, comedy central, comic, computer, concert, conversion, cookbook, corrosion, cowards way out, crack, crashing, creature comforts, criticism, daring fireball, darwin, dashboard, david byrne, dcl, death, delicious, derbi, design, development, digg, dilemma, discussion, disney, domain, download, drivers, dvd, dynetk, e-mail, e3, easter, ebox, eckhart, eckhart koppen, eckhart köppen, eddie izzard, edward gorey, einstein, eject, election, electric motorcycle, electric motorsport, electric vehicle, electronics research laboratory, elmo, emate, emulator, encryption, environment, environmental impact, erin mckeown, escale, exploit, express 530t, expressionengine, feature, feed, feedburner, filtering, finance, firmware, fixdavsvn, flickr, flynn center, focus, font, food, ford, for sale, free, freeverse, freezing, fresh air, frog design, front row, fusion, games, gears of war, geek, geek technique, geocities, git, github, gmail, google, gpr, grammar, grant hutchinson, graylisting, gtd, hack, haiku, halo, hayao miyazaki, health, higher ground, highrise, hiking, hiroshi noguchi, history, hope, hotspot, html, html5, hulu, humor, hybrid, hybrid technologies, hypercard, intel, internet, interview, ipad, iphone, ipod touch, isao takahata, itunes, jabber, japan, javascript, jetblue, jfk, john gruber, john oliver, jon stewart, kid koala, launchd, layover, leopard, liberal, long trail, lorem ipsum, mac, macbook pro, mac mini, macpaint, mac pro, macworld, maczot, magazine, mail, maine, makkintosshu, marathon, marketing, mark hoekstra, matthias melcher, media, mesagepad, messagepad, microbus, microsoft, mobileme, model s, modern warfare, money, monitoring, moon river, motorola, movie, movies, mrtg, multitasking, music, mwsf07, mystic, nascar, ncx, nda, netflix, network, newt/0, newton, newton os, newton press, newtonscript, newtontalk, newton x press, nick park, nitch, npr, on point, openpbx, open source, operation ivy, optimization, organic, os 6, os 8, os9, osheaga, osx, os x, owc, package, palm, password, patch, paul guyot, pbx, pdf, pesticides, photography, pico card, pilot, pixar, playstation, plist, plug-in, pod jungle, politics, productivity, ps3, psp, pump-and-dump, quickdraw, quicksilver, racism, rack-n-roll, radio, ratatouille, realpath, rebooting, recycling, regex, regular expressions, remake, required reading, restoration, retrochallenge, review, roadster, room without a window, rss, scion, screencast, script, search, security, server, sesame street, seven days, shame, shelburne, shelburne museum, shirt, shoppinging cart, signature, simon bell, small dog electronics, snow leopard, social, software, solution, sony, spam, spam haus, startup item, statistics, status, stefano paris, stephen colbert, steve jobs, steven colbert, steven frank, studio 360, studio ghibli, subethaedit, subversion, susan kare, swiss, swuser, sync, syndication, sysmon, tablet, tags, tax, technorati, ted talk, television, terry gross, tesla motors, textpatter, textpattern, the colbert report, the daily show, the flaming lips, the gashleycrumb tinies, the radiator, the world, times argus, titles, tkip, todd kollins, tom gage, tools-osx, trailer, trash, travel, tree, trends, troubleshooting, truetype, twitter, typography, tzero, unicel, universal access, unna, update, upgrade, url title, user interface, v710, venue, verizon wireless, vermont, victor rehorst, video, virtualization, vmware, volkswagen, volvo 122, vpr, vw, wait wait don't tell me, wall-e, wallace & gromit, wavelan, web, web 2.0, webkit, web site, whitepaper, wifi, wikipedia, windows, winter warm-up, wireless, wpa, writing, wwdc, wwnc, xbox 360, xbox live, xhtml, xserve, yahoo, ze frank, zero emission
Articles Tagged "development":
A realpath Implementation in Bash ¬
2012-02-19
I was recently informed of an issue with the in-development version of trash (one of the utilities in tools-osx) that required using an absolute path internally instead of a relative path. In most languages one can just run a path through realpath() to get the absolute path for a relative path, but bash (which trash was developed in) doesn’t have an equivalent. Many people suggest readlink, but it’s generally only included in Linux distributions, so BSD-based operating systems (incl. Mac OS X) are a bit out of luck.
Fortunately, it’s quite easy to emulate using pwd, but there is a bit of extra work that must be done. I found a good, portable example, but it still wasn’t quite up to my standards. I’ve simplified & improved it and the result is as follows (last updated 2012-11-29):
function realpath() { local success=true local path="$1"# make sure the string isn't empty as that implies something in further logic if [ -z "$path" ]; then success=false else # start with the file name (sans the trailing slash) path="${path%/}"# if we stripped off the trailing slash and were left with nothing, that means we're in the root directory if [ -z "$path" ]; then path="/" fi# get the basename of the file (ignoring '.' & '..', because they're really part of the path) local file_basename="${path##*/}" if [[ ( "$file_basename" = "." ) || ( "$file_basename" = ".." ) ]]; then file_basename="" fi# extracts the directory component of the full path, if it's empty then assume '.' (the current working directory) local directory="${path%$file_basename}" if [ -z "$directory" ]; then directory='.' fi# attempt to change to the directory if ! cd "$directory" &>/dev/null ; then success=false fiif $success; then # does the filename exist? if [[ ( -n "$file_basename" ) && ( ! -e "$file_basename" ) ]]; then success=false fi# get the absolute path of the current directory & change back to previous directory local abs_path="$(pwd -P)" cd "-" &>/dev/null# Append base filename to absolute path if [ "${abs_path}" = "/" ]; then abs_path="${abs_path}${file_basename}" else abs_path="${abs_path}/${file_basename}" fi# output the absolute path echo "$abs_path" fi fi$success }
Here’s a simple example of its usage:
relative_path="../Shared/"
absolute_path="$(realpath "$relative_path")"
if [ $? -eq 0 ]; then
echo "absolute_path = $absolute_path"
else
echo "'$relative_path' does not exist!"
fi
I have also tossed together a realpath tool which wraps around this implementation if you would like to install it for use in multiple scripts/tools. Feel free to download it from the development page or get the source code on GitHub. It’s released under a BSD license.
tntk Command Line Newton Compiler ¬
2010-11-24
Yesterday, Eckhart Köppen announced that he’s started piecing together a command line Newton compiler named tntk, based on NEWT/0 & DCL:
So far my experiments are actually quite successful, and it seems that developing Newton applications with just a text editor is not that impractical. […] Some things are still missing for developing larger apps, like the ability to split the code into multiple source files, and a way to embed resources into the final package, but for simple applications (and even auto parts), we might have a way forward.
This is nowhere as ambitious as Matthias Melcher’s DyneTK project, but maybe good enough to get people interested in a bit of Newton hacking.
It’s not really far enough along for a release yet, but you can peek at the Subversion repository if you’re so inclined.
I have a PowerMac 9500 configured for Newton development purposes, among others, but it’s inconvenient at best when I’m actually inspired to do any Newton development. As Eckhart alludes to, dealing with Mac NTK’s binary files w/resource forks in version control is a major pain.
[Via NewtonTalk]
WooRank ¬
2010-01-27
A brand spankin’ new website analysis tool aimed at improving SEO, but it’s already proven itself useful for fixing a few minor issues on a number of my sites. It certainly doesn’t cover everything, but it’s clean, concise, and covers a very good base.
Update: Whatever they’re using to render screenshots of sites can’t grasp HTML5.
[Via Zander Martineau]
SublimeVideo ¬
2010-01-26
A slick new, free HTML5 video player coming soon. Featuring:
- no browser plugin, no Flash dependencies
- jump anywhere in the video and it’ll start buffering from that point
It currently supports Safari 4.0.4+, Chrome 4.0+, and IE with Chrome Frame (I guess that counts) and also fixes the HTML5 video auto-buffer issue. Firefox support still pending.
[Via Jon Hicks]
Posting around here has been sporadic, at best, lately. With little to no time to author full articles this time of year, I figured I’d better improve the efficiency of my quick linking to tidbits I’ve found elsewhere online. I’ve got a ‘hyper’ section in Textpattern (my CMS of choice) for just such a task, akin to and inspired by the Daring Fireball Linked List, but it’s actually more cumbersome to post to. I usually include a quote and the title from the target site, it’s URL, switch it to the ‘hyper’ section, add some tags and a little commentary. A bookmarklet that could pull in much of that data for me to just tweak and comment could drastically reduce the amount of tab switching and cutting & pasting required.
Fortunately, just such a bookmarklet exists. It pulls your selection into a new post body, sets the post title to the page title, and allows you to customize what section & category it gets posted in:
javascript:
var d=document,
w=window,
e=w.getSelection,
k=d.getSelection,
x=d.selection,
s=(e?e():(k)?k():(x?x.createRange().text:0)),
f='http://PathToYourTXPFolder/index.php',
l=d.location,
e=encodeURIComponent,
p='?bm=1&Section=SectionName&from_view=1&Category1=CategoryName&Title='+e(d.title)+'&Body='+e(s),
u=f+p;
a=function(){
if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=800,height=800'))
l.href=u;
}
;
if(/Firefox/.test(navigator.userAgent))
setTimeout(a,0);
else
a();
void(0)
However, I require the target URL in a custom field in order to automatically build the link to the target site. It was designed to do that, but no example was given. You merely need to insert the following (replacing ‘custom_1’ with the number of the appropriate custom field) after Category1 and before Title1:
custom_1='+e(l.href)+'&
But there’s one more thing I found necessary to tweak: the size of the pop-up window. It was a bit too narrow for my install, so I increased the width to ‘960’, but more importantly, I made it scrollable by adding scrollable=1 to the call to w.open().
So, with the my aforementioned modifications, you get something like this (still requiring replacement of PathToYourTXPFolder, SectionName, CategoryName, and custom_1 with your particulars, of course):
javascript:
var d=document,
w=window,
e=w.getSelection,
k=d.getSelection,
x=d.selection,
s=(e?e():(k)?k():(x?x.createRange().text:0)),
f='http://PathToYourTXPFolder/index.php',
l=d.location,
e=encodeURIComponent,
p='?bm=1&Section=SectionName&from_view=1&Category1=CategoryName&custom_1='+e(l.href)+'&Title='+e(d.title)+'&Body='+e(s),
u=f+p;
a=function(){
if(!w.open(u,'t','toolbar=0,resizable=0,scrollable=1,status=1,width=960,height=800'))
l.href=u;
}
;
if(/Firefox/.test(navigator.userAgent))
setTimeout(a,0);
else
a();
void(0)
What now? Run it through something like Bookmarklet Builder to name it and further minify it, then merely drag it to your bookmarks bar. I ended up whipping up two: one for use on this site and one for use on Slotted Pig.
1 You can obviously move it around elsewhere in the query if you’re careful with the quoting.
Optimizing HTML ¬
2009-12-29
Juriy Zaytsev’s overview of what can safely be cleaned up in HTML these days to save a few kilobytes per page load and simplify your markup at the same time.
24 ways 2008 ¬
2008-12-03
[T]he advent calendar for web geeks.
An indispensable resource. The 2008 edition has been live for a few days now.
My mta_article_id Textpattern Plug-in ¬
2006-12-12
I wrote a quick Textpattern plug-in today to spit back a “URL title” for an article ID instead of the numerical “ID” that <txp:article_id /> does and called it mta_article_id. Basically it’s intended to be a replacement of article_id.
I needed it to be able to implement human-readable anchors for articles in sections (for example the autobiograpy and colophon parts of this site’s about section) that aren’t sections that one would really “browse” (so no permalinks), but are mainly fake static pages. In fact, I had intended to have this functionality before I posted my holiday wish list, but I couldn’t find a way to extract just the “URL title” that appears at the end of a Textpattern “Clean URL” permalink (atleast not without writing some custom PHP code).
I asked around on the Textpattern support forum and one kind soul pointed me to this post by one of the moderators describing exactly what I needed.
So, I downloaded the Textpattern plug-in template (see Anatomy of a Textpattern Plug-in for more details on Textpattern plug-in development), and merged the moderator’s code (basically a one-liner) with that of the implementation of the built-in article_id in taghandlers.php (another one-liner), and—Voilà!—my first Textpattern plug-in.
Of course, I discovered that there’s now an <article_url_title /> tag as of Textpattern 4.0.5, but I’m still running 4.0.3. So, my plug-in was depricated before it was released, but the mention of article_url_title only appeared on December 1st, right in the middle of when I was first working on getting “URL titles”, so I guess it’s excusable.
Regardless, you can download mta_article_id from the development section if you like.
Update: It turns out I had overestimated which version Textpattern is currently at. It’s currently only at version 4.0.4, so although version 4.0.5 will include the article_url_title tag my plug-in is still needed in the meantime.
