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.
| # Install XCode. | |
| # Install XCode CLI Tools. | |
| # Select XCode. | |
| xcode-select -switch /Applications/Xcode.app/Contents/Developer | |
| # Install Auto Tools. | |
| brew install autoconf automake | |
| # Symlink iOS Simulator. |
| <?php | |
| class OpenStruct extends ArrayObject | |
| { | |
| public function __construct($input = array()) | |
| { | |
| parent::__construct($input, static::ARRAY_AS_PROPS); | |
| } | |
| public function offsetSet($key, $value) | |
| { |
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <title>iFrame</title> | |
| </head> | |
| <body> | |
| <!-- Page Content --> | |
| <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
| <script> |
| #!/usr/bin/env php | |
| <?php | |
| /* original version can be found at https://gist.github.com/181172 */ | |
| if( ! function_exists( 'inotify_init' ) ) { | |
| die_with_error( 'This script needs the inotify module' ); | |
| } | |
| $excludePatterns = array( |
| <?php | |
| /** | |
| * Simple excel writer class with no external dependencies, drop it in and have fun | |
| * @author Matt Nowack | |
| * @license Unlicensed | |
| * @version 1.0 | |
| */ | |
| class Excel { | |
| private $col; |
| #!/bin/bash | |
| # install homebrew's official php tap | |
| brew tap josegonzalez/homebrew-php | |
| # install homebrew-dupes (required to install zlib, php54's dependency) | |
| brew tap homebrew/dupes | |
| # install nginx + mysql + php 5.4 + php-fpm + apc + xdebug | |
| brew install nginx mysql |
A list of amazingly awesome PHP libraries, resources and shiny things.
| char** explode(char delimiter, char* str) { | |
| int l = strlen(str), i=0, j=0, k=0; | |
| char x = NULL; | |
| char** r = (char**)realloc(r, sizeof(char**)); | |
| r[0] = (char*)malloc(l*sizeof(char)); | |
| while (i<l+1) { | |
| x = str[i++]; | |
| if (x==delimiter || x=='\0') { | |
| r[j][k] = '\0'; | |
| r[j] = (char*)realloc(r[j], k*sizeof(char)); |
| /** | |
| * Failed attempt at gracefully degrading switch-style checkboxes | |
| * without pseudoelements (which shouldn’t exist on replaced elements) and extra elements. | |
| * Inspired by Espresso’s “Tools” switch | |
| * DO NOT USE. Currently only works properly in WebKit :( | |
| */ | |
| input[type="checkbox"]:not(:checked), | |
| input[type="checkbox"]:checked { /* :checked here acting as a filter for older browsers */ | |
| appearance: none; |
| :⌉ | |
| =⌉ | |
| ¦-) as opposed to | | |
| ☺ | |
| ☹ | |
| ☻ | |
| ⍣ | |
| ⍤ | |
| ⍥ om nom nom | |
| ⍨ |