Welcome To Snipplr
You searched for: http
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Function to return the current page name, without the location of it...
Eg, for the URL http://localhost/www/someproject/index.php, this would return index.php
1
875
posted 16 years ago by xtheonex
How to run a KVM VM with no X (server environment, originally seen at http://blog.bodhizazen.net/?p=40).
0
887
posted 16 years ago by narkisr
I had a directory tree with around 4000 pdf files and I needed a page count - so I semi-rolled this. I swiped the counter code from the gem README:
http://github.com/yob/pdf-reader/tree/master
It could be more contained - as is I run it from irb:...
1
1327
posted 16 years ago by inkdeep
This example shows how to clean up git's reflogs entries in order save space (see http://www.newartisans.com/blog/2008/04/diving-into-git.html).
0
2240
posted 16 years ago by narkisr
[quote]$_SERVER['HTTP_REFERRER']'s problem is that can be spoofed, but it's better than nothing if you really want that.[/quote]
1
1252
posted 16 years ago by luizlopes
This snippet shows how to restore HEAD after using Git's reset method (see http://gitready.com/2009/01/17/restoring-lost-commits.html?disqus_reply=5271828#comment-5271828).
0
946
posted 16 years ago by narkisr
Sometime, you need unique classes on the leave join button of the groups page. Place this script in your AC footer.
--<br>
For more tips and tricks checkout the <a href="http://www.kickdeveloper.com/resources">KickApps resources page</a>.
0
1019
posted 16 years ago by krunkosaurus
A bookmarklet that enabled a speed dial storing the data in webkit's SQL engine. There are bugs and a few conditions, read: [http://www.dom111.co.uk/blog/coding/webkit-speed-dial-bookmarklet/59](http://www.dom111.co.uk/blog/coding/webkit-speed-dial-b...
1
1013
posted 16 years ago by dom111
see website for all information about that.
some more theory:
[color-scaling-function](http://stackoverflow.com/questions/168838/color-scaling-function)
[generate-color-for-a-power-meter-red-to-green](http://stackoverflow.com/questions/340209/gene...
0
1293
posted 16 years ago by localhorst
For database inserts must be made some site on "http://redirect_host:port/.../" with nice getip function: http://snipplr.com/view/10946/
0
1077
posted 16 years ago by paramah
Based on Jdub7's Pure PHP Template function
http://snipplr.com/view/10797/pure-php-template-function/
2
894
posted 16 years ago by thermosilla
another way to set / create a date using jodatime
download jodatime at http://joda-time.sourceforge.net/
1
951
posted 16 years ago by callmeblessed
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
1016
posted 16 years ago by berkes
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
856
posted 16 years ago by krunkosaurus
This is a basic script that will redirect a non-member to the login page with a custom message. Place the code between script tags in your Affiliate Center header.
To use:
1) replace loginPage variable with your *login URL.
2) replace accessMe...
0
677
posted 16 years ago by krunkosaurus
Use the Ka.Util.getLocationParam utility method to get the mediaType GET parameter:
--<br>
For more tips and tricks checkout the <a href="http://www.kickdeveloper.com/resources">KickApps resources page</a>.
0
839
posted 16 years ago by krunkosaurus
This is a very simple bookmarklet that will temporarily sort the *visible* messages in Gmail by subject. You'll have to run it again each time Gmail refreshes the list.
[Sort Gmail Messages](javascript:(function(){function%20f(r){var%20t=r...
0
1221
posted 16 years ago by wizard04
Avoid penalties for duplicate content. Also see
<a href="http://sitening.com/blog/htaccess-redirects-to-a-single-hostname/">How to Stay Safe from Duplicate Content by Using .htaccess and 301 Redirects</a>.
2
988
posted 16 years ago by splotchy
See [Raise and Handle Events Generically](http://snipplr.com/view/15033/raise-and-handle-events-generically/) for a better way to use events (generically) and links to best practices in .NET events.
This example should be used as a Console program...
0
1028
posted 16 years ago by pckujawa
reference:
http://codex.wordpress.org/Template_Tags/wp_list_categories
1
777
posted 16 years ago by Ashung
I thought I would share this simple username password PHP auth script. It leans on HTTP to secure a page.. not bulletproof but quick and painless.
3
1076
posted 16 years ago by jadedbat
This source code uses the xml file posted here(http://snipplr.com/view/4138/backup-script2--confg-file/) to know which file should be sent and mailing configuration.
0
841
posted 16 years ago by mjsmagalhaes
This function provides C# with functionality similar to the apparently deprecated my.Computer.FileSystem.FindInFiles under the Microsoft.VisualBasic namespace.
Example usage:
IEnumerable<string> oemFiles = FindInFiles(...
1
1511
posted 16 years ago by jimfred
This email snippet was borrowed from (FlashJunior), the original snippit is: http://snipplr.com/view/7743/email-check/
0
765
posted 16 years ago by binarynomad
View version with full names here:
[Dropdown-states](http://snipplr.com/view/4042/dropdown-states/ "View full names version")
3
1465
posted 16 years ago by jasonseney
Also check out...
http://roshanbh.com.np/2008/10/creating-parsing-json-data-php.html
3
1233
posted 16 years ago by jamesming
C++
Visual Studio debug tools to detect and debug memory leaks by setting a breakpoint on a particular memory allocation.
The Visual Studio output window will display "Detected memory leaks!" with a memory allocation number, for example, {145}. See Memory Leak Detection Enabling.
Using the debugger (without changing code) see: http://msdn.microsoft.com/en-us/library/...
1
1689
posted 16 years ago by jimfred