Welcome To Snipplr
Everyone's Recent Snippets Tagged text
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This can come in handy for a reset or cancel button. You can clear all inputs within a single div in one line of code. Pretty sexy.
0
941
posted 11 years ago by mattvbiggs
Get the text in between more text in a string. Accepts $content,$start,$end & $is_string as parameters.
1
851
posted 12 years ago by o0110o
1. Adding shadow to text – text-shadow
Helps make your text stand out from the rest.
2. border image rounding
0
987
posted 12 years ago by skopp
Hiding text can be extremely useful to hide company logo. As logos are usually an image, you will want to use text indent to place it in a h1 tag for SEO (Search Engine Optimization). The technique we use is to hide the text far away off the screen,...
0
872
posted 12 years ago by skopp
The .NET Framework doesn't support automatic detection of character encoding in the default file I/O methods. This is a quick function that returns True in the specified file is Unicode.
0
1271
posted 12 years ago by ShaneGowland
Takes your table name and key=>value array of values and returns the text for inserting into a MySQL database. Automatically surrounds strings with single quotes.
1
1086
posted 12 years ago by lemcoe9
This Perl snippet shows how to separate quoted parts from a text in order to process quoted and unquoted parts separately. For example, you could expand variables or wildcards only in the unquoted part. Then the different processed parts are put to...
0
871
posted 12 years ago by deepsoul
cross-browser way to select all text in a form element, via Jason on Stack Overflow
0
734
posted 12 years ago by charliefmoran
Clear all text fields on focus based on original value with single function. The code checks for a 'title' attribute on each input with class 'text' and compares this to the current value of the field.
0
1062
posted 12 years ago by Huskie
If you have a Table which has a Column of type char or varchar or even text, and you want to change a portion of text in it for example a path. In this case you need to change the same text with new one in every records.
0
1032
posted 12 years ago by klovera
Projecto de LabP01 que consiste na criação de uma classe que permite efectuar operações sobre ficheiros de texto.
0
731
posted 12 years ago by N-genhocas
This Applescript take the selected file in Finder and open it with Sublime Text 2 (~/bin/subl). Using Alfred you can bind a global hotkey for this script, so you can edit your files with just a keypress, without worrying about the default editor.
0
1203
posted 12 years ago by bash
This Applescript take the selected file in Finder and open it with Sublime Text 2 (~/bin/subl). Using Alfred you can bind a global hotkey for this script, so you can edit your files with just a keypress, without worrying about the default editor.
0
1039
posted 12 years ago by bash
This is a function that receives a string as an argument (along with other config optional arguments) and locates all keywords (words that appear most) from that string, returning the keywords as an array or as a string separated by commas. The funct...
2
3174
posted 12 years ago by TimoZachi
When you run this over a text.txt with some text you will get the word distribution on output_ngram.txt as follows:
30 m
29 por
29 aplicaci
27 modelo
27 datos
24 con
21 este
21 esta
20 En
18 posible
18 palabras
1...
0
676
posted 12 years ago by clopez
For any text document this snippet generates an output file that looks like this:
30 m
29 por
29 aplicaci
27 modelo
27 datos
24 con
21 este
21 esta
0
612
posted 12 years ago by clopez
Hi;
Sometimes you need to "trim" textifield for specific height... This solves just this, perfect for news, news-readers, rss etc
1
1162
posted 12 years ago by burnandbass
TimedText (TT) XML captions files can have namespaces that cause problems when parsing them in AS3. To get around this you can use this code to remove the namespace from the root XML node using Regex. This example uses
0
1052
posted 12 years ago by adrianparr
ActionScript 3
AS3 Convert TextField LineBreaks to CRLF for Display as Plain Text (Notepad) on Windows
Linebreaks differ between Flash TextField and a plain text file like Notepad. In this example we convert the html linebreaks in Flash to \r\n
0
1410
posted 12 years ago by adrianparr
This snippet describes how to fill select html element with Text, Value pairs
where 'Text' is displayed to the user and 'Value' is actual value to be processed.
0
790
posted 12 years ago by Neven
I've yet to work on a WordPress site where at least once post wasn't copied from Microsoft Word, producing a mess of inline tags and awful markup.
This helps prevent that, just a little.
0
707
posted 12 years ago by travishines
This code gets the current caretIndex in the textfield and then inserts the specified string at that point. The caretIndex position is then updated using setSelection, ready for the next insertion. This was developed to be used with an on-screen keyb...
0
1538
posted 13 years ago by adrianparr