-
Archives
- May 2012
- April 2012
- February 2012
- January 2012
- December 2011
- September 2011
- August 2011
- June 2011
- January 2011
- December 2010
- November 2010
- October 2010
- August 2010
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- January 2009
- November 2008
- September 2008
- August 2008
- July 2008
- March 2008
- February 2008
- January 2008
-
Meta
Author Archives: Raymond
Bash: getting confirmation to continue or exit
#!/bin/bash while true do read -r -p ‘Are you sure? ‘ choice case “$choice” in y|Y) echo “Processing…” break ;; n|N) echo “Canceled.” exit ;; esac done echo “Complete.”
Currency Internationalization (i18n), Multiple Currencies and Foreign Exchange (FX)
Currency Internationalization (i18n), Multiple Currencies and Foreign Exchange (FX)
Multibyte PHP Functions
Source: Using Multi-Byte Character Sets in PHP (Unicode, UTF-8, etc) The following list details the PHP string functions which could cause problems when handling multi-byte strings. The multi-byte safe alternative is given when available: mail() Try mb_send_mail() instead. strlen() Try mb_strlen() instead. strpos() Try mb_strpos() instead. … Continue reading
Force secure browsing https
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} dir RewriteRule ^(.*)$ https://www.example.com/dir/$1 [R,L]
Vim: set Caps Lock as Ctrl, set Pause as Caps Lock, let Esc be Esc
raymond@ubuntu:~$ cat .Xmodmap remove Lock = Caps_Lock remove Control = Control_L keysym Caps_Lock = Control_L keysym Pause = Caps_Lock add Lock = Caps_Lock add Control = Control_L
PHP i18n using gettext
Localizing PHP web sites using gettext Setup i18n gettext in your PHP application Benchmarking PHP Localization – Is gettext fast enough?
Inserting a troublesome string from PHP to Javascript
<script type=”text/javascript”> alert(“<?php echo preg_replace(“/\r?\n/”, “\\n”, addslashes($message)); ?>”); </script> Passing variables to Javascript
Javascript Show Caller Function
arguments.callee.caller.toString()
I Thank You Lord
I thank you Lord for all your blessings to me I thank you Lord for all the trials that comes my way I thank you Lord for all the strength when my weakness puts me down I thank you Lord … Continue reading
How to get next MySQL insert id
function getMysqlInsertID($tablename) { $next_increment = 0; $qShowStatus = “SHOW TABLE STATUS LIKE ‘$tablename’”; $qShowStatusResult = mysql_query($qShowStatus) or die ( “Query failed: ” . mysql_error() . “<br/>” . $qShowStatus ); $row = mysql_fetch_assoc($qShowStatusResult); $next_increment = $row['Auto_increment']; return $next_increment; }