Skip to content

Instantly share code, notes, and snippets.


Giorgos Sarigiannidis gsarig

View GitHub Profile
gsarig / github_action_wordpress.yml
Last active Mar 15, 2021
GitHub Action example for a WordPress project
View github_action_wordpress.yml
name: Deploy to Live server
branches: [ master ]
runs-on: ubuntu-latest
- uses: actions/checkout@v2
- name: deploy to server
gsarig / highlight-gutenberg-blocks.css
Last active Sep 13, 2021
Highlight Gutenberg Blocks. An easier way to tell apart Gutenberg blocks on the Editor, with just a few lines of CSS. Read more:
View highlight-gutenberg-blocks.css
.wp-block-group:hover::before {
content: '';
width: 100%;
height: 100%;
pointer-events: none;
border: 1px dashed;
position: absolute;
top: 0;
left: 0;
gsarig / get_instagram_media.php
Last active Nov 15, 2021
Get Instagram media on WordPress using the current Instagram (Facebook) API (details:
View get_instagram_media.php
* Get Instagram media on WordPress using the current Instagram (Facebook) API
* @param $token // Info on how to retrieve the token:
* @param $user // User ID can be found using the Facebook debug tool:
* @param int $limit // Add a limit to prevent excessive calls.
* @param string $fields // More options here:
* @param array $restrict // Available options: IMAGE, VIDEO, CAROUSEL_ALBUM
View gravity-forms-native-repeater-field-example.php
$form_id = 3;
add_filter( 'gform_form_post_get_meta_' . $form_id, 'add_repeater_field' );
function add_repeater_field( $form ) {
$field_id = 1000;
$fields = [
'type' => 'text',
gsarig / Spoilers toggler for
Last active May 15, 2019
A Greasemonkey script which adds a button to batch reveal spoilers on Spoiler morghulis!
View Spoilers toggler for
// ==UserScript==
// @name Spoilers toggler for
// @match*
// @require
// @require
// @version 1
// @grant none
// ==/UserScript==
gsarig / Show ACF field names in WordPress Admin
Last active Apr 4, 2020
A Greasemonkey script to display ACF field names next to their labels on WordPress Admin (read more:
View Show ACF field names in WordPress Admin
// ==UserScript==
// @name Show ACF field names in WP Admin
// @match http://*/wp-admin/*
// @match https://*/wp-admin/*
// @match http://*/*/wp-admin/*
// @match https://*/*/wp-admin/*
// @version 1
// @grant none
// ==/UserScript==
gsarig / remove_greek_accents.php
Last active Sep 6, 2018
PHP function to remove accents from Greek text
View remove_greek_accents.php
* Run it like so:
* $text = 'Your text';
* echo remove_greek_accents( $text );
function remove_greek_accents( $string )
gsarig /
Last active Jan 28, 2021
Batch backup a server's WordPress databases with WP-CLI (read more at:
# A bash script to batch backup a server's WordPress databases with WP-CLI. It requires WP-CLI, obviously (
# The script will search for all WordPress installations under a given directory and will backup their databases. You can declare more than one such directories.
# You don't have to modify the script every time you add a new site. As long as the new site is under a declared parent directory, its database will be backed up.
# After creating the file, don't forget to make it executable by doing:
# chmod +x
# Also, you might want to add this in a cron job for scheduled backups.
# Set PATH environment variable