Sancta Simplicitas: minimalistic WordPress theme using YUI CSS

Sancta Simplicitas is a WordPress theme that uses YUI CSS utilities: reset, base, fonts, grids. It’s very minimalistic in a sense that it’s pretty much all white and simple. Hence the name. The theme is probably not usable by itself, but it’s a base on top of which you can create your own themes. When […]

April 25th, 2008
Tags: WordPress, yui

strftime() in JavaScript

Philip “Bluesmoon” Tellis has posted a tiny (under 3K minified) JavaScript library to format dates, inspired by PHP’s strftime() Examples: d.strftime(‘%Y/%m/%d’) » en: 2008/04/25 » fr: 2008/04/25 » de: 2008/04/25 d.strftime(‘%A, %d %B’) » en: Friday, 25 April » fr: Vendredi, 25 Avril » de: Freitag, 25 April There’s also a demo to fiddle with. […]

April 25th, 2008
Tags: JavaScript, php

A collection of writing tips

A collection of writing tips here, includes advise from Stephen King, Paul Graham, Scott Adams and others. In the end, if you want to write well I believe it all boils down to: write – daily edit – cut out needless words read – everything you can lay your hands on It’s so simple and […]

April 19th, 2008
Tags: writing

Rules for fast web pages

… just updated. http://developer.yahoo.com/performance/rules.html The list (used to be 13 items, then 14, now 34) is becoming too overwhelming so it’s now split into categories: content server cookie css javascript images mobile Act now to improve you page loading speed, your user will thank you later 😉

April 14th, 2008
Tags: performance, yahoo

When client-only validation is good for business

You should never never ever rely on client-side validation only. Client-side validation is for enhancing user experience, server-side is the validation. This is a rule, never to be broken. But here’s a funny story how skipping the server-side validation actually helped. This is a real story, but the actual names have been replaced in XXX, […]

April 13th, 2008
Tags: (x)HTML(5), JavaScript

Santa Monica apartment hunting

Time goes by. Feels like yesterday, but it’s actually been a whole year since I moved to LA together with the family. Guess the wonderful present we received a month ago from our landlord – $500 rent increase. W00t! Needless to say, we’ve been apartment hunting ever since. The Yahoo! office is at a great […]

April 12th, 2008
Tags: California, News/personal

Background repeat and CSS sprites

CSS sprites are a great way to improve the loading speed of your pages. One of the problems you might face with sprites is how to deal with cases when the background repeats. The rule is pretty simple: if you want the background to repeat vertically (top to bottom), place the images in the sprite […]

April 3rd, 2008
Tags: CSS, performance

you’ve been blogging too much when you…

… even as a joke consider putting your domain name on your license “vanity plate”

March 30th, 2008
Tags: Fun, News/personal

Crowes and Crows

Currently enjoying two new albums by two older bands: The Black Crowes – Warpaint Counting Crows – Saturday Nights & Sunday Mornings Cool stuff, especially the first one. Can’t help but be a little worried about the fact that I seem to have stopped my musical development somewhere in the nineties, and just keep listening […]

March 28th, 2008
Tags: Music

The PHP QC presentation featured on slideshare’s homepage

Not bad. Especially having in mind that this is the second time around. I uploaded an updated version of the presentation, that didn’t work too well, so I had to delete the old one and reupload. As a result the stats and faves of the previous version were lost 🙁 Some sites, like Ajaxian, are […]

March 28th, 2008
Tags: News/personal

JSPatterns.com up again

After getting 300 megs of wiki content spam, I deleted the old wiki over at http://www.jspatterns.com. Now restarted the project as a blog with static pages for the javascript patterns and blog posts for anything interesting in the ever so exciting world of JavaScript. So far nothing special there (example), but keep an eye on […]

March 26th, 2008
Tags: JavaScript, Spam, WordPress

JoJo: Javascript Junk generator

Ever needed to be able to generate random, but valid JavaScript code? Well, today is your lucky day: meet J.J. or JoJo, the Javascript Junk code generator. All you need to specify is how many kilobytes of code you need. Available also as a web service. » tools.w3clubs.com/jojo If anyone can think of any application […]

March 25th, 2008
Tags: JavaScript, performance

sleep() in JavaScript

PHP has a sleep() function, but JavaScript doesn’t. Well, this is because it’s useless, you might say, and you’ll be right. But for simulating heavy processing and for misc performance measurements, it could be useful. So here’s how you can go about creating a sleep() in JavaScript. The code function sleep(milliseconds) { var start = […]

March 24th, 2008
Tags: JavaScript, performance

20 new performance best practices

The slides from my PHP Quebec presentation in Montreal are up on slideshare. Roughly the content is divided into: a quick review/update to Yahoo’s existing 14 best practices for improving performance, and a discussion of the 20 new ones Enjoy responsibly and don’t hesitate to send back questions and comments. And how about this slide […]

March 18th, 2008
Tags: performance, yahoo, yslow

PHP-style $GLOBALS in Javascript?

Javascript has implied globals. When you skip the var in var a = 1; and go a = 1;, then a becomes a global variable. Some consider this an error in the language. Global variables should be avoided because they tend to overwrite each other in unexpected places, especially if the project grows in LOC […]

March 8th, 2008
Tags: JavaScript

Canvas pie with tooltips

This is very flattering: Greg Houston took my script for DIY canvas pie and added tooltips and better colors logic. Here’s the result, it’s really nice, built with some MooTools. The tooltips are not supported in <canvas> but Creg used an image that overlays the pie and set the tooltips with an image map. Clever, […]

March 8th, 2008
Tags: canvas, images, JavaScript

replace selected text (Firefox)

A quick function to replace the selected text (in Firefox). Accepts: string to replace the selection, or callback function that takes the selected text and returns a string to replace the selection function replaceSelection(t) { if (typeof t === ‘function’) { t = t(window.getSelection().toString()); } var range = window.getSelection().getRangeAt(0); range.deleteContents(); range.insertNode(document.createTextNode(t)); } Usage: 1. Replace […]

March 6th, 2008
Tags: JavaScript, writing

Simultaneuos HTTP requests in PHP with cURL

The basic idea of a Web 2.0-style “mashup” is that you consume data from several services, often from different providers and combine them in interesting ways. This means you often need to do more than one HTTP request to a service or services. In PHP if you use something like file_get_contents() this means all the […]

February 19th, 2008
Tags: mashup, performance, php, yahoo, ydn

There will be junk

Tip #1 for writing better code – edit. With this book I write, I find I’m spending more time editing than writing. The first draft is usually bad. The first draft “works” in the sense that it covers the material, but not necessarily in the best possible way. Same thing with writing code, it’s one […]

February 18th, 2008
Tags: misc hackery, writing

Sharpenning those flamenco skillz

What’s new today? Let me see. [x] Wrote the first sentence of chapter 6 of the new book. Goes like this “After encapsulation, inheritance is probably the most important feature of the object-oriented programming”. Promising, but not exactly progress. Good news is I already wrote all the code for the chapter. [x] My teammate Nicole […]

February 6th, 2008
Tags: Music, News/personal

Canvas pie

UPDATE: Translation in Brazilian Portuguese here, thanks Maujor! OK, so you have an HTML table. Let’s turn it into a pie chart with a bit of javascript. We’ll be using the canvas tag, so the browser has to support it. For IE – well, you still have the table. That’s why we’ll call it progressive […]

February 5th, 2008
Tags: canvas, JavaScript

Audacity + Starcaster

(if you see this in a RSS reader, come to the page to hear the music) (Now that I got this Starcaster and also completed the first 5 chapters of the new book) Yesterday, I was wondering how I can record some music, so I searched for open-source sound recorder and came across this beautiful […]

January 30th, 2008
Tags: Music

Google docs bookmaklet to format code

Something has been annoying me for some time as I write this book in Google Docs: I want to be able to format text as code (Courier New) only using the keyboard. So I came up with this bookmarklet. It’s one of those “works for me” so if it doesn’t work for you feel free […]

January 27th, 2008
Tags: bookmarklets, writing

Zlatina = 4

So close to being finished with 5 chapters and 1 appendix of the new book (hey, that’s 50%+) and just after the n-th edit of chapter 3, I thought I might share this picture I have on my desk. It’s an self-portrait of my 4yrs old daughter Zlatina, in front of a window. Once this […]

January 26th, 2008
Tags: News/personal, writing

MP3 player from Yahoo! – bookmarklet

Update Jan 30, 2008: updated code based on comments and code from Carl Update Dec 11, 2008: updated the code thanks to the comment from Nolan Here’s the scenario: you have a page that links to some .mp3 files. You add a line of code in your page and lo and behold, there’s a nice […]

January 23rd, 2008
Tags: bookmarklets, JavaScript, Music, yahoo