Skip to content

Instantly share code, notes, and snippets.


Aseem Kishore aseemk

View GitHub Profile
aseemk / package.json
Last active Aug 21, 2017
FiftyThree Mix (AKA Paper Public Stream) archiver/scraper script
View package.json
"name": "mix-archiver",
"version": "1.0.0",
"description": "Scrape and archive a FiftyThree Mix (Paper Public Stream) profile.",
"bin": "scrape.js",
"author": "Aseem Kishore <>",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"superagent": "^3.6.0"
aseemk / typescript-static-and-runtime-typing.ts
Last active Nov 13, 2016
An example of how to use TypeScript's impressive type inference with both generics and function overloads to achieve robust static typing with runtime type knowledge too! Playground:
View typescript-static-and-runtime-typing.ts
type StaticValueType = string | number | boolean;
type StringValueType = 'string' | 'number' | 'boolean';
function parse(val: string): 'string';
function parse(val: number): 'number';
function parse(val: boolean): 'boolean';
function parse<T extends StringValueType>(val: null, valType: T): T;
function parse(val: StaticValueType | null, valType?: StringValueType): StringValueType {
if (val == null) {
if (valType == null) {
aseemk /
Last active Nov 15, 2017
Trello bookmarklet to (re-)calculate sums of "points" from cards.

Trello bookmarklet to (re-)calculate sums of "points" from cards.

"Points" can be anything numeric (no units). Just prefix each card you want to count with the points in parentheses. E.g. (3) Investigate options.

It's okay for cards to not have points. They just won't be included in the sums.

The sum of points for each list will get added to the list title in the same way as cards. E.g. (17) To Do. Any existing sum will get updated.

The list's actual title (e.g. if you refresh) will not be updated; only the "display" title at that moment will be.

aseemk /
Last active Nov 5, 2021
Bookmarklet template!

TODO: Add description of your bookmarklet here.

To add this bookmarklet to your browser, instructions for Chrome:

  1. Right-click your Bookmarks Bar.
  2. Click "Add Page..."
  3. For "Name", type "TODO: Title here".
  4. For "URL", copy-paste the below:
View neo4j-transaction-test._coffee
echo = console.log
Request = require 'request'
BASE_URL = 'http://localhost:7474'
# helper to make transactional requests:
req = (_, {query, params, commit, rollback, txId}) ->
method = if rollback then 'DELETE' else 'POST'
url = "#{BASE_URL}/db/data/transaction"
aseemk /
Last active Aug 29, 2015
CoffeeScript + Streamline patterns for async loading + caching.

Pattern 1: Pre-fetch the result, and cache it.

The result will hopefully already be available when needed, and the async call will be made only once.

fooFuture = fetchFoo !_

# anytime when needed:
foo = fooFuture _ # supports multiple calls!
aseemk /
Created Mar 22, 2014
Keybase verification!

Keybase proof

I hereby claim:

  • I am aseemk on github.
  • I am aseemk ( on keybase.
  • I have a public key whose fingerprint is 8FD7 03E6 42A7 B1CD 6D50 07F4 4929 0166 F879 0B95

To claim this, I am signing this object:

aseemk /
Last active Dec 2, 2017
CoffeeScript upcoming changes.

CoffeeScript 1.7 is shaping up to be a pretty kick-ass release with significant improvements. Here are the ones I'm most excited about, in order of my own excitement.

Parentheses-free chaining


Years of being wished for, finally granted!

aseemk /
Last active Mar 21, 2022
Neo4j Cypher query to get a "normalized" or "weighted" follower count in a social graph.

This is a Neo4j 1.9 (pre-2.0) query:

START user=node:nodes(type='user')
MATCH user <-[:follows]- follower -[?:follows]-> other
WITH user, follower, 1.0 / COUNT(other) AS weighted
WITH user, COUNT(follower) AS numFollowers, SUM(weighted) as totalWeighted
RETURN user, numFollowers,
  ROUND(totalWeighted * 100) / 100.0 AS totalWeighted,
 ROUND(totalWeighted * 100 / numFollowers) / 100.0 AS avgFollowerWeight
aseemk /
Last active Dec 30, 2015
An excerpt of our internal Node.js style guide at @fiftythree, talking about Streamline patterns, tips, and tricks. Tailored for CoffeeScript.