Skip to content

Instantly share code, notes, and snippets.

// using browserify with express http://makerlog.org/posts/express-and-browserify/
var gulp = require('gulp');
var gutil = require('gulp-util');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var watchify = require('watchify');
var babelify = require('babelify');
var exorcist = require('exorcist');
var browserSync = require('browser-sync').create();
@andyfen
andyfen / schema.js
Created May 17, 2016 00:17
graphql users
import _ from 'lodash'
import {
GraphQLObjectType,
GraphQLSchema,
GraphQLInt,
GraphQLString,
GraphQLList
} from 'graphql';
@andyfen
andyfen / ultimate-ut-cheat-sheet.md
Created December 21, 2016 13:35 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@andyfen
andyfen / gist:a7e67a88677fb8d8c794773cda06cc98
Last active December 18, 2017 07:19
hapi & jest test setup
const request = require("supertest");
const Hapi = require('hapi');
const server = new Hapi.Server();
server.connection({ port: 3000, host: 'localhost' });
server.route({
method: 'GET',
path: '/',
@andyfen
andyfen / Gulpfile.js
Created October 20, 2018 05:45
Building Web Applications in Golang With Gulp and LiveReload (http://bit.ly/1ELbcl1)
/*
* Copyright (c) 2015 Martin Donath
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@andyfen
andyfen / AppComponent.js
Created December 25, 2018 20:41 — forked from ericallam/AppComponent.js
Getting React Native's Navigator and Relay to work together
import Relay, {
RootContainer,
Route
} from 'react-relay'
class SeasonRoute extends Route {
static paramDefinitions = {};
static queries = {
currentSeason: () => Relay.QL`query { currentSeason }`,
// TodoList GraphQL
// -----------------
import Foundation
struct Todo: Codable {
let id, text: String?
let complete: Bool?
var description: String {
get {
@andyfen
andyfen / instructions.txt
Created July 21, 2019 18:16 — forked from nathanborror/instructions.txt
Example Kubernetes setup with Postgres and two Services for serving an API and a static site using Ingress. Also have a CronJob example for kicks.
*** Cluster Setup for Google Container Engine ***
0/ Install and configure local gcloud and kubectl: https://cloud.google.com/sdk/docs/
> gcloud components install kubectl
1/ Configure Google Cloud account:
> gcloud config set account YOUR_EMAIL_ADDRESS
> gcloud config set project YOUR_PROJECT_ID
> gcloud config set compute/zone us-west1-a
> gcloud config set container/cluster example
@andyfen
andyfen / solanapay.go
Created November 15, 2022 20:58
WIP: solanapay golang port
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"math/big"
b64 "encoding/base64"
FROM --platform=linux/amd64 docker.io/golang:1.17.5@sha256:90d1ab81f3d157ca649a9ff8d251691b810d95ea6023a03cdca139df58bca599 AS bitcoin-build
ARG ARCH=amd64
ENV GO111MODULE=on
WORKDIR /app
RUN apt-get update && apt-get install git netcat