Category: Uncategorized

Lex and Yacc syntax highlighting for Nano

There’s not a lot to them, but it’s better than anything I could find on the Internet. The real key feature is a line in the yacc syntax highlighting file that marks whitespace at the end of lines. Since yacc/bison are sensitive to that, it’s good to be able to see it.

Nano syntax highlighting for yacc or bison:

## Syntax highlighting for yacc/bison input files
syntax "yacc" ".y$"
color red "%[a-zA-Z0-9]*"
## String highlighting.  You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^=        ]*>" ""(\.|[^"])*""
## This string is VERY resource intensive!
color brightyellow start=""(\.|[^"])*\[[:space:]]*$" end="^(\.|[^"])*""
## Comments
color brightblue start="/*" end="*/"
## Visible space at line ends
color green,green "[[:space:]]+$"

Nano syntax highlighting for Lex or Flex:

## Syntax highlighting for lex/flex input files
syntax "lex" ".l$"
color red "%[^[[:space:]]]*"
## String highlighting.  You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color brightyellow "<[^=        ]*>" ""(\.|[^"])*""
## This string is VERY resource intensive!
color brightyellow start=""(\.|[^"])*\[[:space:]]*$" end="^(\.|[^"])*""
## Comments
color brightblue start="/*" end="*/"

Fixing Firefox's colors

If you are running Ubuntu with a dark theme and Firefox, you may have noticed that some text entry areas are too light to read. This is because a web developer only set the background and not the foreground color of the text area. When this happens, Firefox picks up the webpage’s background (likely white or something light), and the window manager theme’s text color (likely also white or something light in a dark theme). This means you get stuck reading light grey on white text. The fix is to put:

input{background-color:white;color:black;}
textarea{background-color:white;color:black;}
select{background-color:white;color:black;}

in your userContent.css file. That file may not exist yet, but you can create it in:

~/.mozilla/firefox//chrome/

And the next time Firefox starts up, it will use this code to color all inputs, textareas, and select boxes as white with black text.

I still don’t have a fix for all the buttons getting dark text on dark backgrounds.

Sprint cell phone codes

These are codes for doing a lot of random things to Sprint phones. I have an LG Lotus, and have been poking around in these service menus a bit. Unfortunately, I don’t have any way to get the MSL of a phone. I only have my MSL because I got my phone online, and they give you the MSL to register it.

I got the codes from this very useful thread.

##2342# (##CDG2#) CDG2 Menu (NAI setting here). Requires MSL.
##2539# (##AKEY#) AKey Menu. Requires MSL to Edit.
##2739# (##BREW#) BREW Software Menu. Requires MSL.
##2769737# (##BROWSER#) Browser Settings, also available under ##DATA#
##3282# (##DATA#) Power Vision Program. Requires MSL to Edit.
##33284# (##DEBUG#) Debugging Menu. Requires MSL.
##7738# (##PREV#) MOB_P_PREV (P_REV Prefs). Requires MSL.
##786# (##RTM#) Life Timers & Memory Reset. Requires MSL.
##8626337# (##VOCODER#) Vocoder Settings. Requires MSL to Edit.
##889# (##TTY#) TTY Menu (Same as Menu > Settings > More > Accessibility > TTY)
##XXXXXX# (MSL Code) Replace the 6 X with your MSL, offers SVC menu to change NAM and MSID

Turned off commenting

I’ve turned off commenting on this blog, because it only got spam. Drop me a line on twitter if you want to chat.