name: tufte-viz description: | Ideate and critique data visualizations using Edward Tufte's principles from "The Visual Display of Quantitative Information." Use this skill when: (1) Designing new data visualizations or charts (2) Critiquing or improving existing visualizations (3) Reviewing dashboards or reports for graphical integrity (4) Deciding between visualization approaches (5) Reducing chartjunk or improving data-ink ratio (6) Planning small multiples or high-density displays
This file contains hidden or 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
| # Put it to .github/workflows/stale.yml | |
| name: Close stale issues and pull requests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '30 1 * * *' | |
| jobs: | |
| stale: |
This file contains hidden or 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
| 'use strict'; | |
| const assert = require('assert'); | |
| /** | |
| * The redis client is https://github.com/luin/ioredis | |
| */ | |
| /* | |
| const redisClient = new Redis({ |
This file contains hidden or 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
| // Create a queue to push events and stub all methods | |
| window.analytics || (window.analytics = {}); | |
| window.analytics_queue || (window.analytics_queue = []); | |
| (function() { | |
| var methods = ['identify', 'track', 'trackLink', 'trackForm', 'trackClick', 'trackSubmit', 'page', 'pageview', 'ab', 'alias', 'ready', 'group', 'on', 'once', 'off']; | |
| var factory = function(method) { | |
| return function () { | |
| var args = Array.prototype.slice.call(arguments); | |
| args.unshift(method); |
This file contains hidden or 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
| import time | |
| import redis | |
| def get_redis_connection(): | |
| return redis.connect() | |
| class TaskDebouncer(object): | |
| """ A simple Celery task debouncer. |
This file contains hidden or 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
| // Add on element with overflow | |
| -webkit-mask-image: -webkit-radial-gradient(white, black); |
This file contains hidden or 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
| def debounced_wrap(func): | |
| @functools.wraps(func) | |
| def wrapper(*args, **kwargs): | |
| key = kwargs.pop("key") # it's required | |
| call_count = kwargs.pop("call_count", 1) | |
| count = cache.get(key, 1) | |
| if count > call_count: | |
| # someone called the function again before the this was executed | |
| return None | |
| # I'm the last call |
This file contains hidden or 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
| from threading import Timer | |
| def debounce(wait): | |
| """ Decorator that will postpone a functions | |
| execution until after wait seconds | |
| have elapsed since the last time it was invoked. """ | |
| def decorator(fn): | |
| def debounced(*args, **kwargs): | |
| def call_it(): |