Skip to content

Instantly share code, notes, and snippets.

View AlecAivazis's full-sized avatar
💭
I may be slow to respond.

Alec Aivazis AlecAivazis

💭
I may be slow to respond.
View GitHub Profile
@AlecAivazis
AlecAivazis / gulpfile.coffee
Last active August 29, 2015 14:19
Watchify(Babel) / LiveReload / Linting / Uglify
'use strict'
# imports
assign = require('lodash.assign')
babelify = require('babelify')
browserify = require('browserify')
buffer = require('vinyl-buffer')
gulp = require('gulp')
eslint = require('gulp-eslint')
gutil = require('gulp-util')
@AlecAivazis
AlecAivazis / app.js
Last active August 29, 2015 14:19
ES6 React Component
'use strict';
// the base application component for syllabus
class Test extends React.Component{
constructor(){
// create this
super();
// set the initial state
@AlecAivazis
AlecAivazis / meta.py
Created February 1, 2016 21:09
A short python script showing the lifecycle methods of a metaclass
#!/usr/bin/env python3
class Meta(type):
"""
Keeps track of classes derived from a base
"""
@classmethod
def __prepare__(cls, name, bases, **kwds):
package main
import (
"fmt"
"reflect"
)
// Value an interface for anything with a value.
type Value interface {
Value() interface{}
enum Species {
Dog
Cat
}
type Animal {
species: Species
breed: String!
}
enum Species {
Dog
Cat
}
type Animal {
species: Species
breed: String!
}
type User {
username: String!
history: [Bid]
favoritePhoto: Photo
photoGallery: [Photo]
}
type Auction {
photo: Photo
offers: [Bid]
type User {
id: ID!
username: String!
history: [Bid]
favoritePhoto: Photo
photoGallery: [Photo]
}
type Auction {
id: ID!
type User {
id: ID!
username: String!
history: [Bid]
}
type Auction {
id: ID!
offers: [Bid]
highestOffer: Bid
extend type User {
favoritePhoto: Photo
photoGallery: [Photo]
}
extend type Auction {
photo: Photo!
}
extend type Photo {