Skip to content

Instantly share code, notes, and snippets.

@gravesm
gravesm / stubit.js
Last active February 11, 2024 22:24
Jasmine+AMD test stub module injection
/**
* This module allows you to inject test stubs into the module loading process
* during jasmine unit testing.
*/
define(["underscore"], function(_) {
var uid = 0;
function defineMock(mockid, mock) {
define(mockid, function() {
@gravesm
gravesm / tfcloud.md
Created July 31, 2020 14:54
TF remote apply workflows

Notes

  • Does not appear possible to run an apply locally

Open Questions

  • Keep using a mono-repo or switch to one repo per service?
  • Should stage and prod both deploy from master or should there be a long running prod branch?

Workspace Configuration

Two workspaces are created per app and named <app_name>-stage and <app_name>-prod

+++++++++++++
>+++<
[
[>>[-]+<<
>>>>[-]
>[-]
<<<<<-
>-
[->>>+>+<<<<]
>>>>[-<<<<+>>>>]
import io
class S3IO(io.BufferedIOBase):
def __init__(self, s3_obj):
self.obj = s3_obj
self._position = io.SEEK_SET
def tell(self):
return self._position
@gravesm
gravesm / gist:5116963
Created March 8, 2013 14:54
XSLT to remove duplicate instances of MARC subject fields.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:marc="http://www.loc.gov/MARC21/slim"
xmlns:fn="http://libraries.mit.edu/xslt/functions">
<xsl:template match="/">
<add>
<xsl:apply-templates select="marc:collection/marc:record" />

Keybase proof

I hereby claim:

  • I am gravesm on github.
  • I am gravesmj (https://keybase.io/gravesmj) on keybase.
  • I have a public key ASCFAqsyCUQl5tclKjxlKGqiGus3fISuiWatJJXxOI419go

To claim this, I am signing this object:

<section>
<h1>You are in a maze of twisty containers, all unversioned.</h1>
</section>
<section>
<h2>Kubernetes</h2>
<div>
<ul>
<li>6 pods (adit api, elasticsearch, fedora, nginx, pit, postgres)</li>
<li>Container images stored in google cloud</li>
<li>There's no builtin versioning, so it can be hard to figure out what version of what you have deployed</li>
<?xml version="1.0" encoding="UTF-8"?>
<config>
<luceneMatchVersion>4.5</luceneMatchVersion>
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.NRTCachingDirectoryFactory}" />
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# -*- coding: utf-8 -*-
from itertools import repeat
import time
import unittest
import click
from click.testing import CliRunner
@click.group()