Skip to content

Instantly share code, notes, and snippets.

View robertz's full-sized avatar

Robert Zehnder robertz

View GitHub Profile
version: '2'
services:
dev-nginx:
build:
context: ./.docker/dev/nginx
container_name: dev-nginx
links:
- dev-node
ports:
- "80:80"
@robertz
robertz / api.js
Created February 24, 2018 02:15
Export the controller methods to support the app routes
const Payee = require("../models/Payee");
const Payments = require("../models/Payment");
exports.getPayees = async (req, res) => {
return Payee.find({ owner: req.params.userid })
.sort({ day: 1 })
.then(payees => {
res.json(payees);
});
};
@robertz
robertz / index.js
Created February 24, 2018 02:12
serverMiddleware express handler
const express = require("express");
const bodyParser = require("body-parser");
const mongoose = require("mongoose");
const cors = require("cors");
const apiController = require("./controllers/api");
// Create express instnace
const app = express();
@robertz
robertz / nuxt.config.js
Created February 24, 2018 02:05
Nuxt application config
module.exports = {
/*
** Router config
*/
router: {
middleware: "check-auth"
},
/*
** Headers of the page
*/
@robertz
robertz / payment.js
Created February 21, 2018 15:28
The new payment page
const app = new Vue({
el: "#app",
data: {
hasPayments: false,
payments: [],
payees: [],
pageSize: 10,
currentPage: 1,
prevEnable: false,
nextEnable: true,
@robertz
robertz / api.js
Last active February 21, 2018 15:34
API method to support data table and paging
exports.getPaymentsVue = async (req, res) => {
const getPayees = () => {
return Payee.find({ owner: req.params.userid })
.cache(0, req.params.userid + "__payees")
.then(payees => {
return payees;
});
};
@robertz
robertz / timezones.cfm
Created April 20, 2017 16:46 — forked from atuttle/timezones.cfm
Dealing with Time Zones in ColdFusion
<!---
Many thanks to Sean Corfield and Ryan Guill who set me down the correct path of java.util.TimeZone
--->
<cfscript>
writeDump(label="Conversion Examples",var={
"0-local-tz": getSystemTZ()
,"1-local-now": now()
,"2-utc-now": toUTC(now())
,"3-eastern-now": TZtoTZ( getSystemTZ(), now(), "America/New_York" )
msgDetails = {
to="[email protected]",
from="[email protected]",
subject="example subject",
parts = [
{type="text/plain", body="This is plain text..."},
{type="text/html", body="<strong>bold</strong> text..."}
]
};
component{
// Configure ColdBox Application
function configure(){
// coldbox directives
coldbox = {
//Application Setup
appName = "Appname",
eventName = "event",
component {
/*
Parts of this are based on Tim Dawe's
http://amazonsig.riaforge.org
and
Joe Danziger's Amazon S3 REST Wrapper
http://amazons3.riaforge.org/