Skip to content

Instantly share code, notes, and snippets.

View mithra62's full-sized avatar

Eric Lamb mithra62

  • mithra62
  • Arizona / Some Desert, idk
View GitHub Profile
<?php
$sorted = array();
foreach($array AS $key => $value)
{
$sort_key = (empty($sorted[$value['amount']]) ? $value['amount'] : $value['amount']+1);
$sorted[$sort_key] = $value;
}
krsort($sorted);
@mithra62
mithra62 / gist:5491504
Created April 30, 2013 20:04
EE .htaccess file
RewriteEngine on
RewriteCond $1 !^(images|pdf|styles|admin.php|js|images|css|scripts|themes|favicon\.ico|robots\.txt|index\.php) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/html
@mithra62
mithra62 / apc.ini
Created April 30, 2013 17:15
mithra62 APC Configuration
extension=apc.so
[APC]
apc.enabled=1
apc.shm_segments=1
apc.shm_size=1024M
;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number)
apc.num_files_hint=7000