As to my knowledge, strapi does not provide any options to set the email urls via the environment variable. So I included it into the strapi bootstrap function. It relies on the environment variable common.emails.resetPasswordUrl:
// index.ts
import type { Core } from "@strapi/strapi"
async function setEmailConfiguration(strapi: Core.Strapi) {
strapi.log.info("✉️ Setting email configuration...")
const resetPasswordUrl = strapi.config.get("common.emails.resetPasswordUrl")
strapi.log.info(`✉️ Reset password Url: ${resetPasswordUrl}`)I needed a function to hash a cell's content in Microsoft Excel. Internal calls to .NET functions don't work on a Mac. Also the Python-Integration is only available in Business-Plans. So I wrote a VBA function to hash a string with SHA256 on a Mac.
This VBA function uses the Mac's internal sha256 implementation, makes a system call and returns the hash. The function is called SHA256_Mac and takes a string as input. The function returns the hash as a string.
Add it to your macro-enabled Excel file and use it like this:
=SHA256_Mac("abc")
If you have an M1 Mac and want to compile and execute x86_64 assembly code, make sure you install Rosetta 2 and nasm (brew install nasm).
Than, take a 64 Bit assembly program, e.g. from this tutorial page (https://cs.lmu.edu/~ray/notes/nasmtutorial/) in Section
"Your First Program" for macOS, save it to a file called hello.asm.
Compile, link and execute the program:
nasm -f macho64 hello.asm
ld hello.o -o hello -macosx_version_min 11.0 -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem
./hello
If you want to convert a wav file to 16 kHz for whisper in Rust, you can use the following script. It uses the hound crate to read and write wav files and rubato to resample the audio.
Reads a file as input.wav and returns a converted wav as output.wav.
use rubato::{
Resampler, SincFixedIn, SincInterpolationParameters, SincInterpolationType, WindowFunction,
};Let's assume we have a post type employee and some categories. We want to get all employees, who are assigned to a specific category to add them via a shortcode. The shortcode should have two attributes: category and layout. The category attribute should accept a comma-separated list of category slugs or IDs. The layout attribute should define the output layout: grid or slider.
Here is an example of how to create a shortcode to list employees by category:
/**
* Listing of employees by category
*
* Example: [employee category="Physiotherapie" layout="grid"]
* - layout="grid": Displays the employees in a grid (default)This script creates a sitemap based on the page.tsx-files found in your app-directory.
Create a file called sitemap.ts inside of your app/ directory of your NextJS application.
Then fill it with this script:
import { globby } from "globby"
import type { MetadataRoute } from "next"Inspired by this Gist and @coryodaniel's solution,
I put the script inside a babashka script, called pdf-like-fax.clj:
#!/usr/bin/env bb
(defn pdf-like-fax [input output]
(let [sign (rand-nth ["+" "-"])
rotation (rand-int 1000)
cmd (format "convert -density 150 %s -rotate %s0.%s -attenuate 0.4 +noise Multiplicative -attenuate 0.03 +noise Multiplicative -sharpen 0x1.0 -colorspace Gray %s" input sign rotation output)
prepared-cmd (str/split cmd #" ")]This solution is based the code snippet provided @nsteinmetz in this issue.
If you deployed mattermost via the helm chart, you might experience the same problem as we at @schnaq did: the mounted volumes belong to root but not to the mattermost user. This is a problem if you want to install settings, or new plugins (e.g. the playbook or the focalboard).
To fix this, we checked the id of the mattermost user in our running pod: