-
Open the Terminal
-
Use
mysqldump
to backup your databases -
Check for MySQL processes with:
ps -ax | grep mysql
-
Stop and kill any MySQL processes
-
Analyze MySQL on HomeBrew:
brew remove mysql
# Shell script to create a complete Django project. | |
# This script require Python 3.x and pyenv and Django 1.10 | |
# The project contains: | |
# Settings config | |
# Person model and form | |
# Person list and detail | |
# Person create, update and delete | |
# Admin config | |
# Tests |
// Just empty macbook.local.err file then restart the server | |
rm /usr/local/var/mysql/macbook.local.err | |
mysql.server start |
$mapa = ['01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25'] | |
$xmap1 = Array.new | |
$xmap2 = Array.new | |
$xmap3 = Array.new | |
$xmap4 = Array.new | |
# ---------------------------------------------------------------------------- | |
def formata(palavra) | |
if palavra.size != 2 | |
palavra = "0" + palavra |
<?php | |
require('parser.php'); | |
define('BOT_TOKEN', 'SEU TOKEN'); | |
define('API_URL', 'https://api.telegram.org/bot'.BOT_TOKEN.'/'); | |
function processMessage($message) { | |
// processa a mensagem recebida | |
$message_id = $message['message_id']; |
<?php | |
namespace App\Support\ViewPresenter; | |
trait PresentableTrait | |
{ | |
/** | |
* View presenter instance. | |
* | |
* @var mixed |
I recently had the need to write a small url shortening application. I am aware that this problem has been solved quite a few times before, but what is being a developer if not reinventing the wheel just for the heck of it? Custom CMS anyone?
Knowing that this was going to be a tiny RESTful API and also knowing that Laravel 5.2 had API rate limiting built in, I was eager to give it a try. Taylor Otwell being Taylor Otwell shipped 5.2 with the rate limiting defaults set up out of the box and I had my application building out short url's in a matter of minutes. The problem for me came when I wanted to start associating those short urls with a user.
Typically my applications have a UI and authentication is done through a simple login page. Obviously for a RESTful API, having a login page isn't ideal. Instead, my hope was to have users append an api_token
to the end of their query string and use that to auth
The process starts by creating the CSR and the private key:
openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"
Generates
<?php namespace App\Services\Jwt\Exceptions; | |
class BeforeValidException extends \UnexpectedValueException { } |
<?php | |
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php | |
/** | |
* The root directory where the repos live. | |
* | |
* @var string | |
*/ | |
$root_dir = '/your/root/dir/'; |