Real unit test (isolation, no children render)
Calls:
- constructor
- render
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
### Generic Dockerfile demonstrating good practices | |
### Imports | |
# Bad-ish, we do not need Ubuntu for this, nor do we want latest if we are using in a build system, predictable is better | |
FROM ubuntu:latest | |
# Better, using a small image since our app has no dependency on Ubuntu | |
FROM alpine:3.3 |
# selenium webdriver API: http://selenium-python.readthedocs.org/api.html | |
import time | |
import json | |
import sys | |
from selenium import webdriver | |
from selenium.common import exceptions | |
class Webpage(object): | |
"""A headless PhantomJS page running the formular page""" |
I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).
Use ssh keys and define host aliases in ssh config file (each alias for an account).
#!/bin/bash | |
# Download the magic file. | |
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
# Add to ~/.bash_profile file the following 'execute if it exists' code: | |
cat <<EOT >> ~/.bash_profile | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi |
<snippet> | |
<content><![CDATA[ | |
<!-- begin $1 --> | |
<div class="$1"> | |
$2 | |
</div> | |
<!-- end $1 --> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>di</tabTrigger> |
http://xdebug.org/install.php#configure-php | |
http://blog.jetbrains.com/phpstorm/2013/08/debugger-configuration-validation-with-phpstorm/ | |
on CentOS: | |
1. You need to install PHP’s devel package for PHP commands execution | |
yum install php-devel | |
yum install php-pear | |
2. Next install GCC and GCC C++ compilers to compile Xdebug extension yourself. | |
yum install gcc gcc-c++ autoconf automake |
#!/usr/bin/perl | |
use lib (split(/:/, $ENV{GITPERLLIB} || "/usr/share/perl/5.14.2")); | |
use 5.008; | |
use strict; | |
use warnings; | |
use Git; | |
binmode(STDOUT, ":raw"); |