Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Often PHP can't interpret POST data because it is not form-encoded. This is typical when the post data is XML from API's like Flash's XmlSocket. You can use the following methods to read the POST data directly.
1
1991
posted 18 years ago by mthorn
Since PHP is typeless odd things can happen when a variable is not the type you expected. PHP treats 0, null, '0', false, and '' as false. Sometimes you really want to know if the value is false. The solution is simple, use the triple equal (===) ope...
0
1291
posted 18 years ago by mthorn
Will create a thumnail no taller or wider than the supplied size. Also contains some tips for reading and writing images using GD.
22
11214
posted 18 years ago by mthorn
Sends as XHTML 1.1 + MathML if supported, falls back to XHTML 1.1 if supported, or falls back to HTML 4.01 Strict.
Mixed two separate scripts:
http://www.workingwith.me.uk/articles/scripting/mimetypes
http://golem.ph.utexas.edu/~distler/blog/arc...
2
949
posted 18 years ago by rolandog
Save this snippet via Safari as webarchive and replace an already created signature with this webarchive. Signatures are stored under ~/Library/Mail/Signatures
2
1226
posted 18 years ago by AlexK
Great little debuging snippet found while browsing. The code adds different coloured borders to the assets depending on its level. Leave commented out if not needed.
96
8510
posted 18 years ago by 1man
For bin iso you also need cdemu
To convert between formats check: mdf2iso, nrg2iso and ccd2iso
3
2230
posted 18 years ago by yuconner
To make an ISO from your CD/DVD, place the media in your drive but do not mount it. If it automounts, unmount it.
0
985
posted 18 years ago by yuconner
Note: This doesn't work in multi-threaded environments, check http://en.wikipedia.org/wiki/Singleton_pattern#C.2B.2B
Singleton class model
then:
SingletonClass *pSC = SingletonClass::get_singleton_instance();
pSC->any_public_function();
or: Si...
4
1405
posted 18 years ago by yuconner
JavaScript
Regular Expressions simple strings search/replace escape method (with RE speed enhancment - precompilation)
Usefull Regular Expressions enhancement. Simplifies standard string operations escaping special chars. And also saves precompiled REs for a speed increase.
1
1091
posted 18 years ago by cochambre
Para evitar problemas con IE. Hace referencia a un script que pongo en la parte de .js
0
1289
posted 18 years ago by kanirasta
redirects a splash page if visited before. Number of days until expiry can be set
0
1078
posted 18 years ago by markhope
Redirect a splash page using javascript. This snippet allows one redirect per session making the backwards navigation possible using the back button.
0
1204
posted 18 years ago by markhope
Methinks this is a bad idea but it is a suggested use of generics from the .NET 2.0 Generics Wrox book
0
840
posted 18 years ago by sophtwarez
The key here is display:none being in the style attribute of the affected div. It will not work if it's in a separate CSS file.
6
1265
posted 18 years ago by tjstankus
Placing these inside a PyObjC class lets you access PyObjC instance variables starting with '_' without extra work while still allowing access to standard Python instance variables.
0
721
posted 18 years ago by daeken
Support: Fx2, Opera9, IE6
I don't have warrant of Safari's run and NN4. However, I think that this code is perhaps safe.
3
872
posted 18 years ago by kif