<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Snipplr - berkes</title>
<link>http://snipplr.com/users/berkes</link>
<description>Recent snippets posted on Snipplr.com</description>
<language>en-us</language>
<pubDate>Mon, 13 Feb 2012 20:23:12 GMT</pubDate>
<item>
<title>(Other) Harry Potter characters fixture</title>
<link>http://snipplr.com/view/37093/harry-potter-characters-fixture/</link>
<description><![CDATA[ <p>Just a funny, yet usefull fixture for testing users in a rails app.
Using "somewhat real" fixtures, will keep testing both fun and realistic. 
Knowing that "Crabbe_ugly_nick" failed, is a lot easier to communicate then knowing "user_t_x01 failed"</p> ]]></description>
<pubDate>Sun, 11 Jul 2010 01:17:04 GMT</pubDate>
<guid>http://snipplr.com/view/37093/harry-potter-characters-fixture/</guid>
</item>
<item>
<title>(PHP) If a 'bin' exists in the user home, then add that to the PATH.</title>
<link>http://snipplr.com/view/29590/if-a-bin-exists-in-the-user-home-then-add-that-to-the-path/</link>
<description><![CDATA[ <p>Put this line in your .bashrc. 
If the user has a directory named 'bin' then that will be added to the PATH.
All scripts in that path (wich are executable) will be available as commands to that user.</p> ]]></description>
<pubDate>Thu, 11 Mar 2010 03:16:36 GMT</pubDate>
<guid>http://snipplr.com/view/29590/if-a-bin-exists-in-the-user-home-then-add-that-to-the-path/</guid>
</item>
<item>
<title>(PHP) Routine to update and set variables in Drupal using hook_update</title>
<link>http://snipplr.com/view/29499/routine-to-update-and-set-variables-in-drupal-using-hookupdate/</link>
<description><![CDATA[ <p>Drupal allows hook_update_N to run any sort of code. Most of the time, however, people only use this to alter the database scheme. 
But you can use it for much more. Like setting variables, creating nodes, importing views and so on. 
This code shows how to set a series of variables in Drupal.

When you deploy this code, running update.php will set all the variables as in the listing.

I typically catch this in a module called 'projectname_meta'. So this function would go in projectname_meta.install, and will be called from projectname_meta_install and projectname_meta_update_5002, for example.</p> ]]></description>
<pubDate>Tue, 09 Mar 2010 09:00:47 GMT</pubDate>
<guid>http://snipplr.com/view/29499/routine-to-update-and-set-variables-in-drupal-using-hookupdate/</guid>
</item>
<item>
<title>(PHP) Howto run your own functions on any forms submission.</title>
<link>http://snipplr.com/view/28546/howto-run-your-own-functions-on-any-forms-submission/</link>
<description><![CDATA[ <p>By using hook_form_alter, you can add your own callback functions to any Drupal form. 
These functions will be called when Drupal validates the form and when Drupal submits it.

In example below, a module called 'simple_checkout' adds its own handlers to a form called 'ideal_payment_api_issuer_form'. That latter is generated by another module, but we can fill our own tables and run our own validation *in addition to those by the originating module*.</p> ]]></description>
<pubDate>Thu, 18 Feb 2010 09:19:37 GMT</pubDate>
<guid>http://snipplr.com/view/28546/howto-run-your-own-functions-on-any-forms-submission/</guid>
</item>
<item>
<title>(Bash) Commandline oneliner to get your public IP adress</title>
<link>http://snipplr.com/view/27675/commandline-oneliner-to-get-your-public-ip-adress/</link>
<description><![CDATA[ <p>Use wget and sed to get your public IP adress (instead of firing up firefox and visting whatismyip.com). Usefull in scripts where you need your public IP adres.

There are probably better ways, maybe even a GNUtool that I missed?</p> ]]></description>
<pubDate>Thu, 04 Feb 2010 05:58:52 GMT</pubDate>
<guid>http://snipplr.com/view/27675/commandline-oneliner-to-get-your-public-ip-adress/</guid>
</item>
<item>
<title>(PHP) make a tarball of only the changed directories in a git repos, since last tag.</title>
<link>http://snipplr.com/view/27536/make-a-tarball-of-only-the-changed-directories-in-a-git-repos-since-last-tag/</link>
<description><![CDATA[ <p>make a tarball of only the changed directories in a git repos, since last tag.
replace {tagname_last} with any name you siwh to give the tarball
replace {tagname_previous} with a git reference (like a tag) from which you want to zip the changes.</p> ]]></description>
<pubDate>Tue, 02 Feb 2010 02:26:20 GMT</pubDate>
<guid>http://snipplr.com/view/27536/make-a-tarball-of-only-the-changed-directories-in-a-git-repos-since-last-tag/</guid>
</item>
<item>
<title>(PHP) Remove Drupal's search block "search this site" label.</title>
<link>http://snipplr.com/view/27483/remove-drupals-search-block-search-this-site-label/</link>
<description><![CDATA[ <p>Wizzlern, a Dutch Drupal trainer, has a Dutch article online on how to remove the "search this site" label in the Drupal search-block.</p> ]]></description>
<pubDate>Mon, 01 Feb 2010 09:41:26 GMT</pubDate>
<guid>http://snipplr.com/view/27483/remove-drupals-search-block-search-this-site-label/</guid>
</item>
<item>
<title>(Bash) print a list of bookmarks on delicous in a certain tag.</title>
<link>http://snipplr.com/view/27440/print-a-list-of-bookmarks-on-delicous-in-a-certain-tag/</link>
<description><![CDATA[ <p>Simple wget - grep - sed pipe to print a list of bookmarks on delicous in a certain tag.
Replace {USERNAME} with your username. 
Replace {TAG} with the tag you want a list of urls for.</p> ]]></description>
<pubDate>Sun, 31 Jan 2010 15:59:52 GMT</pubDate>
<guid>http://snipplr.com/view/27440/print-a-list-of-bookmarks-on-delicous-in-a-certain-tag/</guid>
</item>
<item>
<title>(Bash) Oneliner to add a public key to a remote servers authorized-keys</title>
<link>http://snipplr.com/view/27074/oneliner-to-add-a-public-key-to-a-remote-servers-authorizedkeys/</link>
<description><![CDATA[ <p>Instead of ~/.ssh/id_rsa.pub, you can choose any location on your local machine where your *public* key lives.
You may need to adjust the file permissions on remote authorized_keys aftwterwards, depending on the configuration of the remote ssh server.</p> ]]></description>
<pubDate>Tue, 26 Jan 2010 03:13:59 GMT</pubDate>
<guid>http://snipplr.com/view/27074/oneliner-to-add-a-public-key-to-a-remote-servers-authorizedkeys/</guid>
</item>
<item>
<title>(Bash) Simple rsync backupscript.</title>
<link>http://snipplr.com/view/26876/simple-rsync-backupscript/</link>
<description><![CDATA[ <p>This script pulls in files with [rsync](http://samba.anu.edu.au/rsync/), storing them locally with hardlinks for unchanged, and real files for changed -files.

* KEY=$HOME/.ssh/id_dsa_passwdless -- an id_rtsa key without a password. --adding this to remote authorized keys must be done with care: you will prbably want to whitelist one IP-adress.
* RHOST=ssh.example.com -- the host where to connect to using ssh, or rsync.
* RUSER=example-username -- the username on the host. Must have _read_ access in the SOURCE dit (see below).
* LPATH=$HOME/Archive/example-com/ -- where to place the backups
* RPATH=/var/www/example-com/ -- the to-be-backuped dir. 

You probably want to add this as script (`backup_example-com.sh`) in `~/bin`, or any other directory available in `$PATH`. And then add it to crontab.

See a howto here: http://troy.jdmz.net/rsync/index.html</p> ]]></description>
<pubDate>Fri, 22 Jan 2010 16:05:54 GMT</pubDate>
<guid>http://snipplr.com/view/26876/simple-rsync-backupscript/</guid>
</item>
<item>
<title>(Apache) Drupal on PCextreme</title>
<link>http://snipplr.com/view/26523/drupal-on-pcextreme/</link>
<description><![CDATA[ <p>http://pcextreme.nl is one of the Best hosters for Drupal in Netherlands. 
But they require one change to the .htaccess in order to run.</p> ]]></description>
<pubDate>Fri, 15 Jan 2010 15:00:51 GMT</pubDate>
<guid>http://snipplr.com/view/26523/drupal-on-pcextreme/</guid>
</item>
<item>
<title>(PHP) Target=_blank in Drupal link</title>
<link>http://snipplr.com/view/26499/targetblank-in-drupal-link/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Fri, 15 Jan 2010 07:17:14 GMT</pubDate>
<guid>http://snipplr.com/view/26499/targetblank-in-drupal-link/</guid>
</item>
<item>
<title>(SQL) move Drupal tags from one vocabulary into another</title>
<link>http://snipplr.com/view/26126/move-drupal-tags-from-one-vocabulary-into-another/</link>
<description><![CDATA[ <p>I had several vocabularies but wanted to merge them into one. 
A simple query does this for you.

The vocabulary_id where I wanted to merge all the tags into is 3
The vocabulary_id where the tags are to be merged from is 7, 8 and 12</p> ]]></description>
<pubDate>Fri, 08 Jan 2010 04:41:13 GMT</pubDate>
<guid>http://snipplr.com/view/26126/move-drupal-tags-from-one-vocabulary-into-another/</guid>
</item>
<item>
<title>(Other) vim search and replace</title>
<link>http://snipplr.com/view/24568/vim-search-and-replace/</link>
<description><![CDATA[ <p></p> ]]></description>
<pubDate>Thu, 10 Dec 2009 14:49:49 GMT</pubDate>
<guid>http://snipplr.com/view/24568/vim-search-and-replace/</guid>
</item>
<item>
<title>(Bash) Run Archivemail on all your IMAP folders.</title>
<link>http://snipplr.com/view/24111/run-archivemail-on-all-your-imap-folders/</link>
<description><![CDATA[ <p>Change 'username' (twice!) with your imap username,'password'with your imap password, and 'example.com' (twice!) with the url of your imap mailserver.

Works on: Ubuntu with Evolution, sqlite3 and archivemail installed. 
Evolution is required because evolution stores the available folders in IMAP. 
sqlite3 is requird to extract those available folders and recurse trough them.

This command looks up all the available folders in your imap box, recurses trough them and runs archivemail to archive all the online mail. 

NOTE: remove the -n (dy-run) flag to actually archive the items.
NOTE: remove the -v (verbose) flag to be less verbose.

TODO: option to purge empty directories.
TODO: store username, password and mailserverURL in a $VAR.</p> ]]></description>
<pubDate>Wed, 02 Dec 2009 04:49:15 GMT</pubDate>
<guid>http://snipplr.com/view/24111/run-archivemail-on-all-your-imap-folders/</guid>
</item>
<item>
<title>(PHP) Track block/views/cck etc changes in RCS and migrate with Drupal updates.</title>
<link>http://snipplr.com/view/20886/track-blockviewscck-etc-changes-in-rcs-and-migrate-with-drupal-updates/</link>
<description><![CDATA[ <p>Takes a .sql file and runs trough that, each line as an update_sql. 
Very usefull to track and migrate your blocks/views/cck etc changes.</p> ]]></description>
<pubDate>Fri, 09 Oct 2009 09:08:00 GMT</pubDate>
<guid>http://snipplr.com/view/20886/track-blockviewscck-etc-changes-in-rcs-and-migrate-with-drupal-updates/</guid>
</item>
<item>
<title>(Bash) Store Drupal blockconfiguration in SVN.</title>
<link>http://snipplr.com/view/14095/store-drupal-blockconfiguration-in-svn/</link>
<description><![CDATA[ <p>A common Drupal problem: how to save e.g. your blocks configuration without dragging an X Gig database around. 

A simple command that dumps a table in a way that it can be inserted into SVN. 
Every row is dumped as a single line, and they are sorted. Minimising the differences.

This example dumps the data for blocks.</p> ]]></description>
<pubDate>Thu, 16 Apr 2009 10:59:17 GMT</pubDate>
<guid>http://snipplr.com/view/14095/store-drupal-blockconfiguration-in-svn/</guid>
</item>
<item>
<title>(CSS) Goodlooking Required textfield</title>
<link>http://snipplr.com/view/10754/goodlooking-required-textfield/</link>
<description><![CDATA[ <p>Grab http://blog.kissmetrics.com/common/images/required.png as example for a required image .

NOTE: You probably don't want to use this trcik, but rather go for the defacto standard of a red asterisk to mark something required. An asterisk is language-independant and recognisable.</p> ]]></description>
<pubDate>Tue, 30 Dec 2008 03:53:16 GMT</pubDate>
<guid>http://snipplr.com/view/10754/goodlooking-required-textfield/</guid>
</item>
<item>
<title>(CSS) Style Buttons,</title>
<link>http://snipplr.com/view/9458/style-buttons/</link>
<description><![CDATA[ <p>Style buttons in Drupal.
The images/button-bg.jpg (or png: better) should be a tile of 2x26. It can contain a nice gradient to represent the embossed look of buttons.

NOTE: applying CSS to change the look of widgets is considered bad usability; people are used to buttons of their OS, and not used to your (weird) idea of buttons.</p> ]]></description>
<pubDate>Mon, 03 Nov 2008 07:28:12 GMT</pubDate>
<guid>http://snipplr.com/view/9458/style-buttons/</guid>
</item>
<item>
<title>(Bash) Return list of modules for each Drupal multisite</title>
<link>http://snipplr.com/view/9074/return-list-of-modules-for-each-drupal-multisite/</link>
<description><![CDATA[ <p>A bash script that calls Drush for all your multisite sites and returns a list of available and installed modules for each site.</p> ]]></description>
<pubDate>Fri, 17 Oct 2008 07:24:23 GMT</pubDate>
<guid>http://snipplr.com/view/9074/return-list-of-modules-for-each-drupal-multisite/</guid>
</item>
</channel>
</rss>
