Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Kilmurray kilbot

View GitHub Profile
@kilbot
kilbot / database.ts
Last active Aug 27, 2022
RxStorage adapter for expo-sqlite
View database.ts
import { createRxDatabase } from 'rxdb';
import { getRxStorageSQLite, SQLiteQueryWithParams } from 'rxdb-premium/plugins/sqlite';
import { openDatabase, WebSQLDatabase, ResultSet } from 'expo-sqlite';
/**
* Polyfill for TextEncoder
* fixes: ReferenceError: Can't find variable: TextEncoder
*/
import 'fast-text-encoding';
@kilbot
kilbot / functions.php
Created May 4, 2022
Deactivate Drip_Woocommerce_Cart_Events->find_drip_visitor_uuid()
View functions.php
<?php
// add to custom functions
add_filter( 'option_account_id', function( $value ){
if ( function_exists('is_pos') && is_pos() ) {
return null;
}
return $value;
});
@kilbot
kilbot / snippet.php
Last active Feb 15, 2022
Snippet to update order postmeta
View snippet.php
<?php
global $wpdb;
$customer_id = 6; // CHANGE THIS!
$customer_email = 'test@wordpress.com'; // CHANGE THIS!
$postids = $wpdb->get_col(
$wpdb->prepare(
"
SELECT pm.post_id
FROM {$wpdb->postmeta} pm
@kilbot
kilbot / functions.php
Last active Dec 16, 2021
Bypass Advanced noCaptcha & invisible Captcha (v2 & v3)
View functions.php
<?php
// add to your theme functions.php file
function woocommerce_pos_anr_verify_captcha_pre($response) {
if( function_exists('is_pos') && is_pos() ) {
return true;
}
return $response;
}
@kilbot
kilbot / functions.php
Last active Nov 7, 2021
Support for PW Gift Cards plugin
View functions.php
<?php
// add to your theme functions.php file
function pw_gift_card_product_response($response) {
if( ! function_exists('is_pos') || ! is_pos() )
return $response;
$data = $response->get_data();
$type = isset( $data['type'] ) ? $data['type'] : '';
@kilbot
kilbot / functions
Created Nov 7, 2021
Support for PW Gift Cards plugin
View functions
<?php
// add to your theme functions.php file
function custom_product_response($response) {
if( ! function_exists('is_pos') || ! is_pos() )
return $response;
$data = $response->get_data();
$type = isset( $data['type'] ) ? $data['type'] : '';
@kilbot
kilbot / ReactNativeFlipper.java
Last active Sep 30, 2022
WatermelonDB Inspector for Flipper (extensible RN debugger)
View ReactNativeFlipper.java
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package ***CHANGE_ME***;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
View keybase.md

Keybase proof

I hereby claim:

  • I am kilbot on github.
  • I am kilbot (https://keybase.io/kilbot) on keybase.
  • I have a public key ASDfUhifa7YeloJAewiQxQS5_qB1BHOdL8ipzmgHcwE3ZAo

To claim this, I am signing this object:

View functions.php
<?php
// the code below goes in your theme's functions.php file
function my_custom_pos_template_redirect() {
$usd_store_id = 3365;
$cad_store_id = 3366;
$current_store_id = get_user_option('woocommerce_pos_store');
View functions.php
<?php
// this goes in your theme functions.php file
function my_custom_rest_dispatch_request($continue, $request, $route, $handler)
{
if (function_exists('is_pos') && is_pos() && $route == 'wc/v3/products') {
$request->set_param('per_page', -1);
$request->set_param('stock_status', 'instock');
}