Dark Launch

This is a Dark Launch.

Bypass Mozilla addon experimental install; "Log in to install this experimental add-on."

Bypass "Log in to install this experimental add-on."
Change:
https://addons.mozilla.org/en-US/firefox/addon/ID_HERE/
To:
https://addons.mozilla.org/en-US/firefox/downloads/file/ID_HERE/
and you will be prompted to install the addon.
OR use http://www.bugmenot.com/

Use 7zip as default zip file manager; Set 7zip as default; Open With 7zip

1. Download and install 7-zip (free) from http://www.7-zip.org/download.html
2. Open My Computer/Windows Explorer. Select Tools> Folder Options.
3. Select the File Types tab and click the New button.
4. Type zip into the file extension text field and click OK.
5. Select the ZIP extension if not already selected and click change.
6. Click Select the program from a list and click OK.
7. Browse to C:\Program Files\7-Zip\7zFM.exe and click Open.
8. Click OK and zip files will now be opened with 7-zip.
Also, FileTypesMan from NirSoft is an excellent file types manager:
http://www.nirsoft.net/utils/file_types_manager.html

Tabs to Spaces, How Many Spaces?

Use 4 spaces or 2 spaces. Nothing else.

If you use 8 spaces, you've just dated yourself.

JavaScript Trim; PHP like Trim for JavaScript

Trim JavaScript string function.

Similar to PHP's trim().

Javascript
/**
 * String Trim
 * 
 * str.trim();
 * str.ltrim();
 * str.rtrim();
 * 
 * trim(str);
 * ltrim(str);
 * rtrim(str);
 * 
 */
 
String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g, "");
};
 
String.prototype.ltrim = function() {
    return this.replace(/^\s+/, "");
};
 
String.prototype.rtrim = function() {
    return this.replace(/\s+$/, "");
};
 
function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars){
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

SciTE Config - Syntax Highlighting; SciTE Dark Theme

http://code.google.com/p/scite-config/
* AU3
* CSS
* HTML
* JS
* PHP
* PY
* SQL
* XML

Crossbrowser CSS Opacity; CSS Transparency/Alpha

Transparency using CSS:

CSS
.transparent {
    -khtml-opacity: .5;
    -moz-opacity: .5;
    -ms-filter: 'alpha(opacity=50)';
    filter: alpha(opacity=50);
    opacity: .5;
}
NOTE: Please use sass.

SciTE change fold code icon, fold plus minus button; code folding icon

Open "\Program Files\SciTE\SciTEGlobal.properties".
Code
 
fold.symbols=3
 

Multiple SciTE Windows; Open at the same time

To open multiple SciTE Windows at the same time.

Open SciTE and select Options > Open Files Here. If "Open Files Here" is grayed out or disabled, open "\Program Files\SciTE\SciTEGlobal.properties" and search for "check.if.already.open" and set it to 1.

Code
check.if.already.open=1
 

JavaScript view whitespace: newlines/line endings & tabs

View whitespace in JavaScript & PHP. This function replaces line endings/newlines and tabs:

Javascript
function raw(str) {
    return str.replace(/\t/g, '\\t')
              .replace(/\r\n/g, '\\r\\n')
              .replace(/\r/g, '\\r')
              .replace(/\n/g, '\\n');
}

The /g modifier finds and replaces all occurrences.

The equivalent for php to see whitespace would be:

PHP
function raw($str) {
    $str = str_replace(array("\t", "\r\n", "\r", "\n"),
                       array('\t', '\r\n', '\r', '\n'), $str);
    return $str;
}

keyconfig with Firefox 3.0.7; install.rdf

Open:
C:\Documents and Settings\\Application Data\Mozilla\Firefox\Profiles\\extensions\keyconfig@dorando\install.rdf
Update :
Code
 
<targetApplication><rdf:Description>
<id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</id>
<minVersion>2.0.0.17</minVersion>
<maxVersion>3.2</maxVersion>
</rdf:Description></targetApplication>
 

maxVersion needs to be greater than 3.0.7

pChart - a PHP Class to build Charts

http://pchart.sourceforge.net/

MySQL Format Money/Currency with Dollar Sign; Get Total for Month

Format the mysql select with a dollar sign and two decimal places.

SQL
SELECT
    CONCAT('$',FORMAT(SUM(`invoice_total`),2)) AS month_total
FROM
    `invoices`
WHERE
    `invoices`.`timestamp` > DATE_SUB('2009-02-01', INTERVAL 1 DAY) AND
    `invoices`.`timestamp` < DATE_ADD(LAST_DAY('2009-02-01'), INTERVAL 1 DAY)
LIMIT
    1

Don't confuse a clear view with a short distance.

"Don't confuse a clear view with a short distance."