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.
| <?php | |
| /* | |
| HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine | |
| Author: _ck_ | |
| License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
| Version: 0.0.6 | |
| * revision history | |
| 0.0.6 2014-08-02 display fix for empty vs zero | |
| 0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements |
| <?php | |
| /** | |
| * Creates directories based on the array given | |
| * | |
| * @param array $structure | |
| * @param string $path | |
| * @return void | |
| */ | |
| function make_dir_tree($structure, $path=__DIR__) |
| sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
| sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
| // by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
| // Quartz Debug says. Who knows, maybe it's lying? | |
| // P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
| // back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
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.
| A simple class for exporting data from a database into a CSV file. | |
| If you want to directly output the CSV, simply call | |
| CSV::export($field_names, $data, $filename); | |
| Where: | |
| $field_names is an array, either associative, with the keys of the array being the column headers, or a traditional array, with the values of the array being the column headers of the csv in the order you want them. | |
| $data is either an array or object of arrays or objects containing your data in the same order as in the $field_names array |
| /* | |
| I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
| so it's better encapsulated. Now you can have multiple random number generators | |
| and they won't stomp all over eachother's state. | |
| If you want to use this as a substitute for Math.random(), use the random() | |
| method like so: | |
| var m = new MersenneTwister(); |