A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer/Packagist - A package and dependency manager.
- Composer Installers - A multi framework Composer library installer.
| <?php | |
| /** | |
| * SplClassLoader implementation that implements the technical interoperability | |
| * standards for PHP 5.3 namespaces and class names. | |
| * | |
| * http://groups.google.com/group/php-standards/web/final-proposal | |
| * | |
| * // Example which loads classes for the Doctrine Common package in the | |
| * // Doctrine\Common namespace. |
A list of amazingly awesome PHP libraries, resources and shiny things.
| <?php | |
| /* From: http://www.php.net/manual/en/function.str-getcsv.php#88773 and http://www.php.net/manual/en/function.str-getcsv.php#91170 */ | |
| if(!function_exists('str_putcsv')) | |
| { | |
| function str_putcsv($input, $delimiter = ',', $enclosure = '"') | |
| { | |
| // Open a memory "file" for read/write... | |
| $fp = fopen('php://temp', 'r+'); | |
| // ... write the $input array to the "file" using fputcsv()... | |
| fputcsv($fp, $input, $delimiter, $enclosure); |
| #!/bin/bash | |
| # | |
| # Steam installer for Debian wheezy (32- and 64-bit) | |
| # | |
| # Place into empty directory and run. | |
| # | |
| download() { | |
| local url="$1" | |
| local filename="$(basename "$url")" |
| function cd { | |
| if (("$#" > 0)); then | |
| if [ "$1" == "-" ]; then | |
| builtin popd >/dev/null | |
| elif [ "$1" == "--" ]; then | |
| dirs -v | |
| return $? | |
| elif [ "$1" == "." ]; then | |
| # break out of symlinked dir (cd into realpath) | |
| builtin pushd "`pwd -P`" >/dev/null |
This is a PHP (5.3+) microframework based on anonymous functions.
$priorityThis is a local copy of the commands from:
| // ActiveTable - a bookmarklet to make tables sortable and editable | |
| function init() { | |
| var aHrows = getHrows(); | |
| var numHrows = aHrows.length; | |
| var aHidden = getHiddenColumns(); | |
| ATpopup = document.createElement("div"); | |
| ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;"; | |
| ATpopup.innerHTML = "<a href='sort' title='sort' onclick='sortColumn(); return false'><img border=0 src='http://stevesouders.com/images/sort_up_down.png' style='padding-top: 0.2em;'></a><br><a href='hide' style='color: #C00; font-family: monospace; font-size: 1.5em; text-decoration: none;' title='hide' onclick='hideColumn(); return false'>x</a>"; // TODO - use protocol-less URL for img |
| javascript:(function(){var p=document.createElement("p");p.innerHTML="<strong>Loading…</strong>";p.id="loadingp";p.style.padding="20px";p.style.background="#fff";p.style.left="20px";p.style.top=0;p.style.position="fixed";p.style.zIndex="9999999";p.style.opacity=".85";document.body.appendChild(p);document.body.appendChild(document.createElement("script")).src="https://gist.github.com/ttscoff/5834741/raw/grablinks.js?x="+(Math.random());})(); |
| <?php | |
| /** | |
| * Ranking Library | |
| * contains alogrithms for story ranking | |
| * Basically a PHP Implementation of reddits algorithms | |
| * | |
| * @author Lucas Nolte <[email protected]> | |
| * @since 0.1 | |
| * @package Polska Wiadomosc | |
| * @subpackage Libraries |