Skip to content

Instantly share code, notes, and snippets.

View RussBrown00's full-sized avatar

Russell Brown RussBrown00

View GitHub Profile
@RussBrown00
RussBrown00 / GraphQL-Schema-Stitching-Example.js
Created July 12, 2018 13:43
Apollo GraphQL Schema Stitching Example
import { makeExecutableSchema, mergeSchemas } from 'graphql-tools';
const widgetTypeDefs = `
type Widgets {
id: ID,
name: String,
color: String
}
type Query {

Keybase proof

I hereby claim:

  • I am 902labs on github.
  • I am russbrown (https://keybase.io/russbrown) on keybase.
  • I have a public key ASDwk7Ox0QAqRmAY4HFA7MEmbqhKv2JvOu3JL78oOzanVgo

To claim this, I am signing this object:

@RussBrown00
RussBrown00 / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Dump master into a new branch to keep changes safe

  • git checkout -b holding

Jump back to master branch

  • git checkout master

Make sure upstream has been updated

  • git fetch upstream

Reset your master

@RussBrown00
RussBrown00 / Gruntfile.js
Last active August 29, 2015 14:01
Using Grunt to Auto-Restart with File Watchers
'use strict';
var path = require("path");
var publicDir = "client/public";
var resourcesDir = "client/resources";
var lessFiles = {
"client/public/css/site.css": path.join(resourcesDir, "less/site.less")
}
{
"aVites": {
"blindness": "",
"bloodPressure": "",
"bp2": "",
"correctiveLenses": "",
"eyes": [
false,
false,
false,
var port = 8000
, http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
server.once('listening', function() {
console.log("Server running at http://127.0.0.1:" + string(port));
```prettyprint
upstream mycoolwebsite_server {
server 127.0.0.1:8000; # My internal app
}
server {
listen 80;
server_name mycoolwebsite.com;
underscores_in_headers on;
@RussBrown00
RussBrown00 / README.md
Last active August 29, 2015 13:57
Node.js Meetup: 12180 - 03-31-14

#Preparation Guide For The 03-31-14 Node.js Meetup: 12180 Meeting

Follow these instructions to prepare for the next node.js meeting. This will get you setup with a basic linux EC2 instance on amazon. If you do not already have an account, setup is easy. An instance is cheap and is free for the first year with a new account. I have chosen Ubuntu because frankly it is my personal favorite, as well as being an industry standard option and light-weight. I want everyone to have experience setting up a server from scratch to gain a better understandings of how everything ties together. It is important that you do all of these steps because the last one will take up valuable meeting time.

https://console.aws.amazon.com/console/home

We will pick up our meeting from the end of these instructions. We will start with going over in detail what and why you did the following steps. We will cover the NGINX web-server, security, auto-start, deployment and more. If you have any questions please feel free to post them here

function getRandomInt (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var randomDate = function (date1, date2) {
var minD = Date.parse(date1);
var maxD = Date.parse(date2);
var random = getRandomInt(parseInt(minD), parseInt(maxD));
var randomDate = new Date();