Skip to content

Instantly share code, notes, and snippets.

View motorcityadam's full-sized avatar
🤖
Industrial Roboticist

Adam Cook motorcityadam

🤖
Industrial Roboticist
View GitHub Profile
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
/**
* Example of using an angular provider to build an api service.
* @author Jeremy Elbourn ([email protected])
*/
/** Namespace for the application. */
var app = {};
/******************************************************************************/

Deis in Google Compute Engine

Let's build a Deis cluster in Google's Compute Engine!

Google

Get a few Google things squared away so we can provison VM instances.

Google Cloud SDK

- name: Create activation scripts for the specified Python virtual environments
template:
src: virtualenv_postactivate.j2
dest: "{{ python_virtualenv_home_dir }}/{{ item.environment.name }}/bin/postactivate"
sudo: yes
sudo_user: "{{ python_user }}"
with_items: python_virtualenvs_variables
when: >
python_virtualenv_install and python_virtualenvs|length > 0 and
python_virtualenvs_variables and python_virtualenvs_variables|length > 0
---
python_major_minor_version: '3.4'
python_major_minor_patch_version: '3.4.3'
python_compressed_source_md5sum: '7d092d1bba6e17f0d9bd21b49e441dd5'
python_virtualenvs:
- name: 'virtualenv1'
requirements: '/app/virtualenv1_requirements.txt'
- name: 'virtualenv2'
requirements: '/app/virtualenv2_requirements.txt'
#!/bin/sh
{% for k, v in item.environment.iteritems() if k != 'name' %}
export {{ k.upper() }}="{{ v }}"
{% endfor %}
echo "##################################"
echo "Completed activation of {{ item.environment.name }}."
#!/bin/sh
{% for k, v in item.environment.iteritems() if k != 'name' %}
unset {{ k.upper() }}
{% endfor %}
echo "##################################"
echo "Completed deactivation of {{ item.environment.name }}."
[uwsgi]
name = apadmin
chdir = /app/apadmin
home = /etc/python/virtual-envs/ap_admin
module = apadmin.wsgi:application
processes = 1
socket = /tmp/ap_admin.sock'
server {
listen 80;
server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:/tmp/ap_admin.sock;
}
location /favicon.ico {
@motorcityadam
motorcityadam / introrx.md
Created June 13, 2016 13:36 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing