Skip to content

Instantly share code, notes, and snippets.

@stringfellow
stringfellow / stacked_area_hover.py
Created October 10, 2016 14:11
Showing how to make a Bokeh stacked area with hover labels per-series
def stacked_area(df, colours, series_noun, **kwargs):
"""Return a stacked area plot."""
columns = df.columns
areas = stacked(df, columns)
x2 = np.hstack((df.index[::-1], df.index))
p = figure(
width=900, height=600, tools=[
SaveTool(),
HoverTool(tooltips=[(series_noun, "@name")])
@stringfellow
stringfellow / pong-chat.md
Last active December 21, 2022 11:33
ChatGPT wrote Pong in an IIFE..!

Me: Using the language Javascript, create an IIFE that will play the game of Pong when run in a chrome debug console.

ChatGPT: Here is an example of how you could create an immediately invoked function expression (IIFE) that plays the game of Pong when run in a Chrome debug console:

Copy code

(function() {
  // set up canvas
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.