Skip to content

Instantly share code, notes, and snippets.

@symbioquine
symbioquine / patch.lua
Last active August 11, 2019 15:40 — forked from alexander-yakushev/patch.lua
Fix move_to_screen in AwesomeWM v4.3
function smart_move_to_screen(c, dir)
local was_maximized = { h = false, v = false }
if c.maximized_horizontal then
c.maximized_horizontal = false
was_maximized.h = true
end
if c.maximized_vertical then
c.maximized_vertical = false
was_maximized.v = true
end
@symbioquine
symbioquine / gist:3be25b130c57f1108eb7ca9bd055f17e
Created February 14, 2021 02:08
2021_02_13_farmOS_2x_migration_testing_log
$ docker-compose logs --follow www2
Attaching to devel_www2_1
www2_1 | + '[' -d /opt/drupal ']'
www2_1 | ++ ls -A /opt/drupal/composer.json
www2_1 | ls: cannot access '/opt/drupal/composer.json': No such file or directory
www2_1 | + '[' '' ']'
www2_1 | + echo 'farmOS codebase not detected. Copying from pre-built files in the Docker image.'
www2_1 | + cp -rp /var/farmOS/. /opt/drupal
www2_1 | farmOS codebase not detected. Copying from pre-built files in the Docker image.
www2_1 | + wait_db_ready
@symbioquine
symbioquine / gist:ecd83655865ebe631a2ed164b665264f
Created February 14, 2021 04:02
Troubleshooting `farm_migrate_quantity` farmOS 2.x migration
# drush migrate:messages farm_migrate_quantity
[warning] array_keys() expects parameter 1 to be array, null given MigrateToolsCommands.php:626
[warning] array_map(): Expected parameter 2 to be an array, null given MigrateToolsCommands.php:626
[warning] array_combine() expects parameter 1 to be array, null given MigrateToolsCommands.php:627
[notice] No messages for this migration
# drush migrate:status farm_migrate_quantity
------------------------------------------------------- ----------------------- -------- ------- ---------- ------------- ---------------
Group Migration ID Status Total Imported Unprocessed Last Imported
------------------------------------------------------- ----------------------- -------- ------- ---------- ------------- ---------------
farmOS 1.x Quantity Migration (farm_migrate_quantity) farm_migrate_quantity Idle 559 0 559
version: '3'
services:
db:
image: postgres:12
volumes:
- './db:/var/lib/postgresql/data'
ports:
- '5432:5432'
environment:
POSTGRES_USER: farm
@symbioquine
symbioquine / poetry.lock
Created January 17, 2022 21:05
rewrite_fix_big_endian_geometries
[[package]]
name = "attrs"
version = "21.4.0"
description = "Classes Without Boilerplate"
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[package.extras]
dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"]
@symbioquine
symbioquine / seeding_logs_by_weekday.ipynb
Created February 12, 2022 15:56
farmOS + JupyterLite: seeding_logs_by_weekday.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@symbioquine
symbioquine / animal_csv_import.ipynb
Created February 12, 2022 17:50
farmOS + JupyterLite: Import a CSV of Animals
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@symbioquine
symbioquine / land_kml_import.ipynb
Created February 15, 2022 16:52
farmOS + JupyterLite: Import KML
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@symbioquine
symbioquine / example_usage_with_pagination.js
Created March 25, 2022 03:52
Using Drupal Subrequests from Javascript
import makeDrupalSubrequest from '@/makeDrupalSubrequest';
const assetTypes = ['animal', 'land', 'plant'];
async main() {
const filterQueryString = `filter[is_location]=1`;
async function* paginateAssets() {
const requests = assetTypes.map(assetType => ({
id: assetType,
@symbioquine
symbioquine / README.md
Created April 21, 2022 14:31
Running farmOS 2.x as a subpath behind a reverse proxy

Demonstrates a simple strategy to host farmOS in a subpath/subdirectory behind a reverse proxy.

Assumes that the farmos.test domain is pointing at localhost or the IP of the server where this example is being run.

The main "tricky" thing that's going on in the example is the creation of a symlink in the web root from ./farm0/ back to the web root itself. That was the simplest strategy I could find to make Drupal understand that it should serve itself from the subdirectory without more complex configuration or file moving.