I hereby claim:
- I am cpbotha on github.
- I am cpbotha (https://keybase.io/cpbotha) on keybase.
- I have a public key ASDREmSD8t6oJihr4EnEG1-26vjV9QtcKZ8EFy0H5bsffAo
To claim this, I am signing this object:
| {{/* | |
| figure with auto-resizing and srcset v2024-11-24 | |
| Drop-in replacement for Hugo's figure shortcode which uses img srcset | |
| to enable browsers to download only the resolution that they need. | |
| The resizing and srcset magic only works for images that are part of the page | |
| bundle. It will fall back to stock Hugo figure behaviour otherwise. |
| ;; https://emacs.stackexchange.com/a/3843/8743 original code | |
| ;; cpbotha.net made small improvements to ergonomics | |
| ;; cpbotha changes: | |
| ;; - by default extract files WITHOUT their relative directories into DIR, | |
| ;; because that's what I expect in OFMs. | |
| (defun archive-extract-to-file (archive-name item-name command dir keep-relpath) | |
| "Extract ITEM-NAME from ARCHIVE-NAME using COMMAND. Save to | |
| DIR. If KEEP-RELPATH, extract with relative path otherwise don't." | |
| (unwind-protect |
| /** | |
| * Running this sketch on the RobotDyn Arduino M0 (SAMD21) with the itead xbee shield 1.1 I see the following output: | |
| * | |
| * waiting for any serial data to become available from the xbee | |
| * 2795 MODEM_STATUS_RESPONSE: 0 | |
| * waiting for any serial data to become available from the xbee | |
| * No packet available. | |
| * waiting for any serial data to become available from the xbee | |
| * 7974 MODEM_STATUS_RESPONSE: 0 | |
| * |
| // what we would like to see: first LED then second LED lights up on the WS2812 strip | |
| // what we see instead: first LED (indicates startup), but then first 4 LEDs go on together, meaning xbee never talked back | |
| // with SoftwareSerial(2,3) and the SparkFun shield switched to dline (vs UART), it does work. | |
| #include <FastLED.h> | |
| #include <XBee.h> | |
| #include <Printers.h> | |
| #define DATA_PIN 9 |
| ;; cpbotha's not so nice elpy init | |
| (use-package elpy | |
| :commands (elpy-enable) ;; this will ensure lazy loading | |
| :config | |
| (progn | |
| (message "LAZY loading elpy") | |
| (elpy-enable) | |
| ;; elpy is mightily confused by ipython 5.2 so we disable it | |
| ;; (elpy-use-ipython) |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/python2 | |
| # -*- coding: utf-8 -*- | |
| # Copyright (c) 2011 Sebastian Wiesner <[email protected]> | |
| # Modifications by Charl Botha <[email protected]> | |
| # * customWidgets support (registerCustomWidget() causes segfault in | |
| # pyside 1.1.2 on Ubuntu 12.04 x86_64) | |
| # * workingDirectory support in loadUi | |
| # found this here: | |
| # https://github.com/lunaryorn/snippets/blob/master/qt4/designer/pyside_dynamic.py |
| // comparison of different d3 colour interpolators with | |
| // colorbrewer sequential single-hue scales | |
| // | |
| // -- http://twitter.com/cpbotha | |
| var numC = 9; | |
| var data = d3.range(numC); | |
| var showColourInterpolations = function(name, cbMap) { | |
| var rectHeight = 50, |
Look ma, those drop shadows are breathing!
Your eyes want you to believe that the blocks are hovering up and down, when in fact only the drop shadow is being translated out and in again.
Follow me on https://twitter.com/cpbotha for even more fun, or see my other d3 blocks: http://bl.ocks.org/cpbotha