Skip to content

Instantly share code, notes, and snippets.

Under construction

Ankur Oberoi aoberoi

Under construction
Block or report user

Report or block aoberoi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

An exploration of ideas for the API and implementation of the next generation RTMClient in Python

Multiprocessing agnostic

At a minimum, the RTMClient must provide a means for application developers to bring their own multiprocessing opinions and implementaitons.

The simplest implementation an app developer might use is exactly what we've recommended every developer use in the current version of the package: an infinite loop that polls for new data in the main thread of a single process.

aoberoi /
Last active Jan 15, 2019
Working out an API proposal for Slapp v4

Slapp v4 Proposal

This proposal expresses a design that leans towards solving problems with middleware. This is motivated by the need to support migratability from Hubot, deliver extensibility in the framework, and to lay the ground work for a plugin API in the future.

Please add feedback Does this feel unintuitive? Complicated? Are there use cases that you beleive should be easy hard to implement using this API? Please comment below.

There are some wrinkles that still need to be ironed out. These are noted below where they come up.

aoberoi /
Last active Nov 2, 2018
A couple papercuts I'd like to see addressed in GitHub


Create an affordance in the GitHub Projects UI for users on touch-based interfaces to change the column of a card.


Users can already drag and drop new cards into a project using a touch-based interface. But once that card is in a specific column, there's no way to move it to another. This feels maddening, because I'm forced to question whether I am too stupid to see something that should be obvious. I realize that adding drag events would be complicated, because dragging on both the X and Y axes are already bound to panning/scrolling the columns on the board. But, there's a flyout menu ... on each card, that seems like it could accomodate an additional "Move card to..." item, or something like that. This could also benefit users with accessibility

View slash-command-dialog.js
const http = require('http');
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const { WebClient } = require('@slack/client');
const { createMessageAdapter } = require('@slack/interactive-messages');
const slack = new WebClient(process.env.SLACK_ACCESS_TOKEN);
const slackInteractions = createMessageAdapter(process.env.SLACK_SIGNING_SECRET);
View new.js
// define dispatch table OR import it from somewhere else
// const commands = require('./commands/live/somewhere');
const commands = {
first: (foo, bar) => { /* ... */ },
second: (baz) => { /* ... */ },
help: (commandName) => { /* ... */ }
function usingDispatch(commandName, ...args) {
const command = commands[commandName] ||;
View duplexify-tests.ts
import Duplexify = require("duplexify");
new Duplexify();
new Duplexify(writable);
new Duplexify(undefined, readable);
new Duplexify(undefined, undefined, opts);
new Duplexify(writable, readable);
new Duplexify(undefined, readable, opts);
new Duplexify(writable, undefined, opts);
new Duplexify(writable, readable, opts);
aoberoi /
Last active Dec 30, 2017
JavaScript objects as key-value pairs or dictionaries

Cheatsheet for JavaScript objects as key-value pairs (object literals)

In many JavaScript programs, plain objects are used as a hash map, a dictionary, or as a simple set of key-value pairs. JavaScript properties can be a little tricky, so this cheatsheet maps out options for accessing those enumerable properties. Non-enumerable properties are usually not interesting in this usage (this includes methods, constructor, etc).

Own Properties Own & Prototype Properties
Exists? x.propertyIsEnumerable(name) Requires walking up the prototype chain
aoberoi /
Created Nov 27, 2017
python slackclient debugging
import os
from slackclient import SlackClient
import requests
import logging
import http.client as http_client
except ImportError:
# Python 2
import httplib as http_client
aoberoi /
Last active Jan 27, 2017
Slack Technologies, Inc. - Individual Contributor License Agreement (CLA)

Slack Individual Contributor License Agreement

Each individual submitting Contributions (as defined below) to Slack Technologies, Inc. (“Slack”) for inclusion in, or documentation of, any of the products owned or managed by Slack (the "Work"), must sign a Contributor License Agreement ("CLA") prior to submitting such Contributions to Slack. This CLA clarifies the intellectual property license You (as defined below) grant to Slack, and is for Your protection as a Contributor as well as the protection of Slack; it does not change Your rights to use Your own Contributions for any other purpose.

You acknowledge and agree that this CLA is in addition to the obligations You have under the MIT license (together, the “Agreement”), and You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Slack. Except for the license granted herein to Slack and recipients of software distributed by Slack, You reserve all right, title, and interest in and to Your Contribu

aoberoi / .dockerignore
Last active Nov 12, 2016
Node Slack SDK Issue 252 Experiment
View .dockerignore
You can’t perform that action at this time.