For educational reasons I've decided to create my own CA. Here is what I learned.
Lets get some context first.
<?php | |
function validateCnpj($cnpj) | |
{ | |
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj); | |
if (strlen($cnpj) != 14) { | |
return false; | |
} | |
for ($i = 0, $j = 5, $sum = 0; $i < 12; $i++) { |
systems({ | |
"my-app": { | |
image: {"docker": "azukiapp/php-fpm"}, | |
provision: [ | |
// "composer install", | |
], | |
workdir: "/azk/#{manifest.dir}", | |
mounts: { | |
'/azk/#{manifest.dir}': path("."), | |
'/etc/nginx/sites-enabled/nginx_public.conf': path("./nginx_public.conf") |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
if Vagrant.has_plugin?("vagrant-cachier") | |
config.cache.scope = :box | |
else | |
puts "_Info_: Plugin '''vagrant-cachier''' is not installed." |
class SampleProduct | |
{ | |
/* implementation */ | |
public function setBougthBy(UserInterface $user) | |
{ | |
$this->bougthBy = $user; | |
} | |
} |
/* | |
Uses http://github.com/kylefox/jquery-modal to open video into modal box | |
*/ | |
var playlistId, key, maxResults, nextPageToken, prevPageToken; | |
playlistId = "playlistID"; | |
key = "apiConsumerKey"; | |
maxResults = 50; |
<?php | |
use Respect\Relational\Mapper; | |
use Respect\Relational\Sql; | |
// Create instance of Mapper | |
$mapper = new Mapper(new PDO('mysql:host=127.0.0.1;port=3306;dbname=blog','root','root')); | |
// Persisting data |
A list of amazingly awesome PHP libraries, resources and shiny things.
<?php | |
namespace Hussani\Entity; | |
use Respect\Relational\Mapper; | |
use PDO; | |
use DateTime; | |
class Post extends AbstractEntity | |
{ |