Greasemonkey: Unset a variable - greasemonkey

This is a question that has been plaguing me for awhile.
In Greasemonkey you can use GM_getValue(name) and GM_setValue(name, value) to store persistent variables. My question is, how do I 'unset' a variable?

GM_deleteValue will unset a value set by GM_setValue,
starting with Greasemonkey version 0.8.20090123 (February 18th, 2009).

Try unsetting it by setting it with a blank value:
GM_setValue(name, '')
If that doesn't work:
Go to about:config
Delete the entry
Restart Firefox
Run the script

Related

$VIM location wrong on Windows 7

for some reason my $VIM location on this Windows machine I am using points to /etc. Is there a way to change this? I don't know where it would be to change this so it is looking in the correct location. Thank you.
Vim will use an environment variable for $VIM, if one is defined. Check if you have a %VIM% environment variable defined. If you do, it may have been set by cygwin or a similar program, so be sure any Vim installation in there still works without this variable before removing it permanently.

Scrollable help in gnuplot

I frequently use the help command in gnuplot. On my office computer (gnuplot 4.6), gnuplot is set up such that when I pull up a help page, I get a scrollable output from which I can exit with q. On my private computer (gnuplot 5.0), I only get some lines of help and need to Press return for more. I like the office setup much better. Did the behavior change from version 4 to 5, or is there a way to configure this? (Well, it's GNUplot, so I guess there is a way to configure it ;-)
You need to set the environment variable PAGER='less' in your .bashrc. In your terminal, run:
echo "export PAGER='less'" >> ~/.bashrc
source ~/.bashrc
After this, the help command will be scrollable.
Note: There are other variables that could be useful. Just run man gnuplot in your terminal, and take a look at the section ENVIRONMENT.

Unset Environment Variable in grunt-env

Is there a way to unset environment variables with grunt-env? I know I can set them from the module, and there is even a way to set them to a value only if it doesn't exist. However, the project's GitHub page does not seem to show how to unset them. Any solution would be better if it also included a way to unset only if the variable is already set. Suggestions for other modules are welcome, as well.
Is there perhaps a value I could set the variable to, like undefined or null or empty string? Forgive me, I'm not too well-versed in environment variables.
The reason I am asking this is because I am creating an express app, and I may want to set some values, which would be controlled by environment variables, back to the defaults, and this would require either setting the variable to a specific value or unsetting it. I would rather go with unsetting it, if possible, so I don't have to remember which value to set it to.
This plugin is setting env variables only within the grunt process - those variables will not be visible for other processes at all! So you will not be able to set shell environment variables for your express app with this grunt plugin.
I also advice you not to set shell env variables with your build tools, but have them defined in bash file and loaded when the server is booted.

Automatic window title update

Is there a mechanism that could set the title of the cgywin window based on the current value of an environment variable?
I found this small script sometime ago (on SO I think) that allows the window title to be set to a specific string:
echo -ne "\e]2;$#\a\e]1;$#\a";
Background: I have just switched from using Subversion to Perforce (company policy) and find myself repeatedly checking the value of the P4CLIENT environment variable to know what my current workspace is. It would be quite useful to have the title of the cygwin window to automatically contain the current value of that environment variable.
At least if you're using Bash and Mintty, you could check out this post on SuperUser.
So in your case, you could do something like (single quotes changed to double quotes from the original answer since single quotes don't interpolate):
echo -ne "\e]0;$P4CLIENT\a"
You could then add that line into your .bashrc file to make it permanent.

C on GNU/Linux, replace terminal strings

Actually when i open the terminal i got this default string:
username#hostname:~
I want to replace the above string whit this one:
<myprgrogram>:~
How can i do this?
I'm developing in C on GNU/Linux).
Thanks in advance!
You need to set up your prompt as detailed here (I'm assuming you're using bash).
There are numerous options and capabilities. See here for a gallery of examples.
If you mean current path, then add the below line to your .bashrc file.
export PS1='<$PWD>:'
You can change an environmental variable using setenv/putenv from the standard library (stdlib.h), see "man setenv".
However, when the program ends the variable won't be saved.

Resources