Skip to content

Instantly share code, notes, and snippets.

View jgeewax's full-sized avatar
🤯
Learning

JJ Geewax jgeewax

🤯
Learning
View GitHub Profile
@jgeewax
jgeewax / sequelize-schema-file-generator.js
Last active August 24, 2016 14:16 — forked from manuelbieh/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
import fs from 'fs';
import { js_beautify as beautify } from 'js-beautify';
import Sequelize from 'sequelize';
import * as models from "../models";
const sequelize = new Sequelize({
host: '',
port: '',
{
"methods": [
{
"exceptions": [],
"returns": [],
"params": [
{
"nullable": null,
"optional": null,
"name": "client",
@jgeewax
jgeewax / .gitignore
Created December 8, 2015 11:29
gcloud-node-pubsub-topic-bug
node_modules
@jgeewax
jgeewax / configure-mailgun
Created December 7, 2015 17:59
Script to configure Postfix for Mailgun
#!/bin/bash
# Configuration for the script
POSTFIX_CONFIG=/etc/postfix/main.cf
POSTFIX_SASL=/etc/postfix/sasl_passwd
function confirm () {
read -r -p "${1:-Are you sure? [Y/n]} " response
if [[ $response == "" || $response == "y" || $response == "Y" ]]; then
echo 0;
@jgeewax
jgeewax / app.js
Last active October 26, 2015 18:58
var express = require('express');
var app = express();
var gcloud = require('gcloud')({ /* extra config here */ });
var dataset = gcloud.datastore.dataset({ /* projectId: my-project */ });
// Set the trace ID on a per-request basis via middleware
// (See http://expressjs.com/guide/writing-middleware.html)
app.use(function(req, res, next) {
// Need to double check that this works from a thread safety perspective.
[
{
"type": "class",
"name": "gcloud.storage.client.Client"
},
{
"return": {
"type_name": "class:`gcloud.storage.bucket.Bucket`",
"description": "The newly created bucket."
},
[
{
"type": "class",
"name": "gcloud.storage.client.Client"
},
{
"type": "function",
"return": {
"type_name": "class:`gcloud.storage.bucket.Bucket`",
"description": "The newly created bucket."
@jgeewax
jgeewax / dox.py
Last active February 11, 2016 18:35
import argparse
import json
from parinx.parser import parse_docstring
import pdoc
def main():
parser = argparse.ArgumentParser(description='Document Python modules.')
parser.add_argument('module', nargs='*',