Skip to content

Instantly share code, notes, and snippets.

@ck-on
ck-on / hhvminfo.php
Last active Mar 18, 2020
HHVMinfo - phpinfo for HHVM HipHop Virtual Machine
View hhvminfo.php
<?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
@timw4mail
timw4mail / a.php
Created Nov 29, 2012
Create directory structure in php
View a.php
<?php
/**
* Creates directories based on the array given
*
* @param array $structure
* @param string $path
* @return void
*/
function make_dir_tree($structure, $path=__DIR__)
@simX
simX / hidpi.txt
Created Jul 28, 2012
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
View hidpi.txt
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.
@ziadoz
ziadoz / awesome-php.md
Last active Jul 19, 2021
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md
@timw4mail
timw4mail / README
Created May 19, 2011
CSV Generating Class
View README
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
@banksean
banksean / mersenne-twister.js
Created Feb 10, 2010
a Mersenne Twister implementation in javascript. Makes up for Math.random() not letting you specify a seed value.
View mersenne-twister.js
/*
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();