Ra

Rainbow Parentheses Highlighting on GitHub (Clojure etc.)

Hacker News

Rainbow Parentheses Highlighting on GitHub (Clojure etc.)

Run it in console (i.e., devtools or other) on a github source view page. (E.g., https://github.com/LightTable/LightTable/blob/master/src/lt/object.cljs) If someone wants to make this into a Chrome Extension, that would be cool. I realize the code is terrible; I just threw it together in dev tools. var rainbow_parens = function(jq_el) { var html = jq_el.html(); var processed_html = ""; var nesting_level = -160; var color; for (var i = 0; i < html.length; i++) { if (html[i] == '(') { nesting_level += 160; color = 'rgba(' + Math.min(Math.max((nesting_level % 510) - 255, 0), 255) + ',0,' + Math.min((nesting_level % 510), 255) + ',1)'; processed_html += '<span style="color: ' + color + '; text-shadow: -1px 0px 0px ' + color + '">(</span>'; } else if (html[i] == ')') { color = 'rgba(' + Math.min(Math.max((nesting_level % 510) - 255, 0), 255) + ',0,' + Math.min((nesting_level % 510), 255) + ',1)'; processed_html += '<span style="color: ' + color + '; text-shadow: 1px 0px 0px ' + color + '">)</span>'; nesting_level -= 160; } else { processed_html += html[i]; } } jq_el.html(processed_html); };rainbow_parens($('.code-body'));

Share card

Actual performance

2points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Hacker NewsMay not resonate with HN audience · Strong signals: io · Missing: https docs, excited, just released
47%47% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
44%44% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: code · Missing: mac, agents, macos
41%41% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
36%36% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Indie HackersIH features products with proven revenue · Missing: supports, reddit linkedin, podcasting
25%25% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
23%23% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
7%7% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

My
My Github résumé63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

My Github résumé

Hacker News301
Gi
GitHub + Tetris = Gitris69%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GitHub + Tetris = Gitris

Hacker News12
My
My Attempt to Gamify Github57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

My Attempt to Gamify Github

Hacker News2
co
completeme, 't' in Github for Bash57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

completeme, 't' in Github for Bash

Hacker News23
Gi
Gitty for GitHub63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Gitty for GitHub

Hacker News1
Gi
GitHub Popularity Contest70%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GitHub Popularity Contest

Hacker News5
A
A Github for writers?67%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

A Github for writers?

Hacker News181
We
We ordered dinner with GitHub at our hackathon50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

We ordered dinner with GitHub at our hackathon

Hacker News5
Gi
GitHub Treemaps63%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GitHub Treemaps

Hacker News33
Cr
Cron for GitHub72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cron for GitHub

Hacker News5