Skip to content

Instantly share code, notes, and snippets.

Gregory Parsons gregorskii

  • Los Angeles, California
Block or report user

Report or block gregorskii

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gregorskii / mongoose.js
Created Mar 25, 2017
Mongoose Interface Promise Based
View mongoose.js
import mongoose from 'mongoose';
import Promise from 'bluebird';
import logger from './logger';
const gracefulShutdown = (reason, done) => {
mongoose.connection.close(() => {`Mongoose default connection disconnected through ${reason}`);
gregorskii / auth.js
Created Mar 25, 2017
Mongoose promise based object creation and validation
View auth.js
const email =;
const password = req.body.password;
const query = UserModel.findOne({ email });
.then((existingUser) => {
if (existingUser) {'user found');
return res.status(422).send({ error: 'Email in use' });
gregorskii / 0_reuse_code.js
Created Aug 1, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:147a4b11836a8bbba1eb90b4509ebcef
Note 1: The following CQ curl commands assumes a admin:admin username and password.
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command.
Example: -F"":operation=delete""
Note 3: Quotes around name of package (or name of zip file, or jar) should be included.
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
gregorskii / facebook-scraper.conf.j2
Last active May 4, 2016
Enable Facebook Scrapers on NGINX using Ansible (Trellis Example) Per
View facebook-scraper.conf.j2
# trellis/roles/nginx/templates/facebook-scraper.conf.j2
satisfy any;
gregorskii / example.js
Last active May 1, 2016
nodemon as a gulp task
View example.js
'use strict';
import {gulp, plugins, config} from '../plugins';
import proxyMiddleware from 'http-proxy-middleware';
const proxy = 'localhost:8002';
* Watch Task: gulp watch
gulp.task('watch', plugins.sequence('nodemon', 'bundle', 'browserSync', 'watch-start'));
View browerSyncProxyMiddleware.js
import proxyMiddleware from 'http-proxy-middleware';
config.browserSyncConfig = {
proxy: {
target: '<DEST SITE>',
middleware: [proxyMiddleware(['<API PATH>'], {target: '<API TARGET>'})]
View VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Simple Provisioner
$script = <<SCRIPT
Vagrant.require_version '>= 1.5.1'
You can’t perform that action at this time.