<?php
function randHash($len=32)
{
return substr(md5(openssl_random_pseudo_bytes(20)),-$len);
}
This file contains hidden or 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
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |
This file contains hidden or 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
| Route::get('redis', array('as' => 'cache', 'do' => function() | |
| { | |
| $redis = Redis::connection(); | |
| //STRING | |
| $redis->set('name', 'Taylor'); | |
| $name = $redis->get('name'); | |
| // LIST | |
| // A list is a series of ordered values. Some of the important commands for interacting with lists are RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP. |
This file contains hidden or 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
| Regular expression cheat sheet for Varnish | |
| Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
| regular expressions, for a complete guide, see: "man 7 regex" | |
| Basic matching: | |
| req.url ~ "searchterm" | |
| True if req.url contains "searchterm" anywhere. | |
| req.url == "searchterm" |
This file contains hidden or 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 | |
| /** | |
| * Split PDF file | |
| * | |
| * <p>Split all of the pages from a larger PDF files into | |
| * single-page PDF files.</p> | |
| * | |
| * @package FPDF required http://www.fpdf.org/ | |
| * @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/ |
This file contains hidden or 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 Pokus; | |
| class Exception extends \Exception | |
| { | |
| } | |
| function tttt($string) | |
| { | |
| try { |
NewerOlder