Skip to content

Instantly share code, notes, and snippets.

class React {
static render(component, target){
target.innerHTML = ''
target.appendChild(component)
this._attach = [
component,
target
]
function API() {
this.apiToken = '';
this.request = function(method, route, data) {
var stuff = {
headers: { 'x-user-token': this.apiToken },
method: method,
url: route,
contentType: 'application/json'
};

What is different now? Why are we changing how we're doing things?

Goals for 2016 - 2017

Build out a more robust solution

Goals for 2018 +

Make that prototype maintainable, and make it so that no 1 person is mission critical to project upkeep.

How?

  1. Always being Explicit
    1. Require files in a readable, obvious maner (always use an index)
    2. Self Document your code (i.e. name vars and functions as what they do)
  2. Write DRY Confident Code
module.exports = (options)=>(
{
entry: "./app/entry", // string | object | array
// Here the application starts executing
// and webpack starts bundling
output: {
// options related to how webpack emits results
path: path.resolve(__dirname, "dist"), // string
class Login extends Component {
constructor(props){
super(props)
this.handleSignup = this.handleSignup.bind(this)
this.handleSubmit = this.handleSubmit.bind(this)
}
handleSignup(e){
e.preventDefault()
put /apps
Required:
name:
Example:
get /users
post /users
Required
contacts:
Example: {email: "test@example.com", phone_number: "555-555-5555"}
Filters
storedFilters Array of Filter Objects
currentFilter Object current filter attributes
UsersOrganizations
usersOrganizationsList
Groups
selectedUsers
CacheStore

Traitify JS 2 Outline

    /*
     * Initialize
     */
    traitify = Traitify.ui.init();
    traitify.publicKey = "publick key";
    traitify.assessmentId = "assessment id";
    
    /*
#!/bin/bash
sudo apt-get install ubuntu-desktop
sudo apt-get install lamp-server^
sudo apt-get install phpmyadmin
cd /var/www
sudo wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
echo "tar -xzvf No wonder I couldn't remember ha"
mv latest wordpress
var ApiClient, SimplePromise, Traitify, console;
if (!Array.prototype.map) {
Array.prototype.map = function(callback, thisArg) {
var A, O, T, k, kValue, len, mappedValue;
T = void 0;
A = void 0;
k = void 0;
if (typeof this === "undefined" || this === null) {
throw new TypeError(" this is null or not defined");