This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ob_start(); | |
include('index.php'); | |
ob_end_clean(); | |
$CI =& get_instance(); | |
$CI->load->library('session'); | |
echo $CI->session->userdata('name'); | |
/* | |
Credit to Ben Swinburne |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('make_slug')) | |
{ | |
function make_slug($text) | |
{ | |
// replace non letter or digits by - | |
$text = preg_replace('~[^\\pL\d]+~u', '-', $text); | |
// trim | |
$text = trim($text, '-'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function compress() | |
{ | |
ini_set("pcre.recursion_limit", "16777"); | |
$CI =& get_instance(); | |
$CI->benchmark->mark('compression_start'); | |
// Set output type | |
$CI->output->set_header('Content-type: text/html; charset=utf-8'); | |
$buffer = $CI->output->get_output(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App::after(function($request, $response) | |
{ | |
// Compress output | |
ini_set("pcre.recursion_limit", "16777"); | |
$buffer = $response->getContent(); | |
$re = '%# Collapse whitespace everywhere but in blacklisted elements. | |
(?> # Match all whitespans other than single space. | |
[^\S ]\s* # Either one [\t\r\n\f\v] and zero or more ws, | |
| \s{2,} # or two or more consecutive-any-whitespace. | |
) # Note: The remaining regex consumes no text at all... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getLevels($cEXP) { | |
for($i = 1; ($i * $i + 2) * $i <= $cEXP; $i++); | |
return $i; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
****************************************************************************** | |
// Extends the CI Parser class to allow for language files to be parsed. | |
// With this instead of using <?php echo $this->lang->line('lineoftext'); ?> | |
// You can now use an underscore in your view files like so: {_lineoftext} | |
// Enjoy cleaner view files! | |
// Place this file in application/libraries/MY_Parser.php | |
****************************************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="print_retroplan_div" id="print_retroplan_div" style="display:none;"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Modified version of | |
# http://dtucker.co.uk/hack/bypassing-the-memory-check-on-a-vmware-esxi-5.html | |
# Boot the system from USB Stick / CD with ESXi installer on it. | |
# Once the installer welcome screen shows up, press ALT+F1 | |
# Login as "root", no password. | |
cd /usr/lib/vmware/weasel/util | |
mv upgrade_precheck.pyc upgrade_precheck.pyc.old | |
cp upgrade_precheck.py upgrade_precheck.py.old | |
chmod 666 upgrade_precheck.py.old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Libraries; | |
use DB; | |
class Slug { | |
// Create a unique slug | |
static function make($name, $table = null, $column = null) | |
{ | |
$valid = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i "s/RELEASE=.*/RELEASE=$(git log --pretty="%h" -n1 HEAD)/" .env |
OlderNewer