Skip to content

Instantly share code, notes, and snippets.

Are def lists

supported?

@mwhipple
mwhipple / deploy.js
Last active February 10, 2017 01:24
//I'm not crazy about the current logic
//may want to shuffle things around a bit after it's known to work
var AWS = require('aws-sdk');
var ecs = new AWS.ECS();
var describeService = function(p) {
return ecs.describeServices({cluster: p.cluster,
services: [p.service]}).promise();
};
(define (mw-opts opts pages)
(define* (page page lst #:optional default?)
(define (budget! name sort help)
(gnc:register-option
opts (gnc:make-budget-option page name sort (N_ help))))
(define (boolean! name sort help default)
(gnc:register-option
opts (gnc:make-simple-boolean-option page name sort (N_ help) default)))
(define (price-source! name sort cost)
var hex_source = ["2", "4", "3", "F", "6", "A", "8", "8", "8", "5", "A", "3", "0", "8", "D", "3", "1", "3", "1", "9"],
decimal_digits = [], holding = [];
function pumpNextHex(source) {
var digit = parseInt(source.shift(),16), new_digits;
holding.push(digit);
// carry-over upward
for (var idx=holding.length-1; idx>0; idx--) {
if (holding[idx] > 9) {
@mwhipple
mwhipple / hex-fractional-digits-to-decimal.js
Last active November 17, 2015 01:23 — forked from getify/hex-fractional-digits-to-decimal.js
converting digit-by-digit, a stream of hexadecimal digits (of PI for example) into decimal base-10 digits.
// current solution adapted from: https://gist.github.com/getify/e5ed084f122d73ac375b#gistcomment-1621271
//
// Problem:
//
// given a stream of "hexadecimal digits" from PI, as in 0.243F6A8885A308D31319...,
// convert the stream digit-by-digit to base-10 decimal digits, as in:
// 0.1415926535897932384...
//
// Complications:
// because of floating point precision, the below current solution
@mwhipple
mwhipple / meld.js
Last active January 1, 2016 18:29
AngularJS module to hold calls until an amount of idle time has passed.
//Copyright 2013 Matt Whipple
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,