Skip to content

Instantly share code, notes, and snippets.

@dtw
dtw / 2fa-initial-setup-form.php
Last active February 27, 2024 11:20
Add filter to 2fa-initial-setup-form
<style>#login { width:360px; padding:5% 0 0; }</style>
<?php if ( ! empty( $args['error'] ) ) : ?>
<div id="login_error"><strong><?php echo $args['error']; ?></strong><br /></div>
<?php endif ?>
<form name="sgs2fa_form" id="loginform" action="<?php echo $args['action']; ?>" method="post">
<h1><?php esc_html_e( '2-factor Authentication', 'sg-security' ); ?></h1>
<br />
<p class="sg-2fa-title"><?php esc_html_e(apply_filters('sg_security_2fa_setup_string', 'The administrator of this site has asked that you enable 2-factor authentication. To do that, install the Google Authenticator app and scan the QR code below to add a token for this website.', 0), 'sg-security'); ?></p>
@dtw
dtw / gist:c346c76d985f4d30e8a2057b2f136eec
Last active February 9, 2024 14:22
Changes to Non-Lethal Trait in Infinity N4
This weapon, piece of Equipment or Hacking Program loads an ammunition type that: doesn’t cause the target to lose points of its Wounds/STR Attribute AND/OR doesn’t require the target to make a Saving Roll when hit.
No matter the ammunition type this weapon, piece of Equipment or Hacking Program uses, it can never cause the target to lose points of its Wounds/STR Attribute, even if a Skill, rule or MOD adds or combines other ammunition types, the Non-Lethal Trait always take precedence.
function slugify(text) {
// from https://gist.github.com/codeguy/6684588?permalink_comment_id=3243980#gistcomment-3243980
return text
.toString() // Cast to string (optional)
.normalize('NFKD') // The normalize() using NFKD method returns the Unicode Normalization Form of a given string.
.toLowerCase() // Convert the string to lowercase letters
.trim() // Remove whitespace from both sides of a string (optional)
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
@dtw
dtw / rss_to_webhook_filter_code_ifttt.js
Last active May 23, 2022 16:44
Filter code to process an RSS Trigger into a Webhook to micropub via IFTTT
// The title is of the form "Movie Name, YYYY - ★★"
let varEntryTitle = 'Jurassic Park III, 2001 - ★★★'
// This is the URL for the user's review
let varEntryUrl = 'https://letterboxd.com/username/film/jurassic-park-iii/'
// Entry content
let varEntryContent ='<p><img src="https://a.ltrbxd.com/resized/film-poster/5/1/7/3/1/51731-jurassic-park-iii-0-500-0-750-crop.jpg?k=d0966124ec"/></p> <p>Fine.</p>'
// Find the final dash to separate the movie title from the star rating
let varDashIndex = varEntryTitle.lastIndexOf('-')
// This is the star rating
let varRating = varEntryTitle.substring(varDashIndex+2)

Keybase proof

I hereby claim:

To claim this, I am signing this object: