<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.8.4" -->
<rss version="0.92">
<channel>
	<title>dan.thoughts</title>
	<link>http://blog.sosedoff.com</link>
	<description>Web-development, PHP, Ruby, Sinatra, Merb, Rails, MySQL, SQLite, Web Services.</description>
	<lastBuildDate>Tue, 07 Sep 2010 01:52:23 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>Custom field aggregations in Sphinx using SphinxQL</title>
		<description>Sphinx is a really powerful tool for a full-text database search. It is the perfect option as a search engine on your website's data. 
In default mode it works as a regular tcp server and has multiple native language bindings for php, ruby, c, etc. But its another outstanding feature ...</description>
		<link>http://blog.sosedoff.com/2010/09/06/custom-field-aggregations-in-sphinx-using-sphinxql/</link>
			</item>
	<item>
		<title>Custom SQL queries in Rails</title>
		<description>Sometimes ORM just cant hand some complicated query, especially when the results of such query does not refer to any table. 

For Rails ActiveRecord:

class Item < ActiveRecord::Base
   def self.some_heavy_stuff(param)
     sql = self.sanitize_sql(['.... SQL ....', param)
     self.connection.execute(sql)
   end
end

# usage
data ...</description>
		<link>http://blog.sosedoff.com/2010/08/17/custom-sql-queries-in-rails/</link>
			</item>
	<item>
		<title>Disable auto-incremental field in Rails Migrations</title>
		<description>Since i`ve been using both DataMapper (Merb/Sinatra) and ActiveRecord (Rails) a lot i noticed that AR acts weight when i manually set PK key, particularly ID field, which you dont have to define by default. In DM you have to define it as 'Serial'. 

So, the task is to create/update ...</description>
		<link>http://blog.sosedoff.com/2010/08/12/disable-auto-incremental-field-in-rails-migrations/</link>
			</item>
	<item>
		<title>Debugging PHP applications in terminal</title>
		<description>Most of Ruby web frameworks have terminal logging in development environments. It makes application debugging process much easier than using file logging. Especially for AJAX requests. Of course there is simple solution - use Firebug and javascript console. Unfortunately it is not that convenient. 

So, one day i came up ...</description>
		<link>http://blog.sosedoff.com/2010/07/03/debugging-php-applications-in-terminal/</link>
			</item>
	<item>
		<title>Generate sitemaps with Ruby and XmlSitemap gem</title>
		<description>Made a simple gem for website sitemap generation. Could be used in any Ruby/Rails/Merb/Sinatra application. It does not have any caching in that case if you want to use framework built-in cache methods. 

Installation:


$ sudo gem install xml-sitemap


Example


pages = Page.all(:order => [:updated_at.desc] # DM model
map = XmlSitemap::Map.new('somedomain.com') do &#124;m&#124;
  ...</description>
		<link>http://blog.sosedoff.com/2010/06/18/generate-sitemaps-with-ruby-and-xmlsitemap-gem/</link>
			</item>
	<item>
		<title>Snippet: Cleanup your Git repository</title>
		<description>Snippet (found on net) for removing files from repository that are no longer present under your project.


$ git rm $(git ls-files -d)


For best use add it to bash alias file: ~/.bashrc or ~/.bash-aliases (under ubuntu):


alias gitclean='git rm $(git ls-files -d)'
 </description>
		<link>http://blog.sosedoff.com/2010/06/15/snippet-cleanup-your-git-repository/</link>
			</item>
	<item>
		<title>Using Amazon product images on your website</title>
		<description>Amazon has an awesome image service. You can use their product images on your site, adjusting them for you needs. All you have to know - one image url of your product. Having that string will provide you an access to its dynamic image scaling service which i had to ...</description>
		<link>http://blog.sosedoff.com/2010/06/15/using-amazon-product-images-on-your-website/</link>
			</item>
	<item>
		<title>Handy HTTP requests with Curb and Ruby</title>
		<description>While working on one of the projects, i tried to find multi-purpose HTTP request class that can use different network interfaces/ip addresses with retry option (if connection slow or server not responding for some reason). 

Here is a small class wrapper build on top of Ruby Curb implemented as a ...</description>
		<link>http://blog.sosedoff.com/2010/06/13/handy-http-requests-with-curb-and-ruby/</link>
			</item>
	<item>
		<title>Making HTTP requests from different network interfaces with Ruby and Curb</title>
		<description>At some point you will find that you have reached requests per IP limit while using some API or crawling resources. And if you`re doing it via standard Net::HTTP you`ll face the problem that you cannot assign request class to specified network interface (or IP). Bummer? No. Even if you ...</description>
		<link>http://blog.sosedoff.com/2010/06/09/making-http-requests-from-different-network-interfaces-with-ruby-and-curb/</link>
			</item>
	<item>
		<title>Setting processor affinity for a certain task or process in Linux</title>
		<description>When you are using SMP you might want to override the kernel's process scheduling and bind a certain process to a specific CPU(s).

What is this?

CPU affinity is nothing but a scheduler property that "bonds" a process to a given set of CPUs on the SMP system. The Linux scheduler will ...</description>
		<link>http://blog.sosedoff.com/2010/06/06/setting-processor-affinity-for-a-certain-task-or-process-in-linux/</link>
			</item>
</channel>
</rss>
