Things I wish I knew before I started using Docker
boot2docker init
boot2docker up
// Add a 401 response interceptor | |
window.axios.interceptors.response.use(function (response) { | |
return response; | |
}, function (error) { | |
if (401 === error.response.status) { | |
swal({ | |
title: "Session Expired", | |
text: "Your session has expired. Would you like to be redirected to the login page?", | |
type: "warning", | |
showCancelButton: true, |
<?php | |
use Swagger\Annotations as SWG; | |
/** | |
* @SWG\Swagger( | |
* basePath="/v1", | |
* host="api.local", | |
* schemes={"http"}, | |
* produces={"application/json"}, |
<?php | |
define('E_FATAL', E_ERROR | E_USER_ERROR | E_PARSE | E_CORE_ERROR | | |
E_COMPILE_ERROR | E_RECOVERABLE_ERROR); | |
define('ENV', 'dev'); | |
//Custom error handling vars | |
define('DISPLAY_ERRORS', TRUE); | |
define('ERROR_REPORTING', E_ALL | E_STRICT); |
FROM node:8.15-alpine | |
RUN apk --no-cache add git | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . |
<?php | |
/** | |
* Created by PhpStorm. | |
* User: markokunic | |
* Date: 4/21/17 | |
* Time: 3:41 PM | |
*/ | |
namespace AppBundle\Exporter; |
<?php | |
namespace Traits\Tests; | |
/** | |
* Mocks the entity manager | |
* | |
* Provides everything in the memory, so the tests does not depend on doctrine, | |
* which does a lot of stuff (maybe too much). This also allows to avoid to | |
* need and modify the data in the database, even if those are for the tests. |
Getting an error after migrating to a new system when adding private keys to ssh-agent | |
/usr/bin/keychain -q --nogui $HOME/.ssh/id_rsa.key | |
* Error: Problem adding; giving up | |
Manually adding the key shows a permission problem | |
ssh-add ~/.ssh/id_rsa.key | |
chmod 700 /home/pwi/.ssh/*.key | |
In .bashrc |
Follow these steps below to enable multiple SSH keys on your device with UNIX Based OS (MacOS/ Ubuntu/ Debian etc.). Suppose, you have two different users/ accounts, one is personalAccount
and another is companyAccount
. And you have already a default key configured with personalAccount
. (If you haven't set up your default ssh-key yet, please follow this article before going ahead with these steps described below.)
Generate a new ssh-key for your companyAccount
.
cd ~/.ssh
ssh-keygen -t rsa -C "[email protected]"
<?php | |
// Code with the security issue | |
// Connect to the database | |
$mysqli = new mysqli ("localhost", "username", "password", "database"); | |
// Check for errors | |
if ($mysqli->connect_error) { | |
die("Connection failed: ". $mysqli->connect_error);} | |
// Get the user input from a GET request | |
$user_id = $_GET['user_id']; |