Skip to content

Instantly share code, notes, and snippets.

View ameistad's full-sized avatar

Andreas Meistad ameistad

View GitHub Profile
import 'dart:convert';
import 'package:meta/meta.dart';
import 'package:http/http.dart' as http;
class HttpClient extends http.BaseClient {
factory HttpClient(String token) {
final http.Client client = http.Client();
return HttpClient._createInstance(client, token);
}
HttpClient._createInstance(this._inner, this.token);
@ameistad
ameistad / auth-mutation-resolvers.js
Created April 30, 2018 19:48
Prisma reset password example
const bcrypt = require('bcryptjs')
const jwt = require('jsonwebtoken')
const authMutations = {
async signup (parent, args, ctx, info) {
const { email } = args
const userExists = await ctx.db.exists.User({ email })
if (userExists) {
throw new Error('User already exists')
}
@ameistad
ameistad / Node.vue
Created April 22, 2017 22:54
Paths.js Tree Demo with Vue.js
<template>
<g :transform="node.position">
<circle fill="white" stroke="black" r="5" cx="0" cy="0"/>
<text
transform="translate(-10,-10)"
:textAnchor="node.textAnchor">
{{ node.name }}
</text>
</g>
</template>