Welcome To Snipplr


Everyone's Recent Snippets



1 ... 446 447 448 449 450 ... 553
2 1788 posted 17 years ago by fruehjahr
Forces a user to download a file, for e.g you have an image but you want the user to download it instead of displaying it in his browser.
0 1653 posted 17 years ago by fruehjahr
Again, as part of the DCODR development I had to find a decent way to get the selection HTML
0 2861 posted 17 years ago by optimal
1 1310 posted 17 years ago by fruehjahr
3 2219 posted 17 years ago by fruehjahr
Developed as part of my DCODR experiments...
0 1508 posted 17 years ago by optimal
0 1331 posted 17 years ago by archlight
1 1503 posted 17 years ago by archlight
I think this is php 5 only
0 1532 posted 17 years ago by jfherring
Based on Jdub7's Pure PHP Template function http://snipplr.com/view/10797/pure-php-template-function/
2 1569 posted 17 years ago by thermosilla
Return just the Apache version number of your server, and operating system, from $_SERVER['SERVER_SOFTWARE'] Example: print ('Apache Version: ' . apacheversion()); will return something along the lines of... "Apache Version: 2.2.10 (Unix...
1 3051 posted 17 years ago by iridium
Simple but useful function for getting a single piece of data from a database and placing it straight into a variable. Example: $variable = one_result("SELECT columnOne FROM table WHERE columnTwo=whatever"); This would insert the value of colu...
1 1409 posted 17 years ago by iridium
To find the latest file in a particular dir
1 2062 posted 17 years ago by jaduks
Simply paste the list of URLs into stdin. You can add the option `-P 4` to parallelize the downloads.
1 1629 posted 17 years ago by xenonite
another way to set / create a date using jodatime download jodatime at http://joda-time.sourceforge.net/
1 1689 posted 17 years ago by callmeblessed
create a date using Calendar
1 1948 posted 17 years ago by callmeblessed
how to rollback data on grails' service .... for myutil --> please look at
0 1710 posted 17 years ago by callmeblessed
I need to create all table in InnoDB in my grails application. you can add this / edit the following code on grails-app/conf/Datasource.groovy
1 2588 posted 17 years ago by callmeblessed
how to "beautify" or tidying your code using vim ?
1 2106 posted 17 years ago by callmeblessed
how to render GSP template as String ? g:render is taglib in gsp (<g:render> ) but you can call it on your controller using g.render().
0 2318 posted 17 years ago by callmeblessed
how to read error message as string instead of complicated codes. usually people using taglib to read error messages. but how to read it in controller/service if you, for example, want to log or render just the message. here is how to do that.
0 2047 posted 17 years ago by callmeblessed
how to call session from grails service (spring service)
0 1990 posted 17 years ago by callmeblessed
how to loop an array / collection / list but with index. instead of using each{} closure, you can use eachWithIndex{} closure
1 1853 posted 17 years ago by callmeblessed
Usage: define('PIRATE',bindec('0001')); // 1 define('NINJA',bindec('0010')); // 2 define('JEDI',bindec('0100')); // 4 define('ADMIN',bindec('1000')); // 8 $rpermit = array(PIRATE,JEDI); // Equivilent Flags '0101'...
0 1237 posted 17 years ago by Jdub7
2 1691 posted 17 years ago by Jdub7
There's been a popular trend to use JavaScript to add target="_blank" to anchors with rel="external". So in the name of making everything in my site Prototype based I worked out a script to do just that.
2 1968 posted 17 years ago by fruehjahr
1 ... 446 447 448 449 450 ... 553