Lang Martin

Email lang.martin at Gmail.

Cheat Sheets

Emacs

2009-07-02 Thu

I just use this to keep a stack of things I've learned recently about emacs. I've only been using it for 8 years, so this happens all the time.

VC Annotate
C-x v g for line-by-line history.
URL Encoding
org-link-unescape and org-link-escape.
eshell pipe to buffer
diff > #<buffer *scratch*>
iBuffer multi-occur
O operates on tagged files. I for replace.

Windows

2009-10-29 Thu

Install Flash Manually

  1. http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-win.xpi
  2. Rename to .zip
  3. Copy NPSWF32.dll and flashplayer.xpt to Mozilla Firefox\plugins 1
  4. Restart
  5. http://www.mozilla.com/en-US/plugincheck/

Classic ASP Order of Evaluation

by Lang. 2009-07-17 Fri

Classic ASP supports a few different language platforms, although it seems rare to see anything other than VBScript and JScript. The order of evaluation is:

  1. The language tag.
  2. <script> tags in the non-default language.
  3. <script> tags in the default language.
  4. Static HTML and <% %> blocks in order.

There are some restrictions on the type of data that can be passed between languages, but functions appear to be fair game. I've had success programming in JScript by leaving the default language alone and preparing thunks that produce output. I can call those thunks in the page as <% foo_thunk %>.

I've had even better success dumping JSON to the client and keeping the HTML on the client side.

Registry Settings for the Default Browser

From this Tom's Hardware forum post:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.shtml]
@="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xht]
@="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xhtm]
@="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xhtml]
@="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.htm]
@="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.html]
@="FirefoxHTML"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\DefaultIcon]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\FirefoxHTML\shell\open\command]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ftp\DefaultIcon]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ftp\shell\open\command]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\gopher\DefaultIcon]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\gopher\shell\open\command]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\DefaultIcon]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\http\shell\open\command]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\DefaultIcon]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\https\shell\open\command]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"%1\""

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CHROME\DefaultIcon]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE,1"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CHROME\shell\open\command]
@="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"%1\""

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Check_Associations"="No"
"IgnoreDefCheck"="Yes"

Footnotes:

1 Firefox plugins can be installed either in the global directory or in your Application Data directory, although a plugins sub-folder might not exist. IE plugins (on XP) seem to go in system32\Macromed\Flash.