Skip to content

Instantly share code, notes, and snippets.

@tcrouch
tcrouch / scribe.html
Created August 8, 2024 23:13
Hugo shortcodes
{{- $id := .Get "id" | default (.Get 0) -}} {{- $embed := .Get "embed" | default
false -}} {{- if $embed -}}
<iframe
style="max-width: 800px"
src="https://scribehow.com/embed/{{ $id }}?skipIntro=true"
width="100%"
height="640"
allowfullscreen
frameborder="0"
></iframe>
@tcrouch
tcrouch / looker-7-day-costs.sql
Created July 16, 2024 21:30
Looker Studio report costs
-- Standard labels Looker Studio uses in native integration.
DECLARE
requestor_key STRING DEFAULT 'requestor';
DECLARE
requestor_value STRING DEFAULT 'looker_studio';
DECLARE
datasource_key STRING DEFAULT 'looker_studio_datasource_id';
DECLARE
report_key STRING DEFAULT 'looker_studio_report_id';
-- Your project ID
@tcrouch
tcrouch / ldap.md
Created February 11, 2022 14:38
Google Workspace Secure LDAP

Google Secure LDAP

Simple bind client

stunnel.conf

[google-ldap]
accept = 127.0.0.1:1636
client = yes
connect = ldap.google.com:636
// cnt length string of random chars in [a-z0-9]
// randomChars(3) => "hb4"
function randomChars(cnt) {
return [...Array(cnt)].map(() => Math.floor(Math.random() * 36).toString(36)).join("");
}
// cnt length string of random chars in [0-9]
// randomNumber(3) => "218"
function randomNumber(cnt) {
return [...Array(cnt)].map(() => Math.floor(Math.random() * 9)).join("");

Student montage

Creating a montage of ~20k student photos.

  • Imagemagick accepts stdin--file lists stored for consistent recreation & manual tweaking.
  • montage can handle resizing and polaroid effect in a single step--as this is the time consuming step, intermediary files generated with mogrify for reuse.

Keybase proof

I hereby claim:

  • I am tcrouch on github.
  • I am tdc (https://keybase.io/tdc) on keybase.
  • I have a public key ASD33po35UaAjmBQ46OL4KqG4TfRVjhHYmg-fZ3mqTSKXgo

To claim this, I am signing this object: