Skip to content

Instantly share code, notes, and snippets.

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 / mac.md
Last active May 13, 2024 05:43
Keyboard Only OS X

Keyboard-only Mac Cheatsheet

Hi, I'm Lorna and I don't use a mouse. I have had RSI issues since a bad workstation setup at work in 2006. I've tried a number of extra hardware modifications but what works best for me is to use the keyboard and only the keyboard, so I'm in a good position and never reaching for anything else (except my coffee cup!). I rather unwisely took a job which required me to use a mac (I've been a linux user until now and also had the ability to choose my tools carefully) so here is my cheatsheet of the apps, tricks and keyboard shortcuts I'm using, mostly for my own reference. Since keyboard-only use is also great for productivity, you may also find some of these ideas useful, in which case at least something good has come of this :)

Apps List

There's more detail on a few of these apps but here is a quick overview of the tools I've installed and found helpful

Tool Link Comments
<?php
$id = filter_input(INPUT_POST, "id", FILTER_SANITIZE_STRING);
$data = ["username" => filter_input(INPUT_POST, "name", FILTER_SANITIZE_STRING),
"comment" => filter_input(INPUT_POST, "comment", FILTER_SANITIZE_STRING),
];
$posts->updateOne(["_id" => new MongoDB\BSON\ObjectID($id)], ['$push' => ["comments" => $data]]);
vagrant up
Bringing machine 'joindin' up with 'virtualbox' provider...
==> joindin: Importing base box 'joindin/development'...
==> joindin: Matching MAC address for NAT networking...
==> joindin: Setting the name of the VM: vm_joindin_1464623655510_48026
==> joindin: Clearing any previously set network interfaces...
==> joindin: Preparing network interfaces based on configuration...
joindin: Adapter 1: nat
joindin: Adapter 2: hostonly
==> joindin: Forwarding ports...
@lornajane
lornajane / people.sql
Created April 4, 2016 16:03
Material to accompany JSON data type examples
-- MySQL dump 10.13 Distrib 5.6.28, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: demo
-- ------------------------------------------------------
-- Server version 5.7.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

Keybase proof

I hereby claim:

  • I am lornajane on github.
  • I am lornajane (https://keybase.io/lornajane) on keybase.
  • I have a public key whose fingerprint is 6AED D723 08F8 0865 FE8B 5A39 7DFC 33E8 65AB FE1F

To claim this, I am signing this object: