brew install fonttools
Put two fonts in a folder, e.g.
| // Please check https://github.com/gristlabs/grist-api | |
| import { GristDocAPI } from 'grist-api' | |
| export default async function Page() { | |
| const DOC_URL = process.env.GRIST_DOC_URL | |
| const API_KEY = process.env.GRIST_API_KEY | |
| const api = new GristDocAPI(DOC_URL, { apiKey: API_KEY }) | |
| const salary_data = await api.fetchTable('Salary') | |
| const team_data = await api.fetchTable('Team') | |
| const team = salary_data.map((person) => { |
| <?php | |
| // Add Blog related field to REST API /wp-json/wp/v2/blog | |
| function blog_add_related_posts() | |
| { | |
| register_rest_field('blog', 'related', [ | |
| 'get_callback' => function ($post) { | |
| $categories = wp_get_post_categories($post['id']); | |
| $related = get_posts([ | |
| 'post_type' => 'blog', |
| <?php | |
| // Add Blog CPT to category archive | |
| add_action('pre_get_posts', 'blog_set_category'); | |
| function blog_set_category($query) | |
| { | |
| if (is_category() && !is_admin() && $query->is_main_query()) { | |
| $query->set('post_type', 'blog'); | |
| } | |
| } |
| <?php | |
| add_action('admin_init', function () { | |
| // Redirect any user trying to access comments page | |
| global $pagenow; | |
| if ($pagenow === 'edit-comments.php') { | |
| wp_redirect(admin_url()); | |
| exit; | |
| } |
| <?php /* EVENT SLUG FROM DATE*/ | |
| function event_slug($post_id, $post, $update) | |
| { | |
| if (get_field('date', $post_id)) { | |
| $date = get_field('date', $post_id); | |
| $slug = date('ymd', strtotime($date)); | |
| if ($post->post_name != $slug) { | |
| remove_action('save_post_event', 'event_slug', 10, 3); | |
| wp_update_post([ |
| #!/bin/bash | |
| # | |
| # This script will browse a Slack export folder and download all files in a new /export folder | |
| # | |
| # HOW TO: | |
| # 1. As a Workspace admin, download an export of your Slack history (https://www.slack.com/services/export) | |
| # 2. Make sure you have jq installed (https://stedolan.github.io/jq/) | |
| # 3. Place this file at the root of your Slack export folder, next to channels.json | |
| # 4. Run `bash slack-files-downloader.sh` in your terminal | |
| # |
| <?php | |
| add_filter('wp_unique_post_slug', 'seed_unique_slug', 10, 4); | |
| function seed_unique_slug($slug, $post_id, $post_status, $post_type) | |
| { | |
| if (in_array($post_type, ['post', 'product'])) { | |
| $post = get_post($post_id); | |
| if (empty($post->post_name) || $slug != $post->post_name) { | |
| $slug = randomSlug(); | |
| } | |
| } |
| on: [push] | |
| jobs: | |
| deploy_job: | |
| runs-on: ubuntu-latest | |
| name: deploy | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Install Dependencies |
| [ | |
| { | |
| "zipCode": "10100", | |
| "subDistrictList": [ | |
| { | |
| "subDistrictId": "100801", | |
| "districtId": "1008", | |
| "provinceId": "10", | |
| "subDistrictName": "ป้อมปราบ" | |
| }, |