Skip to content

Instantly share code, notes, and snippets.

View rhyswynne's full-sized avatar

Rhys Wynne rhyswynne

View GitHub Profile
@pento
pento / php-block.js
Last active March 20, 2025 14:59
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
<?php
/*
Plugin Name: Disable Specific Plugins in Dev - translatepress.com
Plugin URI: http://translatepress.com
Description: Disable specified plugins in development environment
Author: TranslatePress
Version: 1.1
Author URI: http://translatepress.com
*/
@SGudbrandsson
SGudbrandsson / index.php
Last active September 5, 2024 01:54
Create a WordPress staging area from your live wordpress setup with a Click-of-a-button [TM] ..
<?php
/**
*
* This script will copy your wordpress from public_html (or wherever)
* and place it in a staging folder.
* It will then clone the database, reconfigure the config file
* and replace URL's from the original URL to your staging URL.
* It will then make sure to NOT allow search engines to index the page.
*
* Use this script to clone your main wp in order to test maintenance work
@tacoverdo
tacoverdo / i18n-q-link.php
Last active November 13, 2017 07:56
What is the best way to translate a text with hyperlink?
@jordanconductor
jordanconductor / foursquare-list
Last active February 3, 2016 22:18
Foursquare list map embed
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://www.4sqmap.com/js/0.1/api.min.js"></script>
<script type="text/javascript">
// Replace '5230b35f11d210a187a27489' with the ID of your Foursquare List
foursqmap.lists('map2', '5230b35f11d210a187a27489', {'sidebar': 'map2_sidebar'});
</script>
<div>
<div id="map2_sidebar" style="width:300px; float:left; height: 500px; overflow: auto"></div>
<div style="margin-left:300px;">
<div id="map2" style="width: 100%;height: 500px"></div>
@Rarst
Rarst / r-debug.php
Last active March 27, 2025 16:58
R Debug (set of dump helpers for debug)
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/