Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
note t0 self - place inside class declaration with vars
- include Flex SDK swc (flash CS4)
2
2154
posted 17 years ago by obsessivejosh
note to self - Basic settings for clean text in as3 flash project assuming fonts are embedded.
0
1707
posted 17 years ago by obsessivejosh
Sometime it is convenient to get recursive directory listing as array of items
directory => (file array)
Such as:
Array
(
[./a2temple] => Array
(
[0] => example13.zip
)...
2
1920
posted 17 years ago by artoodetoo
Read in a remote XML file, change the pubDate date format, and output to specific local file.
0
1889
posted 17 years ago by karlhorky
If you want to set the active menu trail in a node, simply add this to your template.php in the 'template preprocess node' function.
0
1579
posted 17 years ago by ccalnan
MySQL Insert Unique Reference using MAX() to obtain latest value
Alternate solution to using Composite Primary Keys which INNODB engine does not support.
0
1944
posted 17 years ago by cherbert
To make an image browser, add these lines:
$ext = strtolower(substr("$dirArray[$index]", strrpos("$dirArray[$index]", '.') + 1)); //get file extensions
if ("$ext" == "jpg") { // if file is a jpg
print("<TR><TD>$dirArray[$index]<br/><a href=\...
1
2076
posted 17 years ago by beneberle
will split the string
"I am" search words
into
[0] => I am
[1] => searching
[2] => words
1
2141
posted 17 years ago by svenito
Shortens all strings in an array to a maximum length. Inserts '...' in between the first and last 6 letters
0
2556
posted 17 years ago by svenito
Given a start path will return an array of all subdirectories excluding files
0
2329
posted 17 years ago by svenito
Ensures all elements in an array are unique
newArray = myArray.unique();
0
1655
posted 17 years ago by svenito
This extends arrays withe a removeItems operation to remove all occurances of <item> from <array>
usage: myArray.removeItems("words");
0
1653
posted 17 years ago by svenito
Allows you to convert to any base between 2 and 255, effectively using all the ASCII characters.
In order to convert very large numbers with arbitrary precision you’ll need the BCMath lib. Without BCMath the large numbers will not be converted c...
1
1957
posted 17 years ago by bucabay
This snippet allows you to update multiple rows of a database using a single form in one easy click
0
2677
posted 17 years ago by daveismyname
This snippet collects a date from a var and formats it into the correct format for database date entry
0
2083
posted 17 years ago by daveismyname
There are plenty of classes out there to paginate through database results, well, here's one to paginate through a static array of items. Written quite a few years ago, recently recovered from a crashed drive.
1
1402
posted 17 years ago by evilwalrus
2 login functions that check if a user is logged in by checking is a session is equal to true that would have been set on login.
If not logged in the redirect to login.php
1
1800
posted 17 years ago by daveismyname
very useful function that allows you to redirect to the user to a given location
1
2139
posted 17 years ago by daveismyname