(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env node | |
| // todo: try to require jshint here, instead of spawning process, then fallback to spawning process. | |
| var jshint = nrequire('jshint'); | |
| if (jshint) return process.exit(0); | |
| // jshint not installed locally, spawn process instead. | |
| // basically the same, but less pretty. | |
| var exec = require('child_process').exec; |
| Initially, I found bitmasking to be a confusing concept and found no use for it. So I've whipped up this code snippet in case anyone else is confused: | |
| <?php | |
| // The various details a vehicle can have | |
| $hasFourWheels = 1; | |
| $hasTwoWheels = 2; | |
| $hasDoors = 4; | |
| $hasRedColour = 8; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| import React from "react" | |
| import { Route, Switch } from "react-router-dom" | |
| const AppRoute = ({ component: Component, layout: Layout, ...rest }) => ( | |
| <Route {...rest} render={props => ( | |
| <Layout> | |
| <Component {...props} /> | |
| </Layout> | |
| )} /> | |
| ) |
| <?php declare(strict_types=1); | |
| namespace App\Factory; | |
| use Psr\Http\Message\RequestInterface; | |
| use Psr\Http\Message\ResponseInterface; | |
| use Tuupola\Middleware\Cors; | |
| use Zend\Diactoros\Response; | |
| use Zend\Diactoros\Response\JsonResponse; | |
| use Zend\ProblemDetails\ProblemDetailsResponseFactory; | |
| use Zend\Stratigility\Middleware\CallableMiddlewareWrapper; |
| <?php | |
| /** | |
| * This script performs a full dump of a database query into | |
| * CSV format and pipes it directly to the browser. | |
| * | |
| * - YES, the browser will save the CSV file to disk | |
| * - YES, it should support large files without using massive amounts of memory | |
| * - YES, it compresses the request using GZIP to reduce download time | |
| */ |
| image: docker:latest | |
| variables: | |
| REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME> | |
| REGION: eu-central-1 | |
| TASK_DEFINTION_NAME: <TASK DEFINITION NAME> | |
| CLUSTER_NAME: <CLUSTER NAME> | |
| SERVICE_NAME: <SERVICE NAME> | |
| services: |
We will assume we have a package/project called https://github.com/foo/bar
Most redistributable packages are hosted on a version control website such as Github or Bitbucket. Version control repositories often have a tagging system where we can define stable versions of our application. For example with git we can use the command:
git tag -a 1.0.0 -m 'First version.'
With this we have created version 1.0.0 of our application. This is a stable release which people can depend on. If we wanted to include "foo/bar" then we could create a composer.json and specify the tagged release we wanted: