Skip to content

Instantly share code, notes, and snippets.

View RichardKnop's full-sized avatar
🎯
Focusing

Richard Knop RichardKnop

🎯
Focusing
View GitHub Profile
@RichardKnop
RichardKnop / accounting.sql
Created January 5, 2017 06:55 — forked from NYKevin/accounting.sql
Basic double-entry bookkeeping system, for PostgreSQL.
CREATE TABLE accounts(
id serial PRIMARY KEY,
name VARCHAR(256) NOT NULL
);
CREATE TABLE entries(
id serial PRIMARY KEY,
description VARCHAR(1024) NOT NULL,
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0),
-- Every entry is a credit to one account...
### Keybase proof
I hereby claim:
* I am RichardKnop on github.
* I am richardknop (https://keybase.io/richardknop) on keybase.
* I have a public key whose fingerprint is 8E8A 9426 9E82 5411 752E ECA1 4631 66AC D49B 535C
To claim this, I am signing this object:
4 error(s) occurred:
* apply operation: Real and shadow diffs do not match! Real diff:
module.ca:
module.elasticcache:
module.etcd:
module.nats-streaming-server:
module.rds:
module.registry:
@RichardKnop
RichardKnop / quicksort.go
Last active November 14, 2016 13:05
Two alternative quicksort implementations
package main
import (
"log"
"math/rand"
)
// Quicksort sorts slice of integers from smallest to greatest number
func Quicksort(a []int) []int {
if len(a) < 2 {
@RichardKnop
RichardKnop / gist:0e205ccafc964a8ac0831d1730e2252f
Created November 11, 2016 10:24 — forked from ericandrewlewis/gist:95239573dc97c0e86714
Setting up a WordPress site on AWS

Setting up a WordPress site on AWS

This tutorial walks through setting up AWS infrastructure for WordPress, starting at creating an AWS account. We'll manually provision a single EC2 instance (i.e an AWS virtual machine) to run WordPress using Nginx, PHP-FPM, and MySQL.

This tutorial assumes you're relatively comfortable on the command line and editing system configuration files. It is intended for folks who want a high-level of control and understanding of their infrastructure. It will take about half an hour if you don't Google away at some point.

If you experience any difficulties or have any feedback, leave a comment. 🐬

Coming soon: I'll write another tutorial on a high availability setup for WordPress on AWS, including load-balancing multiple application servers in an auto-scaling group and utilizing RDS.

package main
import (
"encoding/xml"
"fmt"
)
type getFileRequest struct {
XMLName struct{} `xml:"http://tempuri.org/ getFile"`
User string `xml:"userName"`
{
"timestamp": 1441804592.178703,
"message": "Request failed: 500: {\"code\"=>10001, \"description\"=>\"no implicit conversion of Errno::ENOSPC into String\", \"error_code\"=>\"CF-TypeError\", \"backtrace\"=>[\"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/lib/cloud_controller/resource_pool.rb:105:in `+'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/lib/cloud_controller/resource_pool.rb:105:in `rescue in resource_known?'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/lib/cloud_controller/resource_pool.rb:98:in `resource_known?'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/lib/cloud_controller/resource_pool.rb:35:in `block in match_resources'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/lib/cloud_controller/resource_pool.rb:35:in `select'\", \"/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/lib/cloud_controller/resource_pool.rb:35:in `match_resources'\", \"/var/vcap/packages/cloud_controller_ng/cloud_contro