Comments
20 March, 2010

Safari CSS attribute selector bug

Thought I’d share a css bug I just had to work around. Basically, I’m finding that when I update an attribute that is targeted with some styles, Safari doesn’t ‘detect’ a style change and therefor doesn’t re-paint with the new visual appearance. 

One hack/workaround is to force Safari to re-interpret styles by setting a meaningless style or class. Some code to illustrate:

 
$(this).attr('data-star', star);
$('body').toggleClass('hack'); // THE HACK

And the css:


.task[data-star=false] .star { 
  background-position: 0 0; 
}

.task[data-star=true] .star { 
  background-position: 0 -19px; 
}
Comments
23 September, 2009

I’m constantly amazed at the cool new things street artists are doing these days.

Comments
13 August, 2009

Easy deployment of rails apps.

Recently, A friend of mine who is looking at learning rails asked me about deployment strategies. He was concerned that “rails deployment arrangement seems messy… eg, the need to employ several different technologies (apache, mongrel etc) to get the app running”.

I thought a bit about it and in fact rails seems quite the opposite. I think the deployment strategy scales really well with your development workflow. Let me explain:

1. ‘rails someapp’ . Your app is ready. Write some code.
2. ‘ruby start/server’ . Your app is running. Keep writing code.

At some point:

3. Setup mysql and change ‘config/databases.yml’. You’re now using mysql instead of sqlite

At some later point, when your app is ready for production:

4. Setup capistrano for easy deployment.
5. Setup apache + passenger on your production environment.

Finally, after some use:

6. Profit.
7. Think other deployment strategies targetting scalability.

See how good that is? Each step is relatively easy, but you can move forward as you grow and stop at any step after 2 if that’s all you want to do with that app. You don’t have to do it all at once, that’s the beauty and power of rails. It’s something that was sort of missing from web development before rails came along.

One of the things I like best about rails is convention over configuration. Increasingly these days I want to get on with writing code, not configuring the development and deployment environments. Rails really helps with that.

I like where things are heading in terms of cloud platforms like Amazon’s EC2 or Google’s AppEngine. Not having to worry about a data center and physical (or virtual) servers to setup and maintain means I can get on with doing what I like best - writing code.

Comments
25 June, 2009
Volcanic eruption over Matua Island captured by the ISS.

Volcanic eruption over Matua Island captured by the ISS.

Comments
25 June, 2009
Fernand Legros. Forged art dealer. http://en.wikipedia.org/wiki/Fernand_Legros

Fernand Legros. Forged art dealer. http://en.wikipedia.org/wiki/Fernand_Legros

Comments
24 June, 2009

Bums are the ideal clients of modern architecture: in perpetual need of shelter and hygiene, real lovers of sun and the great outdoors, indifferent to architectural doctrine and formal layout.

— Rem Koolhaas (Delirious New York)

Comments
20 June, 2009
Saw the Frank Lloyd Wright exhibition at the Guggenheim. Amazing. Wish more of his designs were actually built.

Saw the Frank Lloyd Wright exhibition at the Guggenheim. Amazing. Wish more of his designs were actually built.

Comments
3 June, 2009

trying out js syntax highlighters

I’m a syntax highlighting fiend. Colors really help me understand code when skimming over it quickly. I’ve found a few javascript syntax highlighting tools so i’ll post some fibonacci code to experiment on.

The one i’ve decided to use is here.


# this is some verbose code, just to see
class FibonacciGenerator      
  def printFibo(size)  
    x1,x2 = 0, 1  
    0.upto(size){ puts x1; x1+=x2; x1,x2=x2,x1 }
  end  
end

f = FibonacciGenerator.new  
f.printFibo(10)


Comments
6 May, 2009

what is this tumblr thing?

I’ve noticed quite a few of the cool kids are using tumblr for their blogs. It seems for better or for worse, the time has come for me to create a blog.

I like tumblr’s design, that’s all I know about it at this point but hopefully soon i’ll know more…

  • lists
  • are
  • cool

can i add some code?


1982.upto(2009) { |x| puts 'I turned x' } 
Comments