Skip to content

Instantly share code, notes, and snippets.

@balsama
balsama / composer.json
Created October 13, 2023 17:27
Example `acquia_cms_community` `composer.json` generated by acms:build
{
"name": "acquia/drupal-recommended-project",
"description": "Acquia-compatible Drupal application based on the Drupal Recommended Project",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Acquia Engineering",
"homepage": "https://www.acquia.com",
"role": "Maintainer"
}
@balsama
balsama / boston311-trash-by-zip-and-year.json
Created September 11, 2023 00:09
Boston 311 reports about Trash by zip code by year
{
"2023": {
"02134": {
"year": "2023",
"zip": "02134",
"count": "433",
"zip_population": 18437,
"zip_area": 854.4388723219971,
"per_capita": 0.023485382654444865,
"per_area": 0.5067653333974522,
@balsama
balsama / uhub-articles-per-day.csv
Created August 10, 2023 03:11
Number of articles published on universalhub.com per day
date count
2020-11-28 3
2020-11-29 4
2020-11-30 6
2020-12-01 10
2020-12-02 9
2020-12-03 11
2020-12-04 5
2020-12-05 8
2020-12-06 6
@balsama
balsama / rangeConverter.php
Created June 9, 2022 14:11
Function to convert a value in a range to an equivalent value in a different range.
<?php
function rangeConverter(
int $input,
int $inputRangeMin,
int $inputRangeMax,
int $outputRangeMin = 0,
int $outputRangeMax = 100
) :int
{
@balsama
balsama / northEndWalkTimeToFruit.json
Created June 3, 2022 06:56
Walk time to nearest store that sells fruit for every address in the north end
{
"2 Atlantic Ave 02110": {
"timeToClosestPlace": 151,
"closestPlace": "golden goose",
"latlong": "42.364078674443,-71.050740588314",
"parcelId": "0303030010"
},
"206-214 Atlantic Ave 02110": {
"timeToClosestPlace": 426,
"closestPlace": "golden goose",
@balsama
balsama / NorthEndBostonAddresses.txt
Last active June 3, 2022 04:34
Unique addresses (no unit numbers) in City of Boston Ward Precincts 0301, 0302, 0303, and 0304 - roughly the North End.
2 Atlantic Ave 02110
206-214 Atlantic Ave 02110
28-32 Atlantic Ave 02110
45 Lewis Whf 02110
34-38 Atlantic Ave 02110
45-63 Atlantic Ave 02110
63 Atlantic Ave 02110
65-69 Atlantic Ave 02110
79-85 Atlantic Ave 02109
84 Atlantic Ave 02110
@balsama
balsama / stopwords.txt
Created December 22, 2021 04:06
STOPWORDS (excluded words) for generating Boston Vax Mandate 311 requests wordcloud
# standard
a
able
about
across
after
all
almost
also
am
@balsama
balsama / 311-vax-mandate-requests.txt
Last active December 22, 2021 04:01
Boston 311 requests containing the word vaccine (and its derivatives), vax, shot, and jab the day Michelle Wu announced the vaccine mandate for city employees and establishments.
please tell the mayor i will not do business in the city until the vaccine mandate is lifted.
can anybody tell me what makes the mayor supposedly running the city think she can make up laws or regulations that interfere with my rights. i am a person of colora us citizena us veteran elderly but , maybe that does not matter, maybe i have to be an "illegal" to get everything "free" and not worry about laws and vaccine mandate. are we now under communist rule with this person of color mayor???time to stand up and say "no"
i wont get vaccinated until we have a free pizza party
my body my choice! i'm a vaccinated person and still think this is absolutely asinine! michelle wu we are all against you
please note my report. i am a lifelong boston resident and i am completely opposed to the mayor's mandates. i've emailed the mayor twice as well as city councilors. guess what? no response. i will not show "papers" to dine out or bring my kids to the library. we are in charge of the government, not the other way around.
@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.