Skip to content

Instantly share code, notes, and snippets.

@balsama
balsama / openalpr.conf
Created November 27, 2021 05:55
ALPR config geared towards crowd sourced images that might nit have a small license plate.
; Specify the path to the runtime data directory
runtime_dir = ${CMAKE_INSTALL_PREFIX}/share/openalpr/runtime_data
ocr_img_size_percent = 1.33333333
state_id_img_size_percent = 2.0
; Calibrating your camera improves detection accuracy in cases where vehicle plates are captured at a steep angle
; Use the openalpr-utils-calibrate utility to calibrate your fixed camera to adjust for an angle
@balsama
balsama / chirp-counter.py
Created August 4, 2021 22:57
Counts the number of Katydid chirp groups and the number of chirps per group in a .wav file.
#!/usr/bin/env python
import sys
from pydub import AudioSegment
from pydub.silence import split_on_silence
sound_file = AudioSegment.from_wav("./wav/2021-08-03--72--002.wav")
# First chunk the audio file into groups of chirps.
audio_chunks = split_on_silence(sound_file,
# Must be silent for a little less than 1/5th of a second.
@balsama
balsama / check-ci-config-for-orca-jobs.php
Created June 7, 2021 12:34
Check CI config for ORCA jobs
<?php
/**
* Provide the URL to the raw Travis CI config file as an argument to this script. Make sure it includes a token param
* if the repo is private. E.g.:
* php ./scripts/check-orca-jobs.php https://raw.githubusercontent.com/acquia/acquia_search/3.x/.travis.yml\?token\=VALIDTOKEN
*/
$config_url = $argv[1];
Councilor Edwards,
I'm writing to express my frustration over your announcement that the Foster Street Playground will continue to be used as a parking lot and that the City has issued an RFP to spend more than $50,000 to repave it for that purpose.
Unless there was a change of use by the Mass General Court, it's my understanding that the City has a constitutional obligation to maintain Foster Street Playground as recreational or open space. Your formal announcement that "it will continue to be a parking space" - and that the City plans to spend money on that use - seems to be in violation of that obligation.
Can you comment on whether a change of use was authorized? How can North End residents ensure that even more public recreational space isn't handed over to passive car storage?
Was an RFP to restore the playground to usable recreational open space considered?
@balsama
balsama / reports-by-day.csv
Created July 16, 2020 05:48
Boston 311 Reports: Fireworks - 2015-15July2020
date value
2015-12-26 1
2015-12-27 0
2015-12-28 0
2015-12-29 0
2015-12-30 0
2015-12-31 0
2016-01-01 1
2016-01-02 0
2016-01-03 0
@balsama
balsama / ama-manual-cloud-deploy.md
Last active June 11, 2020 03:59
Instructions to manually deploy Migrate Assistant to an Acquia Cloud environment

Manually deploy a newly created migrate project to Acquia Cloud

Prerequisites

  1. Admin access to an Acquia Cloud hosting environment.
  2. A Drupal 7 site running locally
  3. SSH keys on Cloud for your local machine

Instructions

  1. Generate a new migrate project. Use the migrate-quickstart command to generate a new Drupal 9 project per the instructions in the Quick Start section of AMA’s README. You should also run the commands that are echoed at the end of following those instructions.
@balsama
balsama / composer.json
Last active February 26, 2020 03:37
Acquia Migrate Assistant Project
{
"name": "acquia/acquia-migrate-project",
"type": "project",
"description": "Project template for Acquia Migrate Assistant",
"homepage": "https://www.drupal.org/project/drupal",
"license": "GPL-2.0-or-later",
"require": {
"php": "~7.3.0",
"composer/installers": "^1.2",
"cweagans/composer-patches": "^1.6",
@balsama
balsama / drupal-project-docroot-convert.sh
Created December 5, 2018 15:26
Convert the web-served directory name in drupal-composer/drupal-project
#!/usr/bin/env bash
# DESCRIPTION:
# https://github.com/drupal-composer/drupal-project assumes your web-served
# directory is named `web`. But certain hosts (e.g. Acquia) need this directory
# to be named `docroot`. This script will convert the name of the directory to
# `docroot` or any other arbitrary name passed as an argument.
#
# USAGE:
# 1. Copy this file into the repo root of a project created with
@balsama
balsama / composer.json
Created October 3, 2018 19:42
Headless with new patch
{
"name": "acquia/headless_lightning",
"description": "Drupal Lightning as a backend for fully decoupled applications.",
"type": "drupal-profile",
"license": "GPL-2.0-or-later",
"minimum-stability": "dev",
"prefer-stable": true,
"require-dev": {
"drupal/devel": "^1.0",
"drupal/console": "^1.0.0",
@balsama
balsama / lightning-user-stories-layout.md
Last active March 12, 2018 17:48
Lightning Layout User Stories

Layout

  1. When I create a one-off page I want to be able to add blocks and position them for just that page so both the layout and the content are unique.

    Solution: Allow overrides enabled and editor modifies via IPE

  2. When I edit a content type, I want to set a default layout that suits the fields in that type so my content type layouts vary in a way that makes them quickly identifiable.

    Solution: Create a layout via Panelizer wizard.

  3. When I create content I want to be able to choose a layout for just one post, so I can use layout to visually emphasize something unique about the content.

> Solution: Create multiple layouts via Panelizer wizard and select more than one as available to Editors.