text:
---

copyright:

  years: 2015,2017

lastupdated: "2016-06-20"

---

{:codeblock: .codeblock}
{:shortdesc: .shortdesc}
{:new_window: target="_blank"}

# Plug-in VPN pour l'interface de ligne de commande {{site.data.keyword.Bluemix_notm}}

*Version :* 1.4.0

Vous pouvez utiliser l'interface de ligne de commande pour configurer et gérer votre service {{site.data.keyword.vpn_full}}. Le plug-in VPN d'interface de ligne de commande est disponible dans deux versions, l'une est destinée à être utilisée avec le plug-in d'interface de ligne de commande Cloud Foundry et l'autre avec le plug-in d'interface de ligne de commande {{site.data.keyword.Bluemix}}. Les deux versions du plug-in fournissent la même fonctionnalité.
{:shortdesc}

Le plug-in VPN est disponible pour les systèmes d'exploitation Windows, MAC et Linux. Assurez-vous d'utiliser celui qui vous correspond.

Les instructions qui suivent s'appliquent au plug-in CLI {{site.data.keyword.Bluemix_notm}}. Pour utiliser le plug-in avec le plug-in d'interface de ligne de commande Cloud Foundry (cf), voir [Plug-in d'interface de ligne de commande VPN pour l'interface de ligne de commande cf](../vpn/index.html).

Vous trouverez ci-après la liste de toutes les commandes qui sont prises en charge par le plug-in VPN pour l'interface de ligne de commande Bluemix, ainsi que leurs noms, leurs options, leur syntaxe, leurs prérequis, leurs descriptions et des exemples. Pour savoir comment installer le plug-in VPN, voir [Etendez votre interface de ligne de commande Bluemix](../../index.html#cli_bluemix_ext).

**Remarque :** la zone *Prérequis* répertorie les actions qui sont requises avant l'utilisation de la commande. Il
peut s'agir d'une ou de plusieurs des actions suivantes :

**Noeud final**

Un noeud final d'API doit être défini via `bluemix api` avant l'utilisation de la commande.

**Connexion**

La connexion avec la commande `bluemix login` est requise avant l'utilisation de cette commande.

**Cible**

La commande `bluemix target` doit être utilisée pour définir une organisation et un espace avant l'utilisation de cette commande.

## bluemix vpn connection-create
Crée une connexion de réseau privé virtuel.

```
bluemix vpn connection-create NOM_CONNEXION -g NOM_PASSERELLE -k CLE_PRE-PARTAGEE -subnets "SOUS-RESEAU/MASQUE" -cip ADRESSE_IP_PASSERELLE_CLIENT [-d DESCRIPTION] [-peer_id ID_HOMOLOGUE] [-admin_state ETAT_ADMIN] [-dpd-action ACTION] [-gateway_ip ADRESSE_IP] [-i ETAT_INITIATEUR] [-dpd-timeout VALEUR] [-dpd-interval VALEUR] [-ike NOM] [-ipsec NOM]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_CONNEXION* (requis) : nom de la connexion.

-g *NOM_PASSERELLE* (requis) : nom de la passerelle.

-k *CLE_PRE-PARTAGEE* (requis) : clé pré-partagée.

-subnets "*SOUS-RESEAU*/*MASQUE*" (requis) : adresse de sous-réseau distant au format CIDR.

-cip *ADRESSE_IP_PASSERELLE_CLIENT* (requis) : adresse IP de noeud final distant du tunnel VPN.

-d *DESCRIPTION* (facultatif) : description des paramètres spécifiés.

-peer_id *ID_HOMOLOGUE* (facultatif) : ID de l'homologue distant. Autre noeud final du tunnel VPN.

-admin_state *ETAT_ADMIN* (facultatif) : statut de la connexion de réseau privé virtuel. Les valeurs admises sont `UP`
et `DOWN`.

-dpd-action *ACTION*  (facultatif) :  action à effectuer lorsque l'homologue est identifié comme non opérationnel. Les valeurs admises sont
`hold`, `clear`, `disabled`, `restart` et `restart-by-peer`. La
valeur par défaut est `hold`.

-gateway_ip *ADRESSE_IP* (facultatif) : adresse IP du noeud final de tunnel VPN local.

-i *ETAT_INITIATEUR* (facultatif) : état de l'initiateur. La valeur par défaut est `bi-directional`.

-dpd-timeout *VALEUR* (facultatif) : valeur de délai en secondes au bout duquel la session est terminée. Plage : 6 à 86400 secondes. La
valeur par défaut est `120` secondes.

-dpd-interval *VALEUR* (facultatif) : intervalle de signal de présence en secondes. Envoyez des messages d'état actif à la fréquence
configurée afin de vérifier l'état opérationnel de l'homologue. Plage : 5 à 86399 secondes. La valeur par défaut est `15` secondes.

-ike *NOM* (facultatif) : nom de la règle IKE (Internet Key Exchange).

-ipsec *NOM* (facultatif) : nom de la règle IPSec (Internet Protocol Security).

**Exemples** :

Créez une connexion de réseau privé virtuel dont le nom est `ma_connexion` :
```
bluemix vpn connection-create ma_connexion -g ma_passerelle -k 123456 -subnets "192.168.10.0/24" -cip 162.135.1.1
```

## bluemix vpn ike-create
Crée une règle IKE (Internet Key Exchange).

```
bluemix vpn ike-create NOM_REGLE -g NOM_PASSERELLE [-d DESCRIPTION] [-pfs GROUPE] [-e ALGORITHME_CHIFFREMENT] [-lv VALEUR_DUREE_VIE]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IKE (Internet Key Exchange).

-g *NOM_PASSERELLE* (requis) : nom de la passerelle.

-d *DESCRIPTION* (facultatif) : description des paramètres spécifiés.

-pfs *GROUPE* (facultatif) : identificateur de groupe Diffie-Hellman (DH). Les valeurs admises sont `Group2`,
`Group5` et `Group14`. La valeur par défaut est `Group2`.

-e *ALGORITHME_CHIFFREMENT* (facultatif) : algorithme de chiffrement. Les valeurs admises sont `aes-128`,
`aes-192`, `aes-256` et `3des`. La valeur par défaut est `aes-128`.

-lv *VALEUR_DUREE_VIE* (facultatif) : valeur de durée de vie de l'association de sécurité IKE (Internet Key Exchange). Plage : 60 à 86400 secondes. La valeur par défaut est `86400` secondes.

**Exemples** :

Créez une règle IKE (Internet Key Exchange) dont le nom est `mon_ike` :
```
bluemix vpn ike-create mon_ike -g ma_passerelle
```

## bluemix vpn ipsec-create
Crée une règle IPSec (Internet Protocol Security).

```
bluemix vpn ipsec-create NOM_REGLE -g NOM_PASSERELLE [-d DESCRIPTION] [-pfs GROUPE] [-e ALGORITHME_CHIFFREMENT] [-lv VALEUR_DUREE_VIE]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IPSec (Internet Protocol Security).

-g *NOM_PASSERELLE* (requis) : nom de la passerelle.

-d *DESCRIPTION* (facultatif) : description des paramètres spécifiés.

-pfs *GROUPE* (facultatif) : identificateur de groupe Diffie-Hellman (DH). Les valeurs admises sont `Group2`,
`Group5` et `Group14`. La valeur par défaut est `Group2`.

-e *ALGORITHME_CHIFFREMENT* (facultatif) : algorithme de chiffrement. Les valeurs admises sont `aes-128`,
`aes-192`, `aes-256` et `3des`. La valeur par défaut est `aes-128`.

-lv *VALEUR_DUREE_VIE* (facultatif) : valeur de durée de vie de l'association de sécurité. Plage : 60 à 86400 secondes. La valeur par
défaut est `3600` secondes.

**Exemples** :

Créez une règle IPSec (Internet Protocol Security) dont le nom est `ma_règle` :
```
bluemix vpn ipsec-create ma_règle -g ma_passerelle
```

## bluemix vpn gateway-create
Crée une passerelle de réseau privé virtuel.

```
bluemix vpn gateway-create NOM_PASSERELLE -t TYPE [-gateway_ip ADRESSE_IP] [-subnets ADRESSE_SOUS-RESEAU]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_PASSERELLE* (requis) : nom de la passerelle.

-t *TYPE* (requis) : conteneurs pour lesquels activer le service. Les valeurs admises sont `allSingleContainers`,
`allContainerGroups` et `allContainers`. Aucune valeur par défaut ; vous devez spécifier un type.

-gateway_ip *ADRESSE_IP* (facultatif) : adresse IP de la passerelle.

-subnets *ADRESSE_SOUS-RESEAU* (facultatif) : adresse de sous-réseau au format CIDR.

**Exemples** :

Créez une passerelle dont le nom est `ma_passerelle` et le type `allContainerGroups` :
```
bluemix vpn gateway-create ma_passerelle -t allContainerGroups
```

## bluemix vpn connections
Affiche des informations sur toutes les connexions en cours.

```
bluemix vpn connections
```

**Prérequis** : Noeud final, Connexion, Cible

## bluemix vpn ikes
Affiche des informations sur les connexions IKE (Internet Key Exchange) en cours.

```
bluemix vpn ikes
```

**Prérequis** : Noeud final, Connexion, Cible

## bluemix vpn ipsecs
Affiche des informations sur les connexions IPSec (Internet Protocol Security) en cours.

```
bluemix vpn ipsecs
```

**Prérequis** : Noeud final, Connexion, Cible

## bluemix vpn gateways
Affiche des informations sur les passerelles en cours.

```
bluemix vpn gateways
```

**Prérequis** : Noeud final, Connexion, Cible

## bluemix vpn connection
Affiche toutes les informations sur une connexion particulière.

```
bluemix vpn connection NOM_CONNEXION
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_CONNEXION* (requis) : nom de la connexion à afficher.

## bluemix vpn ike
Affiche des informations sur une connexion IKE (Internet Key Exchange).

```
bluemix vpn ike NOM_REGLE
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IKE (Internet Key Exchange) à afficher.

## bluemix vpn ipsec
Affiche des informations sur une connexion IPSec (Internet Protocol Security).

```
bluemix vpn ipsec NOM_REGLE
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IPSec (Internet Protocol Security) à afficher.

## bluemix vpn gateway
Affiche les informations de connexion d'une passerelle.

```
bluemix vpn gateway NOM_PASSERELLE
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_PASSERELLE* (requis) : nom de la passerelle à afficher.

## bluemix vpn connection-delete
Supprime une connexion existante.

```
bluemix vpn connection-delete NOM_CONNEXION
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_CONNEXION* (requis) : nom de la connexion à supprimer.

## bluemix vpn ike-delete
Supprime une règle IKE (Internet Key Exchange) existante.

```
bluemix vpn ike-delete NOM_REGLE
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IKE (Internet Key Exchange) à supprimer.

## bluemix vpn ipsec-delete
Supprime une règle IPSec (Internet Protocol Security) existante.

```
bluemix vpn ipsec-delete NOM_REGLE
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IPSec (Internet Protocol Security) à supprimer.

## bluemix vpn gateway-delete
Supprime une passerelle existante.

```
bluemix vpn gateway-delete NOM_PASSERELLE
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_PASSERELLE* (requis) : nom de la passerelle à supprimer.

## bluemix vpn connection-update
Met à jour une connexion de réseau privé virtuel existante.

```
bluemix vpn connection-update NOM_CONNEXION [-g NOM_PASSERELLE] [-k CLE_PRE-PARTAGEE] [-subnets "SOUS-RESEAU/MASQUE"] [-cip ADRESSE_IP_PASSERELLE_CLIENT] [-d DESCRIPTION] [-peer_id ID_HOMOLOGUE] [-admin_state ETAT_ADMIN] [-dpd-action ACTION] [-gateway_ip ADRESSE_IP] [-i ETAT_INITIATEUR] [-dpd-timeout VALEUR] [-dpd-interval VALEUR] [-ike NOM] [-ipsec NOM]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_CONNEXION* (requis) : nom de la connexion.

-g *NOM_PASSERELLE* (facultatif) : nom de la passerelle.

-k *CLE_PRE-PARTAGEE* (facultatif) : clé pré-partagée.

-subnets "*SOUS-RESEAU*/*MASQUE*" (facultatif) : adresse de sous-réseau au format CIDR.

-cip *ADRESSE_IP_PASSERELLE_CLIENT* (facultatif) : adresse IP de noeud final distant du tunnel VPN.

-d *DESCRIPTION* (facultatif) : description des paramètres spécifiés.

-peer_id *ID_HOMOLOGUE* (facultatif) : ID de l'homologue distant. Autre noeud final du tunnel VPN.

-admin_state *ETAT_ADMIN* (facultatif) : statut de la connexion de réseau privé virtuel. Les valeurs admises sont `UP`
et `DOWN`.

-dpd-action *ACTION*  (facultatif) :  action à effectuer lorsque l'homologue est identifié comme non opérationnel. Les valeurs admises sont
`hold`, `clear`, `disabled`, `restart` et `restart-by-peer`.

-gateway_ip *ADRESSE_IP* (facultatif) : adresse IP du noeud final de tunnel VPN local.

-i *ETAT_INITIATEUR* (facultatif) : état de l'initiateur.

-dpd-timeout *VALEUR* (facultatif) : valeur de délai en secondes au bout duquel la session est terminée. Plage : 6 à 86400 secondes.

-dpd-interval *VALEUR* (facultatif) : intervalle de signal de présence en secondes. Envoyez des messages d'état actif à la fréquence
configurée afin de vérifier l'état opérationnel de l'homologue. Plage : 5 à 86399 secondes.

-ike *NOM* (facultatif) : nom de la règle IKE (Internet Key Exchange).

-ipsec *NOM* (facultatif) : nom de la règle IPSec (Internet Protocol Security).

## bluemix vpn ike-update
Met à jour une règle IKE (Internet Key Exchange).

```
bluemix vpn ike-update NOM_REGLE [-g NOM_PASSERELLE] [-d DESCRIPTION] [-pfs GROUP] [-e ALGORITHME_CHIFFREMENT] [-lv VALEUR_DUREE_VIE]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IKE (Internet Key Exchange).

-g *NOM_PASSERELLE* (facultatif) : nom de la passerelle.

-d *DESCRIPTION* (facultatif) : description des paramètres spécifiés.

-pfs *GROUPE* (facultatif) : identificateur de groupe Diffie-Hellman (DH). Les valeurs admises sont `Group2`,
`Group5` et `Group14`.

-e *ALGORITHME_CHIFFREMENT* (facultatif) : algorithme de chiffrement. Les valeurs admises sont `aes-128`,
`aes-192`, `aes-256` et `3des`.

-lv *VALEUR_DUREE_VIE* (facultatif) : valeur de durée de vie de l'association de sécurité IKE (Internet Key Exchange). Plage : 60 à 86400 secondes.

## bluemix vpn ipsec-update
Met à jour une règle IPSec (Internet Protocol Security).

```
bluemix vpn ipsec-update NOM_REGLE [-g NOM_PASSERELLE] [-d DESCRIPTION] [-pfs GROUPE] [-e ALGORITHME_CHIFFREMENT] [-lv VALEUR_DUREE_VIE]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_REGLE* (requis) : nom de la règle IPSec (Internet Protocol Security).

-g *NOM_PASSERELLE* (facultatif) : nom de la passerelle.

-d *DESCRIPTION* (facultatif) : description des paramètres spécifiés.

-pfs *GROUPE* (facultatif) : identificateur de groupe Diffie-Hellman (DH). Les valeurs admises sont `Group2`,
`Group5` et `Group14`.

-e *ALGORITHME_CHIFFREMENT* (facultatif) : algorithme de chiffrement. Les valeurs admises sont `aes-128`,
`aes-192`, `aes-256` et `3des`.

-lv *VALEUR_DUREE_VIE* (facultatif) : valeur de durée de vie de l'association de sécurité. Plage : 60 à 86400 secondes.

## bluemix vpn gateway-update
Met à jour une passerelle de réseau privé virtuel existante.

```
bluemix vpn gateway-update NOM_PASSERELLE [-t TYPE] [-gateway_ip ADRESSE_IP] [-subnets ADRESSE_SOUS-RESEAU]
```

**Prérequis** : Noeud final, Connexion, Cible

**Options de commande** :

*NOM_PASSERELLE* (requis) : nom de la passerelle.

-t *TYPE* (facultatif) : conteneurs pour lesquels activer le service. Les valeurs admises sont `allSingleContainers`,
`allContainerGroups` et `allContainers`.

-gateway_ip *ADRESSE_IP* (facultatif) : adresse IP de la passerelle.

-subnets *ADRESSE_SOUS-RESEAU* (facultatif) : adresse de sous-réseau au format CIDR.


text:
Designing and testing emails is a pain. HTML tables, inline CSS, various devices and clients to test, and varying support for the latest web standards.

This grunt task helps simplify things at the design stage.

1. Compiles your SCSS to CSS

2. Builds your HTML and TXT email templates

3. Inlines your CSS

4. Uploads any images to a CDN (optional)

5. Sends you a test email to your inbox (optional)

## Requirements

* Node.js - [Install Node.js](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)
* Grunt-cli and Grunt (`npm install grunt-cli -g`)
* Ruby - [Install ruby with RVM](https://rvm.io/rvm/install)
* Premailer (`gem install premailer hpricot nokogiri`) - Inlines the CSS
* [Mailgun](http://www.mailgun.com) (optional) - Sends the email
* [Litmus](https://litmus.com) (optional) - Tests the email across all clients/browsers/devices
* [Rackspace Cloud](http://www.rackspace.com/cloud/files/) (optional) - Uses Cloud Files as a CDN

## Getting started

If you haven't used [Grunt](http://gruntjs.com/) before check out Chris Coyier's post on [getting started with Grunt](http://24ways.org/2013/grunt-is-not-weird-and-hard/).

Clone this repo, cd to the directory, run `npm install` to install the necessary packages.

```
git clone https://github.com/leemunroe/grunt-email-design.git
cd grunt-email-design
npm install
grunt
```

### Sensitive Information
We encourage you __not__ to store sensitive data in your git repository. If you must, please look into [git-encrypt](https://github.com/shadowhand/git-encrypt) or some other method of encrypting your configuration secrets.

1. Create a file `secrets.json` in your project root.
2. Paste the following sample code in `secrets.json` and enter the appropriate credentials for the services you want to connect with. It's ok to leave these defaults, but they should exist.

```
{
  "mailgun": {
    "api_key": "YOUR MG PRIVATE API KEY",
    "sender": "E.G. POSTMASTER@YOURDOMAIN.COM",
    "recipient": "WHO YOU WANT TO SEND THE EMAIL TO"
  },
  "litmus": {
    "username": "LITMUS USER NAME",
    "password": "LITMUS PASS",
    "company": "LITMUS COMPANY/API SUBDOMAIN NAME"
  },
  "cloudfiles": {
    "user": "CLOUDFILES USERNAME",
    "key": "CLOUDFILES KEY",
    "region": "CLOUDFILES REGION E.G. ORD",
    "container": "CLOUDFILES CONTAINER NAME",
    "uri": "CLOUDFILES URI"
  },
  "s3": {
    "key": "AMAZON S3 KEY",
    "secret": "AMAZON S3 SECRET",
    "region": "AMAZON S3 REGION",
    "bucketname": "AMAZON S3 BUCKET NAME",
    "bucketdir": "AMAZON S3 BUCKET SUBDIRECTORY (optional)",
    "bucketuri": "AMAZON S3 PATH (ex: https://s3.amazonaws.com/)"
  }
}
```

## How it works

### CSS

This project uses [SCSS](http://sass-lang.com/). You don't need to touch the .css files, these are compiled automatically.

For changes to CSS, modify the `.scss` files.

Media queries and responsive styles are in a separate style sheet so that they don't get inlined. Note that only a few clients support media queries e.g. iOS Mail app.

### Email templates and content

Handlebars and Assemble are used for templating.

`/layouts` contains the standard header/footer HTML markup. You most likely will only need one layout template, but you can have as many as you like.

`/emails` is where your email content will go. To start you off I've included example transactional emails based on my [simple HTML email template](https://github.com/leemunroe/html-email-template).

`/data` contains _optional_ .yml or .json data files that can be used in your templates. It's a good way to store commonly used strings. See `/data/default.yml` and `/partials/follow_lee.hbs` for an example.

`/partials` contains _optional_ .hbs files that can be thought of like includes. To use a partial, for example `/partials/follow_lee.hbs` you would use the following code in your emails template:

```
{{> follow_lee }}
```

### Generate your email templates

In terminal, run `grunt`. This will:

* Compile your SCSS to CSS
* Generate your email layout and content
* Inline your CSS

See the output HTML in the `dist` folder. Open them and preview it the browser.

Alternatively run `grunt watch`. This will check for any changes you make to your .scss and .hbs templates, then automatically run the tasks. Saves you having to run grunt every time.

### Send the email to yourself

* Sign up for a [Mailgun](http://www.mailgun.com) account (it's free)
* Insert your Mailgun API key, either in `Gruntfile.js` or `secrets.json`
* Change the sender and recipient to your own email address (or whoever you want to send it to)

Run `grunt send --template=TEMPLATE_NAME.html`. This will email out the template you specify.

Change 'transaction.html' to the name of the email template you want to send.

### How to test with Litmus

If you have a [Litmus](http://www.litmus.com) account and want to test the email in multiple clients/devices:

* Open up `Gruntfile.js` or `secrets.json`
* Replace `username`, `password` and `yourcompany` under the Litmus task with your credentials

Run `grunt litmus --template=TEMPLATE_NAME.html` to send the email to Litmus. This will create a new test using the `<title>` value of your template.

[See the Litmus results](https://litmus.com/pub/eb33459/screenshots) for the simple transactional email template that is included.

### CDN and working with image assets

If your email contains images you'll want to serve them from a CDN. This Gruntfile has support for Rackspace Cloud Files ([pricing](http://www.rackspace.com/cloud/files/pricing/)).

* Sign up for a Rackspace Cloud account (use the [Developer Discount](http://developer.rackspace.com/devtrial/) for $300 credit)
* Create a new Cloud Files container
* Open up `Gruntfile.js` or `secrets.json`
* Change 'cloudfiles' settings to your settings (you can find your Rackspace API key under your account settings)
* Make any other config changes as per [grunt-cloudfiles](https://github.com/rtgibbons/grunt-cloudfiles) instructions

Run `grunt cdnify` to run the default tasks as well as upload any images to your CDN.

Run `grunt cdnify send --template=branded.html` to send the email to yourself with the 'CDNified' images.

### Using Amazon S3 for image assets

Another option for serving images is to use Amazon S3. Basic service is free of charge. For more information on setting up an account, visit [Amazon](http://aws.amazon.com/s3/).

The Gruntfile uses [grunt-aws-s3](https://github.com/MathieuLoutre/grunt-aws-s3).

Once your AWS account is setup, create a Bucket within S3. You will need to ensure your Bucket has a policy setup under Permissions. Below is a very loose sample policy for testing purposes. You should read up on [AWS Identity and Access Management](http://aws.amazon.com/iam/) for more information.

**Sample S3 Bucket Policy**

```
{
  "Version": "2008-10-17",
  "Id": "Policy123",
  "Statement": [
    {
      "Sid": "Stmt456",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "s3:*",
      "Resource": "arn:aws:s3:::BUCKETNAME"
    }
  ]
}
```

Run `grunt s3upload` to upload images to your S3 Bucket. This will also run a replace task to change image paths within the destination directory to use the new S3 path.

### Sample email templates

I've added two templates here to help you get started.

* [Simple transactional email template](http://leemunroe.github.io/grunt-email-design/dist/transaction.html)
* [Branded email via CDN](http://leemunroe.github.io/grunt-email-design/dist/branded.html)

### More resources

* For more transactional email templates check out [Mailgun's collection of templates](http://github.com/mailgun/transactional-email-templates).
* [Things I've learned about sending email](http://www.leemunroe.com/sending-email-designers-developers/)
* [Things I've learned about building HTML email templates](http://www.leemunroe.com/building-html-email/)

redpajama_set_name: RedPajamaGithub


text:
var app = require('./app'),
    util = require('util'),
    port = process.env.PORT || 3000,
    mongoHost = process.env.TT_MONGO_HOST || 'mongo',
    mongoPort = process.env.TT_MONGO_PORT || 27017,
    MongoClient = require('mongodb').MongoClient,
    mongoUrl = util.format('mongodb://%s:%s/tennistable', mongoHost, mongoPort);

MongoClient.connect(mongoUrl, function (err, db) {
    if (err) {
        console.error(err);
    } else {
        var server = app.listen(port, function () {
            app.set('server', server);
            app.set('db', db);
            console.log('Server listening on port ' + port);
        });
    }
});


text:
package org.springframework.aop.framework.autoproxy;

import org.springframework.aop.framework.autoproxy.target.AbstractPrototypeBasedTargetSourceCreator;
import org.springframework.aop.target.AbstractPrototypeBasedTargetSource;
import org.springframework.aop.target.PrototypeTargetSource;
import org.springframework.beans.factory.BeanFactory;

/**
 * Overrides generic PrototypeTargetSourceCreator to create a prototype only for beans
 * with names beginning with "prototype".
 * @author Rod Johnson
 */
public class SelectivePrototypeTargetSourceCreator extends AbstractPrototypeBasedTargetSourceCreator {

	protected AbstractPrototypeBasedTargetSource createPrototypeTargetSource(Object bean, String beanName, BeanFactory factory) {
		if (!beanName.startsWith("prototype")) {
			return null;
		}
		return new PrototypeTargetSource();
	}

}


text:
package org.podpage.alexa.skills.alexa.response;

/**
 * Created by Lino on 16.01.2017.
 */
public class AlexaResponse {

    private String version;
    private Response response;

    public AlexaResponse(String version, Response response) {
        this.version = version;
        this.response = response;
    }

    public AlexaResponse(Response response) {
        this.version = "1.0";
        this.response = response;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Response getResponse() {
        return response;
    }

    public void setResponse(Response response) {
        this.response = response;
    }
}


text:
<?php

namespace WurflCacheTest\Adapter\Helper;

use WurflCache\Adapter\Helper\StorageObject;

/**
 * Base Storage Provider
 * A Skeleton implementation of the Storage Interface
 *
 * @category   WURFL
 *
 * @copyright  ScientiaMobile, Inc.
 * @license    GNU Affero General Public License
 * @author     Fantayeneh Asres Gizaw
 *
 * @version    $id$
 */
class StorageObjectTest extends \PHPUnit_Framework_TestCase
{
    /**
     *
     */
    public function testValue()
    {
        $value  = 'testValue';
        $object = new StorageObject($value, 10);

        self::assertSame($value, $object->value());
    }

    public function testIsExpired()
    {
        $object = new StorageObject('testValue', 0);

        self::assertFalse($object->isExpired());

        $object = new StorageObject('testValue', 1000);

        self::assertFalse($object->isExpired());

        $object = new StorageObject('testValue', 1);

        sleep(10);

        self::assertTrue($object->isExpired());
    }

    public function testExpiringOn()
    {
        $expiringTime = time() + 1000;
        $object       = new StorageObject('testValue', 1000);

        self::assertSame($expiringTime, $object->expiringOn());
    }
}


text:
@interface SystemExceptionDebugCell()
@property (weak, nonatomic) IBOutlet UILabel *exception_name;
@property (weak, nonatomic) IBOutlet UILabel *exception_time;
@property (weak, nonatomic) IBOutlet UIImageView *disposeImage;

@end

@implementation SystemExceptionDebugCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *ID = @"SystemExceptionDebugCellID";
    SystemExceptionDebugCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[MYBUNDLE loadNibNamed:@"SystemExceptionDebugCell" owner:nil options:nil]lastObject];
        //        cell = [[[NSBundle mainBundle] loadNibNamed:@"SystemExceptionDebugCell" owner:nil options:nil]lastObject];
    }
    return cell;
}

- (void)setModel:(SystemExceptionDebugModel *)model
{
    _model = model;
    self.exception_name.text = [model.exception name];
    self.exception_time.text = [model.exception_time FormatterYMDHMS];
    if (model.isDispose) {
        self.disposeImage.image = [BundleTool getImage:@"exception_success" FromBundle:LXFrameWorkBundle];
    }else{
        self.disposeImage.image = [BundleTool getImage:@"exception_fail" FromBundle:LXFrameWorkBundle];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

@end


text:
//-----------------------------------------------------------------------
// <copyright file="TaskBasedScheduler_Verify_TimeProvider.cs" company="Akka.NET Project">
//     Copyright (C) 2009-2016 Lightbend Inc. <http://www.lightbend.com>
//     Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using System;
using Akka.Actor;
using Akka.TestKit;
using Akka.Util.Internal;
using Xunit;

namespace Akka.Tests.Actor.Scheduler
{
    // ReSharper disable once InconsistentNaming
    public class DefaultScheduler_Verify_TimeProvider
    {
        [Fact]
        public void Now_Should_be_accurate()
        {
            using (var sys = ActorSystem.Create("Foo"))
            {

                ITimeProvider timeProvider = new HashedWheelTimerScheduler(sys.Settings.Config, sys.Log);
                try
                {
                    Math.Abs((timeProvider.Now - DateTimeOffset.Now).TotalMilliseconds).ShouldBeLessThan(20);
                }
                finally
                {
                    timeProvider.AsInstanceOf<IDisposable>().Dispose();
                }
            }
        }
    }
}


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.10
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.badlogic.gdx.physics.bullet.dynamics;

import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.physics.bullet.linearmath.*;
import com.badlogic.gdx.physics.bullet.collision.*;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Matrix4;

public class btHingeConstraint extends btTypedConstraint {
	private long swigCPtr;

	protected btHingeConstraint(final String className, long cPtr, boolean cMemoryOwn) {
		super(className, DynamicsJNI.btHingeConstraint_SWIGUpcast(cPtr), cMemoryOwn);
		swigCPtr = cPtr;
	}

	/** Construct a new btHingeConstraint, normally you should not need this constructor it's intended for low-level usage. */
	public btHingeConstraint(long cPtr, boolean cMemoryOwn) {
		this("btHingeConstraint", cPtr, cMemoryOwn);
		construct();
	}

	@Override
	protected void reset(long cPtr, boolean cMemoryOwn) {
		if (!destroyed)
			destroy();
		super.reset(DynamicsJNI.btHingeConstraint_SWIGUpcast(swigCPtr = cPtr), cMemoryOwn);
	}

	public static long getCPtr(btHingeConstraint obj) {
		return (obj == null) ? 0 : obj.swigCPtr;
	}

	@Override
	protected void finalize() throws Throwable {
		if (!destroyed)
			destroy();
		super.finalize();
	}

  @Override protected synchronized void delete() {
		if (swigCPtr != 0) {
			if (swigCMemOwn) {
				swigCMemOwn = false;
				DynamicsJNI.delete_btHingeConstraint(swigCPtr);
			}
			swigCPtr = 0;
		}
		super.delete();
	}

  public btHingeConstraint(btRigidBody rbA, btRigidBody rbB, Vector3 pivotInA, Vector3 pivotInB, Vector3 axisInA, Vector3 axisInB, boolean useReferenceFrameA) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_0(btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, pivotInA, pivotInB, axisInA, axisInB, useReferenceFrameA), true);
  }

  public btHingeConstraint(btRigidBody rbA, btRigidBody rbB, Vector3 pivotInA, Vector3 pivotInB, Vector3 axisInA, Vector3 axisInB) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_1(btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, pivotInA, pivotInB, axisInA, axisInB), true);
  }

  public btHingeConstraint(btRigidBody rbA, Vector3 pivotInA, Vector3 axisInA, boolean useReferenceFrameA) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_2(btRigidBody.getCPtr(rbA), rbA, pivotInA, axisInA, useReferenceFrameA), true);
  }

  public btHingeConstraint(btRigidBody rbA, Vector3 pivotInA, Vector3 axisInA) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_3(btRigidBody.getCPtr(rbA), rbA, pivotInA, axisInA), true);
  }

  public btHingeConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame, boolean useReferenceFrameA) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_4(btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, rbAFrame, rbBFrame, useReferenceFrameA), true);
  }

  public btHingeConstraint(btRigidBody rbA, btRigidBody rbB, Matrix4 rbAFrame, Matrix4 rbBFrame) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_5(btRigidBody.getCPtr(rbA), rbA, btRigidBody.getCPtr(rbB), rbB, rbAFrame, rbBFrame), true);
  }

  public btHingeConstraint(btRigidBody rbA, Matrix4 rbAFrame, boolean useReferenceFrameA) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_6(btRigidBody.getCPtr(rbA), rbA, rbAFrame, useReferenceFrameA), true);
  }

  public btHingeConstraint(btRigidBody rbA, Matrix4 rbAFrame) {
    this(DynamicsJNI.new_btHingeConstraint__SWIG_7(btRigidBody.getCPtr(rbA), rbA, rbAFrame), true);
  }

  public void getInfo1NonVirtual(SWIGTYPE_p_btTypedConstraint__btConstraintInfo1 info) {
    DynamicsJNI.btHingeConstraint_getInfo1NonVirtual(swigCPtr, this, SWIGTYPE_p_btTypedConstraint__btConstraintInfo1.getCPtr(info));
  }

  public void getInfo2NonVirtual(btConstraintInfo2 info, Matrix4 transA, Matrix4 transB, Vector3 angVelA, Vector3 angVelB) {
    DynamicsJNI.btHingeConstraint_getInfo2NonVirtual(swigCPtr, this, btConstraintInfo2.getCPtr(info), info, transA, transB, angVelA, angVelB);
  }

  public void getInfo2Internal(btConstraintInfo2 info, Matrix4 transA, Matrix4 transB, Vector3 angVelA, Vector3 angVelB) {
    DynamicsJNI.btHingeConstraint_getInfo2Internal(swigCPtr, this, btConstraintInfo2.getCPtr(info), info, transA, transB, angVelA, angVelB);
  }

  public void getInfo2InternalUsingFrameOffset(btConstraintInfo2 info, Matrix4 transA, Matrix4 transB, Vector3 angVelA, Vector3 angVelB) {
    DynamicsJNI.btHingeConstraint_getInfo2InternalUsingFrameOffset(swigCPtr, this, btConstraintInfo2.getCPtr(info), info, transA, transB, angVelA, angVelB);
  }

  public void updateRHS(float timeStep) {
    DynamicsJNI.btHingeConstraint_updateRHS(swigCPtr, this, timeStep);
  }

  public btRigidBody getRigidBodyA() {
    return new btRigidBody(DynamicsJNI.btHingeConstraint_getRigidBodyA__SWIG_0(swigCPtr, this), false);
  }

  public btRigidBody getRigidBodyB() {
    return new btRigidBody(DynamicsJNI.btHingeConstraint_getRigidBodyB__SWIG_0(swigCPtr, this), false);
  }

  public Matrix4 getFrameOffsetA() {
	return DynamicsJNI.btHingeConstraint_getFrameOffsetA(swigCPtr, this);
}

  public Matrix4 getFrameOffsetB() {
	return DynamicsJNI.btHingeConstraint_getFrameOffsetB(swigCPtr, this);
}

  public void setFrames(Matrix4 frameA, Matrix4 frameB) {
    DynamicsJNI.btHingeConstraint_setFrames(swigCPtr, this, frameA, frameB);
  }

  public void setAngularOnly(boolean angularOnly) {
    DynamicsJNI.btHingeConstraint_setAngularOnly(swigCPtr, this, angularOnly);
  }

  public void enableAngularMotor(boolean enableMotor, float targetVelocity, float maxMotorImpulse) {
    DynamicsJNI.btHingeConstraint_enableAngularMotor(swigCPtr, this, enableMotor, targetVelocity, maxMotorImpulse);
  }

  public void enableMotor(boolean enableMotor) {
    DynamicsJNI.btHingeConstraint_enableMotor(swigCPtr, this, enableMotor);
  }

  public void setMaxMotorImpulse(float maxMotorImpulse) {
    DynamicsJNI.btHingeConstraint_setMaxMotorImpulse(swigCPtr, this, maxMotorImpulse);
  }

  public void setMotorTarget(Quaternion qAinB, float dt) {
    DynamicsJNI.btHingeConstraint_setMotorTarget__SWIG_0(swigCPtr, this, qAinB, dt);
  }

  public void setMotorTarget(float targetAngle, float dt) {
    DynamicsJNI.btHingeConstraint_setMotorTarget__SWIG_1(swigCPtr, this, targetAngle, dt);
  }

  public void setLimit(float low, float high, float _softness, float _biasFactor, float _relaxationFactor) {
    DynamicsJNI.btHingeConstraint_setLimit__SWIG_0(swigCPtr, this, low, high, _softness, _biasFactor, _relaxationFactor);
  }

  public void setLimit(float low, float high, float _softness, float _biasFactor) {
    DynamicsJNI.btHingeConstraint_setLimit__SWIG_1(swigCPtr, this, low, high, _softness, _biasFactor);
  }

  public void setLimit(float low, float high, float _softness) {
    DynamicsJNI.btHingeConstraint_setLimit__SWIG_2(swigCPtr, this, low, high, _softness);
  }

  public void setLimit(float low, float high) {
    DynamicsJNI.btHingeConstraint_setLimit__SWIG_3(swigCPtr, this, low, high);
  }

  public void setAxis(Vector3 axisInA) {
    DynamicsJNI.btHingeConstraint_setAxis(swigCPtr, this, axisInA);
  }

  public float getLowerLimit() {
    return DynamicsJNI.btHingeConstraint_getLowerLimit(swigCPtr, this);
  }

  public float getUpperLimit() {
    return DynamicsJNI.btHingeConstraint_getUpperLimit(swigCPtr, this);
  }

  public float getHingeAngle() {
    return DynamicsJNI.btHingeConstraint_getHingeAngle__SWIG_0(swigCPtr, this);
  }

  public float getHingeAngle(Matrix4 transA, Matrix4 transB) {
    return DynamicsJNI.btHingeConstraint_getHingeAngle__SWIG_1(swigCPtr, this, transA, transB);
  }

  public void testLimit(Matrix4 transA, Matrix4 transB) {
    DynamicsJNI.btHingeConstraint_testLimit(swigCPtr, this, transA, transB);
  }

  public Matrix4 getAFrame() {
	return DynamicsJNI.btHingeConstraint_getAFrame__SWIG_0(swigCPtr, this);
}

  public Matrix4 getBFrame() {
	return DynamicsJNI.btHingeConstraint_getBFrame__SWIG_0(swigCPtr, this);
}

  public int getSolveLimit() {
    return DynamicsJNI.btHingeConstraint_getSolveLimit(swigCPtr, this);
  }

  public float getLimitSign() {
    return DynamicsJNI.btHingeConstraint_getLimitSign(swigCPtr, this);
  }

  public boolean getAngularOnly() {
    return DynamicsJNI.btHingeConstraint_getAngularOnly(swigCPtr, this);
  }

  public boolean getEnableAngularMotor() {
    return DynamicsJNI.btHingeConstraint_getEnableAngularMotor(swigCPtr, this);
  }

  public float getMotorTargetVelosity() {
    return DynamicsJNI.btHingeConstraint_getMotorTargetVelosity(swigCPtr, this);
  }

  public float getMaxMotorImpulse() {
    return DynamicsJNI.btHingeConstraint_getMaxMotorImpulse(swigCPtr, this);
  }

  public boolean getUseFrameOffset() {
    return DynamicsJNI.btHingeConstraint_getUseFrameOffset(swigCPtr, this);
  }

  public void setUseFrameOffset(boolean frameOffsetOnOff) {
    DynamicsJNI.btHingeConstraint_setUseFrameOffset(swigCPtr, this, frameOffsetOnOff);
  }

  public void setParam(int num, float value, int axis) {
    DynamicsJNI.btHingeConstraint_setParam__SWIG_0(swigCPtr, this, num, value, axis);
  }

  public void setParam(int num, float value) {
    DynamicsJNI.btHingeConstraint_setParam__SWIG_1(swigCPtr, this, num, value);
  }

  public float getParam(int num, int axis) {
    return DynamicsJNI.btHingeConstraint_getParam__SWIG_0(swigCPtr, this, num, axis);
  }

  public float getParam(int num) {
    return DynamicsJNI.btHingeConstraint_getParam__SWIG_1(swigCPtr, this, num);
  }

}


text:
<?php

namespace Molajo\Plugins\Extensions;

/**
 * Extension Instances Support for Extensions Plugin
 *
 * @package     Molajo
 * @license     http://www.opensource.org/licenses/mit-license.html MIT License
 * @since       1.0
 */
abstract class ExtensionInstances extends Base
{
   /**
    * Check if Extension Instance is already in the Database
    *
    * @param   integer $catalog_type_id
    * @param   string  $extension_name
    * @param   string  $namespace
    *
    * @return  boolean
    * @since   1.0.0
    */
    protected function checkExtensionInstance($catalog_type_id, $extension_name, $namespace)
    {
        $this->setQueryController('Molajo//Model//Datasource//Extensioninstances.xml');

        $this->setQueryControllerDefaults(
            $process_events = 0,
            $query_object = 'item',
            $get_customfields = 0,
            $use_special_joins = 0,
            $use_pagination = 0,
            $check_view_level_access = 0,
            $get_item_children = 0
        );

        $prefix = $this->query->getModelRegistry('primary_prefix', 'a');

        $this->query->where('column', $prefix . '.catalog_type_id', '=', 'integer', $catalog_type_id);
        $this->query->where('column', $prefix . '.extension_id', '=', 'integer', $this->parent_id);
        $this->query->where('column', $prefix . '.title', '=', 'string', $extension_name);
        $this->query->where('column', $prefix . '.namespace', '=', 'string', $namespace);

        $item = $this->runQuery();

        if (is_object($item)) {
            return true;
        }

        return false;
    }

    /**
     * Insert Extension Instance
     *
     * @param   integer $catalog_type_id
     * @param   string  $extension_name
     * @param   string  $catalog_type
     * @param   string  $namespace
     * @param   string  $theme
     *
     * @return  $this
     * @since   1.0.0
     */
    protected function insertExtensionInstance($catalog_type_id, $extension_name, $catalog_type, $namespace, $theme)
    {
        $this->setQueryController('Molajo//Model//Datasource//Extensioninstances.xml', 'Create');

        $this->setQueryControllerDefaults(
            $process_events = 1,
            $query_object = 'result',
            $get_customfields = 0,
            $use_special_joins = 0,
            $use_pagination = 0,
            $check_view_level_access = 0,
            $get_item_children = 0
        );

        $row = $this->query->initialiseRow();

        $this->setInsertValuesExtensionInstance(
            $row,
            $catalog_type_id,
            $extension_name,
            $catalog_type,
            $namespace,
            $theme
        );

        $this->query->setInsertStatement($row);

        $this->runQuery('insertData');

        return $this;
    }

    /**
     * Set row values for inserting extension instance
     *
     * @param   object  $row
     * @param   integer $catalog_type_id
     * @param   string  $extension_name
     * @param   string  $catalog_type
     * @param   string  $namespace
     * @param   string  $theme
     *
     * @return  object
     * @since   1.0.0
     */
    protected function setInsertValuesExtensionInstance(
        $row,
        $catalog_type_id,
        $extension_name,
        $catalog_type,
        $namespace,
        $theme)
    {
        $row->id                        = null;
        $row->extension_id              = $this->parent_id;
        $row->catalog_type_id           = $catalog_type_id;
        $row->title                     = ucfirst(strtolower($extension_name));
        $row->subtitle                  = ucfirst(strtolower($theme));
        $row->namespace                 = $namespace;
        $row->path                      = strtolower($catalog_type);
        $row->menu                      = '';
        $row->page_type                 = 'item';
        $row->content_text              = null;
        $row->protected                 = 0;
        $row->featured                  = 0;
        $row->stickied                  = 0;
        $row->status                    = 0;
        $row->start_publishing_datetime = null;
        $row->stop_publishing_datetime  = null;
        $row->version                   = 1;
        $row->version_of_id             = 0;
        $row->status_prior_to_version   = null;

        //todo move these into common code
        $row->created_datetime  = $this->date->getDate();
        $row->created_by        = $this->runtime_data->user->id;
        $row->modified_datetime = $this->date->getDate();
        $row->modified_by       = $this->runtime_data->user->id;
        $row->author_id         = $this->runtime_data->user->id;

        $row->checked_out_datetime = null;
        $row->checked_out_by       = null;

        $row->root                 = null;
        $row->parent_id            = $this->parent_id;
        $row->lft                  = null;
        $row->rgt                  = null;
        $row->lvl                  = null;
        $row->ordering             = 0;

        $row->home                 = null;

        $row->customfields         = '{}';
        $row->parameters           = '{}';
        $row->metadata             = '{}';

        $row->language             = $this->runtime_data->application->parameters->language;
        $row->translation_of_id    = 0;

        return $row;
    }
}


text:
namespace gpu {

TEST(GpuUtilTest, GetGpuFeatureInfo_WorkaroundFromCommandLine) {
  {
    base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
    GPUInfo gpu_info;
    GpuFeatureInfo gpu_feature_info = ComputeGpuFeatureInfo(
        gpu_info, GpuPreferences(), &command_line, nullptr);
    EXPECT_FALSE(gpu_feature_info.IsWorkaroundEnabled(
        USE_GPU_DRIVER_WORKAROUND_FOR_TESTING));
  }

  {
    base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
    command_line.AppendSwitchASCII(GpuDriverBugWorkaroundTypeToString(
                                       USE_GPU_DRIVER_WORKAROUND_FOR_TESTING),
                                   "1");
    GPUInfo gpu_info;
    GpuFeatureInfo gpu_feature_info = ComputeGpuFeatureInfo(
        gpu_info, GpuPreferences(), &command_line, nullptr);
    EXPECT_TRUE(gpu_feature_info.IsWorkaroundEnabled(
        USE_GPU_DRIVER_WORKAROUND_FOR_TESTING));
  }

  {
    base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
    command_line.AppendSwitchASCII(switches::kGpuDriverBugListTestGroup, "1");
    // See gpu/config/gpu_driver_bug_list.json, test_group 1, entry 215.
    GPUInfo gpu_info;
    GpuFeatureInfo gpu_feature_info = ComputeGpuFeatureInfo(
        gpu_info, GpuPreferences(), &command_line, nullptr);
    EXPECT_TRUE(gpu_feature_info.IsWorkaroundEnabled(
        USE_GPU_DRIVER_WORKAROUND_FOR_TESTING));
  }

  {
    base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
    command_line.AppendSwitchASCII(switches::kGpuDriverBugListTestGroup, "1");
    command_line.AppendSwitchASCII(GpuDriverBugWorkaroundTypeToString(
                                       USE_GPU_DRIVER_WORKAROUND_FOR_TESTING),
                                   "0");
    // See gpu/config/gpu_driver_bug_list.json, test_group 1, entry 215.
    GPUInfo gpu_info;
    GpuFeatureInfo gpu_feature_info = ComputeGpuFeatureInfo(
        gpu_info, GpuPreferences(), &command_line, nullptr);
    EXPECT_FALSE(gpu_feature_info.IsWorkaroundEnabled(
        USE_GPU_DRIVER_WORKAROUND_FOR_TESTING));
  }
}

}  // namespace gpu


text:
tail()
===============================

.. autofunction:: FunctionalX.src.lists._tail.tail


text:
from __future__ import generators
import py
import sys

saferepr = py.io.saferepr

class TestSafeRepr:
    def test_simple_repr(self):
        assert saferepr(1) == '1'
        assert saferepr(None) == 'None'

    def test_maxsize(self):
        s = saferepr('x'*50, maxsize=25)
        assert len(s) == 25
        expected = repr('x'*10 + '...' + 'x'*10)
        assert s == expected

    def test_maxsize_error_on_instance(self):
        class A:
            def __repr__(self):
                raise ValueError('...')

        s = saferepr(('*'*50, A()), maxsize=25)
        assert len(s) == 25
        assert s[0] == '(' and s[-1] == ')'

    def test_exceptions(self):
        class BrokenRepr:
            def __init__(self, ex):
                self.ex = ex
                foo = 0
            def __repr__(self):
                raise self.ex
        class BrokenReprException(Exception):
            __str__ = None
            __repr__ = None
        assert 'Exception' in saferepr(BrokenRepr(Exception("broken")))
        s = saferepr(BrokenReprException("really broken"))
        assert 'TypeError' in s
        if py.std.sys.version_info < (2,6):
            assert 'unknown' in saferepr(BrokenRepr("string"))
        else:
            assert 'TypeError' in saferepr(BrokenRepr("string"))

        s2 = saferepr(BrokenRepr(BrokenReprException('omg even worse')))
        assert 'NameError' not in s2
        assert 'unknown' in s2

    def test_big_repr(self):
        from py._io.saferepr import SafeRepr
        assert len(saferepr(range(1000))) <= \
               len('[' + SafeRepr().maxlist * "1000" + ']')

    def test_repr_on_newstyle(self):
        class Function(object):
            def __repr__(self):
                return "<%s>" %(self.name)
        try:
            s = saferepr(Function())
        except Exception:
            py.test.fail("saferepr failed for newstyle class")

    def test_unicode(self):
        val = py.builtin._totext('£€', 'utf-8')
        reprval = py.builtin._totext("'£€'", 'utf-8')
        assert saferepr(val) == reprval

def test_unicode_handling():
    value = py.builtin._totext('\xc4\x85\xc4\x87\n', 'utf-8').encode('utf8')
    def f():
        raise Exception(value)
    excinfo = py.test.raises(Exception, f)
    s = str(excinfo)
    if sys.version_info[0] < 3:
        u = unicode(excinfo)


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
>
    <LinearLayout
        android:layout_width="0dip"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_gravity="center_vertical"
        android:orientation="vertical"
        android:paddingLeft="8dip"
        >
        <TextView
            android:id="@+id/line1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="#000000"
            android:textSize="16sp"
            />
        <TextView
            android:id="@+id/line2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="#444444"
        />
    </LinearLayout>
    <Button
        android:id="@+id/remove"
        android:text="@string/remove_shortcut"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center"
        android:visibility="visible"
        style="@android:style/Widget.Material.Button.Borderless"/>
    <Button
        android:id="@+id/disable"
        android:text="@string/disable_shortcut"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center"
        android:visibility="visible"
        style="@android:style/Widget.Material.Button.Borderless"/>
</LinearLayout>


text:
package org.apache.axis2.jaxws.description.builder;

import javax.xml.ws.soap.Addressing;
import java.lang.annotation.Annotation;

public class AddressingAnnot implements Addressing {

    private boolean enabled = true;
    private boolean required;

    public boolean enabled() {
        return enabled;
    }

    public void setEnabled(boolean e) {
        enabled = e;
    }

    public boolean required() {
        return required;
    }

    public void setRequired(boolean r) {
        required = r;
    }

    public Class<? extends Annotation> annotationType() {
        return Addressing.class;
    }

}


text:
layout:     post
title:      amour a mort
date:       2015-07-11
summary:    First post
categories: ocean
---

La grandeur des espaces se mesure à la volatilité d'une réflexion, la couleur des mots dans le vague de leur mouvement.

Je me suis décrit, près de toi, dans mon invariable mesure; celle de notre passé commun. Communiquant.


text:
cask 'bunq' do
  version '0.8.11'
  sha256 'cda59e4653e747c0099c5078aaf5d59040d68f7f5784b5a6d94a6fcfff45d9b3'

  # github.com/BunqCommunity/BunqDesktop was verified as official when first introduced to the cask
  url "https://github.com/BunqCommunity/BunqDesktop/releases/download/#{version}/BunqDesktop-#{version}.dmg"
  appcast 'https://github.com/BunqCommunity/BunqDesktop/releases.atom'
  name 'BunqDesktop'
  homepage 'https://bunqdesktop.com/'

  app 'BunqDesktop.app'
end


text:
function getFSUrl() {
   return "http://www.reddit.com/r/friendsafari/new";
}

function goToFS() {
   chrome.storage.sync.set({"last-observed": Date.now()});
   chrome.browserAction.setBadgeText({"text": ""});
   chrome.tabs.create({"url": getFSUrl()});
}

function update() {
   $.get(getFSUrl(),
      function (page) {
         this.page = page;
         this.results = 0;
         var root = this;
         chrome.storage.sync.get(null, function (store) {
            subselector = store["tracked"].map(function (elem) { return ".flair-" + elem; }).toString();
            times = $(".link:has("+subselector+") time", root.page);
            $(times).each(function () {
               if (new Date(store["last-observed"]) < new Date($(this).attr("datetime"))) {
                  console.log("increment");
                  root.results += 1;
               }
            });
            if (root.results > 0) {
               chrome.browserAction.setBadgeBackgroundColor({"color": [80, 136, 47, 255]});
               chrome.browserAction.setBadgeText({"text": root.results.toString()});
            } else {
               chrome.browserAction.setBadgeText({"text": ""});
            }
         });
      });
};

update();

chrome.browserAction.onClicked.addListener(goToFS);
chrome.alarms.onAlarm.addListener(update);
chrome.runtime.onInstalled.addListener(
   function () {
      chrome.storage.sync.get(null,
         function (store) {
            if (!("tracked" in store)) { store["tracked"] = ["ditto"]; }
            if (!("last-observed" in store)) { store["last-observed"] = 0;}
            chrome.storage.sync.set(store);
         });
      chrome.alarms.create("fs-notifier", {
         when: Date.now(),
         periodInMinutes: 5
      });
      chrome.tabs.create({"url": "options.html"});
   }
);


text:
require 'spec_helper'

describe VerifiedDouble::RSpecMocksSyntaxOverrides do
  let(:some_method){ 'fake_to_s' }
  let(:some_result){ 'result' }

  describe "#expect(*args)" do
    context "where the double arg records VerifiedDouble interactions" do
      let(:a_double) { VerifiedDouble.of_instance('Object') }

      it "sets the registry's current_double to the first arg", verifies_contract: 'Object#fake_to_s()=>String' do
        expect(VerifiedDouble.registry.current_double).to_not eq(a_double)
        expect(a_double)
        VerifiedDouble.registry.current_double.should eq(a_double)
      end
    end

    context "where the double arg does not record VerifiedDouble interactions" do
      let(:a_double) { double('Object') }

      it "doesn't set the registry's current_double" do
        expect(VerifiedDouble.registry.current_double).to_not equal(a_double)
        expect(a_double)
        expect(VerifiedDouble.registry.current_double).to be_nil
      end
    end
  end

  describe "#allow(*args)" do
    context "where the double arg records VerifiedDouble interactions" do
      let(:a_double) { VerifiedDouble.of_instance('Object') }

      it "sets the registry's current_double to the first arg", verifies_contract: 'Object#fake_to_s()=>String' do
        expect(VerifiedDouble.registry.last).to_not eq(a_double)
        allow(a_double)
        VerifiedDouble.registry.current_double.should eq(a_double)
      end
    end

    context "where the double arg does not record VerifiedDouble interactions" do
      let(:a_double) { double('Object') }

      it "clears registry's current_double" do
        expect(VerifiedDouble.registry.current_double).to_not equal(a_double)
        allow(a_double)
        expect(VerifiedDouble.registry.current_double).to be_nil
      end
    end
  end

  describe "#receive(*args)" do
    context "where the current double is recording VerifiedDouble interactions" do
      let(:a_double) { VerifiedDouble.of_instance('Object') }

      it "adds the first arg as a method signature for the current double" do
        expect(a_double).to receive(some_method).and_return(some_result)

        method_signature = VerifiedDouble.registry.last
        expect(method_signature).to be_a(VerifiedDouble::MethodSignature)
        expect(method_signature.method).to eq(some_method)
        expect(method_signature.return_values.map(&:content)).to eq([some_result])

        a_double.fake_to_s
      end

      it 'should not add the result to the current test doubles' do
        expect(a_double).to receive(some_method).and_return(some_result)
        expect(VerifiedDouble.doubles_in_current_test).to eq([a_double])

        a_double.fake_to_s
      end
    end

    context "where the current double is not recording VerifiedDouble interactions" do
      let(:a_double) { double('Object') }

      it "doesn't add a method signature for the method" do
        registry_size = VerifiedDouble.registry.size
        expect(a_double).to receive(some_method).and_return(some_result)

        expect(VerifiedDouble.registry.size).to eq(registry_size)
        a_double.fake_to_s
      end
    end
  end
end