Welcome To Snipplr
Everyone's Recent Snippets Tagged directory
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
here's a script, mod_files.sh, in ext/session for creating directory
tree with depth X for sessions. As it stands, it's pretty poorly
documented and very basic. I * got exceptionally bored and rewrote most
of it, the patch is attached. It runs...
0
1159
posted 15 years ago by nkm
Calculate dir size recursive, follow the link above because the version above is better.
0
886
posted 15 years ago by ginoplusio
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
713
posted 15 years ago by artoodetoo
This assumes the modules names are CamelCase and not UPPERCASE.
0
1301
posted 15 years ago by blasterpal
When using `ln` to create a link in a different directory, the semantics of creating hard and symbolic links differ. That is because a hard link contains a direct reference to its target's data, while a symbolic link is just a string containing a (p...
1
899
posted 15 years ago by deepsoul
Flash has a weird cache mechanism, this makes sure that the browser isn't caching any data.
0
1144
posted 15 years ago by iloveitaly
This snippet will create an array of all images in a directory and sub-directories and display them randomly.
4
3559
posted 15 years ago by superuntitled
This function simply takes a Windows UTC timestamp and converts it to Unix epoch.
This was useful when I was pulling LDAP information from Active Directory and the timestamps were ridiculous. Windows builds timestamps by counting seconds since Janua...
0
1035
posted 15 years ago by cllorca
Here’s a snippet that can help you to remove a non-empty directory from the server. It’s a recursive function that deletes the directory with its files, folders and sub-folders.
2
957
posted 15 years ago by fackz
This is a function that selects files from a directory and orders them by the last time they were changed, in ascending or descending order. The snippet also calculates how much time passed since the file’s content was changed.
2
1690
posted 15 years ago by fackz