- Create your realm / client
- Inside client configuration go to "Mappers"
- Click on "Create"
- Name it "hasura"
- Choose Mapper Type "Script Mapper"
- Add following script to demonstrate how it works
#!/usr/bin/env python3 | |
""" | |
Converts WEBVTT subtitles (vtt) to plain text. | |
It removes all time related info as well as duplicated and empty lines. | |
""" | |
# Author: Artur Martins <arturmartins@gmail.com> | |
# Version: 1.0 | |
# Date: 2023-Oct-25 |
""" | |
About: | |
Looks in the given directory for any .srt (transcript) files to convert to a simple, | |
single line of text with timestamps and numbered lines removed. | |
Command line execution: | |
python srt_to_txt.py <source_directory> <file_encoding> | |
@:param <source_directory> is the location of the .srt file(s) | |
@:param <file_encoding> defaults to 'utf-8' |
<!-- | |
/* | |
* Serverless contact form handler for Cloudflare Workers. | |
* Emails are sent via Mailgun. | |
* | |
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form | |
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb | |
* | |
* (c) Max Kostinevich / https://maxkostinevich.com | |
*/ |
I tested this running Ghost 2.11.1 and the multilingual version of the Casper 2 theme.
My code is based on an older blog post by Aspire Themes on Medium: https://medium.com/aspirethemes/how-to-create-a-tags-list-page-in-your-ghost-theme-7a151413f5b0.
First, I recommend, you install Casper or the multilingual version linked above using git clone
. That way, you can't easily mess things up.
""" | |
Convert YouTube subtitles(vtt) to human readable text. | |
Download only subtitles from YouTube with youtube-dl: | |
youtube-dl --skip-download --convert-subs vtt <video_url> | |
Note that default subtitle format provided by YouTube is ass, which is hard | |
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which | |
is easier to process. |
<?php | |
// Add your own function to filter the fields | |
add_filter( 'submit_job_form_fields', 'remove_listify_submit_job_form_fields', 9999999999 ); | |
// This is your function which takes the fields, modifies them, and returns them | |
// You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php | |
function remove_listify_submit_job_form_fields( $fields ) { | |
if( ! isset( $fields['company'] ) ) return $fields; |
Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)
api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});
GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3
/** | |
* Declare Sensei support | |
* | |
* This is needed to hide the Sensei theme compatibility notice your admin dashboard. | |
*/ | |
add_action( 'after_setup_theme', 'divi_sensei_support' ); | |
function divi_sensei_support() { | |
add_theme_support( 'sensei' ); | |
} |
/* Modern Font Stacks */ | |
/* System */ | |
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif; | |
/* System (Bootstrap 5.2.0) */ | |
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; | |
/* Times New Roman-based serif */ | |
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif; |