Skip to content

Instantly share code, notes, and snippets.

View robertandrews's full-sized avatar
💭
Learning

Robert Andrews robertandrews

💭
Learning
View GitHub Profile
@OliverBalfour
OliverBalfour / README.md
Last active April 26, 2024 19:38
Obsidian custom checkbox snippet

Custom checkboxes for Obsidian! It's like deathau's snippet except updated to work really well in Live Preview mode in Obsidian 1.0.

Simply edit the x inside checkboxes to >, ?, etc. to see styling like below!

Editing Live Preview Viewing
image image image

Installation:

  • Download the checkbox.css file on this page
/* RAINBOW INDENT COLORS */
:root {
/* default */
--font-use-default: var(--default-font);
--font-size-use-default: var(--editor-font-size);
--indent-use-default: 1.8ch;
/* ------- */
/* theme */
--font-use-theme: inherit;
@jacobobryant
jacobobryant / bookmarklet.js
Last active February 2, 2024 16:53
How to make your own airtable bookmark bookmarklet
// 1. Create a table on Airtable, and make URL/text columns with these names:
// URL, Title, Description, Image, Feed
//
// 2. Add a Form view. Click "Open form", then copy the URL. Set `airtable_form_url`
// below to that URL.
//
// 3. Create a new bookmark in your web browser, and paste in the code below. Whenever
// you're on a page you want to save, click the bookmark ("bookmarklet", technically).
// You'll go to the airtable form, and the columns listed above will be prefilled.
//
@pirey
pirey / functions.php
Last active May 24, 2022 10:52
Wordpress `the_content` filter, for adding class to img element in the page content
<?php
// other stuff ...
// register our filter to the wordpress action 'the_content',
// it will then be called when we call the_content() from anywhere in our template
add_filter( 'the_content', 'add_classlist_to_img' );
function add_classlist_to_img( $content ) {
// used to detect img tag element
$locateElement = '/\<img.*?\/\>/';
<?php if ( have_posts() ) : ?>
<?php
/**Get all of the data about the author from the WordPress and Pods generated user profile fields.**/
//First get the_post so WordPress knows who's author page this is
the_post();
//get the author's meta data and store in array $user
$user = get_userdata( get_the_author_meta('ID') );
//Escape all of the meta data we need into variables
$name = esc_attr($user->user_firstname) . '&nbsp;' . esc_attr($user->user_lastname);