Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
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
Basic skeleton for a plugin. Contains an example to show where code needs to go.
2
1592
posted 16 years ago by ira
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
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
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