Skip to content

Instantly share code, notes, and snippets.

View afreeland's full-sized avatar

Aaron Freeland afreeland

View GitHub Profile
@afreeland
afreeland / recent.js
Created May 1, 2018 19:52
React: Sample Component illustrating Apollo
import React, { Component } from 'react';
import { render } from 'react-dom';
import { ApolloClient, createNetworkInterface, ApolloProvider, graphql } from 'react-apollo';
import History_HOC from './history-hoc'
import appRoot from 'app-root-path';
import store from '../../store';
const config = require(`${appRoot}/config/config.js`);
let graphqlClient = require(appRoot + '/models/graphql-client.js');
export default class RecentHistory extends Component {
@afreeland
afreeland / recentEnum.js
Created May 1, 2018 19:45
GraphQL: Enum Sample
import {
GraphQLEnumType,
} from 'graphql';
var recentTypes = new GraphQLEnumType({
name: 'recentTypess',
values: {
// The values are going to be used in the actual redis key itself
// i.e. analytics => recent:analytics:username
"Analytics" : { value: "analytics" },
@afreeland
afreeland / pod.yaml
Created May 1, 2018 17:12
k8s: Pod kubernetes bare metal storage
apiVersion: v1
kind: Pod
metadata:
labels:
app: lettuce-redis
name: lettuce-redis-6684f999c4-kfdfr
namespace: default
ownerReferences:
- apiVersion: extensions/v1beta1
name: lettuce-redis-6684f999c4
@afreeland
afreeland / pvc.yaml
Created May 1, 2018 12:59
k8s: PersistentVolumeClaim bare metal
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: let-us-claim
annotations:
volume.beta.kubernetes.io/storage-class: "slow"
spec:
accessModes:
- ReadWriteOnce
resources:
@afreeland
afreeland / pv.yaml
Created April 30, 2018 19:48
K8s: PersistedVolumes bare metal NFS
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv0001
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Recycle
@afreeland
afreeland / sc.yaml
Created April 30, 2018 19:44
K8: Storage Class bare metal
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: slow
provisioner: memorialhealth/nfs
@afreeland
afreeland / Composition.go
Created April 5, 2018 12:54
Go: struct composition
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, playground")
mp := messagePrint{"foo"}
@afreeland
afreeland / Methods.go
Created April 5, 2018 12:54
Go: struct methods
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, playground")
mp := messagePrint{"foo"}
@afreeland
afreeland / Constructor.go
Created April 5, 2018 12:52
Go: constructors (how to)
package main
import (
"fmt"
)
func main() {
foo := newMyStruct()
foo.myMap["bar"] = "baz"
@afreeland
afreeland / Structs.go
Created April 5, 2018 12:51
Go: basic structs
package main
import (
"fmt"
)
func main() {
// We created two structs in the local execution stack...its better to do large objects in heap