Skip to content

Instantly share code, notes, and snippets.

imuneer /
Created May 10, 2020 — forked from demisang/
AES/CBC/PKCS5Padding encrypt/decrypt PHP and JAVA example classes
import android.util.Base64;
import java.nio.ByteBuffer;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
# taken from
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
imuneer / .htaccess
Created Oct 25, 2016 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
# Sublime Text 3 install with Package Control (last update: 12 July 2015)
# No need to download this script, just run it on your terminal:
# $ curl -L | sh
# When you need to update Sublime Text, run this script again.
imuneer / UnauthorizedStrategy.php
Created May 20, 2015
BjyAuthorize's UnauthorizedStrategy to redirect guest to login page and other user not having permission to specific route to home
View UnauthorizedStrategy.php
namespace Application\View;
use BjyAuthorize\Service\Authorize;
use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\ListenerAggregateInterface;
use Zend\Http\Response as HttpResponse;
use Zend\Mvc\MvcEvent;
use Zend\Stdlib\ResponseInterface as Response;