Skip to content

Instantly share code, notes, and snippets.

View mathetos's full-sized avatar
💭
Working on @impress-org Stuff

Matt Cromwell mathetos

💭
Working on @impress-org Stuff
View GitHub Profile
@mathetos
mathetos / search.txt
Created April 25, 2024 14:46
Custom Google Search
/* Add this into your Chrome/Chromium
* Address Bar and Search settings as a New Search Engine
* Give it a shortcut name like "search"
* Set it as your default search engine
* Now every time you search through the Address Bar
* or type "search" then TAB you'll get your Google search results
* But without listicles and review sites
*/
{google:baseURL}search?q=%s+-"Must-have"+-"best"+-"Top+10"+-"The+best+online"+-site%3Ag2.com+-site%3Acapterra.com+-site%3Atrustpilot.com+-site%3Areddit.com+-site%3Aquora.com+-site%3Acapterra.com.de
@mathetos
mathetos / plugin.php
Last active April 9, 2024 17:10
Get User Admin Color Schemes for UI styling
<?php
// Add Current Users Admin Color Scheme
// 1. Create helper function to grab individual colors easily
// 2. Add individual colors to document root as CSS variables
function wpptpcv_return_admin_colors() {
global $_wp_admin_css_colors;
// Get the user's selected color scheme name
<?php
/**
* Plugin Name: Impact Radius for WooCommerce
* Description: Output Impact Radius affiliate tracking codes to integrate with WooCommerce
* Author: The Events Calendar
* Author URI: https://evnt.is
* Version: 1.0
*/
add_action( 'init', function () {
@mathetos
mathetos / code.js
Created March 19, 2022 17:21
Google Script to Process Webhook JSON and add Row in Google Sheets
function doPost(e) {
var body = e.postData.contents;
var bodyJSON = JSON.parse(body);
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Submissions");
var timeStamp = new Date();
var time = Utilities.formatDate(timeStamp, "GMT-08:00", "MM/dd/yy, h:mm a");
var lastRow = sheet.getLastRow();
@mathetos
mathetos / init.php
Created April 17, 2020 04:49
Enqueue custom editor stylesheet for Elementor
<?php
add_action('elementor/editor/before_enqueue_scripts', 'custom_editor_enqueue_scripts');
// editor styles
function custom_editor_enqueue_scripts() {
// If you're making a GiveWP add-on and need the Give admin styles, you'll need to enqueue it here as well
wp_enqueue_style( 'give-admin-styles', GIVE_PLUGIN_URL . 'assets/dist/css/admin.rtl.css', array(), GIVE_VERSION );
@mathetos
mathetos / shortcode-donor-wall.php
Created November 15, 2019 18:05
Add Form Title to Donor Wall Card
<?php
/**
* This template is used to display the donation grid with [give_donor_wall]
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
@mathetos
mathetos / row_classes.php
Last active October 2, 2019 00:29
Add .documents class to specific rows of a Caldera Form
// Add .documents class to divs of the Employee Onboarding Caldera Form
add_action( 'caldera_forms_grid_row_class', function($rowClass, $row, $config ){
//Change your field ID here
if('CF5d8ceba87e343' == $config[ 'form_id' ]){
if( $row==4 || $row==5 ) {
$rowClass .= ' documents';
}
}
@mathetos
mathetos / site-health-curl-test.php
Last active May 9, 2019 18:53
Add cURL test to WP 5.2 Site Health tests
<?php
/**
* Adds a cURL version test to Site Health
*
* Info here: https://make.wordpress.org/core/2019/04/25/site-health-check-in-5-2/
* NOTE: Requires version 5.2+ of WordPress
*
**/
@mathetos
mathetos / fields.php
Created January 18, 2019 20:18
GiveWP Custom field with validation
/**
* Add Custom Donation Form Fields
*
* @param $form_id
*/
function give_myprefix_custom_form_fields( $form_id ) {
if ( $form_id == 8) {
//$forms = array( 8 );
?>
@mathetos
mathetos / give-ify-github.css
Last active September 7, 2018 16:06
Give-ify your Github
/*
* Give-ify your Github
* Preview: https://cloudup.com/cGiBiRpMd3B
*
* Step 1: Install the "Refined Github" browser extension: https://github.com/sindresorhus/refined-github
* Step 2: Use it's Custom CSS field to paste the following.
*/
@font-face {
font-family: give-icomoon;