Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
| /* Obsidian snippet to style output of pdf exports | |
| */ | |
| @media print { | |
| /* set your preferred fonts here. | |
| */ | |
| :root { | |
| --body-font-family: "Newsreader Text", TimesNewRoman, "Times New Roman", Times, Baskerville, Georgia, serif; |
| File ---> application\controllers\admin\Authentication.php: | |
| 23: hooks()->do_action('admin_auth_init'); | |
| 80: hooks()->do_action('after_staff_login'); | |
| 107: hooks()->do_action('after_staff_login'); | |
| 117: hooks()->do_action('after_staff_login'); | |
| 219: hooks()->do_action('after_user_logout'); | |
| File ---> application\controllers\admin\Auto_update.php: | |
| 14: hooks()->do_action('before_perform_update', $latest_version); |
| #!/usr/bin/env php | |
| <?php | |
| // API Credentials | |
| // You can either provide them as environment variables | |
| // or hard-code them in the empty strings below. | |
| $apiUrl = getenv('BS_URL') ?: ''; // http://bookstack.local/ | |
| $clientId = getenv('BS_TOKEN_ID') ?: ''; | |
| $clientSecret = getenv('BS_TOKEN_SECRET') ?: ''; |
| <?php | |
| // example call: http://localhost/largest.php?url_without_http=bbc.co.uk | |
| $url = $_GET['url_without_http']; | |
| $largest = get_largest_img("http://" . $url); | |
| $embed = empty($largest) ? "Suitable image not found" : "<img src='" . $largest . "'>"; | |
| echo("<html><body>" . $embed . "</body></html>"); | |
| function get_largest_img($url) { |
| <?php | |
| /********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
| /* Change size for Yoast SEO OpenGraph image for all content | |
| * Credit: Yoast Development team | |
| * Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1 | |
| * Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail' | |
| * Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/ | |
| */ | |
| <?php | |
| //Use this function to contact CW API | |
| /** | |
| * | |
| * @param string $method GET|POST|PUT|DELETE | |
| * @param string $url relative URL for the call | |
| * @param string $accessToken Access token generated using OAuth Call | |
| * @param type $post Optional post data for the call | |
| * @return object Output from CW API | |
| */ |
| ## Pre-requisite: You have to know your last commit message from your deleted branch. | |
| git reflog | |
| # Search for message in the list | |
| # a901eda HEAD@{18}: commit: <last commit message> | |
| # Now you have two options, either checkout revision or HEAD | |
| git checkout a901eda | |
| # Or | |
| git checkout HEAD@{18} |
| <?php | |
| /** | |
| * PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON | |
| */ | |
| # Connect to MySQL database | |
| $conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword'); | |
| # However the User's Query will be passed to the DB: | |
| $sql = 'SELECT * from GDA_database WHERE user_query = whatever'; |
| #!/bin/sh | |
| # Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
| # CREATE block and create them in separate commands _after_ all the INSERTs. | |
| # Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
| # The mysqldump file is traversed only once. | |
| # Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
| # Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |