Controlling Anki on Linux using a Nintendo Switch Joycon

I’m lying in bed all day curing a cold and I can’t really motivate myself to tackle the 1000+ reviews I’ve amassed over the last few weeks. There’s one gimmick I just implemented to motivate myself, and that is to use one of the Joycons of my Nintendo Switch to control Anki on Ubuntu. Much more comfortable than the laptop keyboard.

Continue reading Controlling Anki on Linux using a Nintendo Switch Joycon

Matplotlib tricks

Two little things I need now and then and am tired of looking up. To change the default font to one which supports Greek characters:

from matplotlib import rcParams
rcParams['font.sans-serif'] = 'DejaVu Sans'

To scale the xticklabels:

ax.set_xticklabels([ int(np.round(i)) for i in ax.get_xticks()*10**6 ])

PayPal REST SDK for Ruby:

Just for the record: I saw on some official PayPal site the use of “PayPal::SDK::Merchant” encouraged. Don’t do that, it’s highly outdated.

If you’ve successfully executed a payment, you can get the shipping address by loading the payment object once again and then calling @payment.payer.payer_info.shipping_address. The “inspect” method is your friend here!