Send Eco-elegant flowers

Archive for February, 2008

Retrieving and Embedding Web Site Thumbnails

The Picoshot service allows you to embed a thumbnail image of another website in your page with a simple <img> tag. And, I was also able to use curl on the command line to create a file.

A little HTML is all you need to know. There are currently 2 ways to retrieve a thumbnail:

  • <img src="http://image.picoshot.com/thumbnail.php?url=http://www.example.com">
  • <img src="http://image.picoshot.com/thumbnail.php?domain=example.com">

Just replace example.com with the domain you wish to get the thumbshot for. It’s that simple to get a thumbnail for free. Currently only domain and sub domain front pages are available, with internal pages a coming feature.

For the command line, you must have curl installed, and then use something like this:

curl -o sw-thumb.jpg http://image.picoshot.com/thumbnail.php?domain=sustainablewebsites.com

Notice the -o switch is lowercase, you might be used to using the -O uppercase version to automatically name the file. Sometimes it takes a couple of tries with curl if the thumbnail has not been generated already for the site. If you figure out how to do this in JavaScript, Ruby, or PHP please let us know in the comments!

Digital Web Magazine - How to Build a Green Business

Latest Bookmarks on Ma.gnolia.com

Digital Web Magazine - How to Build a Green Business

Digital Web Magazine	 - How to Build a Green Business

In an age of inconvenient truths, global warming, and “green is good” messages in the mass media, Sustainability has become a popular catchphrase and the new marketing must-have for many companies. But what does it truly mean? And how can it apply to your business?

Contributing to the community in which you work can have far-reaching business effects, from positive brand recognition, to free networking and marketing, to a broader, better talent pool. Plus, it just makes for a better place to work and live.
In this article, I’ll discuss how our web design and development company incorporated sustainability into our business model, and how other development companies can do the same

Rating: ★ ★ ★ ★ ★

Tags: ,

View all my bookmarks on Ma.gnolia

The Top 50 eco blogs

The Times UK reports on its top 50 eco blogs. It is a must-read (and bookmark) for an aspiring green social marketers. It would be nice to know what criteria (PageRank, Unique visitors, Editorial quality) they used. Congrats to all that made the list, and boos to the climate change skeptics!

Latest Bookmarks on Ma.gnolia.com

Latest Bookmarks on Ma.gnolia.com

PDF Downloads for Coaching Skills Tools | Manager’s Coaching Toolkit - a book & a blog to make business coaching really simple

PDF Downloads for Coaching Skills Tools | Manager's Coaching Toolkit - a book & a blog to make business coaching really simple

Eownload PDF template sheets for all the Manager’s Coaching Toolkit tools. You might not have to read the book if you have a background in coaching or organizational development

Rating: ★ ★ ★ ★ ★

Tags: ,

Howcast - wordpress

Howcast - wordpress

great wordpress screencasts

Rating: ★ ★ ★ ★ ★

Tags: ,

AJAX with acts_as_commentable

AJAX with acts_as_commentable

How to combine the acts_as_commentable plugin with AJAX commenting

Rating: ★ ★ ★ ★ ★

Tags: , ,

View all my bookmarks on Ma.gnolia

Easy Ways to Create a Professional Photography Website

There are so many options available to photographers to create a professional looking portfolio site. Here are just a few I’ve run across in the past couple of months.

SmugMug.com offers template based sites and includes a way to sell your photos, printing, and custom watermarks.

Satellite powered by a flickr professional account. You also need a web hosting account that supports the php programming language to install Satellite on. You don’t have to know any php - but knowing some basic HTML helps. Despite all these steps, this is my current favorite because it’s customizable, can be hosted on many website accounts, and gives you a real web hosting account to play with, which gives you additional benefits of having you@yourdomainname.com email, and the ability to install a WordPress blog like the one you are reading now. To see an example of a Satellite powered site I recently created for a friend, check out Colleen Todd’s. portfolio.

Worried about copying of your images? Consider using steganography (like DigiMarc in Adobe Photoshop) to digitally watermark your photos, although it has been said it reduces quality. An alternative is to put a “bug” in a corner of the image with your name. This can be done in batch mode with a program like iWatermark. Personally, I prefer the bug method, for reasons Ken Rockwell explains.

Want to include a slideshow widget on your site? Check out the Google AJAX Feed Slideshow widget.

Do it yourself portfolios: (free) http://start.uber.com/design can be used for photography or any artwork.

If you have a mac, you may already have the the Apple iLife suite, including iPhoto and iWeb and a dotMac account which can help you make a decent looking portfolio site.

If any of the above methods doesn’t give you a professional web address (URL) of your own, like www.mynamephotos.com - you can use domain masking at a registrar (like SustainableDomains.com) to point to the computer generated URL.

Know of any others, or had experience with the above that you can share? Please let us know in the comments below!

Rake Tasks for dumping mysql

I have definitely used sqlite database files but I also like sticking to mysql, because I know that’s what I’ll use on the the server. I’ve created some rake tasks to help me in this process. As usual, they go in lib/tasks.

here’s my db.rake file:


# with thanks to sake
# http://errtheblog.com/posts/60-sake-bomb
namespace :db do

  # command line usage: rake db:version
  desc "Returns the current schema version"
  task :version => :environment do
    puts "Current version: " +
      ActiveRecord::Migrator.current_version.to_s
  end

  #rake db:dump
  desc "dumps the devel database to a sql file"
  task :dump => :environment do
    puts "Creating .sql dump file. Enter mysql root password. Just press Enter for none"
    #run a shell command mysqldump -u user -p database name to file name
    `mysqldump -uroot -p app_development > app_development_dump.sql`
  end

  #command line usage: rake db:dumpimport
  desc "imports the devel databse dump file to www2_sw"
  task :dumpimport => :environment do
    puts "Loading www2_sw_development_dump.sql. Enter mysql root password. Just press Enter for none"
    `mysql -uroot -p app_development < app_development_dump.sql`
  end

end

Note you might want to use another mysql user to access your database. For example, -u yourusername. I like doing this so I can check in the dump file into subversion or whatever version control system you’re using. If you find this incredibly useful, you may want to sake bomb it, which would make it available to all your projects. Bonus points for commenting on how to do this below (please?) It would also be cool to automatically grab the production database name.

Latest Bookmarks on Ma.gnolia.com

Latest Bookmarks on Ma.gnolia.com

Code Intensity: Auto-Complete Text Fields in Rails 2

Code Intensity: Auto-Complete Text Fields in Rails 2

In Rails 2, the PrototypeHelper and ScriptaculousHelper code was removed to plugins. This means that doing auto-complete for various fields was no longer part of the base Rails. I didn’t find any great, straight-forward docs on how to do this for Rails 2.x, so am sharing what I’ve done to hopefully help others

Rating: ★ ★ ★ ★ ★

Tags: , ,

Suckerfish WordPress Plugin | Ryan Hellyer

Suckerfish WordPress Plugin | Ryan Hellyer

Rating: ★ ★ ★ ★ ★

Tags: , , ,

assert{ 2.0 } - O’Reilly Ruby

assert{ 2.0 } - O'Reilly Ruby

Phlip likea developer tests, but he doesn’t like the primitive assertions - assert_equal, assert_match, assert_not_nil, etc. They only exist for one reason - to print out their input values when they fail. And they don’t even reflect their variable names.

So Phlip wrote an assertion to replace all of them. Put whatever you want into it; it prints out your expression, and all its values.

Rating: ★ ★ ★ ★ ★

Tags: , ,

View all my bookmarks on Ma.gnolia

Australia Releases Green Marketing Guidelines

Bookmarked on Ma.gnolia.com

Australia Releases Green Marketing Guidelines

Australia Releases Green Marketing Guidelines

The Australian Competition and Consumer Commission has released green guidelines for marketers, The Age reports. guidelines to combat businesses wrongly claiming their products or operations are “environmentally friendly”, or “green”.

Fines for those found guilty of misleading conduct can be as high as $1.1 million for companies and up to $220,000 for individuals.

Rating: ★ ★ ★ ★ ★

Tags: , ,

View all my bookmarks on Ma.gnolia

How to remove subversion (SVN) info from a project

Sometimes when I’m coding I need to remove all the subversion (SVN - a source code version control program, which if you’re a non-programmer, you could also use for any documents you want to version control) information from the project. Perhaps you’ve copied the code to another directory and want to start a new source repository, or have some other reason. I wrote a short ruby script to help called ’stripsvn’ Here it is:

#!/usr/bin/env ruby
# note above line may need to be changed on linux - use 'which ruby' to find path to ruby
# by Ivan Storck 13 February 2008
puts "The current directory is #{ENV["PWD"]}"
puts "About to delete ALL subversion info from this directory and all directories below"
print "WARNING - this is permanent! Type YES to continue:"
confirm = gets
if confirm == "YES\n" or confirm == nil
  puts `find . -name .svn -type d -print0 | xargs -0 rm -rf`
  puts "Deleted all subversion info"
else
  puts "Command aborted"
end

I put this in a file called stripsvn in a folder called bash_scripts (I know, it’s not written in bash, it’s in ruby) - that was in my path from the command line so I could just type stripsvn at the terminal and run the command. You could put it anywhere, but it’s useful to have a folder that you put scripts you’ve wrote in, and have it included in your path. You might also have to chmod 755 stripsvn to make it executable. This short script is a good example of using mostly ruby to write a useful shell script and only use bash or what I’d call “unix” commands when you have to. It’s all ruby except for the line with the find that actually does the deleting.

Green Prophet

Green Prophet is a site Sustainable Websites is now hosting that takes a look at environmental issues in Israel - but it’s a great read for anyone because the articles transcend regional issues and offer insights into what positive steps people are taking to green this planet. Check out recent articles on Kenaf, greening your living room, and e-waste.