Skip to content

Instantly share code, notes, and snippets.

terrancesnyder / send_email_row.js
Created June 5, 2024 06:30
send_email_on_row_change (Click on Extensions > Apps Script.)
function onEdit(e) {
// Get the range that was edited
var range = e.range;
var sheet = range.getSheet();
// Specify the column that triggers the email (e.g., column 3 is column C)
var triggerColumn = 3;
// Check if the edited column is the one we are interested in
if (range.getColumn() == triggerColumn) {
// Get the row of the edited cell
var row = range.getRow();
terrancesnyder / example_rule.json
Created September 14, 2023 02:59
Example of protecting with Ory Oathkeeper Access to API (GET)
"id": "Protect a People API with Consent Check",
"match": {
"url": "",
"methods": [ "GET" ]
"upstream": {
"url": "https://my_container_or_dns:8080/api/people/contacts"
"authenticators": [{
terrancesnyder /
Last active January 31, 2020 02:38
automated merge hbase 0.98+ - Bash script that will invoke hshell to query for regions and then perform a merge_region command but only within each regionserver (to avoid data copy/locality issues)
echo "Examining Table $TABLE...."
echo "scan 'hbase:meta',{ COLUMNS => 'info:server', FILTER=>\"PrefixFilter('$TABLE')\"}" | hbase shell > "$TABLE.out" 2>&1
echo "Making splits $TABLE.splits"
echo "" > "$TABLE.splits"
hadoop fsck / | egrep -v '^\.+$' | grep -v corrup | grep / | grep -oh '^\S*:' | rev | cut -c 2- | rev | sort | uniq > corrupted.flst
terrancesnyder / apiary.txt
Last active August 22, 2019 20:03
API Ary - Draft
[#-- @ftlvariable name="resourceApis" type="java.util.List<com.webcohesion.enunciate.api.resources.ResourceApi>" --]
[#-- @ftlvariable name="serviceApis" type="java.util.List<>" --]
[#-- @ftlvariable name="data" type="java.util.List<com.webcohesion.enunciate.api.datatype.Syntax>" --]
[#-- @ftlvariable name="title" type="java.lang.String" --]
[#-- @ftlvariable name="disableMountpoint" type="java.lang.Boolean" --]
[#-- @ftlvariable name="disableResourceLinks" type="java.lang.Boolean" --]
[#-- @ftlvariable name="apiRelativePath" type="java.lang.String" --]
[#-- @ftlvariable name="includeApplicationPath" type="java.lang.Boolean" --]
terrancesnyder / email-template.html
Created November 13, 2018 03:20
<!doctype html>
<meta charset="utf-8">
<title>Catalina News</title>
<link href="|Roboto:100,300,400,500" rel="stylesheet">
body {
margin: 0px auto;
Exception in thread "iothread-2" java.lang.NullPointerException
at zmq.Utils.tuneTcpSocket(
at zmq.TcpListener.acceptEvent(
at zmq.IOObject.acceptEvent(
Exception in thread "iothread-2" java.lang.NullPointerException
at zmq.Utils.tuneTcpSocket(
at zmq.TcpListener.acceptEvent(
at zmq.IOObject.acceptEvent(
terrancesnyder / CustomJwtTokenStore
Created May 30, 2017 23:22 — forked from maxsap/CustomJwtTokenStore
Spring Security OAuth2 programmatic configuration.
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.commons.lang3.SerializationUtils;
import org.springframework.beans.factory.annotation.Autowired;
terrancesnyder / network security groups
Created October 25, 2016 17:41
network security groups
root@dndubuntu1204:/home/azureuser/azure-xplat-cli-azure-dev# node bin/azure network nsg rule set armrestestgrp2n nsg2n nsgrule2n -d 'Allow incoming traffic from proxy22' -p 'Tcp' -f '' -o '*' -e 'VirtualNetwork' -u '7000-7500' -c Allow -r Outbound
info: Executing command network nsg rule set
+ Looking up the network security group "nsg2n"
+ Setting a network security rule "nsgrule2n"
+ Looking up the network security group "nsg2n"
data: Id : /subscriptions/bfb5e0bf-124b-4d0c-9352-7c0a9f4d9948/resourceGroups/armrestestgrp2n/providers/Microsoft.Network/networkSecurityGroups/nsg2n/securityRules/nsgrule2n
data: Name : nsgrule2n
data: Type : Microsoft.Network/networkSecurityGroups/securityRules
data: Provisioning state : Succeeded
data: Description : Allow incoming traffic from proxy22
terrancesnyder /
Last active May 30, 2016 16:50
Date Math

Date Support

The dates used within the platform support more than simple date/time constraints. Almost all dates within the platform are strings and have special semantics when dealing with periodicity as well as general date/math functions that make it much easier to specify effective start/stop period and work within date ranges.

Basic Date Format

The basic date format is defined as YYYY-MM-DDThh:mm:ssZ where:

  • YYYY is the year.
  • MM is the month.
  • DD is the day of the month.