Skip to content

Instantly share code, notes, and snippets.

@shankie-codes
shankie-codes / do-wordpress.sh
Last active April 1, 2016 08:22
Create WordPress nginx droplet on digital ocean using Docker
#!/bin/bash
echo "Enter the hostname that you'd like to create:"
read HOSTNAME
# Can be defined as an environment variable
if [ -z "$DO_TOKEN" ]; then
echo "Enter your Digital Ocean access token:"
read DO_TOKEN
fi
@shankie-codes
shankie-codes / gist:04a0f19cc5346928c95e7686f8df1913
Created April 1, 2016 17:05
Create a new site on a https-portal network
echo "Enter site name, e.g. 'hello' if you want to create 'hello.staging.properdesign.rs'" && \
read SITE && \
docker run -d -P \
--link properstaging_db_1:mysql \
--restart=always \
-e "VIRTUAL_HOST=$SITE.staging.properdesign.rs" \
-e "WORDPRESS_DB_NAME=$SITE" \
-e "PRODUCTION=true" \
-v /www/$SITE/uploads:/var/www/html/wp-content/uploads \
-v /www/$SITE/plugins:/var/www/html/wp-content/plugins \
@shankie-codes
shankie-codes / docker-machine-create-wordpress-nginx-digitalocean-droplet
Last active May 25, 2016 18:14
docker-machine-create-wordpress-nginx-digitalocean-droplet
#!/bin/bash
echo "Enter the hostname that you'd like to create:"
read HOSTNAME
if [ -z "$DO_TOKEN" ]; then
echo "Enter your Digital Ocean access token:"
read DO_TOKEN
fi
if [ -z "$PUBLIC_KEYS" ]; then
echo "Enter your public keys followed by Ctrl-D:"
@shankie-codes
shankie-codes / do-wordpress-ssl
Created April 1, 2016 17:06
create new docker machine with https-portal network
#!/bin/bash
echo "Enter the hostname that you'd like to create:"
read HOSTNAME
# Can be defined as an environment variable
if [ -z "$DO_TOKEN" ]; then
echo "Enter your Digital Ocean access token:"
read DO_TOKEN
fi
@shankie-codes
shankie-codes / mongoose-schema.sublime-snippet
Created January 10, 2017 13:09
A Sublime Text snippet for creating Mongoose.js models
<snippet>
<content><![CDATA[
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const ${1:${TM_FILENAME/(.+)\..+|.*/$1/:SchemaName}}Schema = new Schema({
name: { type: 'String', required: true }
});
export default mongoose.model('${1:SchemaName}', ${1:SchemaName}Schema);
@shankie-codes
shankie-codes / gist:7474f18a3005a75faefe9d7519688501
Created March 22, 2017 09:47
Install / upgrade Docker on Ubuntu
apt-get remove -y docker docker-engine
apt-get update
apt-get install -y \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "Artist Advance API"
},
"securityDefinitions": {
"auth0": {
"type": "oauth2",
"flow": "implicit",