Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Shelob9 / script.js
Last active February 20, 2025 15:09 — forked from spf13/script.js
Download all your Kindle books before Feb 26, 2025
// 1. Log in to your Amazon account
// 2. Go to your Content Library > Books - https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/
// 3. Open your browser's Javascript console
// 4. For each page of books, paste this script into the console
(async function () {
// Close the notification if it appears
function closeNotification() {
const notifClose = document.querySelector("span#notification-close");
if (notifClose) {
@Shelob9
Shelob9 / script.js
Created February 20, 2025 15:08 — forked from spf13/script.js
Download all your Kindle books before Feb 26, 2025
// 1. Log in to your Amazon account
// 2. Go to your Content Library > Books - https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/
// 3. Open your browser's Javascript console
// 4. For each page of books, paste this script into the console
(async function () {
// Close the notification if it appears
function closeNotification() {
const notifClose = document.querySelector("span#notification-close");
if (notifClose) {
@Shelob9
Shelob9 / billing-details-translation.php
Last active April 12, 2022 18:06 — forked from helgatheviking/billing-details-translation.php
Change Billing Details text on free checkout
<?php
add_filter( 'gettext', function( $translated_text, $untranslated_text, $domain ) {
if ( function_exists( 'wc' ) && 'woocommerce' === $domain ) {
//make the changes to the text
switch( $untranslated_text ) {
case 'Billing details':
if ( ! WC()->cart->needs_shipping() && 0.0 === floatval( WC()->cart->get_total( 'edit' ) ) ) {
@Shelob9
Shelob9 / track-entry-id-by-user.php
Created September 13, 2018 14:31 — forked from New0/track-entry-id-by-user.php
Track Caldera Forms entry ID in user meta so form can be used as editor for previous submission https://calderaforms.com/doc/edit-caldera-forms-entries/
<?php
/**
* On form load, check for a saved entry for current user
*/
add_filter( 'caldera_forms_render_entry_id', function ( $entry_id, $form ){
//change form ID to match your form
if( 'CF1234567' == $form[ 'ID' ] && get_current_user_id() ){
$saved_entry_id = get_user_meta( get_current_user_id(), 'form_entry_id', true );
if( 0 < absint( $saved_entry_id ) ){
$entry_id = $saved_entry_id;
@Shelob9
Shelob9 / Hoverable.js
Created September 11, 2018 20:19 — forked from MoOx/Hoverable.js
Hoverable HoC for React components
// @flow
import React, { Component } from "react"
type Props = {
onMouseEnter?: Function | boolean,
onMouseLeave?: Function | boolean,
}
type State = {
@Shelob9
Shelob9 / setup-phpunit.sh
Last active February 28, 2018 17:15 — forked from DevinWalker/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, git, subversion, composer, curl and wget
#
# WordPress and the WP_UnitTestCase are installed in the /tmp directory
# The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file
@Shelob9
Shelob9 / setup-phpunit.sh
Last active April 14, 2018 17:03 — forked from DevinWalker/setup-phpunit.sh
Setup PHPUnit for use in the Local by Flywheel app
#!/usr/bin/env bash
# ===============================================================================
# Script to install PHPUnit in the Local by Flywheel Mac app
# These packages are installed
#
# PHPUnit, git, subversion, composer, curl and wget
#
# WordPress and the WP_UnitTestCase are installed in the /tmp directory
# The $WP_CORE_DIR and $WP_TESTS_DIR variables are added to the .bashrc file
@Shelob9
Shelob9 / addon.js
Created February 16, 2018 16:34 — forked from JasonHoffmann/addon.js
Sample filterable block
/**
* This is an example of a script that would hook into the filter or
* subscribe to some sort of data. I want to make the assumption that
* this could be non-ES6 code with no access to the spread operator, so
* something like push would be used instead.
*/
function rkvAddPython( codeList ) {
codeList.push( {
title: 'Python',
codemirror: 'python',
<?php
/**
* Delete one field's value after Caldera Forms sends main mailer
*/
add_action( 'caldera_forms_submit_complete',
function( $form, $referrer, $process_id, $entry_id ){
//IMPORTANT: Change form ID here
$form_id = 'CF123456';
//IMPORTANT: Change field ID here
@Shelob9
Shelob9 / Select.js
Last active December 18, 2019 22:57 — forked from royboy789/Select.react.js
Gutenberg React state example
const { __ } = wp.i18n;
const { Component } = wp.element;
const el = wp.element.createElement;
export default class Select extends Component {
constructor( props ) {
super( ...props );
this.selectCallback = this.selectCallback.bind(this);
this.state = {