Skip to content

Instantly share code, notes, and snippets.

View codearachnid's full-sized avatar
:octocat:
curiouser and curiouser

Timothy Wood codearachnid

:octocat:
curiouser and curiouser
View GitHub Profile

1. Setup the spreadsheet

Assuming that your sheet is structured as follows (adapt the script according to the specific layout needed):

Task Email Date/Time
Descriptive text value [email protected] 08/14/2025 16:00

2. Set up a trigger

@codearachnid
codearachnid / parseBrightDataCSV2JSON.php
Created July 24, 2025 15:37
Simple parser to convert csv export from brightdata into json output for normalization
<?php
function parseCsvRowToJson($csvRow) {
$keys = [
'url', 'domain', 'country_code', 'model_number', 'sku', 'product_id', 'product_name', 'manufacturer',
'final_price', 'initial_price', 'currency', 'in_stock', 'root_category', 'category', 'category_tree',
'rating', 'reviews_count', 'answered_questions_count', 'main_image', 'image_urls', 'features',
'dimensions', 'weight', 'details', 'warranty', 'related_documents', 'top_reviews', 'answered_questions',
'upc', 'upcgtin13', 'price_range', 'availability_text', 'promotion_fulltext', 'available_to_delivery',
'zipcode', 'store_name', 'store_number', 'description', 'timestamp', 'input', 'discovery_input',
@codearachnid
codearachnid / ResetUserPassword.md
Created January 16, 2025 20:09
ResetUserPassword Laravel custom artisan command

Artisan command to reset a user's password programmatically:

php artisan make:command ResetUserPassword

Open the generated command file app/Console/Commands/ResetUserPassword.php and update the handle method:

use App\Models\User;
@codearachnid
codearachnid / listAllEventListeners.js
Created November 26, 2024 17:37
Javascript - Listing active event listeners on a Web page. Great for use in Chrome console
function listAllEventListeners() {
const allElements = Array.prototype.slice.call(document.querySelectorAll('*'));
allElements.push(document);
allElements.push(window);
const types = [];
for (let ev in window) {
if (/^on/.test(ev)) types[types.length] = ev;
}
@codearachnid
codearachnid / toSqlBoolean.php
Created September 2, 2024 00:44
variety of values and convert to a boolean sql value
<?php
function toSqlBoolean($value) {
// Convert the value to a boolean first
$booleanValue = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
// Return SQL boolean equivalent
return $booleanValue ? 1 : 0;
}
@codearachnid
codearachnid / export-ga-analytics.py
Created June 12, 2024 19:48
Export Universal Analytics from Google Analytics API with pagination due to API limits
from google.oauth2 import service_account
from googleapiclient.discovery import build
from datetime import datetime
import csv
# Set up credentials and analytics service
SCOPES = ['https://www.googleapis.com/auth/analytics.readonly']
KEY_FILE_LOCATION = 'path/to/your-credentials-file.json'
VIEW_ID = 'your-view-id'
@codearachnid
codearachnid / acf_field_gravity_forms_list.php
Last active March 21, 2024 18:12
Populate ACF field with list of active Gravity Forms
<?php
/***
* Populate ACF field (list_gravity_forms) with list of active Gravity Forms
***/
add_filter( 'acf/load_field/name=list_gravity_forms', function( $field ) {
$forms = GFFormsModel::get_forms();
// Filter active forms
$forms = array_filter( $forms, function( $form ) {
@codearachnid
codearachnid / gform_entry_page_replay_webhooks.php
Created February 14, 2024 21:56
Gravity Forms: Webhooks Entry Caller
<?php
// add meta boxes on entry detail
add_filter('gform_entry_detail_meta_boxes', function( $meta_boxes ){
// check that Webhooks class is available
if( class_exists('GF_Webhooks') ){
$meta_boxes['webhooks'] = [
'title' => 'Webhooks',
@codearachnid
codearachnid / gppa-explode-commas-as-selected-choices.php
Last active January 26, 2024 17:45
This is the rework of the explode commas into selected choices as there are changes in how gravitywiz populate anything now behaves. https://github.com/gravitywiz/snippet-library/blob/master/gp-populate-anything/gppa-explode-commas-as-selected-choices.php
/**
* Gravity Perks // Populate Anything // Explode Commas into Selected Choices
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/
*
* Plugin Name: GPPA Explode Commas into Selected Choices
* Plugin URI: https://gravitywiz.com/documentation/gravity-forms-populate-anything/
* Description: Convert comma-delimited values into selected choices when populated into a choice-based field.
* Author: Gravity Wiz
* Version: 0.1
* Author URI: https://gravitywiz.com
<?php
// The field accepts a value with this structure
$value = [
'address' => '123 Example St, Townsville XYZ 1234, Country',
'lat' => - 38.1486228,
'lng' => 144.360414,
'zoom' => 14,
'place_id' => 'Ei0xMjMgTW9vcmFib29sIFN0LCBHZWVsb25nIFZJQyAzMjIwLCBBdXN0cmFsaWEiMBIuChQKEgmX0JaIHBTUahFyH_LC9sYD8hB7KhQKEglDz-DYDxTUahECZY8QisCjzg',
'street_number' => 123,