Skip to content

Instantly share code, notes, and snippets.

@hugohenrique
hugohenrique / aws-ssl-termination-digicert.md
Created November 23, 2017 14:41 — forked from marcuswestin/aws-ssl-termination-digicert.md
How to set up an AWS SSL terminating Elastic Load Balancer with a Digicert certificate

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co
@hugohenrique
hugohenrique / post_webhook.json
Created November 21, 2017 20:21
Criar a preferência de notificação do pagamento com a URL pública.
{
"events": [
"ORDER.*",
"PAYMENT.AUTHORIZED",
"PAYMENT.CANCELLED",
"PAYMENT.PRE_AUTHORIZED"
],
"target": "https://requestb.in/16q3gux1",
"media": "WEBHOOK"
}
<?php
namespace App\Provider;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use Symfony\Component\Console\Application;
class ConsoleServiceProvider implements ServiceProviderInterface
{
@hugohenrique
hugohenrique / AppKernel.php
Created January 24, 2016 06:18 — forked from kbond/AppKernel.php
JWT Authentication With Symfony Guard. POST username/password to /login to receive token, /api* requests require a valid token
<?php
// app/AppKernel.php
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
class AppKernel extends Kernel
{
public function registerBundles()
{
var Environment = function () {
'use strict';
function Environment() {
this.variables = {};
}
Environment.prototype.exist = function (name) {
return !!this.variables[name];
};

Elasticsearch: updating the mappings and settings of an existing index

Note: This was written using elasticsearch 0.9.

Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:

$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
  "_id": 1,