Skip to content

Instantly share code, notes, and snippets.

{
"comment": {
"name": "Helen",
"comment": "The whole experience was magical. Thank you to everyone who was part of it!",
"time": 1482512023
},
"url": {
"url": "http:\/\/requestb.in\/yflr9zyf"
}
}
{
"comment": {
"name": "Helen",
"comment": "The whole experience was magical. Thank you to everyone who was part of it!",
"time": 1482512023
},
"url": {
"url": "http:\/\/requestb.in\/wq2ue6wq"
}
}
{
"comment": {
"name": "Helen",
"comment": "The whole experience was magical. Thank you to everyone who was part of it!",
"time": 1482512023
},
"webhooks": [
{
"url": "http:\/\/requestb.in\/wq2ue6wq"
},
var amqp = require('amqplib/callback_api');
var atob = require('atob');
var cfenv = require('cfenv');
if (process.env.VCAP_SERVICES) {
var appEnv = cfenv.getAppEnv()
rabbitmq_url = appEnv.getService('guestbook-messages').credentials.uri;
cert_string = atob(appEnv.getService('guestbook-messages').credentials.ca_certificate_base64);
ca = new Buffer(cert_string);
opts = {ca: [ca]};
if(isset($_ENV['VCAP_SERVICES'])) {
$vcap_services = json_decode($_ENV['VCAP_SERVICES'], true);
$rabbit_url = $vcap_services['compose-for-rabbitmq'][0]['credentials']['uri'];
$url_bits = parse_url($rabbit_url);
$config['rabbitmq']['host'] = $url_bits['host'];
$config['rabbitmq']['port'] = $url_bits['port'];
$config['rabbitmq']['vhost'] = substr($url_bits['path'], 1);
$config['rabbitmq']['username'] = $url_bits['user'];
$config['rabbitmq']['password'] = $url_bits['pass'];
$config['rabbitmq']['ssl'] = true;
if(isset($_ENV['VCAP_SERVICES'])) {
$vcap_services = json_decode($_ENV['VCAP_SERVICES'], true);
$config['couchdb']['url'] = $vcap_services['cloudantNoSQLDB'][0]['credentials']['url'];
} else {
$config['couchdb']['url'] = "http://localhost:5984";
}
$vcap_services = json_decode($_ENV['VCAP_SERVICES'], true);
---
applications:
- name: guestbook-web
memory: 512M
services:
- guestbook-db
- guestbook-messages
{
"WEBDIR": "public"
}
@lornajane
lornajane / gist:db34c0ae5d8c1649474e
Created August 26, 2015 11:55
History file from my presentation at Laracon "Advanced Git for Developers"
git init mygit
ls
cd mygit/
ls
ls
cd .git/
ls
cat config
git config --local user.email "me@lornajane.net"
cat config