See what formula are available.
brew search mysql==> Formulae| require 'json' | |
| require 'csv' | |
| hash = JSON.parse(File.read('querydata.json')) | |
| CSV.open('data.csv', 'w') do |csv| | |
| hash['results'].each do |result| | |
| data = result['result']['data'] | |
| descriptor = data['descriptor'] | |
| dsr = data['dsr'] |
| // Simple example, but the idea holds for more complex objects. | |
| /* 1) Start with OO */ | |
| // user.js | |
| class User { | |
| constructor(firstName, lastName, email) { | |
| this.firstName = firstName | |
| this.lastName = lastName |
| # Create a pod containing the PHP-FPM application (my-php-app) | |
| # and nginx, each mounting the `shared-files` volume to their | |
| # respective /var/www/html directories. | |
| kind: Pod | |
| apiVersion: v1 | |
| metadata: | |
| name: phpfpm-nginx-example | |
| spec: | |
| volumes: |
WordPress is popular because it's easy to setup without much technical know-how. However, to build a more robust PHP project with command line deployments, updates and ongoing maintenance, working with WordPress out-of-the-box raises specific challenges:
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: nginx-conf | |
| data: | |
| nginx.conf: | | |
| user nginx; | |
| worker_processes 3; | |
| error_log /var/log/nginx/error.log; | |
| events { |
| #! /usr/bin/env node | |
| const mason = require('commander'); | |
| const { version } = require('./package.json'); | |
| const console = require('console'); | |
| // commands | |
| const create = require('./commands/create'); | |
| const setup = require('./commands/setup'); |
| FROM python:3.6-slim-stretch | |
| ADD requirements.txt /tmp/requirements.txt | |
| RUN apt-get update && \ | |
| apt-get install -y \ | |
| build-essential \ | |
| make \ | |
| gcc \ | |
| locales \ |
| # Adapted from https://lobster1234.github.io/2017/12/03/run-tasks-with-aws-fargate-and-lambda/ | |
| import boto3 | |
| import os | |
| def lambda_handler(event,context): | |
| client = boto3.client('ecs') | |
| response = client.run_task( | |
| cluster=os.getenv('CLUSTER'), | |
| launchType=os.getenv('LAUNCH_TYPE', 'FARGATE'), |
| import {createServer} from 'http'; | |
| function waitForChromeToTerminate() { | |
| let retry = 5; | |
| return new Promise((resolve, reject) => { | |
| const server = createServer(); | |
| server.listen(9222); | |
| server.once('listening', () => { | |
| debug('Port is free') | |
| server.close(() => resolve()); | |
| }); |