Things I found myself researching over and over without taking the time to write them down. Until now.
Table of Contents
| function isObject(entity) { | |
| return typeof entity === "object" && entity !== null; | |
| } | |
| function getAdjacentNodes(obj) { | |
| return ( | |
| Object.entries(obj) | |
| .filter(([, v]) => isObject(v)) | |
| ) | |
| } |
| /* | |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the |
| /** | |
| * Coroutine-based solution for delayed and periodic work. May fire once (if [interval] omitted) | |
| * or periodically ([startDelay] defaults to [interval] in this case), replacing both | |
| * `Observable.timer()` & `Observable.interval()` from RxJava. | |
| * | |
| * In contrast to RxJava, intervals are calculated since previous run completion; this is more | |
| * convenient for potentially long work (prevents overlapping) and does not suffer from queueing | |
| * multiple invocations in Doze mode on Android. | |
| * | |
| * Dispatcher is inherited from scope, may be overridden via [context] parameter. |
Things I found myself researching over and over without taking the time to write them down. Until now.
Table of Contents
| #!/bin/bash | |
| clang hello.c -target arm64-apple-darwin20.1.0 -o hello.arm64 | |
| echo -n "hello.arm64 is architecture " && lipo -archs ./hello.arm64 | |
| clang hello.c -target x86_64-apple-darwin-macho -o hello.x86_64 | |
| echo -n "hello.x86_64 is architecture " && lipo -archs ./hello.x86_64 | |
| lipo hello.arm64 hello.x86_64 -create -output hello | |
| echo -n "final output binary has archs " && lipo -archs ./hello |
| function isObject(entity) { | |
| return typeof entity === "object" && entity !== null; | |
| } | |
| function cloneNonObjectProperties(obj) { | |
| return Object.fromEntries( | |
| Object.entries(obj).filter(([, v]) => !isObject(v)) | |
| ) | |
| } |
Note: this guide is designed for AWS ECS services, but starting from Step 4 is functionally equivalent to any Docker container on a Linux host.
| # Run as admin! | |
| # Note you can run more than once - it will not create duplicates | |
| # Based off of https://gist.github.com/dknoodle | |
| $userPath = $env:USERPROFILE | |
| $pathExclusions = New-Object System.Collections.ArrayList | |
| $processExclusions = New-Object System.Collections.ArrayList | |
| # Visual Studio 2019 |
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """Script to facilitate the import of a Readcube Papers 3 library into Zotero | |
| __Purpose of this script__ | |
| If you export your Readcube (Mekentosj) Papers3 library as a BibTeX file, the file paths to the PDFs are not formatted | |
| correctly for Zotero to import them. |
| # Determines which branch(es) will cause a CI build to be started | |
| trigger: | |
| - master | |
| # Stages precede strategy, in other words each stage can contain a strategy (or multiple or none) | |
| # Full run-cylce described here: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/runs?view=azure-devops | |
| stages: | |
| - stage: Prepare | |
| jobs: | |
| - job: |