Skip to content

Instantly share code, notes, and snippets.

View adamgoose's full-sized avatar

Adam Engebretson adamgoose

View GitHub Profile
@adamgoose
adamgoose / gol.go
Last active December 5, 2019 05:29
Game of Life
package main
import (
"fmt"
"math/rand"
"time"
)
// Board represents the game board
type Board struct {
@adamgoose
adamgoose / main.go
Created November 25, 2019 05:08
Reverse Polish Notation Calculator
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"strings"
)
@adamgoose
adamgoose / volume.go
Created April 27, 2019 07:21
Behringer X Touch One - Control your system volume!
package main
import (
"log"
"math"
"github.com/itchyny/volume-go"
"github.com/rakyll/portmidi"
)
/*
Copyright 2017 The Nuclio Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@adamgoose
adamgoose / client.go
Created December 28, 2018 06:24
A sloppy attempt at a GraphQL Subscription Client for golang
package subs
import (
"context"
"encoding/json"
"log"
"github.com/gorilla/websocket"
uuid "github.com/satori/go.uuid"
)

Keybase proof

I hereby claim:

  • I am adamgoose on github.
  • I am artisangoose (https://keybase.io/artisangoose) on keybase.
  • I have a public key ASBUEu40lV93K8LptbQRj2IxJBANfnpcck9ygW_L_XrSmAo

To claim this, I am signing this object:

import cors from 'cors'
import dotenv from 'dotenv'
import express from 'express'
import getSchemas from './schemas'
import resolvers from './resolvers'
import bodyParser from 'body-parser'
import { mergeSchemas } from 'graphql-tools'
import { graphqlExpress } from 'apollo-server-express'
import { express as voyager } from 'graphql-voyager/middleware'
import expressPlayground from 'graphql-playground-middleware-express'
<template>
<div class="form-group" :class="errorClass">
<label :for="slug">{{ title }}</label>
<textarea class="form-control" :id="slug" v-model="model" v-if="isTextarea" v-bind="attrs"></textarea>
<input :type="type" class="form-control" :id="slug" v-model="model" v-if="isInput" v-bind="attrs">
<select class="form-control" :id="slug" v-model="model" v-if="isSelect" v-bind="attrs">
<option :value="option" v-for="option in options">{{ option }}</option>
</select>
<span class="help-block" v-show="errors" v-text="errorText"></span>
</div>
@adamgoose
adamgoose / ApiController.php
Last active April 26, 2016 22:34
IoC Container Tutorail
<?php namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Facades\Textify;
class ApiController extends Controller {
public function postSendSms(Request $request, Textify $textify) {
$this->validate($request, [
'number' => 'required',