Welcome To Snipplr
Everyone's Recent Snippets
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Usage:
//any element
window.onload = function(){
focusFirstInput();
}
or
// form elements under 'content-body'
window.onload = function(){
focusFirstInput('content-body');
}
0
1260
posted 16 years ago by neoprolog
Usually use in a template with `in_category()`, like `if ( in_category( 3 ) || in_subcategory( 3 ) ) { ...`. Tested in WP 2.8.4.
1
1399
posted 16 years ago by cyberhobo
The code below will loop through the properties in an object and alert a string. myObject is in JSON notation. The "for ( x in y)" construct does not work if the Prototype.js library is included on the page
0
2830
posted 16 years ago by elugardo
Below are two functions I've been using to make event tracking a little easier in CodeIgniter.
Two functions are available, google_analytics() & track_event().
google_analytics() takes one argument and uses it as the UA code for your tracking p...
5
1834
posted 16 years ago by brettbergeron
The below code helps you move your site assets (images, css, javascript) to a public folder inside the application directory of CodeIgniter.
One thing you'll need to do is define ASSETPATH to be the path to the location of your public items. For m...
1
1215
posted 16 years ago by brettbergeron
A simple class layout template that I always use to get me started.
Nothing fancy. Just your basic structure.
1
1394
posted 16 years ago by StrawMan
Useful in cases where the object author has specified their own serialization that doesn't work for you.
1
1514
posted 16 years ago by rengber
How to concatenate lists, add an item to a list, slice an item from a list.
0
1087
posted 16 years ago by chrisaiv
This piece of code will store each line of a txt file into a mysql database
2
1947
posted 16 years ago by fackz
This approach allows an application to be embedded in a DLL. This is handy for diagnostic/maintenance utilities that are used with the DLL.
Steps to create:
* Create a MFC DLL project
* Add a dialog
* Add an entry point function such as void CA...
0
2888
posted 16 years ago by jimfred
Code for a Rake task that allows compiles all LESS stylesheets (.less) contained within a single directory.
0
1243
posted 16 years ago by brettbergeron
En este ejemplo, las uri apuntan hacia los dos working copy's pero pueden apuntar también hacia URL's de repositorio.
0
3105
posted 16 years ago by delm
This example demonstrates a way to control Adobe InDesign from Perl. Tested on MacOS X 10.5.7 and INDD.
0
1193
posted 16 years ago by myhd
From Liviu HolhoÅŸ - Blog
http://blog.liviuholhos.com/javascript/add-a-favicon-near-external-links-with-jquery
4
1768
posted 16 years ago by batamire