Skip to content

Instantly share code, notes, and snippets.

@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..
@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

/*
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 / 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
@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'));
})
});
@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 / smallcam.user.js
Last active May 11, 2020 01:00
Nest Cam Enhancements
// ==UserScript==
// @name Nest Cam Smallerizer
// @namespace https://github.com/jrr
// @version 0.2
// @description make camera more usable in small windows
// @author jrr
// @match https://home.nest.com/camera/*
// @match https://home.nest.com/home/*
// @grant none
// ==/UserScript==
#!/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%
import Ember from 'ember';
export default Ember.Controller.extend({
_observeModel: Ember.observer('model', function(){
//console.log('model is',this.get('model'));
})
});