There are many tools to take/capture screenshots from command line in Windows.
If you are looking for command line tools in Linux – read this post.
There are many tools to take/capture screenshots from command line in Windows.
If you are looking for command line tools in Linux – read this post.
There are several ways to take screenshots in Linux. Most of them produce a WebKit, Gecko (Firefox) or khtml rendered screenshot image. Some of the methods require X session to open a window and take screenshots.
Read how to take screenshots from command line in Windows in this my post.
Sometimes you need to run a custom SQL query and return results that do not correspond to your model or make SQL queries to UPDATE or DELETE directly on a database.
Some scenarious:
– make a specific SELECT query and return a list of rows which are dictionaries (not objects of a model)
– make UPDATE or DELETE queries
The code below defines a recursively callable function in the Smarty template itself and calling it. For example, it renders hierarchical menu when the level of the tree is not known and can be deep.
There are a number of algorithms to crop and resize images. Like maintaining the original image’s aspect ratio, cropping over-sized images, padding to fill empty area.
This post shows two approaches – with cropping and without cropping. Continue reading
This post is to assist to create a select tag in a view (HTML) with a list of countries.
The solution presented here:
– The countries are stored in a table in database. If you don’t want to have a table with countries in DB, you can easily modify the code below to have countries as an array in code.
– Helper to show a list of countries in select tag in HTML
You can find the whole solution on github.
File uploading is one of the common tasks in web development.
One of the best scripts for file uploading is valums/file-upoader.
Redis is one of the fastest and most feature-rich in-memory key value data stores.
Ruby and Rails have many magic features like blocks/closures, duck typing/mix-ins/modules, method_missing, poetry mode.
One of the common tasks in programming web applications on Rails is finding a row in a table by several columns and creating a new row in case of row is missing.