Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
From: David Walsh.
http://davidwalsh.name/dw-content/open-links.php
2
2050
posted 17 years ago by gbot
ASP does not have a built in function to reverse or sort array like other languages. Find out how to do it.
1
1936
posted 17 years ago by neal_grosskopf
Este script calcula la edad en años a partir de una fecha dada y la resta con la actual.
0
1417
posted 17 years ago by isaac
Fecha en formato dd/mm/yyyy o dd-mm-yyyy retorna la diferencia en dias
0
1498
posted 17 years ago by isaac
This changes the date format from y-m-d to d-m-y on PHP. It's easy to change the - to / or spaces...
0
2720
posted 17 years ago by isaac
This changes the date format from d-m-y to y-m-d on PHP. It's easy to change the - to / or spaces...
1
3006
posted 17 years ago by isaac
Execute this to remove the .svn directory from the current directory and all sub directories
3
1725
posted 17 years ago by meinhard
Command line currency convertor, just copy and paste. I named mine 'coin'. Make sure you have Ruby, Rubygems and Hpricot (gem install hpricot).
e.g.
~$ coin 100 eur usd
158.3300
Uses the site xurrency.com.
1
1359
posted 17 years ago by plexus
Takes a date and returns a string describing how long ago that date was. examples: 3 seconds ago, 5 days ago, 2 years ago, you get the idea :)
17
9619
posted 17 years ago by patcullen
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
2242
posted 17 years ago by mandric
found this on the adobe cookbook site. There is also some PHP to go along with this in my snippets.
1
3714
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
1063
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
1889
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
1999
posted 17 years ago by jaytee
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
1525
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
3632
posted 17 years ago by webonomic
Flash sucks, embedding it sucks more, find out how to make it not suck.
2
2714
posted 17 years ago by neal_grosskopf