Skip to content

Instantly share code, notes, and snippets.

View archon810's full-sized avatar

Artem Russakovskii archon810

View GitHub Profile
@dbernar1
dbernar1 / disable-autocomplete-for-editor.php
Last active August 29, 2015 14:02
Disabling autocomplete for WP post editor
<?php
/*
* Plugin Name: Disabling autocomplete for editor
* Description: See https://core.trac.wordpress.org/ticket/28037
*/
add_action( 'post_edit_form_tag' , 'disable_autocomplete_for_editor__gfm_ac' );
function disable_autocomplete_for_editor__gfm_ac( ) {
echo ' autocomplete="off" ';
<?php
/**
* AMP Async Validation
*
* Installation instructions:
* 1. Click the “Download ZIP” button.
* 2. Rename the downloaded ZIP file to “amp-async-validation.zip”
* 3. In the WordPress admin, go to Plugins > Add New
* 4. Click the Upload Plugin button.
* 5. Select the “amp-async-validation.zip” file and click “Install now”.
@golderweb
golderweb / curl-no-ipv6.php
Last active January 21, 2024 19:16
Wordpress (MU-)Plugin: cURL disable IPv6
<?php
/**
* @package curl-no-ipv6
* @version 1.0
* @since 1.0
*/
/*
Plugin Name: cURL no IPv6
Plugin URI: https:
Description: On systems where cURL is compiled with IPv6, Requests to Wordpress Update API will timeout since cURL tries it about 15s. Since the timeout defined by WordPress is 3s/5s/10s this will breake the Updater. This Plugin simply forces cURL to use IPv4 only.

Git Cheat Sheet

Commands

Getting Started

git init

or

@n0531m
n0531m / list_gcp_iprange.sh
Last active March 22, 2024 06:07
Google Cloud Platform : ip address range
#!/bin/bash
# https://cloud.google.com/compute/docs/faq#find_ip_range
# nslookup -q=TXT _cloud-netblocks.googleusercontent.com 8.8.8.8
myarray=()
for LINE in `dig txt _cloud-netblocks.googleusercontent.com +short | tr " " "\n" | grep include | cut -f 2 -d :`
do
myarray+=($LINE)
for LINE2 in `dig txt $LINE +short | tr " " "\n" | grep include | cut -f 2 -d :`