Skip to content

Instantly share code, notes, and snippets.

{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "Artist Advance API"
},
"securityDefinitions": {
"auth0": {
"type": "oauth2",
"flow": "implicit",
@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
@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 / 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 / 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 / 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 / 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 / twitter-oauth.js
Last active March 31, 2016 10:55 — forked from santosh79/twitter-oauth.js
Twitter OAuth with node-oauth for node.js+express
var express = require('express');
var sys = require('util');
var oauth = require('oauth');
var app = express.createServer();
var _twitterConsumerKey = process.env['TWITTER_CONSUMER_KEY'];
var _twitterConsumerSecret = process.env['TWITTER_CONSUMER_SECRET'];
console.log("_twitterConsumerKey: %s and _twitterConsumerSecret %s", _twitterConsumerKey, _twitterConsumerSecret);
@shankie-codes
shankie-codes / gist:20bbe5c2e2c1efabc3e4
Created October 6, 2015 15:42
rsync over SSH with zip
rsync -vzre ssh --delete $sourcedir $destdir
@shankie-codes
shankie-codes / gist:5176630e61ee0b98ba43
Last active October 6, 2015 15:33
rsub: add helper script to server
wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate; chmod +x /usr/local/bin/rsub