Welcome To Snipplr
Everyone's Recent Snippets Tagged replace
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Stored Procedure for search and replace a string in all fields of all tables of one DataBase
2
967
posted 14 years ago by Eloi
You can use this SP like that;
Exec CleanInjection 'INFECTED WORD','CLEAN WORD'
(in use : Exec CleanInjection '<script></script>','')
2
893
posted 14 years ago by emregulcan
search for anything in-between two <TAG>'s and then replace the found string into the PHP if/else staement. $1 is wher TextMate stores the found string. (see http://screenflicker.com/mike/code/textmate-regex-replace/)
3
1192
posted 14 years ago by rwczippy
Bash
Bash (Command Line): Loop through directories in specified location, replacing directories in current directory (with backup)
This command line aims at moving directories from a target location to the present working directory (pwd), backing the pwd directories up as it encounters them.
The script works by:
1. Iterating through the contents of the target directory (us...
0
1009
posted 14 years ago by karlhorky
In AS2 forward slashes got url-encoded to %2F when you escaped them. But in AS3 they get ignored and left as they are. In some situations I have found that this can cause problems. So you can do it manually using this regular expression.
0
1058
posted 14 years ago by adrianparr
This is useful for when a Wordpress environment goes live; typically the uploads have an absolute URL.
5
1083
posted 14 years ago by Jamie
These are essential javascript techniques every javascriptr must know. I will be adding more to this list, let me know what you'd like to see. Thanks!
0
700
posted 14 years ago by alvincrespo
This will need to be either embeded or included and you can then just use this as such
myNewString = myStringVariable.nl2br();
0
826
posted 15 years ago by boondoklife
Make (and GMake) ignore spaces in many constructs, making it difficult to use a single space as a search string or a replacement string, for example. This trick works around the problem by assigning the space to a variable named SPACE and using that...
1
1080
posted 15 years ago by michaelaskew
This snippet shows how to replace the colours in a monochrome image, i.e. one which only contains two colours and the range of hues between them.
0
728
posted 15 years ago by deepsoul
A small collection of the most wanted string-functions in ASP / VB.
1
897
posted 15 years ago by choasis
The original string (str) will be changed after calling this function, so if you need it make a copy of it.
0
993
posted 15 years ago by Menda
When you put an image in a printable document, you don't want it to have black (or coloured) background. ImageMagick allows to replace colours even when the coloured regions are non-contiguous. Arbitrary colour values can be specified with `\#12345...
0
742
posted 15 years ago by deepsoul