Skip to content

Instantly share code, notes, and snippets.

@jrr
jrr / render-deployment.md
Last active March 2, 2023 20:11
Render deployment with multiple environments

This is an excerpt from my project's README.


Deployment

The app is deployed to Render.

Cloud resources are provisioned using a feature called Blueprints. Resources are

@jrr
jrr / stopwatch.sh
Last active November 12, 2023 21:19
stopwatch.sh
#!/bin/sh
#
# Stopwatch
#
# Simple script to time how long things take. (useful for CI)
#
# Use it like this:
# > ./scripts/stopwatch.sh
# Started stopwatch..
/*
Runtime Config
Create React App provides a mechanism for _build-time_ configuration,
via REACT_APP_ env vars.
In order to make a single build of the frontend portable across environments,
it's desirable to also be able to provide _run-time_ configuration.
@jrr
jrr / Single Gremlin Query from CLI.md
Last active February 3, 2021 22:20
Single gremlin query from command line.md

I was looking for the easiest way to execute a single gremlin query from the command line, and cobbled this together using the gremlin console:

To use:

  • docker-compose up to fire up a local Tinkerpop
  • ./gremlin.query.sh host "query"

Example:

> ./gremlin-query.sh localhost "g.addV('foobar')"
WARNING: An illegal reflective access operation has occurred
@jrr
jrr / backup-remote-db.sh
Last active April 18, 2022 13:12
Postgres clone
#! /usr/bin/env bash
if [[ -z "${DB_PASSWORD}" ]]; then
echo "Please set a DB_PASSWORD environment variable in order to connect to the RDS Database."
echo "You may be able to retrieve it with:"
echo " aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:xx:xx:xx:xx"
exit 1
fi
if [[ -z "${DB_SSH_KEY}" ]]; then
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jrr
jrr / vsts-foobar-path.bat
Created June 21, 2017 19:00
find an executable from a VSTS build task
@echo off
Powershell.exe -executionpolicy remotesigned -File "%~dp0\vsts-foobar-path.ps1"
set /p foobarPath=< foobar-path.txt
PATH=%PATH%;%foobarPath%
@jrr
jrr / controllers.application.js
Last active May 8, 2021 14:17 — forked from samselikoff/controllers.application.js
Mirage associated serializer?
import Ember from 'ember';
export default Ember.Controller.extend({
_observeModel: Ember.observer('model', function(){
//console.log('model is',this.get('model'));
})
});
import Ember from 'ember';
export default Ember.Controller.extend({
_observeModel: Ember.observer('model', function(){
//console.log('model is',this.get('model'));
})
});
@jrr
jrr / custom-qunit-assertions.js
Created November 10, 2016 02:43
custom qunit assertions
import QUnit from 'qunit';
QUnit.assert.contains = function( haystack, needle, message ) {
var result = haystack.indexOf(needle) > -1;
this.pushResult( {
result: result,
actual: haystack,
expected: needle,
message: message || `'${haystack}' contains string '${needle}'`
});