Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Matches text between each pair of asterisks (see URL above for demo)
**Example:**
Make text between asterisks bold, like in Textile (in Ruby):
`test.gsub(/(\*)+([^.*?$]+)+(\*)/, '<strong>\\2</strong>')`
0
1464
posted 13 years ago by inko9nito
A little function used to set cookies as arrays of values instead of single combinations key->value. Note that it saves values as a stack.
1
711
posted 13 years ago by claudiowebdesign
simple bash script to kill apache childs with status "Gracefully finishing" or "G" status. you may put it at cron
0
738
posted 13 years ago by randompage
Original custom fields code based on Wefunction's code here: http://wefunction.com/2008/10/tutorial-creating-custom-write-panels-in-wordpress/ enhanced to add support for uploading images.
1
794
posted 13 years ago by simnor
This little trick will prevent line breaks on your links. I recommend using this with long text to avoid having links break into 2 lines.
0
793
posted 13 years ago by blueocto
Textareas in IE have vertical scrollbar visible by default. If you want those removed (I know I do) use this line.
0
800
posted 13 years ago by blueocto
With this line of code you can control places where you want your pages to break when printing a document.
0
812
posted 13 years ago by blueocto
the following code can be used to create a table with a dynamic name
0
788
posted 13 years ago by gtaking
Use as follow in you style.less file :
<pre>
.example{
.linearGradient(0, #fff, 50%, #ccc, 100%, #fff);
}
</pre>
1
915
posted 13 years ago by kanouf
Quick and easy javascript in_array function. It's not perfect, but if you need something quick, this is it.
1
645
posted 13 years ago by cornellsteven
ReflectionToStringBuilder wraps a class and outputs a string describing its attributes, more or less similar to var_dump in PHP
1
1392
posted 13 years ago by miceno