Skip to content

Instantly share code, notes, and snippets.

View martonbaranyai's full-sized avatar

Marton Baranyai martonbaranyai

  • Marketing Budget Ltd
  • Brighton, United Kingdom
View GitHub Profile
@martonbaranyai
martonbaranyai / openssl_encrypt_decrypt.php
Created September 11, 2017 13:05 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@martonbaranyai
martonbaranyai / CORS.php
Last active April 15, 2016 07:41
Laravel 5 CORS Access-Control-Allow-Origin middleware to help build mobile application backends
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Response;