Skip to content

Instantly share code, notes, and snippets.

View czbaker's full-sized avatar

Charles Baker czbaker

View GitHub Profile
import java.util.Scanner;
import java.nio.file.*;
import java.io.*;
class CalculateAverage {
public static void main(String args[]) throws FileNotFoundException {
// Use these later
String inLocation, outLocation;
package gql
import (
"context"
"github.com/czbaker/go-loginsystem/models"
)
// Resolver is our root resolver
type Resolver struct{}
<template>
<div>
<h2>Vuex Example:</h2>
<button type="button" @click="decrement(5)">Subtract 5</button>
<button type="button">Subtract 1</button>
<input type="text" disabled v-model="counter"/>
<button type="button">Add 1</button>
<button type="button">Add 5</button>
</div>
</template>
import path from 'path';
import express from 'express';
import webpack from 'webpack';
import webpackDevMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import bodyParser from 'body-parser';
import { graphqlExpress, graphiqlConnect } from 'graphql-server-express';
// Other imports
import Mongoose from './mongoose/mongoose.js';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import Card from './card.jsx';
const GET_MTG_CARD = gql`
query get_mtg_url {
getMagicCard(name: $cardName) {
name
url
}
{
"gameLength": 416,
"gameMode": "CLASSIC",
"mapId": 11,
"bannedChampions": [
{
"pickTurn": 1,
"championId": 8,
"teamId": 100
},
import ApolloClient, { createNetworkInterface } from 'apollo-client';
const networkInterface = createNetworkInterface('/graphql');
networkInterface.use({
applyMiddleWare(req, next) => {
if (!req.options.header) {
req.options.header = {}; // Create the header object if needed.
}
req.options.header.authorization = localStorage.getItem('token') ? localStorage.getItem('token') : null;
[misutowolf@ajani ~]$ mopidy
Traceback (most recent call last):
File "/usr/bin/mopidy", line 9, in <module>
load_entry_point('Mopidy==2.0.0', 'console_scripts', 'mopidy')()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 542, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2569, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2229, in load
return self.resolve()
import util from 'util';
function AppError(settings, implementationContext) {
settings = (settings || {});
this.name = 'AppError';
this.type = (settings.type || 'Application');
this.message = (settings.message || 'An error occurred!!!!!!');
this.detail = (settings.detail || '');
this.extendedInfo = (settings.extendedInfo || '');
this.errorCode = (settings.errorCode || '');
import Mongoose, { Schema } from 'mongoose';
import Random from 'random-js';
// Random Interface
const r = new Random(Random.engines.mt19937().autoSeed());
// User Schema
const UserSchema = new Schema({
id: { type: String, required: true, default: r.string(20) },
username: { type: String, required: true },