Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
GRAPH_NAME=tlehman
function roam_api_get_blocks_containing_string() {
curl -X POST "https://api.roamresearch.com/api/graph/$GRAPH_NAME/q" --location-trusted \
-H "accept: application/json" \
-H "Authorization: Bearer $ROAM_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"query\" : \"[:find ?block-str :in \$ ?search-string :where [?b :block/uid ?block-uid] [?b :block/string ?block-str] [(clojure.string/includes? ?block-str ?search-string)]]\", \"args\": [\"$1\"]}"
@jqtrde
jqtrde / aws_assume_role.py
Created November 13, 2022 13:48 — forked from benkehoe/aws_assume_role.py
Assumed role session chaining (with credential refreshing) for boto3
# *** WARNING ***
# This gist is no longer maintained
# It has been replaced by aws-assume-role-lib in PyPI
# Documentation at https://github.com/benkehoe/aws-assume-role-lib
# It is still a single-file library, you can find the stable version here:
# https://raw.githubusercontent.com/benkehoe/aws-assume-role-lib/stable/aws_assume_role_lib/aws_assume_role_lib.py
# (link also available in the docs)
# Copyright 2020 Ben Kehoe
#
@jqtrde
jqtrde / bulletpaths.js
Created June 21, 2022 08:40 — forked from azlen/bulletpaths.js
All Paths Lead to Roam
/*
* credit to Dhrumil Shah (@wandcrafting) and Robert Haisfield (@RobertHaisfield)
* for the original concept which was part of their RoamGames submission
* and can be found at: https://www.figma.com/file/5shwLdUCHxSaPNEO7pazbe/
*
*/
/* ======= OPTIONS ======== */
/* note: if you change these, reload the page to see the effect */
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Important

DO NOT USE VSCODE terminal and make sure uname -m returns arm64

  1. First Install Xcode command line tool
xcode-select --install
  1. Create and change /opt directories owner
@jqtrde
jqtrde / readme.md
Created June 3, 2020 11:56 — forked from kgjenkins/readme.md
TIFF compression options

TIFF compression options

Summary

Realistically, especially when considering the inherent noise in the original image, I'd settle for lossy compression with COMPRESS=JPEG JPEG_QUALITY=90, which could reduce file size fairly quickly to 16% of the original.

But if lossless compression is a hard requirement, I'd probably go with COMPRESS=LZW PREDICTOR=2. However, I would want to verify that any downstream tools wolud support this sort of compression.

UPDATE: When saving with JPEG compression, further speed and size improvements are gained by adding PHOTOMETRIC=YCBCR, which uses a different color space that has even better compression. I've added new rows to the table for YCBCR, as well as .jp2 formats.

For a while, I thought that our modern culture's relationship to science best resembled the Catholic Church during the middle ages. Priests delivering sermons in Latin, indulgences, poor families of believers praying one of their sons would be bright enough for the clergy... Then I discovered the Druze.

"But when I asked him about the Druze faith, he gave me an unexpected reply. 'I know nothing about the Druze', the pre-eminent leader of the Druze declared with a violent wave of his arm. From his piles of books he selected a couple by Tariq Ali and gave them to me as gifts. He invited me to visit him at his palace in the mountains. And then he said goodbye. Either the most powerful Druze man in Lebanon, an intellectual in his own right, had been excluded from the teachings of his own religion, or else he knew better than to pass them on to an outsider. I had every intention of taking up his invitation to spend time among the Druze communities, but first I would have to find someone more willing to talk

@jqtrde
jqtrde / install-arch.md
Last active June 15, 2023 20:41 — forked from mjnaderi/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)
@jqtrde
jqtrde / README.md
Created March 15, 2020 19:46 — forked from clhenrick/README.md
PostgreSQL & PostGIS cheatsheet (a work in progress)
from botocore.credentials import RefreshableCredentials
from botocore.session import get_session
from boto3 import Session
def assumed_session(role_arn, session_name, session=None):
"""STS Role assume a boto3.Session
With automatic credential renewal.