Skip to content

Instantly share code, notes, and snippets.

View ewanharris's full-sized avatar

Ewan Harris ewanharris

View GitHub Profile
@ewanharris
ewanharris / new.json
Created June 24, 2022 21:04
Old and new json output
{
"branch": {},
"branches": false,
"defaultInstallLocation": "/Users/user/Library/Application Support/Titanium",
"installLocations": [
"/Library/Application Support/Titanium",
"/Users/user/Library/Application Support/Titanium"
],
"installed": {},
"releases": [
@ewanharris
ewanharris / 12.1.0.GA
Created April 27, 2023 21:28
macos errors
[TRACE] #import "TiAppiOSActivityAttributesProxy.h"
[TRACE] ^
[TRACE] /Users/awam/Documents/titanium-workspace/test-app/build/iphone/Classes/TiAppiOSActivityAttributesProxy.h:10:9: error: 'TitaniumKit/TitaniumKit.h' file not found
[TRACE] #import <TitaniumKit/TitaniumKit.h>
[TRACE] ^
[TRACE] /Users/awam/Documents/titanium-workspace/test-app/build/iphone/Classes/TiAppiOSActivityAttributesProxy.h:10:9: note: did not find header 'TitaniumKit.h' in framework 'TitaniumKit' (loaded from '/Users/awam/Documents/titanium-workspace/test-app/build/iphone/build/Products/Debug-maccatalyst')
[TRACE] #import <TitaniumKit/TitaniumKit.h>
[TRACE] ^
[TRACE] 1 error generated.
[TRACE] <unknown>:0: error: failed to emit precompiled header '/Users/awam/Documents/titanium-workspace/test-app/build/iphone/build/Intermediates/PrecompiledHeaders/test_app-Bridging-Header-swift_2S904Q57JC3MW-clang_38YETQ0XB7NQN.pch' for bridging header '/Users/awam/Documents/titanium-workspace/test-app/build/iphone/test_
@ewanharris
ewanharris / index.js
Last active June 20, 2023 22:09
Script to extract from package.json and write to package.nls.json
const fs = require('fs-extra');
const packageJson = require('./package.json');
const existing = require('./package.nls.json');
function handleStringEdit (str, obj, key) {
if (!obj[key] || obj[key]?.startsWith('%')) {
return;
}
existing[str] = obj[key];
obj[key] = `%${str}%`;
Feature: Check folder access
Background:
Given folder:5 is a parent of folder:product-2021
* folder:product-2021 is a parent of folder:product-2021Q1
* folder:product is a parent of folder:product-2021
Scenario: user:anne can read and write but not share folder:product-2021
Given user:anne is an owner of folder:product
When she accesses folder:product-2021
@ewanharris
ewanharris / condition-based-store.fga.yaml
Last active September 17, 2024 12:00
Approaches to multi-tenant entitlements in OpenFGA
# In this store we've taken the approach of having a condition that checks the assigned org against the active org that is provided as context on the request
name: Entitlements
model: |
model
schema 1.1
type user
type organization
relations
@ewanharris
ewanharris / check.tests.yaml
Last active December 2, 2024 11:51
Example of separating tests
- name: "folder-document-access-checks"
description: ""
tuple_file: ./folder-document-access_tuples.json
check:
- user: user:anne
object: folder:product-2021
assertions:
can_view: true
can_write: true
can_share: false