Welcome To Snipplr


Everyone's Recent Snippets Tagged c



1 ... 342 343 344 345 346 ... 552
Another common task when working with strings is to replace a set of characters with a set of escape sequences. Sometimes the replacement is very easy - you only have to place a backslash (or another character) before every occurrence of an escaped c...
0 2546 posted 16 years ago by quangnd
remove and item or items from array
0 1317 posted 16 years ago by edektor
pads a string "2".pad(2, "0"); //02
0 1148 posted 16 years ago by edektor
This command will count the number of files in the given directory and sub-directories.
0 3266 posted 16 years ago by gdvickery
If you're writing a preference pane and you'd like to exit back to the main System Preferences view, just use this code.
1 3185 posted 16 years ago by Carter
Credit: http://pragmatig.wordpress.com/2009/04/14/recursive-symbolize_keys/
0 1727 posted 16 years ago by nate63179
I wrote this really quick and dirty script to paginate a very large chunk of text. A client site was setup with the understanding their about page would consist of 5-6 paragraphs but their biography ended up being 60 paragraphs. At the end of the d...
0 1679 posted 16 years ago by aristoworks
Very quick CSS addon to create a checkerboard background color "grid". Not compatible with Internet Explorer (until they start accepting better CSS selectors).
1 2786 posted 16 years ago by cryode
Also we can use HTTP_ACCEPT
0 1668 posted 16 years ago by kossmoss
Basic skeleton for a plugin. Contains an example to show where code needs to go.
2 1592 posted 16 years ago by ira
0 1800 posted 16 years ago by unravelme1
An easy way to hide your email from spam bots.
4 2697 posted 16 years ago by fackz
0 1757 posted 16 years ago by iloveitaly
This is based upon a debian guide, it seems to work well for ubuntu as well, all these steps can be performed via remote ssh (no need to access the machine).
0 1948 posted 16 years ago by narkisr
I had several vocabularies but wanted to merge them into one. A simple query does this for you. The vocabulary_id where I wanted to merge all the tags into is 3 The vocabulary_id where the tags are to be merged from is 7, 8 and 12
2 2137 posted 16 years ago by berkes
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 2128 posted 16 years ago by michaelaskew
This rule lets you print the contents of any variable for debugging purposes. Usage: > gmake echo_SOURCES SOURCES = main.c foo.c
1 3978 posted 16 years ago by michaelaskew
Example code to exercise a Crystalfontz 533 display from a 8051 using Keil C51.
0 2199 posted 16 years ago by jimfred
This is a simple function that will return an array of all the dates corresponding to the day 'Monday' for a given year. It's pretty simple and may not be the cleanest way but it works for my purpose.
0 2267 posted 16 years ago by aristoworks
This is another way to get a list of files ordered by upload time.
1 2417 posted 16 years ago by fackz
0 1481 posted 16 years ago by svenkaemper
4 2201 posted 16 years ago by vas3k
Use this little bit of CSS to get rid of the active link dotted border in Firefox. A must have when doing the text-indent:-9000px; image replacement technique on links.
0 2050 posted 16 years ago by toddaeverett
1 1618 posted 16 years ago by joet3ch
1 1233 posted 16 years ago by eivind
this specifically checks the view name and then checks the arg length altering the page title if its a match
1 1627 posted 16 years ago by ReeceMarsland
1 ... 342 343 344 345 346 ... 552