Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
I can't say I can rely on mb_detect_encoding(). Had some freaky false positives a while back. The following code will detect when you need to enconde or decode it.
1
966
posted 9 years ago by fackz
A PHP function for calculating the distance between two UK postcodes
0
1297
posted 9 years ago by mickeywilko
Cross platform development is usually an interesting puzzle to solve. Developers will have to concentrate on meeting the requirement and also focus on getting it done for multiple platforms. We would like to showcase a small html and control file tha...
0
1111
posted 9 years ago by w2ssolutions
let commandOutput = executeCommand("/bin/echo", ["Hello, I am here!"])
println("Command output: \(commandOutput)")
0
998
posted 9 years ago by nguyenvu
check email address whether valid or not by checking list of MX servers and send email command - will work as long as the SMTP server of target domain not be protected / the VRVY not be disabled in MX server.
1
980
posted 9 years ago by brm
To do this for any object in JavaScript will not be simple or straightforward. You will run into the problem of erroneously picking up attributes from the object's prototype that should be left in the prototype and not copied to the new instance. If,...
0
1193
posted 9 years ago by BrentS
delete Operator don’t impact the length of Array in JavaScript
1
1096
posted 9 years ago by ursdeep
Different ways to change the Maximum Execution time for PHP Scripts
1
1160
posted 9 years ago by ursdeep
[The original problem was stated as a SQL (SQL Server 2008) problem. This Perl script demonstrates the desired outcome for the problem statement.]
PROBLEM STATEMENT:
Please help me with SQL Query and requirement is as below:
Below is the Da...
0
964
posted 9 years ago by bvwatson
PHP
WordPress - redirect to the post instead of archive page when search query returns single result
Courtesy Kevin Chard at WPSnipp.com.
Adding this snippet to the functions.php of your wordpress theme will redirect your search to the post automatically when wordpress only returns a single search result.
1
1349
posted 9 years ago by adambundy
One day I got to wondering if it was possible to get a Python script to modify itself. After a few searches I found a solution that I present here. I did not write this code, but feel that it should be "paid forward" so others know that it is possibl...
1
1171
posted 9 years ago by BustACode
This snippet allows an array or multiple arrays to be re-sorted using multiple key fields.
0
904
posted 9 years ago by COBOLdinosaur
The key to making it work is the event listener that get added using the DOM method that binds it to the mousemove event and declares the event handler. Most event can be bound to a handler this way.
0
999
posted 9 years ago by COBOLdinosaur
This is damn crazy! sQlite does not have all the trig functions need to do distances. So here is how you load that into sQlite on the fly.
0
943
posted 9 years ago by brownrl
# HTML 5 Starter Template
Use this when creating a new HTML page.
0
1332
posted 9 years ago by GertjandW
Created as reply to question on ittoolbox.com:"Need your help in writing a query to pull audit history i.e. Last updated by a user 'XYZ' and for the same record key (ID) the second last record in the audit history table. i.e. Last update by this user...
0
1030
posted 9 years ago by bvwatson
Written as reply to question on ittoolbox.com:"I need to execute a query in vb which can find multiple value provided by the user to find from a single column of a table."
[http://database.ittoolbox.com/groups/technical-functional/sql-l/query-to-fin...
0
1005
posted 9 years ago by bvwatson