Skip to content

Instantly share code, notes, and snippets.

View rniswonger's full-sized avatar
🖖

Ryan Niswonger rniswonger

🖖
View GitHub Profile
@rniswonger
rniswonger / bookmarklet-fix-gmail-desktop-annoyances.js
Last active August 24, 2023 16:47
A bookmarklet that resizes image and table content in Gmail messages to prevent horizontal scrolling.
javascript: (() => { let style = document.createElement("style"); style.innerHTML = ` .a3s table { width: 90% !important; } .a3s img { max-width: 90% !important; height: auto !important; } tr:has(.ast) { display: none !important; } `; document.head.appendChild(style);})();
@plasticmind
plasticmind / functions.php
Last active July 14, 2022 09:41
Adding column count class to Gutenberg columns block
<?php
/**
* inject_class_column_count
*
* @param string $content The block content about to be appended.
* @param array $block The full block, including name and attributes
* @return $content;
*/
function inject_class_column_count( $content, $block ) {
if ( ! is_block_type( $block, "core/columns" ) ) {
@winuxue
winuxue / puppeteer-ubuntu-1804.md
Created May 22, 2019 01:15
Solution for common dependences issues using puppeteer in ubuntu 18.04 (Bionic)

puppeteer dependeces in ubuntu 18.04 (Bionic)

error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

sudo apt-get install libnss3

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

sudo apt-get install libxss1
@psaikali
psaikali / acf-gravity-forms-field.php
Created January 4, 2019 13:43
Populate ACF select field options with Gravity Forms to select a specific form
<?php
/**
* Populate ACF select field options with Gravity Forms forms
*/
function acf_populate_gf_forms_ids( $field ) {
if ( class_exists( 'GFFormsModel' ) ) {
$choices = [];
foreach ( \GFFormsModel::get_forms() as $form ) {
$choices[ $form->id ] = $form->title;
@rmpel
rmpel / wp-499-up-fix-csv-upload.php
Last active January 2, 2022 15:01
A filter (an mu-plugin) to restore CSV upload functionality to WordPress 4.9.9 and up.
<?php
/**
* Restore CSV upload functionality for WordPress 4.9.9 and up
*/
add_filter('wp_check_filetype_and_ext', function($values, $file, $filename, $mimes) {
if ( extension_loaded( 'fileinfo' ) ) {
// with the php-extension, a CSV file is issues type text/plain so we fix that back to
// text/csv by trusting the file extension.
$finfo = finfo_open( FILEINFO_MIME_TYPE );
$real_mime = finfo_file( $finfo, $file );
@sgaulding
sgaulding / own.dg.theme
Last active October 6, 2023 11:09
SmartGit Dark Theme (SmartGit Version 17.1)
# This file lists the color values of the default dark theme.
# Each line starting with a # is a comment.
# To overwrite certain colors remove the leading # and change the color values.
# The "extends" line defines which color definitions to use if none is found here.
extends=deepgit-dark-theme.properties
# The "preferredEditorTheme" line determines what editor theme should be used by default ('light' or 'dark').
preferredEditorTheme=dark
@matthewbeta
matthewbeta / scrim-gradient.scss
Last active January 22, 2024 15:52
A simple little SCSS mixin for creating scrim gradients
/*
A simple little SCSS mixin for creating scrim gradients
Inspired by Andreas Larson - https://github.com/larsenwork
https://css-tricks.com/easing-linear-gradients/
*/
@mixin scrimGradient($startColor: $color-black, $direction: 'to bottom') {
$scrimCoordinates: (
@TeddyGandon
TeddyGandon / _bga_ide_helper.php
Last active July 7, 2020 00:43
This an IDE helper for developing games on Board Game Arena Studio. Feel free to use it in your preferred IDE to get out these ugly undefined methods errors and to have a direct documentation to classes / methods.
<?php
/**
* This an IDE helper for developing games on Board Game Arena Studio.
* Feel free to use it in your preferred IDE to get out these ugly undefined methods errors and to have a direct
* documentation to classes / methods.
*
* @author Teddy Gandon
* @see https://gist.github.com/TeddyGandon/9e3183475252203b1ede192688b463cd
*/
@jonathanmoore
jonathanmoore / gist:c0e0e503aa732bf1c05b7a7be4230c61
Last active January 17, 2024 21:47 — forked from carolineschnapp/gist:1083007
Linked options helper methods for Shopify. See this: http://docs.shopify.com/manual/configuration/store-customization/advanced-navigation/linked-product-options - Updated to work with sectioned themes (tested with District)
<script>
// (c) Copyright 2016 Caroline Schnapp. All Rights Reserved. Contact: mllegeorgesand@gmail.com
// See https://docs.shopify.com/themes/customization/navigation/link-product-options-in-menus
// Modified by Jonathan Moore (Style Hatch) https://github.com/jonathanmoore
/*
Updated to work with sectioned themes
- Added required methods from the deprecated options_selection.js
- Triggers an initial variant change
- Hides sold out variants with only one option
@jsonmaur
jsonmaur / bzexcluderules_editable.xml
Last active April 9, 2024 04:47
Backblaze Custom Exclude
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/_build/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/deps/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />