Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| /** | |
| * PE to use SVG as CSS background image with fallback for IE8/7/6 | |
| * | |
| * Using SVG as CSS background image to display | |
| * resolution-independent logos or icons is pretty | |
| * awesome but does completely fail on IE8/7/6 | |
| * | |
| * The trick: | |
| * All three IE versions don't support rgba color values. | |
| * By defining a rgba background color together with the |
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
| # The MySQL database server configuration file. | |
| # | |
| # DESC: InnoDB mainly, heavy queries, fewer connections, 4GB RAM | |
| # | |
| # Remember to edit /etc/mysql/debian.cnf when changing the socket location. | |
| [client] | |
| port = 3306 | |
| socket = /var/run/mysqld/mysqld.sock | |
| # This was formally known as [safe_mysqld]. Both versions are currently parsed. |
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| <?php | |
| /** | |
| * Remove any non-ASCII characters and convert known non-ASCII characters | |
| * to their ASCII equivalents, if possible. | |
| * | |
| * @param string $string | |
| * @return string $string | |
| * @author Jay Williams <myd3.com> | |
| * @license MIT License | |
| * @link http://gist.github.com/119517 |