We can use the file_line type reference to append or substitute a string inside a file with regular expression.
Add a string
file { '/tmp/eureka.txt':
ensure => present,
}->
file_line { 'Append a line to /tmp/eureka.txt':
path => '/tmp/eureka.txt',
line => 'Hello World',
}
Continue reading Puppet – Add or Replace a string in a file →
Yesterday we have talked about converting URL into clickable link by Regular Expression.
PHP – Convert URL into clickable link by Regular Expression
If you want a more complete and robust solution, you can try the UrlLinker written by Søren Løvborg.
Continue reading PHP – Convert URL into clickable link with UrlLinker →
I want to convert the all URLs in a string into clickable links. I found a solution in StackOverflow but probably it only works in PHP 5.2 since it uses eregi_replace() which is deprecated in PHP 5.3. So use it with cares.
Continue reading PHP – Convert URL into clickable link by Regular Expression →
After working for about one year, the BHJS Alumni website phase 2 is completed. But after it is deployed in production server, i found that some email addresses are regarded as invalid email address. The email validation rule which i used is provided by CakePHP. Only email addresses ended with .com, .org etc… could pass the validation rule.
So i ask the Google teacher and luckily i am not the only one to come across this problem.
Continue reading CakePHP – Email Validation →
Dream BIG and go for it =)