Setup pre-commit hook in php projects for lint, code standard, test cases etc.
- php >= 5.6
- composer
- git
| *auth_socket* If you install 5.7 and don’t provide a password to the root user, it will use the auth_socket plugin. That plugin doesn’t care and doesn’t need a password. It just checks if the user is connecting using a UNIX socket and then compares the username. | |
| *mysql_native_password* | |
| If we want to configure a password, we need to change the plugin and set the password at the same time, in the same command. First changing the plugin and then setting the password won’t work, and it will fall back to auth_socket again | |
| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'test'; | |
| Normal change password for root mysql.user: ALTER USER 'root'@'localhost' IDENTIFIED BY '2DEyjZKiN6'; |
| const puppeteer = require('puppeteer'); | |
| const cheerio = require('cheerio'); | |
| (async () => { | |
| const browser = await puppeteer.launch({headless: false, devtools: true}) | |
| const page = await browser.newPage() | |
| await page.goto('https://dantri.com.vn/') | |
| //https://github.com/cheeriojs/cheerio | |
| let content = await page.content(); |
| // polyfill window.getMatchedCSSRules() in FireFox 6+ | |
| if (typeof window.getMatchedCSSRules !== 'function') { | |
| var ELEMENT_RE = /[\w-]+/g, | |
| ID_RE = /#[\w-]+/g, | |
| CLASS_RE = /\.[\w-]+/g, | |
| ATTR_RE = /\[[^\]]+\]/g, | |
| // :not() pseudo-class does not add to specificity, but its content does as if it was outside it | |
| PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g, | |
| PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g; | |
| // convert an array-like object to array |
| <?php | |
| /** | |
| * @author Henrik Hofmeister | |
| * @license MIT | |
| * @version 1.0 | |
| * | |
| * XmlRPC using SimpleXML and CURL | |
| * | |
| * Usage: | |
| * |
| <?php | |
| use Illuminate\Foundation\Http\FormRequest; | |
| use Illuminate\Validation\Rules\Unique; | |
| class RegisterRequest extends FormRequest | |
| { | |
| const NAME_MAX_LENGTH = 255; | |
| const EMAIL_MAX_LENGTH = 255; | |
| const PASSWORD_MIN_LENGTH = 8; |
sudo apt-get update && apt-get install -y apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
// Open the /etc/apt/sources.list.d/docker.list and add the following line then save it
// Ubuntu 14.04
deb https://apt.dockerproject.org/repo ubuntu-trusty main
// Ubuntu 16.04
| "encodingJob": { | |
| "M": { | |
| "Role": { | |
| "S": "arn:aws:iam::test:role/vod-test-MediaConvertRole-5I6IRWVD5W20" | |
| }, | |
| "UserMetadata": { | |
| "M": { | |
| "workflow": { | |
| "S": "vod-test" | |
| }, |
| /** | |
| * @author richt / http://richt.me | |
| * @author WestLangley / http://github.com/WestLangley | |
| * | |
| * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html) | |
| */ | |
| THREE.DeviceOrientationControls = function( object ) { | |
| var scope = this; |