Skip to content

Instantly share code, notes, and snippets.

View andrewfinnell's full-sized avatar

Andrew T. Finnell andrewfinnell

View GitHub Profile
@andrewfinnell
andrewfinnell / uuid.sql
Last active August 19, 2016 21:22
Postgres Table with UUID Primary key
-- Turn on the pgcrypto extension which should be installed
-- by default in recent Postgres builds.
CREATE EXTENSION pgcrypto;
-- Create a table with the primary key as an UUID
-- using the gen_random_uuid() function which is
-- available through the pgcrypto extension.
CREATE TABLE tbl_sometable
(
id uuid NOT NULL DEFAULT gen_random_uuid(),
@andrewfinnell
andrewfinnell / gulpfile.js
Last active September 29, 2016 16:15
symlink node_module dependencies on Windows
/**
* Gulpfile.js
* Symlinks node_module dependencies into any directory. This
* file works on Windows and Linux machines by recursively
* symlinking the files within a node module instead of symlinking
* just the directory. This is vitally important as Editor's on Windows
* do not understand Junctions and therefor will delete all the children
* files first (i.e. the original files from the original directory), a
* disasterous situation, especially if this is used with npm link.
*/
import QUnit from "qunitjs";
QUnit.module("Async Bluebird Testsuite");
/* jshint ignore:start */
QUnit.test("Test async functions", async function (assert) {
//var done = assert.async();
function doSomethingAsync() {
var path = require('path')
var childProcess = require('child_process')
var phantomjs = require('phantomjs')
var nodemailer = require("nodemailer");
// create reusable transport method (opens pool of SMTP connections)
var smtpTransport = nodemailer.createTransport("SMTP",{
service: "Gmail",
auth: {
user: "br****@gmail.com",
/************************************************************************************************************
* registry.js - contains a wrapper for the REG command under Windows, which provides access to the registry
*
* author: Paul Bottin a/k/a FrEsC
* Copyright (c) 2014
*
* 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:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
@andrewfinnell
andrewfinnell / node-folder-structure-options.md
Created November 1, 2016 18:38 — forked from lancejpollard/node-folder-structure-options.md
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
@andrewfinnell
andrewfinnell / generate_object_id.sql
Last active April 7, 2018 23:01
NoSQL-like Unique Identifiers in SQL
-- This file is released under the MIT License (MIT)
--
-- Copyright (c) 2013 Jamar Parris
-- Copyright (c) 2016 Andrew T. Finnell <andrew.finnell@gmail.com>
--
-- 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:
--
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
<script src="script.js"></script>
@andrewfinnell
andrewfinnell / credit-card-country-list-select
Created January 16, 2017 00:31
HTML country list select with 3 letter ISO country code values based on PayPal's 190 supported countries.
<select name="countries">
<option value="USA" selected>United States</option>
<option value="GBR">United Kingdom</option>
<option value="AUS">Australia</option>
<option value="CAN">Canada</option>
<option value="IND">India</option>
<option value="BRA">Brazil</option>
<option value="">-------------------------------</option>
<option value="ALB">Albania</option>
<option value="DZA">Algeria</option>
ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue")
ActivationConfigProperty(propertyName="destination", propertyValue="/jms/queue/")