Skip to content

Instantly share code, notes, and snippets.

View aseemk's full-sized avatar

Aseem Kishore aseemk

View GitHub Profile
@aseemk
aseemk / 1-instructions.md
Last active November 5, 2021 06:08
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:
@aseemk
aseemk / 1-trello-sum-bookmarklet.md
Last active November 15, 2017 19:36
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
aseemk / typescript-static-and-runtime-typing.ts
Last active November 13, 2016 15:32
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: http://tinyurl.com/hxue2sw
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
aseemk / package.json
Last active August 21, 2017 16:49
FiftyThree Mix (AKA Paper Public Stream) archiver/scraper script
{
"name": "mix-archiver",
"version": "1.0.0",
"description": "Scrape and archive a FiftyThree Mix (Paper Public Stream) profile.",
"bin": "scrape.js",
"author": "Aseem Kishore <[email protected]>",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"superagent": "^3.6.0"