Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
4 total  XML / RSS feed 

Rewrite SPAM subject line with procmail

// Remove textdrive's ***SPAM*** addition
// by phearlez
// http://discuss.joyent.com/viewtopic.php?pid=154695#p154695

# Remove the word ***SPAM*** from SpamAssassin's subject line re-write

 :0 fHw
 * ^Subject: \*\*\*SPAM\*\*\*
 | sed -e 's/\*\*\*SPAM\*\*\*//g'

get firstname and surname from string

// takes a string and rips out the firstname and surname from it

select 
substring(login_id, 1, patindex('% %', login_id)) as firstname,
substring(login_id, patindex('% %', login_id), len(login_id)) as surname

from c_contact
and login_id <> ''

Фильтр на обновление только разрешенных полей

%w(name email address).each { |f| @person[f] = params[:person][f] }

Svn obliterate (dump filter)

Taken and slightly adapted from www.robgonda.com/blog

svnadmin dump /path/to/repos > proj.dump
cat proj.dump | svndumpfilter exclude somefolder > cleanproj.dump
STOP SVN services
BACKUP /path/to/repos/conf /path/to/repos/hooks (all custom configuration for this repository)
DELETE /path/to/repos
svnadmin create /path/to/repos
RESTORE /path/to/repos/conf /path/to/repos/hooks
svnadmin load /path/to/repos < cleanproj.dump
RESTART SVN services
« Newer Snippets
Older Snippets »
4 total  XML / RSS feed