Tools of the trade

 

Graphene Django - Uploading files.

 

#!/usr/bin/env python3
'''
Since Django's request isn't avaliable to graphene's mutation def. 
It is passed in via context.
'''
import graphene

from .models import Users

class UploadMutation(graphene.Mutation):
  class Input:
    id = graphene.String()
    profileImage = graphene.String()
    
    def mutate(self, input, context, info):
      id = input.get('id')
      user = Users.objects.get(pk=id)
      
      if context.FILES and context.method == 'POST':
        user.image = context.FILES['profileImage']
        user.save()
        
      return UploadMutation(user=user)
          

Nerf

Since I started learning ReactJS, I constantly became frustrated that all the examples were either ToDo apps or had all the code in one file.

N.E.R.F is an example of how to build a website running Express and React using a componentized application structure.

You can find the source on github.

nerf

Sputnik

An internal project. Designed to monitor and manage a AWS cloud infrastructure.

Built around the Silex framework and AWS SDK. Sputnik allows the system admin to schedule a variety of task from stopping and starting servers. Provision new servers, using ansible playbooks to deploy pre-designed configurations. User management, Incident management, Documentation repository etc

sputnik

E.volv

The Evolv API is built on Silex acting as a RESTful API and content analysis dashboard.
All requests made to a MySQL database via GET requests with JSON responses return as the data type.
OAuth2 has been setup on a content recommendation engine outside of the Evolv Dashboard and the dashboard is powered by AngularJS 1.3.

evolv macbook