• GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.

Number rounding extension method

A C# extension method which takes an integer and rounds it to the nearest multiple of 10. Written in response to this question on Stack Overflow.

using System; namespace TestApp { public static class ExtensionMethods { public static int RoundOff (this int i) { return ((int)Math.Round(i / 10.0)) * 10; } } public class TestApp { public static void Main() { int roundedNumber = 236.RoundOff(); // returns 240 int roundedNumber2 = 11.RoundOff(); // returns 10 Console.WriteLine(roundedNumber); Console.WriteLine(roundedNumber2); } } }

Anti-Telus filter

A Perl script which removes the tag added by Telus in mobile e-mail, so that various services can work properly when using mobile e-mail from a Telus phone.

#!/usr/bin/perl $user = 'REDIR@EXAMPLE.ADDRESS'; $pass = 'PASSWORD'; $host = 'POP3.SERVER.ADDRESS'; %redir = ( 'sender@example.address' => 'reciever@example.address' ); $sendmail = '/usr/sbin/sendmail -t'; #DEBUG $sendmail = 'cat >>test2.txt'; use Mail::POP3Client; # connection $pop = new Mail::POP3Client(HOST => $host); $pop->User($user); $pop->Pass($pass); $pop->Connect() >= 0 || die $pop->Message(); # loop through messages for ($i = 1; $i <= $pop->Count(); $i++) { %head = (); foreach ($pop->Head($i)) { /^(From|Subject|Content-type):\s+(

Chris' APT Repository Builder 0.1

Download: carb-0.1.tar.gz
Size: 18.3 KB
md5_file hash: 08a91324d75c6cac290afcb8ab19086d
First released: Wed, 2008-03-12 19:36

Original release.

# Syndicate content