Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Usage:
<?php>post_excerpt; if($textin == ""){ $textin = $post->post_content; } echo TruncateText($textin, 150); ?>
0
1183
posted 14 years ago by tcelestino
I made this because org.apache.commons.lang.StringUtils does not have this method. I used this because i was dealing with a legacy db where all fields were char. trailing spaces were a pita.
0
1268
posted 14 years ago by m3rol666
I used this because I had a legacy db table that all fields are char. the right spaces were a pita. The rightTrim function can be viewed in my profile
0
1213
posted 14 years ago by m3rol666
Namespaces for enable browsers redering stuff for facebook's fbml, Google+1 and WAI-ARIA attributes in XHTML served as application/xml+html.
0
3551
posted 14 years ago by leobetosouza
Comes in handy for php magic functions such as __get and __set. This behaviour is fixed in php 5.3. Returns true also for private and protected properties using a reflectionclass
0
1538
posted 14 years ago by Roen
Useful snippet for getting a specific number of posts from a specific category, useful for news listing in sidebar
0
1310
posted 14 years ago by i-am-andy
By omitting [end] it will remove all to the end. Set an [end] with a negative value to count back from the end of the elements. fadeOut is unnecessary.
0
1606
posted 14 years ago by lewiswalsh
Thanks to followgram.me you can read a public feed with your photos. Use this code to retrieve your Instagr.am photos and use them on your web.
0
1878
posted 14 years ago by ginoplusio
Questa piccola funzione riceve come argomento uno unix timestamp e ritorna una stringa contenente la "descrizione verbosa" della differenza di tempo. Ad esempio, usando il timestamp relativo a 5 minuti e mezzo fa, ritornerà la stringa "5 minuti e 30...
0
1150
posted 14 years ago by claudiowebdesign
Check if user has intruded a real email address. Return true (real email) or false (fake email).
Arguments: Element from a form.
From book Dom Scripting by Jeremy Keith
0
2701
posted 14 years ago by alberomo
Arguments: Element from a form.
Take that element and checks if is filled. If not, returns false. If is filled, returns true.
From book Dom Scripting by Jeremy Keith
0
2762
posted 14 years ago by alberomo
I create this recursive function to remove and null all children inside a display object container.
0
1859
posted 14 years ago by radykal
A JS function that put the focus in the form field associated to a label element whenever is clicked. The for atributte of the label element must match the id attribute of the associated form field.
It takes no arguments.
From book Dom Scripting by...
0
1156
posted 14 years ago by alberomo
An additional method for the jQuery validation plugin to validate a german date (dd.mm.YYYY) based on DateITA method.
0
1919
posted 14 years ago by tuuul
I was working on a site that pulled in and republished a bunch of RSS feeds. Some contained duff images such as blank gifs that I needed to block so I wrote this function to compare the url of an image against a blacklist
0
1719
posted 14 years ago by paulo72
Add this code to the controller
Set controller as the delegate of the all the UITextField s in the UIView
1
2141
posted 14 years ago by yasirmturk
JS Function that style sibling elements of a given tag. Arguments: tag of the element We want siblings to style and name of the class we want to add. It needs the class to be styled (using CSS). It uses getNextElement function and addClass functions....
0
872
posted 14 years ago by alberomo
A JS function that makes bold the text of table rows ("tr" elements) when you "mouseover" them. It takes no arguments.
From book Dom Scripting by Jeremy Keith.
0
909
posted 14 years ago by alberomo