Skip to content

Instantly share code, notes, and snippets.

View davisford's full-sized avatar

Davis Ford davisford

View GitHub Profile
@davisford
davisford / assign.sql
Last active September 23, 2015 00:53
CREATE OR REPLACE FUNCTION assign(INT, VARCHAR(10))
RETURNS INT AS $$
DECLARE
total ALIAS FOR $1;
clientname ALIAS FOR $2;
rowcount INT;
BEGIN
UPDATE accounts
SET CLIENT = clientname
WHERE id IN (
@davisford
davisford / example.md
Created June 1, 2015 16:00
usaepay UMhash example broken

USAePay, looks like your hash example is wrong. Consider your example listed here: http://wiki.usaepay.com/developer/transactionapi?#calculating_hash_value

You use as input string sale:sd*s3j002jd:53.21:34576721:1234, but claim it md5 hashes to 52d534dd45388432ac0a44c9174ffb3f, but this is wrong.

Using Mac OS built-in md5 binary:

$md5 -s sale:sd*s3j002jd:53.21:3456721:1234
MD5 ("sale:sd*s3j002jd:53.21:3456721:1234") = 423ce7188315e73be5d81dbe7f28db22
@davisford
davisford / Dockerfile
Last active August 29, 2015 14:18
Trying to devise a solution so Docker bind-mount won't shadow dir/files inside container
FROM debian:jessie
RUN mkdir /test
RUN mkdir /outside
WORKDIR /test
RUN ln -s /outside /test/lib
RUN touch /test/lib/readme.txt && echo "this is from the container" >> /test/lib/readme.txt
@davisford
davisford / .bowerrc
Last active November 11, 2020 07:09
Updated build system for Ionic Framework
{
"directory": "bower_components"
}
@davisford
davisford / chart-controller.js
Created November 26, 2014 16:16
angular directive for resizing dc.js charts
'use strict';
angular.module('app', ['dc-resize']).controller('ChartCtrl', ['$scope', function ($scope) {
$scope.loading = true;
$scope.charts = {
mychart: dc.rowChart('#mychart')
}
@davisford
davisford / app.js
Last active March 6, 2019 10:51 — forked from tomshaw/app.js
/*!
* MailWrapper - An extremely simple nodemailer wrapper library that makes it easy to send emails using Express and Jade templates. Originally
* developed to practice and learn how to write modules for node.
*
* Copyright(c) 2011 Tom Shaw <tom@tomshaw.info>
* MIT Licensed
*/
var mailer = require('./lib/mailer');
@davisford
davisford / svg-resize-directive.js
Created July 26, 2014 19:59
svg resize angular directive for dc.js
/* global _, d3 */
'use strict';
angular.module('app.warehouse')
/**
* directive to make the charts responsive (at least for the widths);
* chart heights are typically fixed. Use this directive like so:
* <div id='mychart'>
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@davisford
davisford / markdown-to-pdf.txt
Last active June 20, 2023 06:20
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
@davisford
davisford / _.md
Created May 17, 2014 22:00
Tributary inlet