Skip to content

Instantly share code, notes, and snippets.

View rodrisan's full-sized avatar
🏠
Working from home

Rodrigo S rodrisan

🏠
Working from home
View GitHub Profile
{"rules":[{
"class": "InteractiveRule",
"selector" : "figure.wp-block-embed",
"properties" : {
"interactive.iframe" : {
"type" : "children",
"selector" : "div.wp-block-embed__wrapper"
}
}
}]
@yoonhoGo
yoonhoGo / init.toml
Last active November 3, 2023 18:11
~/.SpaceVim.d/init.toml
#=============================================================================
# dark_powered.toml --- dark powered configuration example for SpaceVim
# Copyright (c) 2016-2017 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================
# All SpaceVim option below [option] section
[options]
@westonruter
westonruter / gist-wp-plugin-installation.md
Last active June 30, 2023 03:43
How to install a WordPress plugin from a Gist
@igorbenic
igorbenic / field.php
Last active June 23, 2021 21:26
How to use the WooCommerce Postcode Validator | https://www.ibenic.com/woocommerce-postcode-validator
<?php
/**
* Shipping method id: rp_table_rate
* You can use any ID here and replace rp_table_rate to add this field to your shipping method settings page.
*/
add_filter( 'woocommerce_settings_api_form_fields_rp_table_rate', 'ibenic_add_postcodes_field_a_shipping_method' );
/**
* Add Postcodes field to the Table Rate
@llimllib
llimllib / mssql_to_csv.bash
Last active October 6, 2025 08:57
This is a script to convert every table in a Microsoft SQL Server database backup (.bak file) to a .csv file
#!/usr/bin/env bash
# import an MS SQL .bak backup file to an MS SQL database, then export all
# tables to csv. run this script as `import.sh <filename>`. It expects to be
# run in the same directory as the backup file.
# this is only tested on my mac (OS X Catalina). I tried to stick to posix, but
# It will probably require some tweaking for you. I hope it gives a general
# sense of what you need to do at the very least.
@sirbrillig
sirbrillig / .gitconfig
Created March 10, 2020 22:34
Git config alias for backup and restore of current branch
[alias]
backup-create = "!f() { git branch -f backup-$(git rev-parse --abbrev-ref HEAD) && echo 'Backup created. Use git backup-restore to restore.'; }; f"
backup-restore = "!f() { echo 'Are you sure you want to overwrite the current branch with the latest backup? This cannot be undone!'; select result in Yes No; do [[ $result == "Yes" ]] && git reset --hard backup-$(git rev-parse --abbrev-ref HEAD) && echo 'Backup restored.'; break; done; }; f"
@claudiosanches
claudiosanches / woocommerce-pay-button-sample.php
Created November 7, 2019 20:40
WooCommerce - Pay Button sample
<?php
/**
* Plugin Name: Test "pay button" support
*/
add_action( 'plugins_loaded', function() {
class My_Custom_Gateway extends WC_Payment_Gateway {
public function __construct() {
$this->id = 'custom_gateway';
$this->has_fields = false;
@varenc
varenc / audacity.rb
Last active February 8, 2021 09:40
Unofficial Hombrew Cask for Audacity 2.3.2 (recent 64-bit version). Get around Fosshub's limitations
# Unofficial Hombrew Cask for Audacity 2.3.2 (recent 64-bit version)
# Made entirely for fun and to demonstrate how to get around fosshub's limitations.
# Problem: Audacity's binary is hosted on fosshub and they don't provide a fixed url! The seems to intentionally try to prevent "hot-linking".
# Solution: Make a request to fosshub's special XHR endpoint to get the signed download url. Then just pass that URL to Homebrew
require 'net/http'
require 'json'
require 'uri'
{
"rules":
[{
"class": "TextNodeRule"
}, {
"class": "PassThroughRule",
"selector": "html"
}, {
"class": "PassThroughRule",
"selector": "head"
<?php
/**
* AMP Query Monitor Compat
*
* @package AMP_Query_Monitor_Compat
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2019 Google LLC
*
* @wordpress-plugin