(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.
| function getRemoteMimeType($url) { | |
| $ch = curl_init($url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| curl_exec($ch); | |
| # get the content type | |
| return curl_getinfo($ch, CURLINFO_CONTENT_TYPE); | |
| } |
| /* | |
| 1. Create a folder named "email" within "tinymce/plugins". | |
| 2. Create a file called "plugin.min.js" within the folder. | |
| 2. Paste the below code inside "tinymce/plugins/email/plugin.min.js" | |
| 3. Extend your tiny.init like: | |
| tinymce.init({ | |
| plugins: "email", | |
| toolbar: "email" |
| /** | |
| * AngularJS SPA Sample using Authenticator service with Session model | |
| * | |
| * @author Thomas Burleson | |
| * | |
| */ | |
| (function( angular ){ | |
| "use strict"; | |
| /** |
(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.
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
| #!/bin/bash | |
| # Check if command was ran as root. | |
| if [[ $(id -u) -eq 0 ]]; then | |
| echo "The command \"sphp\" should not be executed as root or via sudo directly." | |
| echo "When a service requires root access, you will be prompted for a password as needed." | |
| exit 1 | |
| fi | |
| # Usage |
| <?php | |
| namespace app\models; | |
| use yii\base\Model; | |
| use Yii; | |
| /** | |
| * Simplified model with validation rules. | |
| * All characters are allowed (you want emojis in the password? Go ahead). |
| if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value } |
This recipe is useful for cooking up chained API calls as a result of a single action.
In the below example, a single action called POST_REPO is dispatched and it's intention is to create a new repostiory on GitHub then update the README with new data after it is created.
For this to happen there are 4 API calls necessary to the GitHub API: