Skip to content

Instantly share code, notes, and snippets.

View fungusakafungus's full-sized avatar

Ilya Margolin fungusakafungus

View GitHub Profile
@chriscct7
chriscct7 / gist:d7d077afb01011b1839d
Last active January 24, 2024 04:20
Plugins that need to be updated to be ready for the move to PHP 5 constructors

Important Notice for WordPress Plugins Using PHP 4 Style Constructors

The ability to use PHP 4 style constructors is getting removed from PHP. Without an update, many plugins will eventually no longer work (this is PHP breaking this backwards compatibility, not WordPress)

One of the more common uses of the PHP 4 style constructor (as opposed to PHP 5 style __construct() ) are plugins with widgets calling WP_Widget::WP_Widget() and/or parent::WP_Widget() and/or {object}->WP_Widget()

Note: Starting in WordPress 4.3, regardless of the PHP version in use on a server, WordPress will throw a deprecated notice when one of the PHP 4 style constructors is called specifically for widgets.

Basically instead of doing these:

@softwaredoug
softwaredoug / asyncio.md
Last active January 3, 2019 20:38
Python Asyncio Notes

This is a document full of notes of all the things that have hung me up getting into Python's new asyncio library. I mostly use it for tools that schlep data around between file systems, databases, and search engines for work. So lots of io. Usually I use gevent and python 2.7. But recently I've been trying to get more into asyncio and here I'm going to document all the things that I felt important to know or that tripped me up.

1. Thoroughly understand yield, and non asyncio coroutines

The first thing you need to do is write some coroutines without asyncio. This means understanding the yield keyword and how it can be used to create generators. Then next the protocol for sending/receiving from generator objects.

Recall generators are a special kind of iterator. When you specify a generator like so, you can use it in a for loop:

def generator()

for i in range(0, 5):

@mathieue
mathieue / udp-multi-socat.sh
Created August 28, 2012 23:57
udp multiplexer with socat
socat - udp4-listen:8125,fork | tee >(socat - udp-sendto:127.0.0.1:8135) >(socat - udp-sendto:127.0.0.1:8140)
anonymous
anonymous / gist:1427230
Created December 3, 2011 14:16
import static org.junit.Assert.*;
import org.junit.Test;
public class WorldTest {
@Test(expected = IllegalArgumentException.class)
public void testWorldCreation() throws Exception {
new World("", 1, 1);
}