This as-simple-as-possible example tries to demonstrate Mike Bostock's pattern "Towards Reusable Charts" http://bost.ocks.org/mike/chart/ for d3 plugins that are composite shapes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// d3.js drop shadow example | |
// put together by http://charlbotha.com/ | |
var items = [ | |
{x : 50, y : 10}, | |
{x : 100, y: 170}, | |
{x : 320, y: 70} | |
]; | |
// we can increase this, everything will scale up with us |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 | |
* |
OlderNewer