Welcome To Snipplr


Everyone's Recent Snippets Tagged c



1 ... 490 491 492 493 494 ... 554
PSTrickで書いた多様体の図
0 1481 posted 17 years ago by tkf
1 918 posted 17 years ago by inkdeep
2 918 posted 17 years ago by inkdeep
This is meant to be run as root, so do it at your own risk. It's very raw and needs error checking, but works. I run this script to get new django sites off the ground in a few minutes.
0 1803 posted 17 years ago by mandric
got this as part of an example on the adobe cookbook site
1 1290 posted 17 years ago by mswallace
found this on the adobe cookbook site. There is also some PHP to go along with this in my snippets.
1 1378 posted 17 years ago by mswallace
/* if (globalVariable) { But this wouldn't work. That code is actually checking to see if the defined variable globalVariable has a null value. If the variable has not been defined, that code will cause an error. Instead, here is the code that...
0 821 posted 17 years ago by zha
You can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15). MySQL has two built-in functions: INET_ATON() and INET_NTOA(). These two functions are used allover the place in any TCP/IP s...
0 1361 posted 17 years ago by zingo
30 5957 posted 17 years ago by zingo
Worst title ever. Basically, this takes a string like: "Check this out: http://snipplr.com/view/5759/replace-a-url-its-domain-name-and-create-link/" and replaces it with "Check this out: snipplr.com [with a link to the full URL]"
1 1426 posted 17 years ago by jaytee
1 1176 posted 17 years ago by tclancy
This bit of code allows you to turn code that looks like this: x = {'foo':1, 'bar':2 } x['foo'] = 3 Into this: x = dictclass( {'foo':1, 'bar':2 } ) x.foo = 3
2 1029 posted 17 years ago by kangell
Below is some code written for creating one response from survey questions where the respondent checks all that apply.
0 1357 posted 17 years ago by webonomic
Flash sucks, embedding it sucks more, find out how to make it not suck.
2 1318 posted 17 years ago by neal_grosskopf
Start mplayer with -vf screenshot, and press 's' when you want to capture a frame.
0 973 posted 17 years ago by mandric
I often find something like this lurking at the end of my base templates - it'll show you which queries were run while generating the current page, but they'll start out hidden so as not to be a pain. Of course, before this works, you'll need to s...
1 1348 posted 17 years ago by jonhenshaw
Send an e-mail message to the given addresses.
2 1002 posted 17 years ago by kangell
Run the specified command. If expect is not None then look for the given text in the output. If it is not there we throw an error. expect can also be a list of strings. In that case any match results in success unless matchall=True.
0 903 posted 17 years ago by kangell
1 915 posted 17 years ago by neil
provides a tidy way to add initialization by hash to new classes
1 879 posted 17 years ago by neil
3 937 posted 17 years ago by rblalock
8 1240 posted 17 years ago by rblalock
3 1013 posted 17 years ago by rblalock
0 778 posted 17 years ago by rblalock
Instead of using this function to set the default timezone in your script, you can also use the INI setting date.timezone to set the default timezone. * Does not affect timestamp functions, which are all GMT
0 1094 posted 17 years ago by johnself
Check out the bash command 'shopt -s cdable_vars' From the man bash page: If set, an argument to the cd builtin command that is not a directory is assumed to be the name of a variable whose value is the directory to change to.
0 933 posted 17 years ago by cczona
Useful for speeding up searches.
1 1284 posted 17 years ago by jarnaldich
1 ... 490 491 492 493 494 ... 554