Welcome To Snipplr


Everyone's Recent Snippets Tagged c



1 ... 446 447 448 449 450 ... 552
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 3295 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 1596 posted 17 years ago by iridium
To find the latest file in a particular dir
1 2283 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 1843 posted 17 years ago by xenonite
another way to set / create a date using jodatime download jodatime at http://joda-time.sourceforge.net/
1 1935 posted 17 years ago by callmeblessed
create a date using Calendar
1 2151 posted 17 years ago by callmeblessed
how to rollback data on grails' service .... for myutil --> please look at
0 1918 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 2821 posted 17 years ago by callmeblessed
how to "beautify" or tidying your code using vim ?
1 2343 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 2553 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 2233 posted 17 years ago by callmeblessed
how to call session from grails service (spring service)
0 2194 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 2071 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 1430 posted 17 years ago by Jdub7
2 1870 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 2182 posted 17 years ago by fruehjahr
Paste this code in your HTML to display the current year. This script is commonly used in the © copyright's current year.
4 2265 posted 17 years ago by variantstudios
0 1370 posted 17 years ago by kevinberny
0 1680 posted 17 years ago by archlight
0 1275 posted 17 years ago by kevinberny
6 2292 posted 17 years ago by AlexWolfe
1 1545 posted 17 years ago by burnsra
Wordpress function
1 2037 posted 17 years ago by Tate
Grab http://blog.kissmetrics.com/common/images/required.png as example for a required image . NOTE: You probably don't want to use this trcik, but rather go for the defacto standard of a red asterisk to mark something required. An asterisk is lang...
1 1807 posted 17 years ago by berkes
Doesn't work on Windows, obviously
1 1999 posted 17 years ago by tclancy
In this example below I am moving the "recent blogs" module in "My Home" to the very top. I have placed this code in the footer of my Affiliate Center wrapped in script tags. For maximum efficiency: 1) Use the inspect tool in Firebug to find the...
0 1691 posted 17 years ago by krunkosaurus
1 ... 446 447 448 449 450 ... 552