Find all <style> tags and their contents:
``
| package com.odbol.utils | |
| import kotlinx.coroutines.flow.MutableSharedFlow | |
| import kotlinx.coroutines.flow.MutableStateFlow | |
| /** Shares events across activities, services, etc */ | |
| object EventBus { | |
| val events = MutableStateFlow<Event>(Event.None) | |
| } |
| package com.odbol.utils | |
| /** | |
| * Groups consecutive items in an iterable by the given key. i.e. the sequence will emit a new list | |
| * each time the key changes, containing all items since the last key change. | |
| * | |
| * This is similar to Kotlin's built-in `groupBy` function, but it groups consecutive items with the | |
| * same key, rather than all items with the same key. Thus the same key can appear multiple times in | |
| * the output sequence. | |
| * |
| package com.odbol.coroutines | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.coroutineScope | |
| import java.util.function.Consumer | |
| import kotlinx.coroutines.flow.StateFlow | |
| import kotlinx.coroutines.launch | |
| /** Helps using Kotlin coroutines from Java code */ | |
| object CoroutineHelper { |
| /* | |
| * Copyright (C) 2024 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| Image key Image Another column | |
| 1 =IMAGE("data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7") Random data | |
| 2 =IMAGE("data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/XBs/fNwfjZ0frl3/zy7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkAABAALAAAAAAQABAAAAVVICSOZGlCQAosJ6mu7fiyZeKqNKToQGDsM8hBADgUXoGAiqhSvp5QAnQKGIgUhwFUYLCVDFCrKUE1lBavAViFIDlTImbKC5Gm2hB0SlBCBMQiB0UjIQA7") More Random data |
Find all <style> tags and their contents:
``
The WooCommerce Wordpress plugin doesn't have a way to update all prices for all products and all variations in bulk. You have to do it by hand, in the Wordpress admin editor, or pay for a "bulk edit" plugin to do it.
Or, you can hack the database directly using some fancy SQL. It took me a while to figure this out.
-- Update all prices for all variations and products that are 4.99, change to 5.99| fun generateSequenceOfFractions( | |
| range: ClosedFloatingPointRange<Float>, | |
| step: Float | |
| ): Sequence<Float> { | |
| val multiplier = 1f / step | |
| val start = floor(range.start * multiplier).toInt() | |
| val endInclusive = ceil(range.endInclusive * multiplier).toInt() | |
| return generateSequence(start) { it + 1 } | |
| .takeWhile { it <= endInclusive } | |
| .map{ it.toFloat() / multiplier } |
| /** Returns the first querystring parameter with the given key, or null if not found. */ | |
| export function getParam(param: string): string|null { | |
| var dataCallbackMatches = new RegExp(param + '=([^&]+)').exec(document.location.href); | |
| if (dataCallbackMatches) { | |
| return dataCallbackMatches[1]; | |
| } else { | |
| return null; | |
| } | |
| }; |
| import {Deferred} from './Deferred.js'; // See https://gist.github.com/odbol/1a98cf6186caaace78cae9e7a249c992 | |
| /** | |
| * A PendingRequest. | |
| */ | |
| export interface PendingRequest<T> { | |
| /** | |
| * Id of the request for resolving/rejecting later. | |
| */ | |
| requestId: number; |